From 8fdc48be400b89a8b523739f015b5675ed41470d Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 21 Sep 2017 21:15:13 -0400 Subject: [PATCH] DENSO map calibration --- firmware/config/engines/mazda_miata_1_6.cpp | 12 +----------- firmware/controllers/sensors/map.cpp | 4 +++- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/firmware/config/engines/mazda_miata_1_6.cpp b/firmware/config/engines/mazda_miata_1_6.cpp index 8c94e9452b..52693c9431 100644 --- a/firmware/config/engines/mazda_miata_1_6.cpp +++ b/firmware/config/engines/mazda_miata_1_6.cpp @@ -92,18 +92,8 @@ void setMiataNA_1_6_Configuration(DECLARE_ENGINE_PARAMETER_SIGNATURE) { // Frankenso analog #6 pin 3R, W56 (5th lower row pin from the end) top <> W45 bottom jumper, not OEM engineConfiguration->map.sensor.hwChannel = EFI_ADC_7; - engineConfiguration->map.sensor.type = MT_CUSTOM; - - // 66.677993 kPa drop = 2v drop - // see http://rusefi.com/forum/viewtopic.php?f=3&t=906&p=18976#p18976 - - float _100Kpa_value = 3.7; - engineConfiguration->map.sensor.lowValue = 33.322271; - engineConfiguration->mapLowValueVoltage = _100Kpa_value - 2; - - engineConfiguration->map.sensor.highValue = 100; - engineConfiguration->mapHighValueVoltage = _100Kpa_value; + engineConfiguration->map.sensor.type = MT_TOYOTA_89420_02010; engineConfiguration->mafAdcChannel = EFI_ADC_0; diff --git a/firmware/controllers/sensors/map.cpp b/firmware/controllers/sensors/map.cpp index a8f181a844..8e899c1812 100644 --- a/firmware/controllers/sensors/map.cpp +++ b/firmware/controllers/sensors/map.cpp @@ -63,6 +63,8 @@ static FastInterpolation mpx4100(0.3, 20, 4.9, 105); //static FastInterpolation dodgeNeon2003(0.5 /* volts */, 0 /* kPa */, 4.5 /* volts */ , 100 /* kPa */); static FastInterpolation dodgeNeon2003(0.4 /* volts */, 15.34 /* kPa */, 4.5 /* volts */ , 100 /* kPa */); +static FastInterpolation densoToyota(3.7 - 2 /* volts */, 33.322271 /* kPa */, 3.7 /* volts */ , 100 /* kPa */); + /** * We hold a reference to current decoder to reduce code branching * to lookup decoder each time we need to decode @@ -88,7 +90,7 @@ float decodePressure(float voltage, air_pressure_sensor_config_s * mapConfig DEC case MT_GM_3_BAR: return gm3bar.getValue(voltage); case MT_TOYOTA_89420_02010: - // todo: add calibration + return densoToyota.getValue(voltage); case MT_MPX4100: return mpx4100.getValue(voltage); default: