From 740e6ba22fa0766a08a14f320998669058d36b17 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 12 Feb 2015 21:04:12 -0600 Subject: [PATCH] auto-sync --- firmware/config/engines/dodge_neon.cpp | 4 +- firmware/console/status_loop.cpp | 150 ++++++++-------------- firmware/controllers/algo/fuel_math.cpp | 5 + firmware/controllers/algo/fuel_math.h | 1 + firmware/controllers/math/engine_math.cpp | 15 +-- firmware/controllers/sensors/maf.cpp | 11 ++ firmware/controllers/sensors/maf.h | 2 + firmware/tunerstudio/rusefi.ini | 19 ++- 8 files changed, 96 insertions(+), 111 deletions(-) diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index cac76041c1..db98163a9c 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -192,8 +192,6 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat // set_injection_offset 0 engineConfiguration->injectionAngle = 0; - setMap(engineConfiguration->fuelTable, -180); - engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; engineConfiguration->injectionMode = IM_SEQUENTIAL; engineConfiguration->ignitionMode = IM_WASTED_SPARK; @@ -395,6 +393,8 @@ void setDodgeNeonNGCEngineConfiguration(engine_configuration_s *engineConfigurat engineConfiguration->canReadEnabled = false; engineConfiguration->canNbcType = CAN_BUS_NBC_BMW; // engineConfiguration->canNbcType = CAN_BUS_MAZDA_RX8; + + setMap(engineConfiguration->injectionPhase, -180); } #endif /* EFI_SUPPORT_DODGE_NEON */ diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 1b94653eff..7cf2801713 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -96,8 +96,8 @@ static LoggingWithStorage fileLogger("file logger"); static int logFileLineIndex = 0; #define TAB "\t" -static void reportSensorF(Logging *log, bool fileFormat, const char *caption, - const char *units, float value, int precision) { +static void reportSensorF(Logging *log, bool fileFormat, const char *caption, const char *units, float value, + int precision) { if (!fileFormat) { #if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) debugFloat(log, caption, value, precision); @@ -119,8 +119,7 @@ static void reportSensorF(Logging *log, bool fileFormat, const char *caption, } } -static void reportSensorI(Logging *log, bool fileFormat, const char *caption, - const char *units, int value) { +static void reportSensorI(Logging *log, bool fileFormat, const char *caption, const char *units, int value) { if (!fileFormat) { #if (EFI_PROD_CODE || EFI_SIMULATOR) || defined(__DOXYGEN__) @@ -154,16 +153,18 @@ void printSensors(Logging *log, bool fileFormat, Engine *engine) { #if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) reportSensorI(log, fileFormat, "rpm", "RPM", getRpmE(engine)); - reportSensorF(log, fileFormat, "TRG_0_DUTY", "%", getTriggerDutyCycle(0), - 2); - reportSensorF(log, fileFormat, "TRG_1_DUTY", "%", getTriggerDutyCycle(1), - 2); + reportSensorF(log, fileFormat, "TRG_0_DUTY", "%", getTriggerDutyCycle(0), 2); + reportSensorF(log, fileFormat, "TRG_1_DUTY", "%", getTriggerDutyCycle(1), 2); #endif - reportSensorF(log, fileFormat, "maf", "V", getMaf(), 2); - engine_configuration_s *engineConfiguration = engine->engineConfiguration; + if (engineConfiguration->hasMafSensor) { + reportSensorF(log, fileFormat, "maf", "V", getMaf(), 2); + reportSensorF(log, fileFormat, "mafr", "kg/hr", getRealMaf(), 2); + } + + #if EFI_ANALOG_SENSORS || defined(__DOXYGEN__) if (engineConfiguration->hasMapSensor) { reportSensorF(log, fileFormat, "MAP", "kPa", getMap(), 2); @@ -182,21 +183,16 @@ void printSensors(Logging *log, bool fileFormat, Engine *engine) { reportSensorF(log, fileFormat, "vss", "kph", getVehicleSpeed(), 2); } #endif /* EFI_PROD_CODE */ - reportSensorF(log, fileFormat, "vref", "V", getVRef(engineConfiguration), - 2); - reportSensorF(log, fileFormat, "vbatt", "V", getVBatt(engineConfiguration), - 2); + reportSensorF(log, fileFormat, "vref", "V", getVRef(engineConfiguration), 2); + reportSensorF(log, fileFormat, "vbatt", "V", getVBatt(engineConfiguration), 2); - reportSensorF(log, fileFormat, "TP", "%", getTPS(PASS_ENGINE_PARAMETER_F), - 2); + reportSensorF(log, fileFormat, "TP", "%", getTPS(PASS_ENGINE_PARAMETER_F), 2); if (engineConfiguration->hasCltSensor) { - reportSensorF(log, fileFormat, "CLT", "C", - getCoolantTemperature(engine), 2); + reportSensorF(log, fileFormat, "CLT", "C", getCoolantTemperature(engine), 2); } - reportSensorF(log, fileFormat, "MAT", "C", getIntakeAirTemperature(engine), - 2); + reportSensorF(log, fileFormat, "MAT", "C", getIntakeAirTemperature(engine), 2); // debugFloat(&logger, "tch", getTCharge1(tps), 2); @@ -230,16 +226,13 @@ static void printState(Engine *engine) { if (subscription[(int) RO_TOTAL_REVOLUTION_COUNTER]) debugInt(&logger, "ckp_c", getCrankEventCounter()); if (subscription[(int) RO_RUNNING_REVOLUTION_COUNTER]) - debugInt(&logger, "ckp_r", - triggerCentral.triggerState.runningRevolutionCounter); + debugInt(&logger, "ckp_r", triggerCentral.triggerState.runningRevolutionCounter); if (subscription[(int) RO_RUNNING_TRIGGER_ERROR]) - debugInt(&logger, "trg_r_errors", - triggerCentral.triggerState.runningTriggerErrorCounter); + debugInt(&logger, "trg_r_errors", triggerCentral.triggerState.runningTriggerErrorCounter); if (subscription[(int) RO_RUNNING_ORDERING_TRIGGER_ERROR]) - debugInt(&logger, "trg_r_order_errors", - triggerCentral.triggerState.runningOrderingErrorCounter); + debugInt(&logger, "trg_r_order_errors", triggerCentral.triggerState.runningOrderingErrorCounter); if (subscription[(int) RO_WAVE_CHART_CURRENT_SIZE]) debugInt(&logger, "wave_chart_current", 0); @@ -253,13 +246,10 @@ static void printState(Engine *engine) { debugFloat(&logger, "fuel_base", baseFuel, 2); // debugFloat(&logger, "fuel_iat", getIatCorrection(getIntakeAirTemperature()), 2); // debugFloat(&logger, "fuel_clt", getCltCorrection(getCoolantTemperature()), 2); - debugFloat(&logger, "fuel_lag", - getInjectorLag(getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER), - 2); + debugFloat(&logger, "fuel_lag", getInjectorLag(getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER), 2); debugFloat(&logger, "fuel", getFuelMs(rpm PASS_ENGINE_PARAMETER), 2); - debugFloat(&logger, "timing", - getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER), 2); + debugFloat(&logger, "timing", getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER), 2); // float map = getMap(); @@ -286,8 +276,7 @@ static systime_t timeOfPreviousPrintVersion = (systime_t) -1; #if EFI_PROD_CODE || defined(__DOXYGEN__) static void printOutPin(const char *pinName, brain_pin_e hwPin) { - appendPrintf(&logger, "outpin%s%s@%s%s", DELIMETER, pinName, - hwPortname(hwPin), DELIMETER); + appendPrintf(&logger, "outpin%s%s@%s%s", DELIMETER, pinName, hwPortname(hwPin), DELIMETER); } #endif /* EFI_PROD_CODE */ @@ -302,8 +291,7 @@ static void printInfo(Engine *engine, systime_t nowSeconds) { return; } timeOfPreviousPrintVersion = nowSeconds; - appendPrintf(&logger, "rusEfiVersion%s%d@%s %s%s", DELIMETER, - getRusEfiVersion(), VCS_VERSION, + appendPrintf(&logger, "rusEfiVersion%s%d@%s %s%s", DELIMETER, getRusEfiVersion(), VCS_VERSION, getConfigurationName(engineConfiguration->engineType), DELIMETER); #if EFI_PROD_CODE || defined(__DOXYGEN__) @@ -315,11 +303,9 @@ static void printInfo(Engine *engine, systime_t nowSeconds) { #endif for (int i = 0; i < engineConfiguration->specs.cylindersCount; i++) { - printOutPin(enginePins.coils[i].name, - boardConfiguration->ignitionPins[i]); + printOutPin(enginePins.coils[i].name, boardConfiguration->ignitionPins[i]); - printOutPin(enginePins.injectors[i].name, - boardConfiguration->injectionPins[i]); + printOutPin(enginePins.injectors[i].name, boardConfiguration->injectionPins[i]); } #endif @@ -363,8 +349,7 @@ void updateDevConsoleState(Engine *engine) { #if EFI_ENGINE_CONTROL || defined(__DOXYGEN__) int currentCkpEventCounter = getCrankEventCounter(); - if (prevCkpEventCounter == currentCkpEventCounter - && timeOfPreviousReport == nowSeconds) { + if (prevCkpEventCounter == currentCkpEventCounter && timeOfPreviousReport == nowSeconds) { return; } timeOfPreviousReport = nowSeconds; @@ -394,36 +379,29 @@ void updateDevConsoleState(Engine *engine) { static void showFuelInfo2(float rpm, float engineLoad, Engine *engine) { engine_configuration_s *engineConfiguration = engine->engineConfiguration; - float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, - engineLoad); + float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, engineLoad); - scheduleMsg(&logger, "SD magic fuel %f", - sdMath(engineConfiguration, 100, 100, 14.7, - convertCelsiusToKelvin(20))); + scheduleMsg(&logger, "SD magic fuel %f", sdMath(engineConfiguration, 100, 100, 14.7, convertCelsiusToKelvin(20))); - scheduleMsg(&logger2, "algo=%s/pump=%s", - getEngine_load_mode_e(engineConfiguration->algorithm), + scheduleMsg(&logger2, "algo=%s/pump=%s", getEngine_load_mode_e(engineConfiguration->algorithm), boolToString(enginePins.fuelPumpRelay.getLogicValue())); + scheduleMsg(&logger2, "phase=%f", getInjectionAngle(rpm)); + #if EFI_ENGINE_CONTROL scheduleMsg(&logger2, "cranking fuel: %f", getCrankingFuel(engine)); if (engine->rpmCalculator.isRunning()) { - float iatCorrection = getIatCorrection( - getIntakeAirTemperature(engine) PASS_ENGINE_PARAMETER); - float cltCorrection = getCltCorrection( - getCoolantTemperature(engine) PASS_ENGINE_PARAMETER); - float injectorLag = getInjectorLag( - getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER); + float iatCorrection = getIatCorrection(getIntakeAirTemperature(engine) PASS_ENGINE_PARAMETER); + float cltCorrection = getCltCorrection(getCoolantTemperature(engine) PASS_ENGINE_PARAMETER); + float injectorLag = getInjectorLag(getVBatt(engineConfiguration) PASS_ENGINE_PARAMETER); scheduleMsg(&logger2, "rpm=%f engineLoad=%f", rpm, engineLoad); scheduleMsg(&logger2, "baseFuel=%f", baseFuelMs); - scheduleMsg(&logger2, - "iatCorrection=%f cltCorrection=%f injectorLag=%f", - iatCorrection, cltCorrection, injectorLag); + scheduleMsg(&logger2, "iatCorrection=%f cltCorrection=%f injectorLag=%f", iatCorrection, cltCorrection, + injectorLag); - float value = getRunningFuel(baseFuelMs, - (int) rpm PASS_ENGINE_PARAMETER); + float value = getRunningFuel(baseFuelMs, (int) rpm PASS_ENGINE_PARAMETER); scheduleMsg(&logger2, "injection pulse width: %f", value); } #endif @@ -431,8 +409,7 @@ static void showFuelInfo2(float rpm, float engineLoad, Engine *engine) { #if EFI_ENGINE_CONTROL static void showFuelInfo(Engine *engine) { - showFuelInfo2((float) getRpmE(engine), - getEngineLoadT(PASS_ENGINE_PARAMETER), engine); + showFuelInfo2((float) getRpmE(engine), getEngineLoadT(PASS_ENGINE_PARAMETER), engine); } #endif @@ -452,20 +429,19 @@ OutputPin warningPin; OutputPin runningPin; extern engine_pins_s enginePins; -static OutputPin *leds[] = { &warningPin, &runningPin, &enginePins.errorLedPin, - &communicationPin, &checkEnginePin }; +static OutputPin *leds[] = { &warningPin, &runningPin, &enginePins.errorLedPin, &communicationPin, &checkEnginePin }; static void initStatisLeds() { #if EFI_PROD_CODE outputPinRegister("communication status 1", &communicationPin, - LED_COMMUNICATION_PORT, LED_COMMUNICATION_PIN); + LED_COMMUNICATION_PORT, LED_COMMUNICATION_PIN); #endif #if EFI_WARNING_LED outputPinRegister("warning", &warningPin, LED_WARNING_PORT, - LED_WARNING_PIN); + LED_WARNING_PIN); outputPinRegister("is running status", &runningPin, LED_RUNNING_STATUS_PORT, - LED_RUNNING_STATUS_PIN); + LED_RUNNING_STATUS_PIN); #endif /* EFI_WARNING_LED */ } @@ -533,8 +509,7 @@ static THD_WORKING_AREA(tsThreadStack, UTILITY_THREAD_STACK_SIZE); #if EFI_TUNER_STUDIO -void updateTunerStudioState(Engine *engine, - TunerStudioOutputChannels *tsOutputChannels) { +void updateTunerStudioState(Engine *engine, TunerStudioOutputChannels *tsOutputChannels) { #if EFI_SHAFT_POSITION_INPUT || defined(__DOXYGEN__) int rpm = getRpmE(engine); #else @@ -548,8 +523,7 @@ void updateTunerStudioState(Engine *engine, float intake = getIntakeAirTemperature(engine); float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER); - float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, - engineLoad); + float baseFuelMs = getBaseTableFuel(engineConfiguration, (int) rpm, engineLoad); // header tsOutputChannels->tsConfigVersion = TS_FILE_VERSION; @@ -566,8 +540,7 @@ void updateTunerStudioState(Engine *engine, tsOutputChannels->atmospherePressure = getBaroPressure(); tsOutputChannels->manifold_air_pressure = getMap(); tsOutputChannels->engineLoad = engineLoad; - tsOutputChannels->rpmAcceleration = - engine->rpmCalculator.getRpmAcceleration(); + tsOutputChannels->rpmAcceleration = engine->rpmCalculator.getRpmAcceleration(); tsOutputChannels->checkEngine = hasErrorCodes(); #if EFI_PROD_CODE @@ -580,19 +553,13 @@ void updateTunerStudioState(Engine *engine, tsOutputChannels->isFanOn = enginePins.fanRelay.getLogicValue(); tsOutputChannels->isO2HeaterOn = enginePins.o2heater.getLogicValue(); tsOutputChannels->ignition_enabled = engineConfiguration->isIgnitionEnabled; - tsOutputChannels->injection_enabled = - engineConfiguration->isInjectionEnabled; - tsOutputChannels->cylinder_cleanup_enabled = - engineConfiguration->isCylinderCleanupEnabled; - tsOutputChannels->cylinder_cleanup_activated = - engine->isCylinderCleanupMode; - tsOutputChannels->secondTriggerChannelEnabled = - engineConfiguration->secondTriggerChannelEnabled; + tsOutputChannels->injection_enabled = engineConfiguration->isInjectionEnabled; + tsOutputChannels->cylinder_cleanup_enabled = engineConfiguration->isCylinderCleanupEnabled; + tsOutputChannels->cylinder_cleanup_activated = engine->isCylinderCleanupMode; + tsOutputChannels->secondTriggerChannelEnabled = engineConfiguration->secondTriggerChannelEnabled; tsOutputChannels->vehicleSpeedKph = getVehicleSpeed(); - tsOutputChannels->isCltError = !isValidCoolantTemperature( - getCoolantTemperature(engine)); - tsOutputChannels->isIatError = !isValidIntakeAirTemperature( - getIntakeAirTemperature(engine)); + tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature(engine)); + tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature(engine)); #endif tsOutputChannels->clutchUpState = engine->clutchUpState; tsOutputChannels->clutchDownState = engine->clutchDownState; @@ -601,8 +568,7 @@ void updateTunerStudioState(Engine *engine, tsOutputChannels->inj_adv = timing > 360 ? timing - 720 : timing; tsOutputChannels->sparkDwell = getSparkDwellMsT(rpm PASS_ENGINE_PARAMETER); tsOutputChannels->baseFuel = baseFuelMs; - tsOutputChannels->pulseWidthMs = getRunningFuel(baseFuelMs, - rpm PASS_ENGINE_PARAMETER); + tsOutputChannels->pulseWidthMs = getRunningFuel(baseFuelMs, rpm PASS_ENGINE_PARAMETER); tsOutputChannels->crankingFuelMs = getCrankingFuel(engine); } @@ -636,8 +602,7 @@ void initStatusLoop(Engine *engine) { #if EFI_PROD_CODE #if EFI_ENGINE_CONTROL - addConsoleActionFFP("fuelinfo2", (VoidFloatFloatVoidPtr) showFuelInfo2, - engine); + addConsoleActionFFP("fuelinfo2", (VoidFloatFloatVoidPtr) showFuelInfo2, engine); addConsoleActionP("fuelinfo", (VoidPtr) showFuelInfo, engine); #endif @@ -657,14 +622,11 @@ void initStatusLoop(Engine *engine) { void startStatusThreads(Engine *engine) { // todo: refactoring needed, this file should probably be split into pieces - chThdCreateStatic(lcdThreadStack, sizeof(lcdThreadStack), NORMALPRIO, - (tfunc_t) lcdThread, engine); - chThdCreateStatic(tsThreadStack, sizeof(tsThreadStack), NORMALPRIO, - (tfunc_t) tsStatusThread, engine); + chThdCreateStatic(lcdThreadStack, sizeof(lcdThreadStack), NORMALPRIO, (tfunc_t) lcdThread, engine); + chThdCreateStatic(tsThreadStack, sizeof(tsThreadStack), NORMALPRIO, (tfunc_t) tsStatusThread, engine); #if EFI_PROD_CODE || defined(__DOXYGEN__) initStatisLeds(); - chThdCreateStatic(blinkingStack, sizeof(blinkingStack), NORMALPRIO, - (tfunc_t) blinkingThread, NULL); + chThdCreateStatic(blinkingStack, sizeof(blinkingStack), NORMALPRIO, (tfunc_t) blinkingThread, NULL); #endif /* EFI_PROD_CODE */ } diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 5ed77dd2cd..879a7979b3 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -55,6 +55,11 @@ float getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_S) { } } +float getInjectionAngle(int rpm DECLARE_ENGINE_PARAMETER_S) { + float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F); + return fuelPhaseMap.getValue(engineLoad, rpm); +} + /** * Number of injections into each cylinder per engine cycle */ diff --git a/firmware/controllers/algo/fuel_math.h b/firmware/controllers/algo/fuel_math.h index de9f36e413..ad0c9be784 100644 --- a/firmware/controllers/algo/fuel_math.h +++ b/firmware/controllers/algo/fuel_math.h @@ -13,6 +13,7 @@ void prepareFuelMap(engine_configuration_s *engineConfiguration); float getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_S); +float getInjectionAngle(int rpm DECLARE_ENGINE_PARAMETER_S); float getBaseTableFuel(engine_configuration_s *engineConfiguration, int rpm, float engineLoad); float getIatCorrection(float iat DECLARE_ENGINE_PARAMETER_S); float getInjectorLag(float vBatt DECLARE_ENGINE_PARAMETER_S); diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index 74a821f7f7..ba818f8652 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -28,20 +28,13 @@ #include "trigger_decoder.h" #include "event_registry.h" #include "efiGpio.h" +#include "fuel_math.h" EXTERN_ENGINE ; extern engine_pins_s enginePins; -/* - * default Volumetric Efficiency - */ -//float getDefaultVE(int rpm) { -// if (rpm > 5000) -// return interpolate(5000, 1.1, 8000, 1, rpm); -// return interpolate(500, 0.5, 5000, 1.1, rpm); -//} /** * @return number of milliseconds in one crankshaft revolution */ @@ -66,8 +59,7 @@ float getEngineLoadT(DECLARE_ENGINE_PARAMETER_F) { case LM_ALPHA_N: return getTPS(PASS_ENGINE_PARAMETER_F); case LM_REAL_MAF: { - int mafAdc = getAdcValue(engineConfiguration->mafAdcChannel); - return getMafT(engineConfiguration); + return getRealMaf(PASS_ENGINE_PARAMETER_F); } default: firmwareError("Unexpected engine load parameter: %d", engineConfiguration->algorithm); @@ -168,7 +160,8 @@ void FuelSchedule::addFuelEvents(OutputSignalList *sourceList, injection_mode_e * injection phase is scheduled by injection end, so we need to step the angle back * for the duration of the injection */ - float baseAngle = engineConfiguration->injectionAngle - MS2US(engine->fuelMs) / engine->rpmCalculator.oneDegreeUs; + float baseAngle = getInjectionAngle(engine->rpmCalculator.rpmValue PASS_ENGINE_PARAMETER) + + engineConfiguration->injectionAngle - MS2US(engine->fuelMs) / engine->rpmCalculator.oneDegreeUs; switch (mode) { case IM_SEQUENTIAL: diff --git a/firmware/controllers/sensors/maf.cpp b/firmware/controllers/sensors/maf.cpp index 86cacf16d9..3816ccb0a2 100644 --- a/firmware/controllers/sensors/maf.cpp +++ b/firmware/controllers/sensors/maf.cpp @@ -10,6 +10,17 @@ float getMaf(DECLARE_ENGINE_PARAMETER_F) { return getMafT(engineConfiguration); } +/** + * @return kg/hour value + */ +float getRealMaf(DECLARE_ENGINE_PARAMETER_F) { + int mafAdc = getAdcValue(engineConfiguration->mafAdcChannel); + /** + * here we drop from 12 bit ADC to 8 bit index + */ + return engine->mafDecodingLookup[mafAdc >> 4]; +} + void setBosch0280218037(engine_configuration_s *engineConfiguration) { int i = 0; engineConfiguration->mafDecoding[i] = -34.5; diff --git a/firmware/controllers/sensors/maf.h b/firmware/controllers/sensors/maf.h index 0c1b9ca650..d5bc12897d 100644 --- a/firmware/controllers/sensors/maf.h +++ b/firmware/controllers/sensors/maf.h @@ -16,6 +16,8 @@ #define getMafT(ec) (getVoltageDivided(ec->mafAdcChannel)) float getMaf(void); +float getRealMaf(DECLARE_ENGINE_PARAMETER_F); + void setBosch0280218037(engine_configuration_s *engineConfiguration); #endif diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 943a5aecdf..63200c2b1c 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -524,7 +524,7 @@ fileVersion = { 20150211 } TPS = scalar, F32, 12, "%", 1, 0 MAF = scalar, F32, 16, "V", 1, 0 AFRactual = scalar, F32, 20, "AFR", 1, 0.0 - engineload = scalar, F32, 24, "%", 1, 0.0 ; Blend of MAP and TPS, depends on algorithm + engineLoad = scalar, F32, 24, "%", 1, 0.0 ; Blend of MAP and TPS, depends on algorithm VBatt = scalar, F32, 28, "V", 1, 0.0 ; 10 bit TPS ADC value (from 0 to 1023 in 5v scale) tpsADC = scalar, U16, 32, "ADC", 1, 0.0; @@ -572,7 +572,7 @@ fileVersion = { 20150211 } rpmAcceleration = scalar, F32, 104, "dRpm", 1, 0 egoCorrection = { 1 } time = { timeNow } - engineLoad = { algorithm == 0 ? MAF : TPS } +; engineLoad = { algorithm == 0 ? MAF : TPS } [CurveEditor] curve = dwellCorrection, "Dwell time RPM based" @@ -675,6 +675,15 @@ fileVersion = { 20150211 } gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. upDownLabel = "(RICHER)", "(LEANER)" + table = injPhaseTableTbl, injPhaseTableMap, "Injection Phase Table", 1 + ; constant, variable + xBins = injPhaseRpmBins, rpm + yBins = injPhaseLoadBins, engineLoad + zBins = injectionPhase +; gridHeight = 2.0 + gridOrient = 250, 0, 340 ; Space 123 rotation of grid in degrees. + upDownLabel = "(Later)", "(Sooner)" + table = afrTableTbl, afrTableMap, "Target AFR Table", 1 ; constant, variable xBins = afrRpmBins, rpm @@ -776,7 +785,7 @@ fileVersion = { 20150211 } entry = MAP, "MAP", float, "%d" entry = AFRactual, "AFR", float, "%.2f" entry = VBatt, "vBatt", float, "%.2f" - entry = engineload, "Load", float, "%d" + entry = engineLoad, "Load", float, "%d" entry = pulseWidth, "injPulse", float, "%.3f" entry = baseFuel, "baseFuel", float, "%.2f" entry = ign_adv, "ignAdv", float, "%.2f" @@ -818,7 +827,8 @@ fileVersion = { 20150211 } subMenu = iatFuelCorrCurve, "Intake air temp fuel correction" subMenu = cltFuelCorrCurve, "Coolant temp fuel correction" subMenu = veTableTbl, "VE Table", {algorithm == 3} - subMenu = afrTableTbl, "Targe AFR Table", {algorithm == 3} + subMenu = afrTableTbl, "Targe AFR Table", {algorithm == 3} + subMenu = injPhaseTableTbl, "Injection Phase" subMenu = std_separator subMenu = ignitionTableTbl, "Ignition Table" subMenu = mafDecodingCurve, "MAF Decoding Curve" @@ -832,6 +842,7 @@ fileVersion = { 20150211 } subMenu = fuelTableMap, "Fuel Table" subMenu = veTableMap, "VE Table" subMenu = afrTableMap, "Targe AFR Table" + subMenu = injPhaseTableMap, "Injection Phase" menu = "Board" subMenu = boardInputs, "Board Inputs"