diff --git a/firmware/config/engines/GY6_139QMB.cpp b/firmware/config/engines/GY6_139QMB.cpp index f48178c5c5..b595835247 100644 --- a/firmware/config/engines/GY6_139QMB.cpp +++ b/firmware/config/engines/GY6_139QMB.cpp @@ -84,7 +84,7 @@ void setGy6139qmbDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->cranking.rpm = 1100; engineConfiguration->targetIdleRpm = 2000; engineConfiguration->analogInputDividerCoefficient = 1; - engineConfiguration->algorithm = LM_MAP; + engineConfiguration->fuelAlgorithm = LM_MAP; engineConfiguration->globalTriggerAngleOffset = 45; boardConfiguration->sensorChartMode = SC_MAP; engineConfiguration->specs.displacement = 0.072; // 72cc diff --git a/firmware/config/engines/dodge_neon.cpp b/firmware/config/engines/dodge_neon.cpp index 953a2981f4..d517033b16 100644 --- a/firmware/config/engines/dodge_neon.cpp +++ b/firmware/config/engines/dodge_neon.cpp @@ -151,7 +151,7 @@ EXTERN_ENGINE; void setDodgeNeon1995EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->trigger.type = TT_DODGE_NEON_1995; - engineConfiguration->algorithm = LM_ALPHA_N; + engineConfiguration->fuelAlgorithm = LM_ALPHA_N; // engineConfiguration->spi2SckMode = PAL_STM32_OTYPE_OPENDRAIN; // 4 // engineConfiguration->spi2MosiMode = PAL_STM32_OTYPE_OPENDRAIN; // 4 @@ -200,7 +200,7 @@ void setDodgeNeon1995EngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { // set_ignition_offset 350 engineConfiguration->ignitionOffset = 350; // set_injection_offset 510 - engineConfiguration->injectionOffset = 510 + 497; + engineConfiguration->extraInjectionOffset = 510 + 497; /** * that's 1995 config @@ -267,7 +267,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { // set_global_trigger_offset_angle 38 engineConfiguration->globalTriggerAngleOffset = 38; // set_injection_offset 0 - engineConfiguration->injectionOffset = 0; + engineConfiguration->extraInjectionOffset = 0; engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; engineConfiguration->injectionMode = IM_SEQUENTIAL; @@ -314,7 +314,7 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { */ engineConfiguration->injector.flow = 199; - //engineConfiguration->algorithm = LM_ALPHA_N; // I want to start with a simple Alpha-N + //engineConfiguration->fuelAlgorithm = LM_ALPHA_N; // I want to start with a simple Alpha-N setFuelLoadBin(0, 100 PASS_ENGINE_PARAMETER); setTableBin2(config->ignitionLoadBins, IGN_LOAD_COUNT, 20, 120, 1); diff --git a/firmware/config/engines/ford_1995_inline_6.cpp b/firmware/config/engines/ford_1995_inline_6.cpp index f9cff1ac36..6e2c3c9e8c 100644 --- a/firmware/config/engines/ford_1995_inline_6.cpp +++ b/firmware/config/engines/ford_1995_inline_6.cpp @@ -51,7 +51,7 @@ void setFordInline6(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->globalTriggerAngleOffset = 0; engineConfiguration->ignitionOffset = 13; - engineConfiguration->injectionOffset = 207.269999; + engineConfiguration->extraInjectionOffset = 207.269999; setThermistorConfiguration(&engineConfiguration->clt, -10.0, 160310.0, 60.0, 7700.0, 120.0, 1180.0); engineConfiguration->clt.config.bias_resistor = 2700; diff --git a/firmware/config/engines/ford_aspire.cpp b/firmware/config/engines/ford_aspire.cpp index ebfaff8b27..d94e57e515 100644 --- a/firmware/config/engines/ford_aspire.cpp +++ b/firmware/config/engines/ford_aspire.cpp @@ -104,7 +104,7 @@ void setFordAspireEngineConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->specs.firingOrder = FO_1_3_4_2; engineConfiguration->globalTriggerAngleOffset = 175; engineConfiguration->ignitionOffset = 87; - engineConfiguration->injectionOffset = 54 + 360; + engineConfiguration->extraInjectionOffset = 54 + 360; setDefaultAspireMaps(PASS_ENGINE_PARAMETER_F); // set_cranking_rpm 550 diff --git a/firmware/config/engines/ford_festiva.cpp b/firmware/config/engines/ford_festiva.cpp index fde70aa38d..7bf6f05fc2 100644 --- a/firmware/config/engines/ford_festiva.cpp +++ b/firmware/config/engines/ford_festiva.cpp @@ -78,9 +78,9 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->globalFuelCorrection = 0.75; engineConfiguration->specs.displacement = 1.839; -// engineConfiguration->algorithm = LM_PLAIN_MAF; +// engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF; setAlgorithm(LM_SPEED_DENSITY PASS_ENGINE_PARAMETER); -// engineConfiguration->algorithm = LM_REAL_MAF; +// engineConfiguration->fuelAlgorithm = LM_REAL_MAF; setFuelLoadBin(1.2, 4.4 PASS_ENGINE_PARAMETER); setFuelRpmBin(800, 7000 PASS_ENGINE_PARAMETER); @@ -139,7 +139,7 @@ void setFordEscortGt(DECLARE_ENGINE_PARAMETER_F) { // set_ignition_offset 0 engineConfiguration->ignitionOffset = 0; // set_injection_offset 0 - engineConfiguration->injectionOffset = 0; + engineConfiguration->extraInjectionOffset = 0; // todo: change to 15? // set_cranking_timing_angle 3 diff --git a/firmware/config/engines/honda_600.cpp b/firmware/config/engines/honda_600.cpp index b0ae691fe7..04b419bf16 100644 --- a/firmware/config/engines/honda_600.cpp +++ b/firmware/config/engines/honda_600.cpp @@ -61,7 +61,7 @@ static void setDefaultCustomMaps(DECLARE_ENGINE_PARAMETER_F) { void setHonda600(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->trigger.type = TT_HONDA_CBR_600_CUSTOM; - engineConfiguration->algorithm = LM_ALPHA_N; + engineConfiguration->fuelAlgorithm = LM_ALPHA_N; // upside down wiring boardConfiguration->triggerInputPins[0] = GPIOA_5; @@ -77,7 +77,7 @@ void setHonda600(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS; engineConfiguration->injectionMode = IM_SEQUENTIAL; engineConfiguration->specs.firingOrder = FO_1_3_4_2; - engineConfiguration->injectionOffset = 320; + engineConfiguration->extraInjectionOffset = 320; engineConfiguration->cranking.rpm = 800; // engineConfiguration->ignitionMode = IM_WASTED_SPARK; //IM_INDIVIDUAL_COILS; diff --git a/firmware/config/engines/honda_accord.cpp b/firmware/config/engines/honda_accord.cpp index 2d74f4b5f8..bc0c38fcac 100644 --- a/firmware/config/engines/honda_accord.cpp +++ b/firmware/config/engines/honda_accord.cpp @@ -79,7 +79,7 @@ static void setHondaAccordConfigurationCommon(DECLARE_ENGINE_PARAMETER_F) { // set_ignition_offset 350 // engineConfiguration->ignitionOffset = 350; // set_injection_offset 510 -// engineConfiguration->injectionOffset = 510; +// engineConfiguration->extraInjectionOffset = 510; /** diff --git a/firmware/config/engines/mazda_miata.cpp b/firmware/config/engines/mazda_miata.cpp index 845cdb94a0..0c13668fe9 100644 --- a/firmware/config/engines/mazda_miata.cpp +++ b/firmware/config/engines/mazda_miata.cpp @@ -358,7 +358,7 @@ void setMiata1994_s(DECLARE_ENGINE_PARAMETER_F) { boardConfiguration->malfunctionIndicatorPin = GPIOE_5; boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT; - engineConfiguration->algorithm = LM_REAL_MAF; + engineConfiguration->fuelAlgorithm = LM_REAL_MAF; setMazdaMiataNAMaf(config); engineConfiguration->injector.flow = 230; } diff --git a/firmware/config/engines/sachs.cpp b/firmware/config/engines/sachs.cpp index d28f2b380c..c413dfe466 100644 --- a/firmware/config/engines/sachs.cpp +++ b/firmware/config/engines/sachs.cpp @@ -23,7 +23,7 @@ void setSachs(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->engineChartSize = 400; // set_injection_offset 0 - engineConfiguration->injectionOffset = 0; + engineConfiguration->extraInjectionOffset = 0; setEgoSensor(ES_Innovate_MTX_L PASS_ENGINE_PARAMETER); diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 562cf9b659..547d790dc0 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -429,7 +429,7 @@ static void showFuelInfo2(float rpm, float engineLoad) { scheduleMsg(&logger, "inj flow %fcc/min displacement %fL", engineConfiguration->injector.flow, engineConfiguration->specs.displacement); - scheduleMsg(&logger2, "algo=%s/pump=%s", getEngine_load_mode_e(engineConfiguration->algorithm), + scheduleMsg(&logger2, "algo=%s/pump=%s", getEngine_load_mode_e(engineConfiguration->fuelAlgorithm), boolToString(enginePins.fuelPumpRelay.getLogicValue())); scheduleMsg(&logger2, "injection phase=%f/global fuel correction=%f", getinjectionOffset(rpm), engineConfiguration->globalFuelCorrection); diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index ec8454b60a..bbc57b2ee6 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -180,8 +180,8 @@ float getInitialAdvance(int rpm, float map, float advanceMax) { * this method builds a good-enough base timing advance map bases on a number of heuristics */ void buildTimingMap(float advanceMax DECLARE_ENGINE_PARAMETER_S) { - if (engineConfiguration->algorithm != LM_SPEED_DENSITY && - engineConfiguration->algorithm != LM_MAP) { + if (engineConfiguration->fuelAlgorithm != LM_SPEED_DENSITY && + engineConfiguration->fuelAlgorithm != LM_MAP) { warning(CUSTOM_OBD_1, "wrong algorithm for MAP-based timing"); return; } diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index dc73fe9657..3ae72a2890 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -186,7 +186,7 @@ void EngineState::periodicFastCallback(DECLARE_ENGINE_PARAMETER_F) { float engineLoad = getEngineLoadT(PASS_ENGINE_PARAMETER_F); timingAdvance = getAdvance(rpm, engineLoad PASS_ENGINE_PARAMETER); - if (engineConfiguration->algorithm == LM_SPEED_DENSITY) { + if (engineConfiguration->fuelAlgorithm == LM_SPEED_DENSITY) { float coolantC = ENGINE(engineState.clt); float intakeC = ENGINE(engineState.iat); float tps = getTPS(PASS_ENGINE_PARAMETER_F); diff --git a/firmware/controllers/algo/engine_configuration.cpp b/firmware/controllers/algo/engine_configuration.cpp index c116763290..5b89915335 100644 --- a/firmware/controllers/algo/engine_configuration.cpp +++ b/firmware/controllers/algo/engine_configuration.cpp @@ -530,12 +530,12 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) { engineConfiguration->ignitionMode = IM_ONE_COIL; engineConfiguration->globalTriggerAngleOffset = 0; - engineConfiguration->injectionOffset = 0; + engineConfiguration->extraInjectionOffset = 0; engineConfiguration->ignitionOffset = 0; engineConfiguration->overrideCrankingIgnition = true; engineConfiguration->sensorChartFrequency = 20; - engineConfiguration->algorithm = LM_PLAIN_MAF; + engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF; engineConfiguration->vbattDividerCoeff = ((float) (15 + 65)) / 15; diff --git a/firmware/controllers/algo/engine_configuration_generated_structures.h b/firmware/controllers/algo/engine_configuration_generated_structures.h index 885768d17f..023b4c23e2 100644 --- a/firmware/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Aug 27 10:09:22 EDT 2016 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Aug 28 15:53:30 EDT 2016 // begin #ifndef ENGINE_CONFIGURATION_GENERATED_H_ #define ENGINE_CONFIGURATION_GENERATED_H_ @@ -973,11 +973,11 @@ typedef struct { */ int rpmHardLimit; /** - * This setting controls which algorithm is used for ENGINE LOAD + * This setting controls which fuel quantity control algorithm is used. * set_algorithm X * offset 424 */ - engine_load_mode_e algorithm; + engine_load_mode_e fuelAlgorithm; /** * offset 428 */ @@ -990,9 +990,10 @@ typedef struct { /** * this is about deciding when the injector starts it's squirt * See also injectionPhase map + * todo: do we need even need this since we have the map anyway? * offset 436 */ - angle_t injectionOffset; + angle_t extraInjectionOffset; /** * Timing advance while engine cranking * set_cranking_timing_angle X @@ -1929,4 +1930,4 @@ typedef struct { #endif // end -// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Aug 27 10:09:22 EDT 2016 +// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Aug 28 15:53:30 EDT 2016 diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 859f6070b2..324b2b5dea 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -74,9 +74,9 @@ float getRealMafFuel(float airSpeed, int rpm DECLARE_ENGINE_PARAMETER_S) { floatms_t getBaseFuel(int rpm DECLARE_ENGINE_PARAMETER_S) { ENGINE(engineState.tpsAccelEnrich) = ENGINE(tpsAccelEnrichment.getTpsEnrichment(PASS_ENGINE_PARAMETER_F)); - if (CONFIG(algorithm) == LM_SPEED_DENSITY) { + if (CONFIG(fuelAlgorithm) == LM_SPEED_DENSITY) { engine->engineState.baseFuel = getSpeedDensityFuel(rpm PASS_ENGINE_PARAMETER); - } else if (engineConfiguration->algorithm == LM_REAL_MAF) { + } else if (engineConfiguration->fuelAlgorithm == LM_REAL_MAF) { float maf = getRealMaf(PASS_ENGINE_PARAMETER_F) + engine->engineLoadAccelEnrichment.getEngineLoadEnrichment(PASS_ENGINE_PARAMETER_F); engine->engineState.baseFuel = getRealMafFuel(maf, rpm PASS_ENGINE_PARAMETER); } else { diff --git a/firmware/controllers/algo/rusefi_generated.h b/firmware/controllers/algo/rusefi_generated.h index 673f6a8367..9a135a4076 100644 --- a/firmware/controllers/algo/rusefi_generated.h +++ b/firmware/controllers/algo/rusefi_generated.h @@ -191,10 +191,10 @@ #define cylinderBore_offset 412 #define sensorSnifferRpmThreshold_offset 416 #define rpmHardLimit_offset 420 -#define algorithm_offset 424 +#define fuelAlgorithm_offset 424 #define crankingInjectionMode_offset 428 #define injectionMode_offset 432 -#define injectionOffset_offset 436 +#define extraInjectionOffset_offset 436 #define crankingTimingAngle_offset 440 #define ignitionMode_offset 444 #define ignitionOffset_offset 448 diff --git a/firmware/controllers/lcd_controller.cpp b/firmware/controllers/lcd_controller.cpp index 49f0ffaecf..2d0491b58d 100644 --- a/firmware/controllers/lcd_controller.cpp +++ b/firmware/controllers/lcd_controller.cpp @@ -230,7 +230,7 @@ static void showLine(lcd_line_e line, int screenY) { lcdPrintf("Intake Air %f", getIntakeAirTemperature(PASS_ENGINE_PARAMETER_F)); return; case LL_ALGORITHM: - lcdPrintf(getEngine_load_mode_e(engineConfiguration->algorithm)); + lcdPrintf(getEngine_load_mode_e(engineConfiguration->fuelAlgorithm)); return; case LL_INJECTION: lcdPrintf(getInjection_mode_e(engineConfiguration->injectionMode)); diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index a3fa0ddcd8..ee709611e9 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -50,7 +50,7 @@ floatms_t getCrankshaftRevolutionTimeMs(int rpm) { float getEngineLoadT(DECLARE_ENGINE_PARAMETER_F) { efiAssert(engine!=NULL, "engine 2NULL", NAN); efiAssert(engineConfiguration!=NULL, "engineConfiguration 2NULL", NAN); - switch (engineConfiguration->algorithm) { + switch (engineConfiguration->fuelAlgorithm) { case LM_PLAIN_MAF: if (!hasMafSensor(PASS_ENGINE_PARAMETER_F)) { warning(CUSTOM_OBD_17, "MAF sensor needed for current fuel algorithm"); @@ -67,7 +67,7 @@ float getEngineLoadT(DECLARE_ENGINE_PARAMETER_F) { return getRealMaf(PASS_ENGINE_PARAMETER_F); } default: - warning(CUSTOM_OBD_18, "Unexpected engine load parameter: %d", engineConfiguration->algorithm); + warning(CUSTOM_OBD_18, "Unexpected engine load parameter: %d", engineConfiguration->fuelAlgorithm); return -1; } } @@ -138,7 +138,7 @@ void FuelSchedule::registerInjectionEvent(int injectorIndex, float angle, NamedOutputPin *output = &enginePins.injectors[injectorIndex]; if (!isSimultanious && !isPinAssigned(output)) { - // todo: extact method for this index math + // todo: extract method for this index math warning(CUSTOM_OBD_20, "no_pin_inj #%s", output->name); } @@ -192,9 +192,12 @@ void FuelSchedule::addFuelEvents(injection_mode_e mode DECLARE_ENGINE_PARAMETER_ /** * injection phase is scheduled by injection end, so we need to step the angle back * for the duration of the injection + * + * todo: since this method is not invoked within trigger event handler and + * engineState.injectionOffset is calculated from the same utility timer should we more that logic here? */ angle_t baseAngle = ENGINE(engineState.injectionOffset) - + CONFIG(injectionOffset) - MS2US(ENGINE(fuelMs)) / ENGINE(rpmCalculator.oneDegreeUs); + + CONFIG(extraInjectionOffset) - MS2US(ENGINE(fuelMs)) / ENGINE(rpmCalculator.oneDegreeUs); switch (mode) { case IM_SEQUENTIAL: @@ -448,7 +451,7 @@ int isInjectionEnabled(engine_configuration_s *engineConfiguration) { * this method sets algorithm and ignition table scale */ void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_S) { - engineConfiguration->algorithm = algo; + engineConfiguration->fuelAlgorithm = algo; if (algo == LM_ALPHA_N) { setTimingLoadBin(20, 120 PASS_ENGINE_PARAMETER); } else if (algo == LM_SPEED_DENSITY) { @@ -458,7 +461,5 @@ void setAlgorithm(engine_load_mode_e algo DECLARE_ENGINE_PARAMETER_S) { } void setInjectorLag(float value DECLARE_ENGINE_PARAMETER_S) { - for (int i=0;iinjector.battLagCorr[i] = value; - } + setArrayValues(engineConfiguration->injector.battLagCorr, VBAT_INJECTOR_CURVE_SIZE, value); } diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index cff0d4ef92..3d232adb06 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -200,7 +200,7 @@ void printConfiguration(engine_configuration_s *engineConfiguration) { scheduleMsg(&logger, "Template %s/%d trigger %s/%s/%d", getConfigurationName(engineConfiguration->engineType), engineConfiguration->engineType, getTrigger_type_e(engineConfiguration->trigger.type), - getEngine_load_mode_e(engineConfiguration->algorithm), engineConfiguration->algorithm); + getEngine_load_mode_e(engineConfiguration->fuelAlgorithm), engineConfiguration->fuelAlgorithm); scheduleMsg(&logger, "configurationVersion=%d", getGlobalConfigurationVersion()); @@ -254,7 +254,7 @@ void printConfiguration(engine_configuration_s *engineConfiguration) { scheduleMsg(&logger, "=== injection ==="); scheduleMsg(&logger, "injection %s offset=%f/enabled=%s", getInjection_mode_e(engineConfiguration->injectionMode), - (double) engineConfiguration->injectionOffset, boolToString(engineConfiguration->isInjectionEnabled)); + (double) engineConfiguration->extraInjectionOffset, boolToString(engineConfiguration->isInjectionEnabled)); printOutputs(engineConfiguration); @@ -342,7 +342,7 @@ static void setIdlePinMode(int value) { } static void setInjectionOffset(float value) { - engineConfiguration->injectionOffset = value; + engineConfiguration->extraInjectionOffset = value; doPrintConfiguration(engine); incrementGlobalConfigurationVersion(); } @@ -582,7 +582,7 @@ static void setWholeTimingMapCmd(float value) { static void setWholeVeCmd(float value) { scheduleMsg(&logger, "Setting whole VE map to %f", value); - if (engineConfiguration->algorithm != LM_SPEED_DENSITY) { + if (engineConfiguration->fuelAlgorithm != LM_SPEED_DENSITY) { scheduleMsg(&logger, "WARNING: setting VE map not in SD mode is pointless"); } setMap(config->veTable, value); @@ -590,7 +590,7 @@ static void setWholeVeCmd(float value) { static void setWholeFuelMapCmd(float value) { scheduleMsg(&logger, "Setting whole fuel map to %f", value); - if (engineConfiguration->algorithm == LM_SPEED_DENSITY) { + if (engineConfiguration->fuelAlgorithm == LM_SPEED_DENSITY) { scheduleMsg(&logger, "WARNING: setting fuel map in SD mode is pointless"); } setWholeFuelMap(value PASS_ENGINE_PARAMETER); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index c7cfbe29e7..268ca8531a 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -264,13 +264,13 @@ int sensorSnifferRpmThreshold;+Disable sensor sniffer above this rpm;"RPM", custom engine_load_mode_e 4 bits, U32, @OFFSET@, [0:1], @@engine_load_mode_e_enum@@ -engine_load_mode_e algorithm;+This setting controls which algorithm is used for ENGINE LOAD\nset_algorithm X +engine_load_mode_e fuelAlgorithm;+This setting controls which fuel quantity control algorithm is used.\nset_algorithm X custom injection_mode_e 4 bits, U32, @OFFSET@, [0:1], "Simultaneous", "Sequential", "Batch", "INVALID" injection_mode_e crankingInjectionMode; injection_mode_e injectionMode;+'batched' means two injectors are wired together -angle_t injectionOffset;+this is about deciding when the injector starts it's squirt\nSee also injectionPhase map;"deg", 1, 0.0, -720, 720, 2 +angle_t extraInjectionOffset;+this is about deciding when the injector starts it's squirt\nSee also injectionPhase map\ntodo: do we need even need this since we have the map anyway?;"deg", 1, 0.0, -720, 720, 2 angle_t crankingTimingAngle;+Timing advance while engine cranking\nset_cranking_timing_angle X; "deg", 1, 0.0, -360, 360, 2 custom ignition_mode_e 4 bits, U32, @OFFSET@, [0:1], "One coil", "Individual Coils", "Wasted", "INVALID" diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index df8050b099..60a8c9dd78 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -42,7 +42,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Aug 23 22:54:36 EDT 2016 +; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Aug 28 15:53:30 EDT 2016 pageSize = 16376 page = 1 @@ -127,10 +127,10 @@ page = 1 cylinderBore = scalar, F32, 412, "mm", 1, 0, 0, 20000.0, 2 sensorSnifferRpmThreshold = scalar, S32, 416, "RPM", 1, 0, 0,30000, 0 rpmHardLimit = scalar, S32, 420, "rpm", 1, 0, 0, 20000.0, 2 - algorithm = bits, U32, 424, [0:1], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY" + fuelAlgorithm = bits, U32, 424, [0:1], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY" crankingInjectionMode = bits, U32, 428, [0:1], "Simultaneous", "Sequential", "Batch", "INVALID" injectionMode = bits, U32, 432, [0:1], "Simultaneous", "Sequential", "Batch", "INVALID" - injectionOffset = scalar, F32, 436, "deg", 1, 0.0, -720, 720, 2 + extraInjectionOffset = scalar, F32, 436, "deg", 1, 0.0, -720, 720, 2 crankingTimingAngle = scalar, F32, 440, "deg", 1, 0.0, -360, 360, 2 ignitionMode = bits, U32, 444, [0:1], "One coil", "Individual Coils", "Wasted", "INVALID" ignitionOffset = scalar, F32, 448, "RPM", 1, 0, 0, 3000.0, 0 @@ -688,9 +688,9 @@ page = 1 knockBandCustom = "kHz knock band override" cylinderBore = "Cylinder diameter, in mm." sensorSnifferRpmThreshold = "Disable sensor sniffer above this rpm" - algorithm = "This setting controls which algorithm is used for ENGINE LOAD\nset_algorithm X" + fuelAlgorithm = "This setting controls which fuel quantity control algorithm is used.\nset_algorithm X" injectionMode = "'batched' means two injectors are wired together" - injectionOffset = "this is about deciding when the injector starts it's squirt\nSee also injectionPhase map" + extraInjectionOffset = "this is about deciding when the injector starts it's squirt\nSee also injectionPhase map\ntodo: do we need even need this since we have the map anyway?" crankingTimingAngle = "Timing advance while engine cranking\nset_cranking_timing_angle X" ignitionMode = "'wasted' means one coil is driving two spark plugs in two cylinders, with one of the aparks not doing anything since it's happening on the exhaust cycle" ignitionOffset = "this value could be used to offset the whole ignition timing table by a constant" @@ -870,7 +870,7 @@ fileVersion = { 20160702 } egoCorrection = { 100 } time = { timeNow } -; engineLoad = { algorithm == 0 ? MAF : TPS } +; engineLoad = { fuleAlgorithm == 0 ? MAF : TPS } [CurveEditor] ; xAxis = leftValue, rightValue, step @@ -1317,9 +1317,9 @@ fileVersion = { 20160702 } subMenu = warmupTargetAfrCurve, "Warmup fuel auto correction AFR target", 0, {useWarmupPidAfr == 1} subMenu = cltIdleCurve, "Warmup IAC position manual Multiplier" subMenu = std_separator - subMenu = fuelTableTbl, "Fuel Table", 0, {algorithm != 3} - subMenu = veTableTbl, "VE Table", 0, {algorithm == 3} - subMenu = afrTableTbl, "Targe AFR Table", 0, {algorithm == 3} + subMenu = fuelTableTbl, "Fuel Table", 0, {fuelAlgorithm != 3} + subMenu = veTableTbl, "VE Table", 0, {fuelAlgorithm == 3} + subMenu = afrTableTbl, "Targe AFR Table", 0, {fuelAlgorithm == 3} subMenu = AccelEnrich, "Accel/Decel Enrichment/Enleanment" subMenu = iatFuelCorrCurve, "Intake air temperature fuel Multiplier" subMenu = injPhaseTableTbl, "Injection Phase" @@ -1328,16 +1328,16 @@ fileVersion = { 20160702 } subMenu = std_separator subMenu = ignitionTableTbl, "Ignition Table" subMenu = ignitionIatCorrTableTbl, "Ignition Intake Air Temp correction" - subMenu = baroCorrTbl, "Baro Correction", 0, {algorithm == 3} + subMenu = baroCorrTbl, "Baro Correction", 0, {fuelAlgorithm == 3} subMenu = std_separator subMenu = std_realtime, "&Realtime Display", 0 menu = "3D Map Tuning" ; subMenu = std_realtime, "Realtime Display" ; subMenu = std_warmup, "Warmup Wizard" - subMenu = fuelTableMap, "Fuel Table", 0, {algorithm != 3} - subMenu = veTableMap, "VE Table", 0, {algorithm == 3} - subMenu = afrTableMap, "Targe AFR Table", 0, {algorithm == 3} + subMenu = fuelTableMap, "Fuel Table", 0, {fuelAlgorithm != 3} + subMenu = veTableMap, "VE Table", 0, {fuelAlgorithm == 3} + subMenu = afrTableMap, "Targe AFR Table", 0, {fuelAlgorithm == 3} subMenu = injPhaseTableMap, "Injection Phase" subMenu = ignitionTableMap, "Ignition Table" subMenu = ignitionIatCorrTableMap, "Ignition Intake Air Temp correction" @@ -1470,7 +1470,7 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01" ; Engine->Injection Settings dialog = injChars, "Injector Settings", yAxis field = "Injector Flow", injector_flow - field = "phase offset", injectionOffset + field = "phase offset", extraInjectionOffset dialog = injIO, "Injector Output", yAxis field = "!ECU reboot needed to apply these settings" @@ -1837,7 +1837,7 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01" field = "RPM Hard Limit", rpmHardLimit field = "Boost Cut Pressure", boostCutPressure field = "" - field = "Fuel Algorithm", algorithm + field = "Fuel Algorithm", fuelAlgorithm field = "" field = "#System hack's" field = "Global fuel correction", globalFuelCorrection diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 96500cfe36..ab041b626d 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -852,7 +852,7 @@ fileVersion = { 20160702 } egoCorrection = { 100 } time = { timeNow } -; engineLoad = { algorithm == 0 ? MAF : TPS } +; engineLoad = { fuleAlgorithm == 0 ? MAF : TPS } [CurveEditor] ; xAxis = leftValue, rightValue, step @@ -1299,9 +1299,9 @@ fileVersion = { 20160702 } subMenu = warmupTargetAfrCurve, "Warmup fuel auto correction AFR target", 0, {useWarmupPidAfr == 1} subMenu = cltIdleCurve, "Warmup IAC position manual Multiplier" subMenu = std_separator - subMenu = fuelTableTbl, "Fuel Table", 0, {algorithm != 3} - subMenu = veTableTbl, "VE Table", 0, {algorithm == 3} - subMenu = afrTableTbl, "Targe AFR Table", 0, {algorithm == 3} + subMenu = fuelTableTbl, "Fuel Table", 0, {fuelAlgorithm != 3} + subMenu = veTableTbl, "VE Table", 0, {fuelAlgorithm == 3} + subMenu = afrTableTbl, "Targe AFR Table", 0, {fuelAlgorithm == 3} subMenu = AccelEnrich, "Accel/Decel Enrichment/Enleanment" subMenu = iatFuelCorrCurve, "Intake air temperature fuel Multiplier" subMenu = injPhaseTableTbl, "Injection Phase" @@ -1310,16 +1310,16 @@ fileVersion = { 20160702 } subMenu = std_separator subMenu = ignitionTableTbl, "Ignition Table" subMenu = ignitionIatCorrTableTbl, "Ignition Intake Air Temp correction" - subMenu = baroCorrTbl, "Baro Correction", 0, {algorithm == 3} + subMenu = baroCorrTbl, "Baro Correction", 0, {fuelAlgorithm == 3} subMenu = std_separator subMenu = std_realtime, "&Realtime Display", 0 menu = "3D Map Tuning" ; subMenu = std_realtime, "Realtime Display" ; subMenu = std_warmup, "Warmup Wizard" - subMenu = fuelTableMap, "Fuel Table", 0, {algorithm != 3} - subMenu = veTableMap, "VE Table", 0, {algorithm == 3} - subMenu = afrTableMap, "Targe AFR Table", 0, {algorithm == 3} + subMenu = fuelTableMap, "Fuel Table", 0, {fuelAlgorithm != 3} + subMenu = veTableMap, "VE Table", 0, {fuelAlgorithm == 3} + subMenu = afrTableMap, "Targe AFR Table", 0, {fuelAlgorithm == 3} subMenu = injPhaseTableMap, "Injection Phase" subMenu = ignitionTableMap, "Ignition Table" subMenu = ignitionIatCorrTableMap, "Ignition Intake Air Temp correction" @@ -1452,7 +1452,7 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01" ; Engine->Injection Settings dialog = injChars, "Injector Settings", yAxis field = "Injector Flow", injector_flow - field = "phase offset", injectionOffset + field = "phase offset", extraInjectionOffset dialog = injIO, "Injector Output", yAxis field = "!ECU reboot needed to apply these settings" @@ -1819,7 +1819,7 @@ cmd_test_idle_valve = "w\x00\x17\x00\x01" field = "RPM Hard Limit", rpmHardLimit field = "Boost Cut Pressure", boostCutPressure field = "" - field = "Fuel Algorithm", algorithm + field = "Fuel Algorithm", fuelAlgorithm field = "" field = "#System hack's" field = "Global fuel correction", globalFuelCorrection diff --git a/java_console/models/src/com/rusefi/config/Fields.java b/java_console/models/src/com/rusefi/config/Fields.java index 8eb01a3013..c078360785 100644 --- a/java_console/models/src/com/rusefi/config/Fields.java +++ b/java_console/models/src/com/rusefi/config/Fields.java @@ -1,6 +1,6 @@ package com.rusefi.config; -// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Tue Aug 23 21:52:05 EDT 2016 +// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Aug 28 15:53:30 EDT 2016 public class Fields { public static final int LE_COMMAND_LENGTH = 200; public static final int FSIO_ADC_COUNT = 4; @@ -195,10 +195,10 @@ public class Fields { public static final int cylinderBore_offset = 412; public static final int sensorSnifferRpmThreshold_offset = 416; public static final int rpmHardLimit_offset = 420; - public static final int algorithm_offset = 424; + public static final int fuelAlgorithm_offset = 424; public static final int crankingInjectionMode_offset = 428; public static final int injectionMode_offset = 432; - public static final int injectionOffset_offset = 436; + public static final int extraInjectionOffset_offset = 436; public static final int crankingTimingAngle_offset = 440; public static final int ignitionMode_offset = 444; public static final int ignitionOffset_offset = 448; @@ -1038,10 +1038,10 @@ public class Fields { public static final Field SENSORSNIFFERRPMTHRESHOLD = Field.create("SENSORSNIFFERRPMTHRESHOLD", 416, FieldType.INT); public static final Field RPMHARDLIMIT = Field.create("RPMHARDLIMIT", 420, FieldType.INT); public static final String[] engine_load_mode_e = {"MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY"}; - public static final Field ALGORITHM = Field.create("ALGORITHM", 424, FieldType.INT, engine_load_mode_e); + public static final Field FUELALGORITHM = Field.create("FUELALGORITHM", 424, FieldType.INT, engine_load_mode_e); public static final Field CRANKINGINJECTIONMODE = Field.create("CRANKINGINJECTIONMODE", 428, FieldType.INT); public static final Field INJECTIONMODE = Field.create("INJECTIONMODE", 432, FieldType.INT); - public static final Field INJECTIONOFFSET = Field.create("INJECTIONOFFSET", 436, FieldType.FLOAT); + public static final Field EXTRAINJECTIONOFFSET = Field.create("EXTRAINJECTIONOFFSET", 436, FieldType.FLOAT); public static final Field CRANKINGTIMINGANGLE = Field.create("CRANKINGTIMINGANGLE", 440, FieldType.FLOAT); public static final Field IGNITIONMODE = Field.create("IGNITIONMODE", 444, FieldType.INT); public static final Field IGNITIONOFFSET = Field.create("IGNITIONOFFSET", 448, FieldType.FLOAT); diff --git a/unit_tests/test_fuel_map.cpp b/unit_tests/test_fuel_map.cpp index 76a29d126c..83d89b85f0 100644 --- a/unit_tests/test_fuel_map.cpp +++ b/unit_tests/test_fuel_map.cpp @@ -24,7 +24,7 @@ void testMafFuelMath(void) { EngineTestHelper eth(FORD_ASPIRE_1996); EXPAND_EngineTestHelper; - engineConfiguration->algorithm = LM_REAL_MAF; + engineConfiguration->fuelAlgorithm = LM_REAL_MAF; engineConfiguration->injector.flow = 200; setAfrMap(config->afrTable, 13); diff --git a/unit_tests/test_trigger_decoder.cpp b/unit_tests/test_trigger_decoder.cpp index ee0a711a65..9bb03ff380 100644 --- a/unit_tests/test_trigger_decoder.cpp +++ b/unit_tests/test_trigger_decoder.cpp @@ -598,7 +598,7 @@ void testFuelSchedulerBug299(void) { printf("*************************************************** testFuelSchedulerBug299\r\n"); EngineTestHelper eth(TEST_ENGINE); EXPAND_EngineTestHelper; - assertEquals(LM_PLAIN_MAF, engineConfiguration->algorithm); + assertEquals(LM_PLAIN_MAF, engineConfiguration->fuelAlgorithm); engineConfiguration->isIgnitionEnabled = false; engineConfiguration->specs.cylindersCount = 4; engineConfiguration->injectionMode = IM_BATCH;