diff --git a/.github/workflows/build-firmware.yaml b/.github/workflows/build-firmware.yaml index b729c7a8d2..d341b0e57b 100644 --- a/.github/workflows/build-firmware.yaml +++ b/.github/workflows/build-firmware.yaml @@ -24,7 +24,7 @@ jobs: - build-target: frankenso-pal efi-cpu: ARCH_STM32F4 efi-board: st_stm32f4 - target-extra-params: -DHAL_TRIGGER_USE_PAL=TRUE -DHAL_USE_ICU=FALSE -DEFI_VEHICLE_SPEED=FALSE -DEFI_LOGIC_ANALYZER=FALSE + target-extra-params: -DHAL_TRIGGER_USE_PAL=TRUE -DEFI_ICU_INPUTS=FALSE -DEFI_VEHICLE_SPEED=FALSE -DEFI_LOGIC_ANALYZER=FALSE - build-target: mre-f4 efi-cpu: ARCH_STM32F4 diff --git a/firmware/config/boards/kinetis/config/!gen_config.bat b/firmware/config/boards/kinetis/config/!gen_config.bat index c15b5d6509..167e7144b6 100644 --- a/firmware/config/boards/kinetis/config/!gen_config.bat +++ b/firmware/config/boards/kinetis/config/!gen_config.bat @@ -26,6 +26,7 @@ java ^ -definition integration/rusefi_config.txt ^ -ts_destination tunerstudio ^ -tool kineris_gen_config.bat ^ + -firing_order controllers/algo/firing_order.h ^ -with_c_defines false ^ -initialize_to_zero false ^ -ts_output_name rusefi_kinetis.ini ^ diff --git a/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp b/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp index 6e29f5398a..18cbf3f1b9 100644 --- a/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp +++ b/firmware/config/boards/kinetis/config/controllers/algo/auto_generated_enums.cpp @@ -516,8 +516,6 @@ case Force_4_bytes_size_engine_load_mode: return "Force_4_bytes_size_engine_load_mode"; case LM_ALPHA_N: return "LM_ALPHA_N"; -case LM_MAP: - return "LM_MAP"; case LM_PLAIN_MAF: return "LM_PLAIN_MAF"; case LM_REAL_MAF: diff --git a/firmware/config/boards/kinetis/config/controllers/algo/engine_configuration_generated_structures.h b/firmware/config/boards/kinetis/config/controllers/algo/engine_configuration_generated_structures.h index e1e2c53055..eecd145954 100644 --- a/firmware/config/boards/kinetis/config/controllers/algo/engine_configuration_generated_structures.h +++ b/firmware/config/boards/kinetis/config/controllers/algo/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Sun May 03 03:40:24 EDT 2020 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Wed May 06 12:33:00 EDT 2020 // by class com.rusefi.output.CHeaderConsumer // begin #ifndef CONFIG_BOARDS_KINETIS_CONFIG_CONTROLLERS_ALGO_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H @@ -1894,7 +1894,15 @@ struct engine_configuration_s { /** * offset 1096 */ - int unusedAtOldBoardConfigurationEnd[92]; + vehicle_info_t engineMake; + /** + * offset 1128 + */ + vehicle_info_t engineCode; + /** + * offset 1160 + */ + int unusedAtOldBoardConfigurationEnd[76]; /** offset 1464 bit 0 */ bool vvtDisplayInverted : 1; @@ -3166,7 +3174,7 @@ struct persistent_config_s { /** * offset 6312 */ - uint8_t boostMapBins[BOOST_LOAD_COUNT]; + uint8_t unused6312[8]; /** * offset 6320 */ @@ -3431,4 +3439,4 @@ typedef struct persistent_config_s persistent_config_s; #endif // end -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Sun May 03 03:40:24 EDT 2020 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Wed May 06 12:33:00 EDT 2020 diff --git a/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h b/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h index 221af68b94..b3251ecb5e 100644 --- a/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h +++ b/firmware/config/boards/kinetis/config/controllers/algo/rusefi_generated.h @@ -291,8 +291,6 @@ #define boostControlPinMode_offset_hex 3dd #define boostCutPressure_offset 2132 #define boostCutPressure_offset_hex 854 -#define boostMapBins_offset 6312 -#define boostMapBins_offset_hex 18a8 #define boostPid_dFactor_offset 1000 #define boostPid_dFactor_offset_hex 3e8 #define boostPid_iFactor_offset 996 @@ -554,10 +552,12 @@ #define enableLaunchRetard_offset_hex 3d0 #define enableVerboseCanTx_offset 744 #define enableVerboseCanTx_offset_hex 2e8 -#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY", "MAF Air Charge" +#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge" #define ENGINE_NOISE_CURVE_SIZE 8 #define engineChartSize_offset 1480 #define engineChartSize_offset_hex 5c8 +#define engineCode_offset 1128 +#define engineCode_offset_hex 468 #define engineConfiguration_offset 0 #define engineConfiguration_offset_hex 0 #define engineLoadAccelEnrichmentMultiplier_offset 2072 @@ -570,6 +570,8 @@ #define engineLoadDecelEnleanmentMultiplier_offset_hex 810 #define engineLoadDecelEnleanmentThreshold_offset 2060 #define engineLoadDecelEnleanmentThreshold_offset_hex 80c +#define engineMake_offset 1096 +#define engineMake_offset_hex 448 #define engineSnifferRpmThreshold_offset 4 #define engineSnifferRpmThreshold_offset_hex 4 #define engineType_offset 0 @@ -1356,17 +1358,6 @@ #define ignitionMode_offset_hex 1b8 #define ignitionOffset_offset 444 #define ignitionOffset_offset_hex 1bc -#define ignitionPin10logic -#define ignitionPin11logic -#define ignitionPin12logic -#define ignitionPin2logic || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)) -#define ignitionPin3logic || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)) -#define ignitionPin4logic || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)) -#define ignitionPin5logic || ((firingOrder == 4) || (firingOrder == 12)) -#define ignitionPin6logic -#define ignitionPin7logic || ((firingOrder == 11)) -#define ignitionPin8logic || ((firingOrder == 5) || (firingOrder == 11)) -#define ignitionPin9logic #define ignitionPinMode_offset 649 #define ignitionPinMode_offset_hex 289 #define ignitionPins10_offset 645 @@ -2276,6 +2267,8 @@ #define unused1476b20_offset_hex 5c4 #define unused2432_offset 2432 #define unused2432_offset_hex 980 +#define unused6312_offset 6312 +#define unused6312_offset_hex 18a8 #define unused711_offset 711 #define unused711_offset_hex 2c7 #define unused76b0_offset 76 @@ -2302,8 +2295,8 @@ #define unused_former_warmup_target_afr_offset_hex 834 #define unusedAntilagTimeout_offset 820 #define unusedAntilagTimeout_offset_hex 334 -#define unusedAtOldBoardConfigurationEnd_offset 1096 -#define unusedAtOldBoardConfigurationEnd_offset_hex 448 +#define unusedAtOldBoardConfigurationEnd_offset 1160 +#define unusedAtOldBoardConfigurationEnd_offset_hex 488 #define unusedBit4_1476_offset 1476 #define unusedBit4_1476_offset_hex 5c4 #define unusedBit_251_10_offset 976 @@ -2453,6 +2446,7 @@ #define vbattAdcChannel_offset_hex 201 #define vbattDividerCoeff_offset 464 #define vbattDividerCoeff_offset_hex 1d0 +#define VEHICLE_INFO_SIZE 32 #define vehicleSpeedCoef_offset 476 #define vehicleSpeedCoef_offset_hex 1dc #define vehicleSpeedSensorInputPin_offset 968 diff --git a/firmware/config/boards/proteus/board.mk b/firmware/config/boards/proteus/board.mk index 4c657cb8a7..b849cc4150 100644 --- a/firmware/config/boards/proteus/board.mk +++ b/firmware/config/boards/proteus/board.mk @@ -24,4 +24,4 @@ endif # Override DEFAULT_ENGINE_TYPE -DDEFS += $(MCU_DEFS) -DEFI_USE_OSC=TRUE -DEFI_FATAL_ERROR_PIN=GPIOE_3 -DFIRMWARE_ID=\"proteus\" -DDEFAULT_ENGINE_TYPE=PROTEUS -DUSE_ADC3_VBATT_HACK -DSTM32_ADC_USE_ADC3=TRUE -DEFI_INCLUDE_ENGINE_PRESETS=FALSE +DDEFS += $(MCU_DEFS) -DEFI_USE_OSC=TRUE -DEFI_FATAL_ERROR_PIN=GPIOE_3 -DFIRMWARE_ID=\"proteus\" -DDEFAULT_ENGINE_TYPE=PROTEUS -DUSE_ADC3_VBATT_HACK -DSTM32_ADC_USE_ADC3=TRUE -DEFI_INCLUDE_ENGINE_PRESETS=FALSE -DEFI_ICU_INPUTS=FALSE -DHAL_TRIGGER_USE_PAL=TRUE -DEFI_VEHICLE_SPEED=FALSE -DEFI_LOGIC_ANALYZER=FALSE diff --git a/firmware/config/engines/GY6_139QMB.cpp b/firmware/config/engines/GY6_139QMB.cpp index fab1a1416d..de6750edb2 100644 --- a/firmware/config/engines/GY6_139QMB.cpp +++ b/firmware/config/engines/GY6_139QMB.cpp @@ -20,62 +20,12 @@ EXTERN_CONFIG; -static const fuel_table_t default_139qmb_fuel_table = { - -{ 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000 }, { 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000 }, { 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000 }, { 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000 }, { 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000 }, - { 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000 }, { 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000 }, { 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000 }, { 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000 }, { 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000 }, { 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000 }, { 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000 }, { 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000 }, { 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000 }, { 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000 }, { 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, 6.000000, - 6.000000 } - -}; - static void setDefault139qmbMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) { setFuelLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); setFuelRpmBin(1000, 11000 PASS_CONFIG_PARAMETER_SUFFIX); setTimingLoadBin(1.2, 4.4 PASS_CONFIG_PARAMETER_SUFFIX); setTimingRpmBin(1000, 11000 PASS_CONFIG_PARAMETER_SUFFIX); - - copyFuelTable(default_139qmb_fuel_table, config->fuelTable); - //copyTimingTable(default_139qmb_timing_table, config->ignitionTable); } void setGy6139qmbDefaultEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) { @@ -87,7 +37,6 @@ void setGy6139qmbDefaultEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) engineConfiguration->cranking.rpm = 1100; setTargetRpmCurve(2000 PASS_CONFIG_PARAMETER_SUFFIX); engineConfiguration->analogInputDividerCoefficient = 1; - engineConfiguration->fuelAlgorithm = LM_MAP; engineConfiguration->globalTriggerAngleOffset = 45; engineConfiguration->sensorChartMode = SC_MAP; engineConfiguration->specs.displacement = 0.072; // 72cc diff --git a/firmware/config/stm32f7ems/efifeatures.h b/firmware/config/stm32f7ems/efifeatures.h index 6cf08b99d1..ab21b78ecb 100644 --- a/firmware/config/stm32f7ems/efifeatures.h +++ b/firmware/config/stm32f7ems/efifeatures.h @@ -78,7 +78,6 @@ // todo: start using consoleUartDevice? Not sure #undef EFI_CONSOLE_SERIAL_DEVICE -#define EFI_CONSOLE_SERIAL_DEVICE (&SD3) // todo: our "DMA-half" ChibiOS patch not implemented for USARTv2/STM32F7 #undef TS_UART_DMA_MODE diff --git a/firmware/controllers/actuators/boost_control.cpp b/firmware/controllers/actuators/boost_control.cpp index 1e0b5f7923..ff5f5ca540 100644 --- a/firmware/controllers/actuators/boost_control.cpp +++ b/firmware/controllers/actuators/boost_control.cpp @@ -18,9 +18,7 @@ #include "io_pins.h" #include "engine_configuration.h" #include "pwm_generator_logic.h" -#include "pid.h" #include "engine_controller.h" -#include "periodic_task.h" #include "pin_repository.h" #include "pwm_generator_logic.h" #include "pid_auto_tune.h" @@ -37,96 +35,129 @@ static Logging *logger; static boostOpenLoop_Map3D_t boostMapOpen("boostmapopen", 1); static boostOpenLoop_Map3D_t boostMapClosed("boostmapclosed", 1); static SimplePwm boostPwmControl("boost"); -static Pid boostControlPid; -static bool shouldResetPid = false; +void BoostController::init(SimplePwm* pwm, const ValueProvider3D* openLoopMap, const ValueProvider3D* closedLoopTargetMap, pid_s* pidParams) { + m_pwm = pwm; + m_openLoopMap = openLoopMap; + m_closedLoopTargetMap = closedLoopTargetMap; + + m_pid.initPidClass(pidParams); +} + + +void BoostController::reset() { + m_shouldResetPid = true; +} + +void BoostController::onConfigurationChange(pid_s* previousConfiguration) { + if (!m_pid.isSame(previousConfiguration)) { + m_shouldResetPid = true; + } +} + +int BoostController::getPeriodMs() { + return GET_PERIOD_LIMITED(&engineConfiguration->boostPid); +} + +expected BoostController::observePlant() const { + float map = getMap(PASS_ENGINE_PARAMETER_SIGNATURE); + + if (cisnan(map)) { + return unexpected; + } + + return map; +} + +expected BoostController::getSetpoint() const { + float rpm = GET_RPM(); + + auto tps = Sensor::get(SensorType::DriverThrottleIntent); + + if (!tps) { + return unexpected; + } + + if (!m_closedLoopTargetMap) { + return unexpected; + } + + return m_closedLoopTargetMap->getValue(rpm / RPM_1_BYTE_PACKING_MULT, tps.Value / TPS_1_BYTE_PACKING_MULT) * LOAD_1_BYTE_PACKING_MULT; +} + +expected BoostController::getOpenLoop(float target) const { + // Boost control open loop doesn't care about target - only MAP/RPM + UNUSED(target); + + float rpm = GET_RPM(); + auto tps = Sensor::get(SensorType::DriverThrottleIntent); + + if (!tps) { + return unexpected; + } + + if (!m_openLoopMap) { + return unexpected; + } + + percent_t openLoop = m_openLoopMap->getValue(rpm / RPM_1_BYTE_PACKING_MULT, tps.Value / TPS_1_BYTE_PACKING_MULT) * LOAD_1_BYTE_PACKING_MULT; #if EFI_TUNER_STUDIO -extern TunerStudioOutputChannels tsOutputChannels; -#endif /* EFI_TUNER_STUDIO */ + if (engineConfiguration->debugMode == DBG_BOOST) { + tsOutputChannels.debugFloatField1 = openLoop; + } +#endif -static void pidReset(void) { - boostControlPid.reset(); + return openLoop; } -class BoostControl: public PeriodicTimerController { - DECLARE_ENGINE_PTR; - - int getPeriodMs() override { - return GET_PERIOD_LIMITED(&engineConfiguration->boostPid); +expected BoostController::getClosedLoop(float target, float manifoldPressure) { + // If we're in open loop only mode, make no closed loop correction. + if (engineConfiguration->boostType != CLOSED_LOOP) { + return 0; } - void PeriodicTask() override { - if (shouldResetPid) { - pidReset(); - shouldResetPid = false; - } + // Reset PID if requested + if (m_shouldResetPid) { + m_pid.reset(); + m_shouldResetPid = false; + } - float rpm = GET_RPM_VALUE; - float mapValue = getMap(PASS_ENGINE_PARAMETER_SIGNATURE); + // If the engine isn't running, don't correct. + if (GET_RPM() == 0) { + m_pid.reset(); + return 0; + } - if (!engineConfiguration->isBoostControlEnabled) - return; + float closedLoop = m_pid.getOutput(target, manifoldPressure); - bool engineRunning = rpm > engineConfiguration->cranking.rpm; - if (!engineRunning) { - boostControlPid.reset(); - return; - } - - percent_t openLoopDuty = boostMapOpen.getValue(rpm / RPM_1_BYTE_PACKING_MULT, mapValue / LOAD_1_BYTE_PACKING_MULT) * LOAD_1_BYTE_PACKING_MULT; - percent_t closedLoopDuty = 0; - percent_t duty = openLoopDuty; - - if (engineConfiguration->boostType == CLOSED_LOOP) { - auto [valid, tps] = Sensor::get(SensorType::DriverThrottleIntent); - - if (valid) { - float targetBoost = boostMapClosed.getValue(rpm / RPM_1_BYTE_PACKING_MULT, tps / TPS_1_BYTE_PACKING_MULT) * LOAD_1_BYTE_PACKING_MULT; - closedLoopDuty = openLoopDuty + boostControlPid.getOutput(targetBoost, mapValue); - duty += closedLoopDuty; - } - } - - boostControlPid.iTermMin = -50; - boostControlPid.iTermMax = 50; - - if (engineConfiguration->debugMode == DBG_BOOST) { #if EFI_TUNER_STUDIO - boostControlPid.postState(&tsOutputChannels); - tsOutputChannels.debugFloatField1 = openLoopDuty; - tsOutputChannels.debugFloatField7 = closedLoopDuty; + if (engineConfiguration->debugMode == DBG_BOOST) { + m_pid.postState(&tsOutputChannels); + tsOutputChannels.debugFloatField2 = closedLoop; + } #endif /* EFI_TUNER_STUDIO */ - } -#if EFI_LAUNCH_CONTROL - if (engine->setLaunchBoostDuty) { - duty = engineConfiguration->launchBoostDuty; + return closedLoop; +} + +void BoostController::setOutput(expected output) { + // TODO: hook up safe duty cycle + float duty = PERCENT_TO_DUTY(output.value_or(/*CONFIG(boostControlSafeDutyCycle)*/ 0)); + + if (m_pwm) { + m_pwm->setSimplePwmDutyCycle(duty); } -#endif /* EFI_LAUNCH_CONTROL */ - - boostPwmControl.setSimplePwmDutyCycle(PERCENT_TO_DUTY(duty)); - } -}; - -static BoostControl BoostController; - -#if !EFI_UNIT_TEST -void setBoostPFactor(float value) { - engineConfiguration->boostPid.pFactor = value; - boostControlPid.reset(); } -void setBoostIFactor(float value) { - engineConfiguration->boostPid.iFactor = value; - boostControlPid.reset(); +void BoostController::PeriodicTask() { + m_pid.iTermMin = -50; + m_pid.iTermMax = 50; + + update(); } -void setBoostDFactor(float value) { - engineConfiguration->boostPid.dFactor = value; - boostControlPid.reset(); -} -#endif /* EFI_UNIT_TEST */ +BoostController boostController; void setDefaultBoostParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->isBoostControlEnabled = true; @@ -141,22 +172,17 @@ void setDefaultBoostParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) { engineConfiguration->boostControlPinMode = OM_DEFAULT; setLinearCurve(config->boostRpmBins, 0, 8000 / RPM_1_BYTE_PACKING_MULT, 1); - setLinearCurve(config->boostMapBins, 0, 300 / LOAD_1_BYTE_PACKING_MULT, 1); - for (int loadIndex = 0;loadIndexboostTableOpenLoop[loadIndex][rpmIndex] = config->boostMapBins[loadIndex]; - } - } - setLinearCurve(config->boostTpsBins, 0, 100 / TPS_1_BYTE_PACKING_MULT, 1); - for (int loadIndex = 0;loadIndexboostTableOpenLoop[loadIndex][rpmIndex] = config->boostTpsBins[loadIndex]; config->boostTableClosedLoop[loadIndex][rpmIndex] = config->boostTpsBins[loadIndex]; } } } -static void turnBoostPidOn() { +void startBoostPin() { #if !EFI_UNIT_TEST if (CONFIG(boostControlPin) == GPIO_UNASSIGNED){ return; @@ -174,18 +200,14 @@ static void turnBoostPidOn() { #endif /* EFI_UNIT_TEST */ } -void startBoostPin(void) { - turnBoostPidOn(); -} - -void stopBoostPin(void) { +void stopBoostPin() { #if !EFI_UNIT_TEST brain_pin_markUnused(activeConfiguration.boostControlPin); #endif /* EFI_UNIT_TEST */ } void onConfigurationChangeBoostCallback(engine_configuration_s *previousConfiguration) { - shouldResetPid = !boostControlPid.isSame(&previousConfiguration->boostPid); + boostController.onConfigurationChange(&previousConfiguration->boostPid); } void initBoostCtrl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { @@ -195,15 +217,18 @@ void initBoostCtrl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { } #endif - boostControlPid.initPidClass(&engineConfiguration->boostPid); - logger = sharedLogger; - boostMapOpen.init(config->boostTableOpenLoop, config->boostMapBins, config->boostRpmBins); + + // Set up open & closed loop tables + boostMapOpen.init(config->boostTableOpenLoop, config->boostTpsBins, config->boostRpmBins); boostMapClosed.init(config->boostTableClosedLoop, config->boostTpsBins, config->boostRpmBins); - boostControlPid.reset(); + + // Set up boost controller instance + boostController.init(&boostPwmControl, &boostMapOpen, &boostMapClosed, &engineConfiguration->boostPid); + #if !EFI_UNIT_TEST startBoostPin(); - BoostController.Start(); + boostController.Start(); #endif } diff --git a/firmware/controllers/actuators/boost_control.h b/firmware/controllers/actuators/boost_control.h index 3554f35828..ecaf681021 100644 --- a/firmware/controllers/actuators/boost_control.h +++ b/firmware/controllers/actuators/boost_control.h @@ -8,13 +8,46 @@ #include "engine.h" #include "periodic_task.h" +#include "closed_loop_controller.h" +#include "pid.h" -void startBoostPin(void); -void stopBoostPin(void); +class SimplePwm; + +class BoostController : public ClosedLoopController, public PeriodicTimerController { +public: + DECLARE_ENGINE_PTR; + + void init(SimplePwm* pmw, const ValueProvider3D* openLoopMap, const ValueProvider3D* closedLoopTargetMap, pid_s* pidParams); + + // PeriodicTimerController implementation + int getPeriodMs() override; + void PeriodicTask() override; + void reset(); + + // Called when the configuration may have changed. Controller will + // reset if necessary. + void onConfigurationChange(pid_s* previousConfiguration); + + // Helpers for individual parts of boost control + expected observePlant() const override; + expected getSetpoint() const override; + + expected getOpenLoop(float target) const override; + expected getClosedLoop(float target, float manifoldPressure) override; + + void setOutput(expected outputValue) override; + +private: + bool m_shouldResetPid = false; + Pid m_pid; + + const ValueProvider3D* m_openLoopMap = nullptr; + const ValueProvider3D* m_closedLoopTargetMap = nullptr; + SimplePwm* m_pwm = nullptr; +}; + +void startBoostPin(); +void stopBoostPin(); void initBoostCtrl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX); -void setBoostPFactor(float p); -void setBoostIFactor(float i); -void setBoostDFactor(float d); void setDefaultBoostParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE); -void showBoostInfo(void); void onConfigurationChangeBoostCallback(engine_configuration_s *previousConfiguration); diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index 4dad7da054..98b3582ee5 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -222,29 +222,59 @@ expected EtbController::getClosedLoopAutotune(percent_t actualThrottl // Publish to TS state #if EFI_TUNER_STUDIO + // Amplitude of input (duty cycle %) + float b = 2 * autotuneAmplitude; + + // Ultimate gain per A-H relay tuning rule + float ku = 4 * b / (3.14159f * m_a); + + // The multipliers below are somewhere near the "no overshoot" + // and "some overshoot" flavors of the Ziegler-Nichols method + // Kp + float kp = 0.35f * ku; + float ki = 0.25f * ku / m_tu; + float kd = 0.08f * ku * m_tu; + + // Every 5 cycles (of the throttle), cycle to the next value + if (m_autotuneCounter == 5) { + m_autotuneCounter = 0; + m_autotuneCurrentParam++; + + if (m_autotuneCurrentParam >= 3) { + m_autotuneCurrentParam = 0; + } + } + + m_autotuneCounter++; + + // Multiplex 3 signals on to the {mode, value} format + tsOutputChannels.calibrationMode = static_cast(m_autotuneCurrentParam + 3); + + switch (m_autotuneCurrentParam) { + case 0: + tsOutputChannels.calibrationValue = kp; + break; + case 1: + tsOutputChannels.calibrationValue = ki; + break; + case 2: + tsOutputChannels.calibrationValue = kd; + break; + } + + // Also output to debug channels if configured if (engineConfiguration->debugMode == DBG_ETB_AUTOTUNE) { // a - amplitude of output (TPS %) - tsOutputChannels.debugFloatField1 = m_a; - float b = 2 * autotuneAmplitude; // b - amplitude of input (Duty cycle %) tsOutputChannels.debugFloatField2 = b; // Tu - oscillation period (seconds) tsOutputChannels.debugFloatField3 = m_tu; - // Ultimate gain per A-H relay tuning rule - // Ku - float ku = 4 * b / (3.14159f * m_a); tsOutputChannels.debugFloatField4 = ku; - - // The multipliers below are somewhere near the "no overshoot" - // and "some overshoot" flavors of the Ziegler-Nichols method - // Kp - tsOutputChannels.debugFloatField5 = 0.35f * ku; - // Ki - tsOutputChannels.debugFloatField6 = 0.25f * ku / m_tu; - // Kd - tsOutputChannels.debugFloatField7 = 0.08f * ku * m_tu; + tsOutputChannels.debugFloatField5 = kp; + tsOutputChannels.debugFloatField6 = ki; + tsOutputChannels.debugFloatField7 = kd; } #endif } diff --git a/firmware/controllers/actuators/electronic_throttle.h b/firmware/controllers/actuators/electronic_throttle.h index 075cc5e40b..5c120aac1e 100644 --- a/firmware/controllers/actuators/electronic_throttle.h +++ b/firmware/controllers/actuators/electronic_throttle.h @@ -88,8 +88,14 @@ private: efitick_t m_cycleStartTime = 0; float m_minCycleTps = 0; float m_maxCycleTps = 0; - float m_a = 0; - float m_tu = 0; + // Autotune measured parameters: gain and ultimate period + // These are set to correct order of magnitude starting points + // so we converge more quickly on the correct values + float m_a = 8; + float m_tu = 0.1f; + + uint8_t m_autotuneCounter = 0; + uint8_t m_autotuneCurrentParam = 0; }; void initElectronicThrottle(DECLARE_ENGINE_PARAMETER_SIGNATURE); diff --git a/firmware/controllers/algo/advance_map.cpp b/firmware/controllers/algo/advance_map.cpp index 68fc648fbe..d48901fbf3 100644 --- a/firmware/controllers/algo/advance_map.cpp +++ b/firmware/controllers/algo/advance_map.cpp @@ -368,8 +368,7 @@ 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_CONFIG_PARAMETER_SUFFIX) { - if (engineConfiguration->fuelAlgorithm != LM_SPEED_DENSITY && - engineConfiguration->fuelAlgorithm != LM_MAP) { + if (engineConfiguration->fuelAlgorithm != LM_SPEED_DENSITY) { warning(CUSTOM_WRONG_ALGORITHM, "wrong algorithm for MAP-based timing"); return; } diff --git a/firmware/controllers/algo/auto_generated_enums.cpp b/firmware/controllers/algo/auto_generated_enums.cpp index 7c43d365c7..eb2ada7262 100644 --- a/firmware/controllers/algo/auto_generated_enums.cpp +++ b/firmware/controllers/algo/auto_generated_enums.cpp @@ -660,8 +660,6 @@ case Force_4_bytes_size_engine_load_mode: return "Force_4_bytes_size_engine_load_mode"; case LM_ALPHA_N: return "LM_ALPHA_N"; -case LM_MAP: - return "LM_MAP"; case LM_PLAIN_MAF: return "LM_PLAIN_MAF"; case LM_REAL_MAF: diff --git a/firmware/controllers/algo/engine.cpp b/firmware/controllers/algo/engine.cpp index 03cad6a76c..5f3902155c 100644 --- a/firmware/controllers/algo/engine.cpp +++ b/firmware/controllers/algo/engine.cpp @@ -145,6 +145,8 @@ void Engine::periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) { cylinderCleanupControl(PASS_ENGINE_PARAMETER_SIGNATURE); + standardAirCharge = getStandardAirCharge(PASS_ENGINE_PARAMETER_SIGNATURE); + #if (BOARD_TLE8888_COUNT > 0) if (CONFIG(useTLE8888_cranking_hack) && ENGINE(rpmCalculator).isCranking(PASS_ENGINE_PARAMETER_SIGNATURE)) { efitick_t nowNt = getTimeNowNt(); diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 88238e2473..dabc4526be 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -216,6 +216,9 @@ public: */ floatms_t actualLastInjection = 0; + // Standard cylinder air charge - 100% VE at standard temperature, grams per cylinder + float standardAirCharge = 0; + void periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); void periodicSlowCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE); void updateSlowSensors(DECLARE_ENGINE_PARAMETER_SIGNATURE); diff --git a/firmware/controllers/algo/firing_order.h b/firmware/controllers/algo/firing_order.h index 9bed06331b..e59b3e6aaa 100644 --- a/firmware/controllers/algo/firing_order.h +++ b/firmware/controllers/algo/firing_order.h @@ -35,6 +35,8 @@ typedef enum { FO_1_2_3_4_5_6 = 9, FO_1_6_3_2_5_4 = 13, // EG33 + // todo: one day we shall support 7 cylinder radial, probably not before one actually approaches us + // 8 cylinder FO_1_8_4_3_6_5_7_2 = 5, FO_1_8_7_2_6_5_4_3 = 11, @@ -43,6 +45,7 @@ typedef enum { FO_1_3_7_2_6_5_4_8 = 20, // Ford 5.0 HO and 351W // 9 cylinder - for instance radial :) + // PS: Matt says that 9cyl is actually 1-3-5-7-9-2-4-6-8 or 1-8-6-4-2-9-7-5-3 for reverse rotation FO_1_2_3_4_5_6_7_8_9 = 21, // 10 cylinder diff --git a/firmware/controllers/algo/fuel_math.cpp b/firmware/controllers/algo/fuel_math.cpp index 0561c5c1e0..4c13d6d1a0 100644 --- a/firmware/controllers/algo/fuel_math.cpp +++ b/firmware/controllers/algo/fuel_math.cpp @@ -163,11 +163,9 @@ float getRealMafFuel(float airSpeed, int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) { float halfCylCount = CONFIG(specs.cylindersCount) / 2.0f; float cylinderAirmass = airPerRevolution / halfCylCount; - - //Calculation of 100% VE air mass in g/rev - 1 cylinder filling at 1.2929g/L - float StandardAirCharge = CONFIG(specs.displacement) / CONFIG(specs.cylindersCount) * 1.2929; + //Create % load for fuel table using relative naturally aspiratedcylinder filling - float airChargeLoad = 100 * cylinderAirmass/StandardAirCharge; + float airChargeLoad = 100 * cylinderAirmass / ENGINE(standardAirCharge); //Correct air mass by VE table float corrCylAirmass = cylinderAirmass * veMap.getValue(rpm, airChargeLoad) / 100; @@ -452,6 +450,15 @@ floatms_t getCrankingFuel(DECLARE_ENGINE_PARAMETER_SIGNATURE) { return getCrankingFuel3(Sensor::get(SensorType::Clt).value_or(20), engine->rpmCalculator.getRevolutionCounterSinceStart() PASS_ENGINE_PARAMETER_SUFFIX); } + +float getStandardAirCharge(DECLARE_ENGINE_PARAMETER_SIGNATURE) { + float totalDisplacement = CONFIG(specs.displacement); + float cylDisplacement = totalDisplacement / CONFIG(specs.cylindersCount); + + // Calculation of 100% VE air mass in g/cyl - 1 cylinder filling at 1.204/L - air density at 20C + return cylDisplacement * 1.204f; +} + #endif float getFuelRate(floatms_t totalInjDuration, efitick_t timePeriod DECLARE_ENGINE_PARAMETER_SUFFIX) { diff --git a/firmware/controllers/algo/fuel_math.h b/firmware/controllers/algo/fuel_math.h index 2680a94be3..6fe04eb355 100644 --- a/firmware/controllers/algo/fuel_math.h +++ b/firmware/controllers/algo/fuel_math.h @@ -37,5 +37,7 @@ floatms_t getCrankingFuel3(float coolantTemperature, uint32_t revolutionCounterS floatms_t getInjectionDuration(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX); +float getStandardAirCharge(DECLARE_ENGINE_PARAMETER_SIGNATURE); + // convert injection duration (Ms/Nt) to fuel rate (L/h) float getFuelRate(floatms_t totalInjDuration, efitick_t timePeriod DECLARE_ENGINE_PARAMETER_SUFFIX); diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 922668a028..81e459e65c 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -405,10 +405,6 @@ typedef enum { * Throttle Position Sensor value is used as engine load. http://en.wikipedia.org/wiki/Throttle_position_sensor */ LM_ALPHA_N = 1, - /** - * raw Manifold Absolute Pressure sensor value is used as engine load http://en.wikipedia.org/wiki/MAP_sensor - */ - LM_MAP = 2, /** * Speed Density algorithm - Engine Load is a function of MAP, VE and target AFR * http://articles.sae.org/8539/ diff --git a/firmware/controllers/algo/rusefi_types.h b/firmware/controllers/algo/rusefi_types.h index a3b998363e..81502aa0a4 100644 --- a/firmware/controllers/algo/rusefi_types.h +++ b/firmware/controllers/algo/rusefi_types.h @@ -83,6 +83,8 @@ typedef void (*Void)(void); typedef char error_message_t[ERROR_BUFFER_SIZE]; +typedef char vehicle_info_t[VEHICLE_INFO_SIZE]; + typedef char le_formula_t[LE_COMMAND_LENGTH]; typedef brain_pin_e egt_cs_array_t[EGT_CHANNEL_COUNT]; diff --git a/firmware/controllers/bench_test.cpp b/firmware/controllers/bench_test.cpp index 3b926ae3fb..e82d195225 100644 --- a/firmware/controllers/bench_test.cpp +++ b/firmware/controllers/bench_test.cpp @@ -259,9 +259,6 @@ static void handleCommandX14(uint16_t index) { case 0xB: starterRelayBench(); return; - case 0xC: - engine->etbAutoTune = true; - return; case 0xD: engine->directSelfStimulation = true; return; @@ -269,6 +266,12 @@ static void handleCommandX14(uint16_t index) { case 0xE: etbAutocal(0); return; + case 0xC: + engine->etbAutoTune = true; + return; + case 0x10: + engine->etbAutoTune = false; + return; #endif case 0xF: engine->directSelfStimulation = false; diff --git a/firmware/controllers/gauges/tachometer.cpp b/firmware/controllers/gauges/tachometer.cpp index 71427b0d7c..b7a1daa5e3 100644 --- a/firmware/controllers/gauges/tachometer.cpp +++ b/firmware/controllers/gauges/tachometer.cpp @@ -55,9 +55,9 @@ static void tachSignalCallback(trigger_event_e ckpSignalType, } // What is the angle per tach output period? - float cycleTimeMs = 60000.0 / GET_RPM(); + float cycleTimeMs = 60000.0f / GET_RPM(); float periodTimeMs = cycleTimeMs / periods; - tachFreq = 1000.0 / periodTimeMs; + tachFreq = 1000.0f / periodTimeMs; if (CONFIG(tachPulseDurationAsDutyCycle)) { // Simple case - duty explicitly set @@ -68,7 +68,7 @@ static void tachSignalCallback(trigger_event_e ckpSignalType, } // In case Freq is under 1Hz, we stop pwm to avoid warnings! - if (tachFreq < 1.0) { + if (tachFreq < 1) { tachFreq = NAN; } @@ -87,7 +87,7 @@ void initTachometer(DECLARE_ENGINE_PARAMETER_SIGNATURE) { &engine->executor, CONFIG(tachOutputPin), &enginePins.tachOut, - NAN, 0.1, (pwm_gen_callback*)applyPinState); + NAN, 0.1f); #if EFI_SHAFT_POSITION_INPUT addTriggerEventListener(tachSignalCallback, "tach", engine); diff --git a/firmware/controllers/generated/engine_configuration_generated_structures.h b/firmware/controllers/generated/engine_configuration_generated_structures.h index 8ba13fa45c..134936a698 100644 --- a/firmware/controllers/generated/engine_configuration_generated_structures.h +++ b/firmware/controllers/generated/engine_configuration_generated_structures.h @@ -1,4 +1,4 @@ -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun May 03 03:38:31 EDT 2020 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed May 06 12:32:31 EDT 2020 // by class com.rusefi.output.CHeaderConsumer // begin #ifndef CONTROLLERS_GENERATED_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H @@ -1894,7 +1894,15 @@ struct engine_configuration_s { /** * offset 1096 */ - int unusedAtOldBoardConfigurationEnd[92]; + vehicle_info_t engineMake; + /** + * offset 1128 + */ + vehicle_info_t engineCode; + /** + * offset 1160 + */ + int unusedAtOldBoardConfigurationEnd[76]; /** offset 1464 bit 0 */ bool vvtDisplayInverted : 1; @@ -3166,7 +3174,7 @@ struct persistent_config_s { /** * offset 6312 */ - uint8_t boostMapBins[BOOST_LOAD_COUNT]; + uint8_t unused6312[8]; /** * offset 6320 */ @@ -3431,4 +3439,4 @@ typedef struct persistent_config_s persistent_config_s; #endif // end -// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Sun May 03 03:38:31 EDT 2020 +// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed May 06 12:32:31 EDT 2020 diff --git a/firmware/controllers/generated/rusefi_generated.h b/firmware/controllers/generated/rusefi_generated.h index 0bbcd3f0c0..59b90f2549 100644 --- a/firmware/controllers/generated/rusefi_generated.h +++ b/firmware/controllers/generated/rusefi_generated.h @@ -291,8 +291,6 @@ #define boostControlPinMode_offset_hex 3dd #define boostCutPressure_offset 2132 #define boostCutPressure_offset_hex 854 -#define boostMapBins_offset 6312 -#define boostMapBins_offset_hex 18a8 #define boostPid_dFactor_offset 1000 #define boostPid_dFactor_offset_hex 3e8 #define boostPid_iFactor_offset 996 @@ -554,10 +552,12 @@ #define enableLaunchRetard_offset_hex 3d0 #define enableVerboseCanTx_offset 744 #define enableVerboseCanTx_offset_hex 2e8 -#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY", "MAF Air Charge" +#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge" #define ENGINE_NOISE_CURVE_SIZE 8 #define engineChartSize_offset 1480 #define engineChartSize_offset_hex 5c8 +#define engineCode_offset 1128 +#define engineCode_offset_hex 468 #define engineConfiguration_offset 0 #define engineConfiguration_offset_hex 0 #define engineLoadAccelEnrichmentMultiplier_offset 2072 @@ -570,6 +570,8 @@ #define engineLoadDecelEnleanmentMultiplier_offset_hex 810 #define engineLoadDecelEnleanmentThreshold_offset 2060 #define engineLoadDecelEnleanmentThreshold_offset_hex 80c +#define engineMake_offset 1096 +#define engineMake_offset_hex 448 #define engineSnifferRpmThreshold_offset 4 #define engineSnifferRpmThreshold_offset_hex 4 #define engineType_offset 0 @@ -1356,17 +1358,6 @@ #define ignitionMode_offset_hex 1b8 #define ignitionOffset_offset 444 #define ignitionOffset_offset_hex 1bc -#define ignitionPin10logic -#define ignitionPin11logic -#define ignitionPin12logic -#define ignitionPin2logic || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)) -#define ignitionPin3logic || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)) -#define ignitionPin4logic || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)) -#define ignitionPin5logic || ((firingOrder == 4) || (firingOrder == 12)) -#define ignitionPin6logic -#define ignitionPin7logic || ((firingOrder == 11)) -#define ignitionPin8logic || ((firingOrder == 5) || (firingOrder == 11)) -#define ignitionPin9logic #define ignitionPinMode_offset 649 #define ignitionPinMode_offset_hex 289 #define ignitionPins10_offset 645 @@ -2276,6 +2267,8 @@ #define unused1476b20_offset_hex 5c4 #define unused2432_offset 2432 #define unused2432_offset_hex 980 +#define unused6312_offset 6312 +#define unused6312_offset_hex 18a8 #define unused711_offset 711 #define unused711_offset_hex 2c7 #define unused76b0_offset 76 @@ -2302,8 +2295,8 @@ #define unused_former_warmup_target_afr_offset_hex 834 #define unusedAntilagTimeout_offset 820 #define unusedAntilagTimeout_offset_hex 334 -#define unusedAtOldBoardConfigurationEnd_offset 1096 -#define unusedAtOldBoardConfigurationEnd_offset_hex 448 +#define unusedAtOldBoardConfigurationEnd_offset 1160 +#define unusedAtOldBoardConfigurationEnd_offset_hex 488 #define unusedBit4_1476_offset 1476 #define unusedBit4_1476_offset_hex 5c4 #define unusedBit_251_10_offset 976 @@ -2453,6 +2446,7 @@ #define vbattAdcChannel_offset_hex 201 #define vbattDividerCoeff_offset 464 #define vbattDividerCoeff_offset_hex 1d0 +#define VEHICLE_INFO_SIZE 32 #define vehicleSpeedCoef_offset 476 #define vehicleSpeedCoef_offset_hex 1dc #define vehicleSpeedSensorInputPin_offset 968 diff --git a/firmware/controllers/math/engine_math.cpp b/firmware/controllers/math/engine_math.cpp index d9c00784d9..4d9b2d716f 100644 --- a/firmware/controllers/math/engine_math.cpp +++ b/firmware/controllers/math/engine_math.cpp @@ -65,9 +65,6 @@ float getEngineLoadT(DECLARE_ENGINE_PARAMETER_SIGNATURE) { } return getMafVoltage(PASS_ENGINE_PARAMETER_SIGNATURE); case LM_SPEED_DENSITY: - // SD engine load is used for timing lookup but not for fuel calculation, - // so fall thru to the MAP case. - case LM_MAP: return getMap(PASS_ENGINE_PARAMETER_SIGNATURE); case LM_ALPHA_N: return Sensor::get(SensorType::Tps1).value_or(0); diff --git a/firmware/controllers/sensors/map.cpp b/firmware/controllers/sensors/map.cpp index 9d7c5fd0df..4b9459b5e1 100644 --- a/firmware/controllers/sensors/map.cpp +++ b/firmware/controllers/sensors/map.cpp @@ -277,7 +277,7 @@ void initMapDecoder(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) { //engine->configurationListeners.registerCallback(applyConfiguration); if (engineConfiguration->hasFrequencyReportingMapSensor) { -#if HAL_USE_ICU +#if EFI_ICU_INPUTS digital_input_s* digitalMapInput = startDigitalCapture("MAP freq", CONFIG(frequencyReportingMapInputPin)); digitalMapInput->setWidthCallback((VoidInt) digitalMapWidthCallback, NULL); diff --git a/firmware/controllers/system/thread_controller.h b/firmware/controllers/system/thread_controller.h index e32aaeb41f..84c58fae32 100644 --- a/firmware/controllers/system/thread_controller.h +++ b/firmware/controllers/system/thread_controller.h @@ -25,6 +25,7 @@ class ThreadController : public ControllerBase private: THD_WORKING_AREA(m_threadstack, TStackSize); const tprio_t m_prio; + bool m_isStarted = false; /** * The OS can only call a function with a single void* param. We have @@ -57,8 +58,14 @@ public: */ void Start() { + if (m_isStarted) { + warning(CUSTOM_OBD_6003, "Tried to start thread %s but it was already running", GetName()); + return; + } + m_thread = chThdCreateStatic(m_threadstack, sizeof(m_threadstack), m_prio, StaticThreadTaskAdapter, this); m_thread->name = GetName(); + m_isStarted = true; } }; diff --git a/firmware/controllers/trigger/decoders/trigger_toyota.cpp b/firmware/controllers/trigger/decoders/trigger_toyota.cpp index debf994fa8..3d987eb317 100644 --- a/firmware/controllers/trigger/decoders/trigger_toyota.cpp +++ b/firmware/controllers/trigger/decoders/trigger_toyota.cpp @@ -9,6 +9,12 @@ #include "trigger_toyota.h" +/** + * TT_2JZ_1_12 + * One cam + 12 crank + * http://rusefi.com/images/triggers/trigger_29.png + */ + void initialize2jzGE1_12(TriggerWaveform *s) { s->initialize(FOUR_STROKE_CAM_SENSOR); @@ -43,6 +49,9 @@ void initialize2jzGE1_12(TriggerWaveform *s) { s->isSynchronizationNeeded = false; } +/** + * https://rusefi.com/forum/viewtopic.php?f=5&t=1720 + */ void initialize2jzGE3_34(TriggerWaveform *s) { setToothedWheelConfiguration(s, 36, 2, FOUR_STROKE_CRANK_SENSOR); diff --git a/firmware/gen_config.bat b/firmware/gen_config.bat index 4be42cbce6..ae8c5fc406 100644 --- a/firmware/gen_config.bat +++ b/firmware/gen_config.bat @@ -20,6 +20,7 @@ java -DSystemOut.name=gen_config ^ -initialize_to_zero false ^ -tool gen_config.bat ^ -c_defines controllers\generated\rusefi_generated.h ^ + -firing_order controllers/algo/firing_order.h ^ -c_destination controllers\generated\engine_configuration_generated_structures.h ^ -c_fsio_constants controllers\generated\fsio_enums_generated.def ^ -c_fsio_getters controllers\generated\fsio_getters.def ^ diff --git a/firmware/gen_config_board.bat b/firmware/gen_config_board.bat index 6b7a4b882c..929a84f4bc 100644 --- a/firmware/gen_config_board.bat +++ b/firmware/gen_config_board.bat @@ -31,6 +31,7 @@ java -DSystemOut.name=gen_config_board ^ -definition integration\rusefi_config.txt ^ -tool gen_config.bat ^ -ts_destination tunerstudio ^ + -firing_order controllers/algo/firing_order.h ^ -ts_output_name rusefi_%BOARDNAME%.ini ^ -prepend tunerstudio/%BOARDNAME%_prefix.txt ^ -prepend config/boards/%BOARDNAME%/prepend.txt ^ diff --git a/firmware/hw_layer/trigger_input.cpp b/firmware/hw_layer/trigger_input.cpp index c08cfa5918..ac7efb9541 100644 --- a/firmware/hw_layer/trigger_input.cpp +++ b/firmware/hw_layer/trigger_input.cpp @@ -76,6 +76,7 @@ static int turnOnTriggerInputPin(const char *msg, int index, bool isTriggerShaft return 0; /* try ICU first */ +#if EFI_ICU_INPUTS if (icuTriggerTurnOnInputPin(msg, index, isTriggerShaft) >= 0) { if (isTriggerShaft) shaftTriggerType[index] = TRIGGER_ICU; @@ -83,6 +84,7 @@ static int turnOnTriggerInputPin(const char *msg, int index, bool isTriggerShaft camTriggerType[index] = TRIGGER_ICU; return 0; } +#endif /* ... then EXTI */ if (extiTriggerTurnOnInputPin(msg, index, isTriggerShaft) >= 0) { @@ -103,15 +105,19 @@ static void turnOffTriggerInputPin(int index, bool isTriggerShaft) { activeConfiguration.triggerInputPins[index] : activeConfiguration.camInputs[index]; if (isTriggerShaft) { +#if EFI_ICU_INPUTS if (shaftTriggerType[index] == TRIGGER_ICU) icuTriggerTurnOffInputPin(brainPin); +#endif if (shaftTriggerType[index] == TRIGGER_EXTI) extiTriggerTurnOffInputPin(brainPin); shaftTriggerType[index] = TRIGGER_NONE; } else { +#if EFI_ICU_INPUTS if (camTriggerType[index] == TRIGGER_ICU) icuTriggerTurnOffInputPin(brainPin); +#endif if (camTriggerType[index] == TRIGGER_EXTI) extiTriggerTurnOffInputPin(brainPin); diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 4fec66af45..ed25396de1 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -41,19 +41,6 @@ ! all the sub-structures are going to be nested within the primary structure, that's ! needed to get a proper TunerStudio file -! this section is auto-generated by FiringOrderTSLogic.java -#define ignitionPin2logic || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)) -#define ignitionPin3logic || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)) -#define ignitionPin4logic || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)) -#define ignitionPin5logic || ((firingOrder == 4) || (firingOrder == 12)) -#define ignitionPin6logic -#define ignitionPin7logic || ((firingOrder == 11)) -#define ignitionPin8logic || ((firingOrder == 5) || (firingOrder == 11)) -#define ignitionPin9logic -#define ignitionPin10logic -#define ignitionPin11logic -#define ignitionPin12logic - struct persistent_config_s struct_no_prefix engine_configuration_s @@ -128,6 +115,8 @@ struct_no_prefix engine_configuration_s #define FSIO_COMMAND_COUNT 16 #define AUX_PID_COUNT 4 +#define VEHICLE_INFO_SIZE 32 + #define FUEL_RPM_COUNT 16 #define FUEL_LOAD_COUNT 16 @@ -460,7 +449,7 @@ int sensorSnifferRpmThreshold;+Disable sensor sniffer above this rpm;"RPM", int rpmHardLimit;set rpm_hard_limit X;"rpm", 1, 0, 0, 20000.0, 2 -#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY", "MAF Air Charge" +#define engine_load_mode_e_enum "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge" custom engine_load_mode_e 4 bits, U32, @OFFSET@, [0:7], @@engine_load_mode_e_enum@@ @@ -805,6 +794,8 @@ custom maf_sensor_type_e 4 bits, S32, @OFFSET@, [0:7], @@maf_sensor_type_e_enum@ ! same length used for critical and soft error messages #define ERROR_BUFFER_SIZE 120 + custom vehicle_info_t @@VEHICLE_INFO_SIZE@@ string, ASCII, @OFFSET@, @@VEHICLE_INFO_SIZE@@ + custom error_message_t @@ERROR_BUFFER_SIZE@@ string, ASCII, @OFFSET@, @@ERROR_BUFFER_SIZE@@ custom le_formula_t @@LE_COMMAND_LENGTH@@ string, ASCII, @OFFSET@, @@LE_COMMAND_LENGTH@@ brain_pin_e[FSIO_COMMAND_COUNT iterate] fsioDigitalInputs;todo:not finished\nThese input pins allow us to pull toggle buttons state; @@ -882,7 +873,10 @@ custom maf_sensor_type_e 4 bits, S32, @OFFSET@, [0:7], @@maf_sensor_type_e_enum@ etb_io[ETB_COUNT iterate] etbIo2 - int[92] unusedAtOldBoardConfigurationEnd; + vehicle_info_t engineMake; + vehicle_info_t engineCode; + + int[76] unusedAtOldBoardConfigurationEnd; bit vvtDisplayInverted bit fuelClosedLoopCorrectionEnabled;+Enables lambda sensor closed loop feedback for fuelling. @@ -1292,7 +1286,7 @@ float[AFTERSTART_DECAY_CURVE_SIZE] afterstartDecayTime;;"Seconds", 1, 0 boost_table_t boostTableOpenLoop; -uint8_t[BOOST_LOAD_COUNT] boostMapBins;;"", @@LOAD_1_BYTE_PACKING_MULT@@, 0, 0, 600.0, 1 +uint8_t[8] unused6312; uint8_t[BOOST_RPM_COUNT] boostRpmBins;;"RPM", @@RPM_1_BYTE_PACKING_MULT@@, 0, 0.0, 12000.0, 0 boost_table_t boostTableClosedLoop; diff --git a/firmware/tunerstudio/rusefi.ini b/firmware/tunerstudio/rusefi.ini index 20406ac1fa..97a29fe70c 100644 --- a/firmware/tunerstudio/rusefi.ini +++ b/firmware/tunerstudio/rusefi.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon May 04 19:09:36 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed May 06 12:32:31 EDT 2020 pageSize = 20000 page = 1 @@ -179,7 +179,7 @@ page = 1 cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2 sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0 rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2 - fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY", "MAF Air Charge" + fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge" crankingInjectionMode = bits, U32, 424, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" injectionMode = bits, U32, 428, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" extraInjectionOffset = scalar, F32, 432, "deg", 1, 0.0, -720, 720, 2 @@ -633,7 +633,9 @@ page = 1 etbIo22_directionPin2 = bits, U08, 1093, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_controlPin1 = bits, U08, 1094, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_disablePin = bits, U08, 1095, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" -;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1096 + engineMake = string, ASCII, 1096, 32 + engineCode = string, ASCII, 1128, 32 +;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1160 vvtDisplayInverted = bits, U32, 1464, [0:0], "false", "true" fuelClosedLoopCorrectionEnabled= bits, U32, 1464, [1:1], "false", "true" isVerboseIAC = bits, U32, 1464, [2:2], "false", "true" @@ -1095,7 +1097,7 @@ page = 1 afterstartEnrich = array, F32, 6184, [8], "%", 1, 0, 0, 600, 1 afterstartDecayTime = array, F32, 6216, [8], "Seconds", 1, 0, 0, 100, 1 boostTableOpenLoop = array, U08, 6248, [8x8],"", 2, 0 , 0, 3000, 0 - boostMapBins = array, U08, 6312, [8], "", 2, 0, 0, 600.0, 1 +;no TS info - skipping unused6312 offset 6312 boostRpmBins = array, U08, 6320, [8], "RPM", 50, 0, 0.0, 12000.0, 0 boostTableClosedLoop = array, U08, 6328, [8x8],"", 2, 0 , 0, 3000, 0 boostTpsBins = array, U08, 6392, [8], "%", 2, 0.0, 0, 100.0, 2 @@ -1613,7 +1615,6 @@ fileVersion = { 20200310 } ; todo: generate this section programatically LM_PLAIN_MAF = {0}, LM_ALPHA_N = {1}, - LM_MAP = {2}, LM_SPEED_DENSITY = {3}, LM_REAL_MAF = {4} @@ -1662,6 +1663,10 @@ fileVersion = { 20200310 } maintainConstantValue = tpsMax, { (calibrationMode == 1 ) ? calibrationValue : tpsMax } maintainConstantValue = tpsMin, { (calibrationMode == 2 ) ? calibrationValue : tpsMin } + maintainConstantValue = etb_pFactor, { (calibrationMode == 3 ) ? calibrationValue : etb_pFactor } + maintainConstantValue = etb_iFactor, { (calibrationMode == 4 ) ? calibrationValue : etb_iFactor } + maintainConstantValue = etb_dFactor, { (calibrationMode == 5 ) ? calibrationValue : etb_dFactor } + requiresPowerCycle = warningLedPin requiresPowerCycle = runningLedPin requiresPowerCycle = binarySerialTxPin @@ -1990,7 +1995,7 @@ fileVersion = { 20200310 } table = boostTableTbl, boostMapOpen, "", 1 xBins = boostRpmBins, RPMValue - yBins = boostMapBins, MAPValue + yBins = boostTpsBins, TPSValue zBins = boostTableOpenLoop table = boostTable2Tbl, boostMapClosed, "", 1 @@ -2736,7 +2741,6 @@ cmd_test_inj14 = "w\x00\x13\x00\x0e" cmd_test_inj15 = "w\x00\x13\x00\x0f" cmd_test_inj16 = "w\x00\x13\x00\x10" -; cmd_test_fuel_pump = "w\x00\x14\x00\x01" cmd_calibrate_tps_1_closed = "w\x00\x14\x00\x02" cmd_calibrate_tps_1_wot = "w\x00\x14\x00\x03" @@ -2752,6 +2756,7 @@ cmd_etb_autotune = "w\x00\x14\x00\x0C" cmd_enable_self_stim = "w\x00\x14\x00\x0D" cmb_etb_auto_calibrate = "w\x00\x14\x00\x0E" cmd_disable_self_stim = "w\x00\x14\x00\x0F" +cmd_etb_autotune_stop = "w\x00\x14\x00\x10" cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01" @@ -2843,17 +2848,18 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "Ignition Pin 1", ignitionPins1, {isIgnitionEnabled == 1} ; see rusefi_config.txt comment next to 'ignitionPin2logic' which says ; this section is auto-generated by FiringOrderTSLogic.java - field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 1) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)))} - field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)))} - field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)))} - field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12)))} - field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 )} - field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11)))} - field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} + field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9) || (firingOrder == 13) || (firingOrder == 14) || (firingOrder == 15) || (firingOrder == 18) || (firingOrder == 20)))} + field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12) || (firingOrder == 14) || (firingOrder == 16) || (firingOrder == 17)))} + field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12) || (firingOrder == 15) || (firingOrder == 18)))} + field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 13)))} + field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11) || (firingOrder == 15) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11) || (firingOrder == 16) || (firingOrder == 18) || (firingOrder == 19)))} + field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 15)))} + field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 16) || (firingOrder == 18)))} + field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 15)))} + field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 12) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 18)))} + field = "This is useful to have tachometer working" field = " while converting from distributor" field = "Dizzy out Pin", dizzySparkOutputPin, {isIgnitionEnabled == 1} @@ -2875,6 +2881,8 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" dialog = baseEngineConfig, "Engine Configuration" ; field = "Engine Preset", engineType + field = "Engine Make", engineMake + field = "Engine Code", engineCode field = "Number of Cylinders", cylindersCount field = "Engine Displacement", displacement field = "Firing Order", firingOrder @@ -4075,11 +4083,14 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } dialog = etbAutotune, "PID Autotune" - field = "!Set debug mode below to 'ETB Autotune' to show results" - field = "Debug mode", debugMode - commandButton = "ETB PID Autotune", cmd_etb_autotune + commandButton = "Start ETB PID Autotune", cmd_etb_autotune + commandButton = "Stop ETB PID Autotune", cmd_etb_autotune_stop + commandButton = "Auto Calibrate TPS", cmb_etb_auto_calibrate + field = "!Set debug mode below to 'ETB Autotune' to show more detail" + field = "Debug mode", debugMode + dialog = etbDialogRight panel = etbIdleDialog panel = etbPidDialog diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 693e29d5f4..2d9fa5f5c4 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -366,7 +366,6 @@ fileVersion = { @@TS_FILE_VERSION@@ } ; todo: generate this section programatically LM_PLAIN_MAF = {0}, LM_ALPHA_N = {1}, - LM_MAP = {2}, LM_SPEED_DENSITY = {3}, LM_REAL_MAF = {4} @@ -415,6 +414,10 @@ fileVersion = { @@TS_FILE_VERSION@@ } maintainConstantValue = tpsMax, { (calibrationMode == 1 ) ? calibrationValue : tpsMax } maintainConstantValue = tpsMin, { (calibrationMode == 2 ) ? calibrationValue : tpsMin } + maintainConstantValue = etb_pFactor, { (calibrationMode == 3 ) ? calibrationValue : etb_pFactor } + maintainConstantValue = etb_iFactor, { (calibrationMode == 4 ) ? calibrationValue : etb_iFactor } + maintainConstantValue = etb_dFactor, { (calibrationMode == 5 ) ? calibrationValue : etb_dFactor } + requiresPowerCycle = warningLedPin requiresPowerCycle = runningLedPin requiresPowerCycle = binarySerialTxPin @@ -743,7 +746,7 @@ fileVersion = { @@TS_FILE_VERSION@@ } table = boostTableTbl, boostMapOpen, "", 1 xBins = boostRpmBins, RPMValue - yBins = boostMapBins, MAPValue + yBins = boostTpsBins, TPSValue zBins = boostTableOpenLoop table = boostTable2Tbl, boostMapClosed, "", 1 @@ -1489,7 +1492,6 @@ cmd_test_inj14 = "w\x00\x13\x00\x0e" cmd_test_inj15 = "w\x00\x13\x00\x0f" cmd_test_inj16 = "w\x00\x13\x00\x10" -; cmd_test_fuel_pump = "w\x00\x14\x00\x01" cmd_calibrate_tps_1_closed = "w\x00\x14\x00\x02" cmd_calibrate_tps_1_wot = "w\x00\x14\x00\x03" @@ -1505,6 +1507,7 @@ cmd_etb_autotune = "w\x00\x14\x00\x0C" cmd_enable_self_stim = "w\x00\x14\x00\x0D" cmb_etb_auto_calibrate = "w\x00\x14\x00\x0E" cmd_disable_self_stim = "w\x00\x14\x00\x0F" +cmd_etb_autotune_stop = "w\x00\x14\x00\x10" cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01" @@ -1596,17 +1599,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "Ignition Pin 1", ignitionPins1, {isIgnitionEnabled == 1} ; see rusefi_config.txt comment next to 'ignitionPin2logic' which says ; this section is auto-generated by FiringOrderTSLogic.java - field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 1) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)))} - field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)))} - field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)))} - field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12)))} - field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 )} - field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11)))} - field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} +@@FIRINGORDER@@ field = "This is useful to have tachometer working" field = " while converting from distributor" field = "Dizzy out Pin", dizzySparkOutputPin, {isIgnitionEnabled == 1} @@ -1628,6 +1621,8 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" dialog = baseEngineConfig, "Engine Configuration" ; field = "Engine Preset", engineType + field = "Engine Make", engineMake + field = "Engine Code", engineCode field = "Number of Cylinders", cylindersCount field = "Engine Displacement", displacement field = "Firing Order", firingOrder @@ -2829,11 +2824,14 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } dialog = etbAutotune, "PID Autotune" - field = "!Set debug mode below to 'ETB Autotune' to show results" - field = "Debug mode", debugMode - commandButton = "ETB PID Autotune", cmd_etb_autotune + commandButton = "Start ETB PID Autotune", cmd_etb_autotune + commandButton = "Stop ETB PID Autotune", cmd_etb_autotune_stop + commandButton = "Auto Calibrate TPS", cmb_etb_auto_calibrate + field = "!Set debug mode below to 'ETB Autotune' to show more detail" + field = "Debug mode", debugMode + dialog = etbDialogRight panel = etbIdleDialog panel = etbPidDialog diff --git a/firmware/tunerstudio/rusefi_frankenso.ini b/firmware/tunerstudio/rusefi_frankenso.ini index 1fa1ea4e87..bceef54cd5 100644 --- a/firmware/tunerstudio/rusefi_frankenso.ini +++ b/firmware/tunerstudio/rusefi_frankenso.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon May 04 19:09:41 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed May 06 12:32:54 EDT 2020 pageSize = 20000 page = 1 @@ -179,7 +179,7 @@ page = 1 cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2 sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0 rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2 - fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY", "MAF Air Charge" + fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge" crankingInjectionMode = bits, U32, 424, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" injectionMode = bits, U32, 428, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" extraInjectionOffset = scalar, F32, 432, "deg", 1, 0.0, -720, 720, 2 @@ -633,7 +633,9 @@ page = 1 etbIo22_directionPin2 = bits, U08, 1093, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_controlPin1 = bits, U08, 1094, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_disablePin = bits, U08, 1095, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" -;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1096 + engineMake = string, ASCII, 1096, 32 + engineCode = string, ASCII, 1128, 32 +;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1160 vvtDisplayInverted = bits, U32, 1464, [0:0], "false", "true" fuelClosedLoopCorrectionEnabled= bits, U32, 1464, [1:1], "false", "true" isVerboseIAC = bits, U32, 1464, [2:2], "false", "true" @@ -1095,7 +1097,7 @@ page = 1 afterstartEnrich = array, F32, 6184, [8], "%", 1, 0, 0, 600, 1 afterstartDecayTime = array, F32, 6216, [8], "Seconds", 1, 0, 0, 100, 1 boostTableOpenLoop = array, U08, 6248, [8x8],"", 2, 0 , 0, 3000, 0 - boostMapBins = array, U08, 6312, [8], "", 2, 0, 0, 600.0, 1 +;no TS info - skipping unused6312 offset 6312 boostRpmBins = array, U08, 6320, [8], "RPM", 50, 0, 0.0, 12000.0, 0 boostTableClosedLoop = array, U08, 6328, [8x8],"", 2, 0 , 0, 3000, 0 boostTpsBins = array, U08, 6392, [8], "%", 2, 0.0, 0, 100.0, 2 @@ -1613,7 +1615,6 @@ fileVersion = { 20200310 } ; todo: generate this section programatically LM_PLAIN_MAF = {0}, LM_ALPHA_N = {1}, - LM_MAP = {2}, LM_SPEED_DENSITY = {3}, LM_REAL_MAF = {4} @@ -1662,6 +1663,10 @@ fileVersion = { 20200310 } maintainConstantValue = tpsMax, { (calibrationMode == 1 ) ? calibrationValue : tpsMax } maintainConstantValue = tpsMin, { (calibrationMode == 2 ) ? calibrationValue : tpsMin } + maintainConstantValue = etb_pFactor, { (calibrationMode == 3 ) ? calibrationValue : etb_pFactor } + maintainConstantValue = etb_iFactor, { (calibrationMode == 4 ) ? calibrationValue : etb_iFactor } + maintainConstantValue = etb_dFactor, { (calibrationMode == 5 ) ? calibrationValue : etb_dFactor } + requiresPowerCycle = warningLedPin requiresPowerCycle = runningLedPin requiresPowerCycle = binarySerialTxPin @@ -1990,7 +1995,7 @@ fileVersion = { 20200310 } table = boostTableTbl, boostMapOpen, "", 1 xBins = boostRpmBins, RPMValue - yBins = boostMapBins, MAPValue + yBins = boostTpsBins, TPSValue zBins = boostTableOpenLoop table = boostTable2Tbl, boostMapClosed, "", 1 @@ -2736,7 +2741,6 @@ cmd_test_inj14 = "w\x00\x13\x00\x0e" cmd_test_inj15 = "w\x00\x13\x00\x0f" cmd_test_inj16 = "w\x00\x13\x00\x10" -; cmd_test_fuel_pump = "w\x00\x14\x00\x01" cmd_calibrate_tps_1_closed = "w\x00\x14\x00\x02" cmd_calibrate_tps_1_wot = "w\x00\x14\x00\x03" @@ -2752,6 +2756,7 @@ cmd_etb_autotune = "w\x00\x14\x00\x0C" cmd_enable_self_stim = "w\x00\x14\x00\x0D" cmb_etb_auto_calibrate = "w\x00\x14\x00\x0E" cmd_disable_self_stim = "w\x00\x14\x00\x0F" +cmd_etb_autotune_stop = "w\x00\x14\x00\x10" cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01" @@ -2843,17 +2848,18 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "Ignition Pin 1", ignitionPins1, {isIgnitionEnabled == 1} ; see rusefi_config.txt comment next to 'ignitionPin2logic' which says ; this section is auto-generated by FiringOrderTSLogic.java - field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 1) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)))} - field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)))} - field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)))} - field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12)))} - field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 )} - field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11)))} - field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} + field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9) || (firingOrder == 13) || (firingOrder == 14) || (firingOrder == 15) || (firingOrder == 18) || (firingOrder == 20)))} + field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12) || (firingOrder == 14) || (firingOrder == 16) || (firingOrder == 17)))} + field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12) || (firingOrder == 15) || (firingOrder == 18)))} + field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 13)))} + field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11) || (firingOrder == 15) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11) || (firingOrder == 16) || (firingOrder == 18) || (firingOrder == 19)))} + field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 15)))} + field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 16) || (firingOrder == 18)))} + field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 15)))} + field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 12) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 18)))} + field = "This is useful to have tachometer working" field = " while converting from distributor" field = "Dizzy out Pin", dizzySparkOutputPin, {isIgnitionEnabled == 1} @@ -2875,6 +2881,8 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" dialog = baseEngineConfig, "Engine Configuration" ; field = "Engine Preset", engineType + field = "Engine Make", engineMake + field = "Engine Code", engineCode field = "Number of Cylinders", cylindersCount field = "Engine Displacement", displacement field = "Firing Order", firingOrder @@ -4075,11 +4083,14 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } dialog = etbAutotune, "PID Autotune" - field = "!Set debug mode below to 'ETB Autotune' to show results" - field = "Debug mode", debugMode - commandButton = "ETB PID Autotune", cmd_etb_autotune + commandButton = "Start ETB PID Autotune", cmd_etb_autotune + commandButton = "Stop ETB PID Autotune", cmd_etb_autotune_stop + commandButton = "Auto Calibrate TPS", cmb_etb_auto_calibrate + field = "!Set debug mode below to 'ETB Autotune' to show more detail" + field = "Debug mode", debugMode + dialog = etbDialogRight panel = etbIdleDialog panel = etbPidDialog diff --git a/firmware/tunerstudio/rusefi_kinetis.ini b/firmware/tunerstudio/rusefi_kinetis.ini index ddadd08ffd..847c3ee7a5 100644 --- a/firmware/tunerstudio/rusefi_kinetis.ini +++ b/firmware/tunerstudio/rusefi_kinetis.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Mon May 04 19:09:46 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on kineris_gen_config.bat integration/rusefi_config.txt Wed May 06 12:33:00 EDT 2020 pageSize = 20000 page = 1 @@ -179,7 +179,7 @@ page = 1 cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2 sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0 rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2 - fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY", "MAF Air Charge" + fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge" crankingInjectionMode = bits, U32, 424, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" injectionMode = bits, U32, 428, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" extraInjectionOffset = scalar, F32, 432, "deg", 1, 0.0, -720, 720, 2 @@ -633,7 +633,9 @@ page = 1 etbIo22_directionPin2 = bits, U08, 1093, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PA16", "PA17", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PB16", "PB17", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PC16", "PC17", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "PE16", "PE17", "TLE6240_1", "TLE6240_2", "TLE6240_3", "TLE6240_4", "TLE6240_5", "TLE6240_6", "TLE6240_7", "TLE6240_8", "TLE6240_9", "TLE6240_10", "TLE6240_11", "TLE6240_12", "TLE6240_13", "TLE6240_14", "TLE6240_15", "TLE6240_16" etbIo22_controlPin1 = bits, U08, 1094, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PA16", "PA17", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PB16", "PB17", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PC16", "PC17", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "PE16", "PE17", "TLE6240_1", "TLE6240_2", "TLE6240_3", "TLE6240_4", "TLE6240_5", "TLE6240_6", "TLE6240_7", "TLE6240_8", "TLE6240_9", "TLE6240_10", "TLE6240_11", "TLE6240_12", "TLE6240_13", "TLE6240_14", "TLE6240_15", "TLE6240_16" etbIo22_disablePin = bits, U08, 1095, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PA16", "PA17", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PB16", "PB17", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PC16", "PC17", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "PE12", "PE13", "PE14", "PE15", "PE16", "PE17", "TLE6240_1", "TLE6240_2", "TLE6240_3", "TLE6240_4", "TLE6240_5", "TLE6240_6", "TLE6240_7", "TLE6240_8", "TLE6240_9", "TLE6240_10", "TLE6240_11", "TLE6240_12", "TLE6240_13", "TLE6240_14", "TLE6240_15", "TLE6240_16" -;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1096 + engineMake = string, ASCII, 1096, 32 + engineCode = string, ASCII, 1128, 32 +;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1160 vvtDisplayInverted = bits, U32, 1464, [0:0], "false", "true" fuelClosedLoopCorrectionEnabled= bits, U32, 1464, [1:1], "false", "true" isVerboseIAC = bits, U32, 1464, [2:2], "false", "true" @@ -1095,7 +1097,7 @@ page = 1 afterstartEnrich = array, F32, 6184, [8], "%", 1, 0, 0, 600, 1 afterstartDecayTime = array, F32, 6216, [8], "Seconds", 1, 0, 0, 100, 1 boostTableOpenLoop = array, U08, 6248, [8x8],"", 2, 0 , 0, 3000, 0 - boostMapBins = array, U08, 6312, [8], "", 2, 0, 0, 600.0, 1 +;no TS info - skipping unused6312 offset 6312 boostRpmBins = array, U08, 6320, [8], "RPM", 50, 0, 0.0, 12000.0, 0 boostTableClosedLoop = array, U08, 6328, [8x8],"", 2, 0 , 0, 3000, 0 boostTpsBins = array, U08, 6392, [8], "%", 2, 0.0, 0, 100.0, 2 @@ -1613,7 +1615,6 @@ fileVersion = { 20200310 } ; todo: generate this section programatically LM_PLAIN_MAF = {0}, LM_ALPHA_N = {1}, - LM_MAP = {2}, LM_SPEED_DENSITY = {3}, LM_REAL_MAF = {4} @@ -1662,6 +1663,10 @@ fileVersion = { 20200310 } maintainConstantValue = tpsMax, { (calibrationMode == 1 ) ? calibrationValue : tpsMax } maintainConstantValue = tpsMin, { (calibrationMode == 2 ) ? calibrationValue : tpsMin } + maintainConstantValue = etb_pFactor, { (calibrationMode == 3 ) ? calibrationValue : etb_pFactor } + maintainConstantValue = etb_iFactor, { (calibrationMode == 4 ) ? calibrationValue : etb_iFactor } + maintainConstantValue = etb_dFactor, { (calibrationMode == 5 ) ? calibrationValue : etb_dFactor } + requiresPowerCycle = warningLedPin requiresPowerCycle = runningLedPin requiresPowerCycle = binarySerialTxPin @@ -1990,7 +1995,7 @@ fileVersion = { 20200310 } table = boostTableTbl, boostMapOpen, "", 1 xBins = boostRpmBins, RPMValue - yBins = boostMapBins, MAPValue + yBins = boostTpsBins, TPSValue zBins = boostTableOpenLoop table = boostTable2Tbl, boostMapClosed, "", 1 @@ -2736,7 +2741,6 @@ cmd_test_inj14 = "w\x00\x13\x00\x0e" cmd_test_inj15 = "w\x00\x13\x00\x0f" cmd_test_inj16 = "w\x00\x13\x00\x10" -; cmd_test_fuel_pump = "w\x00\x14\x00\x01" cmd_calibrate_tps_1_closed = "w\x00\x14\x00\x02" cmd_calibrate_tps_1_wot = "w\x00\x14\x00\x03" @@ -2752,6 +2756,7 @@ cmd_etb_autotune = "w\x00\x14\x00\x0C" cmd_enable_self_stim = "w\x00\x14\x00\x0D" cmb_etb_auto_calibrate = "w\x00\x14\x00\x0E" cmd_disable_self_stim = "w\x00\x14\x00\x0F" +cmd_etb_autotune_stop = "w\x00\x14\x00\x10" cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01" @@ -2843,17 +2848,18 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "Ignition Pin 1", ignitionPins1, {isIgnitionEnabled == 1} ; see rusefi_config.txt comment next to 'ignitionPin2logic' which says ; this section is auto-generated by FiringOrderTSLogic.java - field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 1) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)))} - field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)))} - field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)))} - field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12)))} - field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 )} - field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11)))} - field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} + field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9) || (firingOrder == 13) || (firingOrder == 14) || (firingOrder == 15) || (firingOrder == 18) || (firingOrder == 20)))} + field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12) || (firingOrder == 14) || (firingOrder == 16) || (firingOrder == 17)))} + field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12) || (firingOrder == 15) || (firingOrder == 18)))} + field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 13)))} + field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11) || (firingOrder == 15) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11) || (firingOrder == 16) || (firingOrder == 18) || (firingOrder == 19)))} + field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 15)))} + field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 16) || (firingOrder == 18)))} + field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 15)))} + field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 12) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 18)))} + field = "This is useful to have tachometer working" field = " while converting from distributor" field = "Dizzy out Pin", dizzySparkOutputPin, {isIgnitionEnabled == 1} @@ -2875,6 +2881,8 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" dialog = baseEngineConfig, "Engine Configuration" ; field = "Engine Preset", engineType + field = "Engine Make", engineMake + field = "Engine Code", engineCode field = "Number of Cylinders", cylindersCount field = "Engine Displacement", displacement field = "Firing Order", firingOrder @@ -4076,11 +4084,14 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } dialog = etbAutotune, "PID Autotune" - field = "!Set debug mode below to 'ETB Autotune' to show results" - field = "Debug mode", debugMode - commandButton = "ETB PID Autotune", cmd_etb_autotune + commandButton = "Start ETB PID Autotune", cmd_etb_autotune + commandButton = "Stop ETB PID Autotune", cmd_etb_autotune_stop + commandButton = "Auto Calibrate TPS", cmb_etb_auto_calibrate + field = "!Set debug mode below to 'ETB Autotune' to show more detail" + field = "Debug mode", debugMode + dialog = etbDialogRight panel = etbIdleDialog panel = etbPidDialog diff --git a/firmware/tunerstudio/rusefi_microrusefi.ini b/firmware/tunerstudio/rusefi_microrusefi.ini index 481d094866..a4fedd3c09 100644 --- a/firmware/tunerstudio/rusefi_microrusefi.ini +++ b/firmware/tunerstudio/rusefi_microrusefi.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon May 04 19:09:39 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed May 06 12:32:52 EDT 2020 pageSize = 20000 page = 1 @@ -179,7 +179,7 @@ page = 1 cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2 sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0 rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2 - fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY", "MAF Air Charge" + fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge" crankingInjectionMode = bits, U32, 424, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" injectionMode = bits, U32, 428, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" extraInjectionOffset = scalar, F32, 432, "deg", 1, 0.0, -720, 720, 2 @@ -633,7 +633,9 @@ page = 1 etbIo22_directionPin2 = bits, U08, 1093, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_controlPin1 = bits, U08, 1094, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_disablePin = bits, U08, 1095, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" -;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1096 + engineMake = string, ASCII, 1096, 32 + engineCode = string, ASCII, 1128, 32 +;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1160 vvtDisplayInverted = bits, U32, 1464, [0:0], "false", "true" fuelClosedLoopCorrectionEnabled= bits, U32, 1464, [1:1], "false", "true" isVerboseIAC = bits, U32, 1464, [2:2], "false", "true" @@ -1095,7 +1097,7 @@ page = 1 afterstartEnrich = array, F32, 6184, [8], "%", 1, 0, 0, 600, 1 afterstartDecayTime = array, F32, 6216, [8], "Seconds", 1, 0, 0, 100, 1 boostTableOpenLoop = array, U08, 6248, [8x8],"", 2, 0 , 0, 3000, 0 - boostMapBins = array, U08, 6312, [8], "", 2, 0, 0, 600.0, 1 +;no TS info - skipping unused6312 offset 6312 boostRpmBins = array, U08, 6320, [8], "RPM", 50, 0, 0.0, 12000.0, 0 boostTableClosedLoop = array, U08, 6328, [8x8],"", 2, 0 , 0, 3000, 0 boostTpsBins = array, U08, 6392, [8], "%", 2, 0.0, 0, 100.0, 2 @@ -1613,7 +1615,6 @@ fileVersion = { 20200310 } ; todo: generate this section programatically LM_PLAIN_MAF = {0}, LM_ALPHA_N = {1}, - LM_MAP = {2}, LM_SPEED_DENSITY = {3}, LM_REAL_MAF = {4} @@ -1662,6 +1663,10 @@ fileVersion = { 20200310 } maintainConstantValue = tpsMax, { (calibrationMode == 1 ) ? calibrationValue : tpsMax } maintainConstantValue = tpsMin, { (calibrationMode == 2 ) ? calibrationValue : tpsMin } + maintainConstantValue = etb_pFactor, { (calibrationMode == 3 ) ? calibrationValue : etb_pFactor } + maintainConstantValue = etb_iFactor, { (calibrationMode == 4 ) ? calibrationValue : etb_iFactor } + maintainConstantValue = etb_dFactor, { (calibrationMode == 5 ) ? calibrationValue : etb_dFactor } + requiresPowerCycle = warningLedPin requiresPowerCycle = runningLedPin requiresPowerCycle = binarySerialTxPin @@ -1990,7 +1995,7 @@ fileVersion = { 20200310 } table = boostTableTbl, boostMapOpen, "", 1 xBins = boostRpmBins, RPMValue - yBins = boostMapBins, MAPValue + yBins = boostTpsBins, TPSValue zBins = boostTableOpenLoop table = boostTable2Tbl, boostMapClosed, "", 1 @@ -2727,7 +2732,6 @@ cmd_test_inj14 = "w\x00\x13\x00\x0e" cmd_test_inj15 = "w\x00\x13\x00\x0f" cmd_test_inj16 = "w\x00\x13\x00\x10" -; cmd_test_fuel_pump = "w\x00\x14\x00\x01" cmd_calibrate_tps_1_closed = "w\x00\x14\x00\x02" cmd_calibrate_tps_1_wot = "w\x00\x14\x00\x03" @@ -2743,6 +2747,7 @@ cmd_etb_autotune = "w\x00\x14\x00\x0C" cmd_enable_self_stim = "w\x00\x14\x00\x0D" cmb_etb_auto_calibrate = "w\x00\x14\x00\x0E" cmd_disable_self_stim = "w\x00\x14\x00\x0F" +cmd_etb_autotune_stop = "w\x00\x14\x00\x10" cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01" @@ -2834,17 +2839,18 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "Ignition Pin 1", ignitionPins1, {isIgnitionEnabled == 1} ; see rusefi_config.txt comment next to 'ignitionPin2logic' which says ; this section is auto-generated by FiringOrderTSLogic.java - field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 1) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)))} - field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)))} - field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)))} - field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12)))} - field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 )} - field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11)))} - field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} + field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9) || (firingOrder == 13) || (firingOrder == 14) || (firingOrder == 15) || (firingOrder == 18) || (firingOrder == 20)))} + field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12) || (firingOrder == 14) || (firingOrder == 16) || (firingOrder == 17)))} + field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12) || (firingOrder == 15) || (firingOrder == 18)))} + field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 13)))} + field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11) || (firingOrder == 15) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11) || (firingOrder == 16) || (firingOrder == 18) || (firingOrder == 19)))} + field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 15)))} + field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 16) || (firingOrder == 18)))} + field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 15)))} + field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 12) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 18)))} + field = "This is useful to have tachometer working" field = " while converting from distributor" field = "Dizzy out Pin", dizzySparkOutputPin, {isIgnitionEnabled == 1} @@ -2866,6 +2872,8 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" dialog = baseEngineConfig, "Engine Configuration" ; field = "Engine Preset", engineType + field = "Engine Make", engineMake + field = "Engine Code", engineCode field = "Number of Cylinders", cylindersCount field = "Engine Displacement", displacement field = "Firing Order", firingOrder @@ -4034,11 +4042,14 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } dialog = etbAutotune, "PID Autotune" - field = "!Set debug mode below to 'ETB Autotune' to show results" - field = "Debug mode", debugMode - commandButton = "ETB PID Autotune", cmd_etb_autotune + commandButton = "Start ETB PID Autotune", cmd_etb_autotune + commandButton = "Stop ETB PID Autotune", cmd_etb_autotune_stop + commandButton = "Auto Calibrate TPS", cmb_etb_auto_calibrate + field = "!Set debug mode below to 'ETB Autotune' to show more detail" + field = "Debug mode", debugMode + dialog = etbDialogRight panel = etbIdleDialog panel = etbPidDialog diff --git a/firmware/tunerstudio/rusefi_prometheus.ini b/firmware/tunerstudio/rusefi_prometheus.ini index 3fa259f03c..5c3aa9e6da 100644 --- a/firmware/tunerstudio/rusefi_prometheus.ini +++ b/firmware/tunerstudio/rusefi_prometheus.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon May 04 19:09:43 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed May 06 12:32:56 EDT 2020 pageSize = 20000 page = 1 @@ -179,7 +179,7 @@ page = 1 cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2 sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0 rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2 - fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY", "MAF Air Charge" + fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge" crankingInjectionMode = bits, U32, 424, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" injectionMode = bits, U32, 428, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" extraInjectionOffset = scalar, F32, 432, "deg", 1, 0.0, -720, 720, 2 @@ -633,7 +633,9 @@ page = 1 etbIo22_directionPin2 = bits, U08, 1093, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_controlPin1 = bits, U08, 1094, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_disablePin = bits, U08, 1095, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" -;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1096 + engineMake = string, ASCII, 1096, 32 + engineCode = string, ASCII, 1128, 32 +;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1160 vvtDisplayInverted = bits, U32, 1464, [0:0], "false", "true" fuelClosedLoopCorrectionEnabled= bits, U32, 1464, [1:1], "false", "true" isVerboseIAC = bits, U32, 1464, [2:2], "false", "true" @@ -1095,7 +1097,7 @@ page = 1 afterstartEnrich = array, F32, 6184, [8], "%", 1, 0, 0, 600, 1 afterstartDecayTime = array, F32, 6216, [8], "Seconds", 1, 0, 0, 100, 1 boostTableOpenLoop = array, U08, 6248, [8x8],"", 2, 0 , 0, 3000, 0 - boostMapBins = array, U08, 6312, [8], "", 2, 0, 0, 600.0, 1 +;no TS info - skipping unused6312 offset 6312 boostRpmBins = array, U08, 6320, [8], "RPM", 50, 0, 0.0, 12000.0, 0 boostTableClosedLoop = array, U08, 6328, [8x8],"", 2, 0 , 0, 3000, 0 boostTpsBins = array, U08, 6392, [8], "%", 2, 0.0, 0, 100.0, 2 @@ -1613,7 +1615,6 @@ fileVersion = { 20200310 } ; todo: generate this section programatically LM_PLAIN_MAF = {0}, LM_ALPHA_N = {1}, - LM_MAP = {2}, LM_SPEED_DENSITY = {3}, LM_REAL_MAF = {4} @@ -1662,6 +1663,10 @@ fileVersion = { 20200310 } maintainConstantValue = tpsMax, { (calibrationMode == 1 ) ? calibrationValue : tpsMax } maintainConstantValue = tpsMin, { (calibrationMode == 2 ) ? calibrationValue : tpsMin } + maintainConstantValue = etb_pFactor, { (calibrationMode == 3 ) ? calibrationValue : etb_pFactor } + maintainConstantValue = etb_iFactor, { (calibrationMode == 4 ) ? calibrationValue : etb_iFactor } + maintainConstantValue = etb_dFactor, { (calibrationMode == 5 ) ? calibrationValue : etb_dFactor } + requiresPowerCycle = warningLedPin requiresPowerCycle = runningLedPin requiresPowerCycle = binarySerialTxPin @@ -1990,7 +1995,7 @@ fileVersion = { 20200310 } table = boostTableTbl, boostMapOpen, "", 1 xBins = boostRpmBins, RPMValue - yBins = boostMapBins, MAPValue + yBins = boostTpsBins, TPSValue zBins = boostTableOpenLoop table = boostTable2Tbl, boostMapClosed, "", 1 @@ -2732,7 +2737,6 @@ cmd_test_inj14 = "w\x00\x13\x00\x0e" cmd_test_inj15 = "w\x00\x13\x00\x0f" cmd_test_inj16 = "w\x00\x13\x00\x10" -; cmd_test_fuel_pump = "w\x00\x14\x00\x01" cmd_calibrate_tps_1_closed = "w\x00\x14\x00\x02" cmd_calibrate_tps_1_wot = "w\x00\x14\x00\x03" @@ -2748,6 +2752,7 @@ cmd_etb_autotune = "w\x00\x14\x00\x0C" cmd_enable_self_stim = "w\x00\x14\x00\x0D" cmb_etb_auto_calibrate = "w\x00\x14\x00\x0E" cmd_disable_self_stim = "w\x00\x14\x00\x0F" +cmd_etb_autotune_stop = "w\x00\x14\x00\x10" cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01" @@ -2839,17 +2844,18 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "Ignition Pin 1", ignitionPins1, {isIgnitionEnabled == 1} ; see rusefi_config.txt comment next to 'ignitionPin2logic' which says ; this section is auto-generated by FiringOrderTSLogic.java - field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 1) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)))} - field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)))} - field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)))} - field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12)))} - field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 )} - field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11)))} - field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} + field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9) || (firingOrder == 13) || (firingOrder == 14) || (firingOrder == 15) || (firingOrder == 18) || (firingOrder == 20)))} + field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12) || (firingOrder == 14) || (firingOrder == 16) || (firingOrder == 17)))} + field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12) || (firingOrder == 15) || (firingOrder == 18)))} + field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 13)))} + field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11) || (firingOrder == 15) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11) || (firingOrder == 16) || (firingOrder == 18) || (firingOrder == 19)))} + field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 15)))} + field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 16) || (firingOrder == 18)))} + field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 15)))} + field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 12) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 18)))} + field = "This is useful to have tachometer working" field = " while converting from distributor" field = "Dizzy out Pin", dizzySparkOutputPin, {isIgnitionEnabled == 1} @@ -2871,6 +2877,8 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" dialog = baseEngineConfig, "Engine Configuration" ; field = "Engine Preset", engineType + field = "Engine Make", engineMake + field = "Engine Code", engineCode field = "Number of Cylinders", cylindersCount field = "Engine Displacement", displacement field = "Firing Order", firingOrder @@ -4071,11 +4079,14 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } dialog = etbAutotune, "PID Autotune" - field = "!Set debug mode below to 'ETB Autotune' to show results" - field = "Debug mode", debugMode - commandButton = "ETB PID Autotune", cmd_etb_autotune + commandButton = "Start ETB PID Autotune", cmd_etb_autotune + commandButton = "Stop ETB PID Autotune", cmd_etb_autotune_stop + commandButton = "Auto Calibrate TPS", cmb_etb_auto_calibrate + field = "!Set debug mode below to 'ETB Autotune' to show more detail" + field = "Debug mode", debugMode + dialog = etbDialogRight panel = etbIdleDialog panel = etbPidDialog diff --git a/firmware/tunerstudio/rusefi_proteus.ini b/firmware/tunerstudio/rusefi_proteus.ini index b3587be77d..3d40be877f 100644 --- a/firmware/tunerstudio/rusefi_proteus.ini +++ b/firmware/tunerstudio/rusefi_proteus.ini @@ -89,7 +89,7 @@ enable2ndByteCanID = false ; see PAGE_0_SIZE in C source code ; CONFIG_DEFINITION_START -; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Mon May 04 19:09:45 EDT 2020 +; this section was generated automatically by rusEfi tool ConfigDefinition.jar based on gen_config.bat integration\rusefi_config.txt Wed May 06 12:32:58 EDT 2020 pageSize = 20000 page = 1 @@ -179,7 +179,7 @@ page = 1 cylinderBore = scalar, F32, 408, "mm", 1, 0, 0, 20000.0, 2 sensorSnifferRpmThreshold = scalar, S32, 412, "RPM", 1, 0, 0,30000, 0 rpmHardLimit = scalar, S32, 416, "rpm", 1, 0, 0, 20000.0, 2 - fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "MAP", "SPEED DENSITY", "MAF Air Charge" + fuelAlgorithm = bits, U32, 420, [0:7], "MAF", "Alpha-N/TPS", "INVALID", "SPEED DENSITY", "MAF Air Charge" crankingInjectionMode = bits, U32, 424, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" injectionMode = bits, U32, 428, [0:7], "Simultaneous", "Sequential", "Batch", "Single Point" extraInjectionOffset = scalar, F32, 432, "deg", 1, 0.0, -720, 720, 2 @@ -633,7 +633,9 @@ page = 1 etbIo22_directionPin2 = bits, U08, 1093, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_controlPin1 = bits, U08, 1094, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" etbIo22_disablePin = bits, U08, 1095, [0:7], "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "PA8", "PA9", "PA10", "PA11", "PA12", "PA13", "PA14", "PA15", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "PB8", "PB9", "PB10", "PB11", "PB12", "PB13", "PB14", "PB15", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "PC10", "PC11", "PC12", "PC13", "PC14", "PC15", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "PD8", "PD9", "PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6","PE7","PE8","PE9","PE10","PE11","PE12","PE13","PE14","PE15", "PF0","PF1","PF2","PF3","PF4","PF5","PF6","PF7","PF8","PF9","PF10","PF11","PF12","PF13","PF14","PF15", "PG0","PG1","PG2","PG3","PG4","PG5","PG6","PG7","PG8","PG9","PG10","PG11","PG12","PG13","PG14","PG15", "PH0","PH1","PH2","PH3","PH4","PH5","PH6","PH7","PH8","PH9","PH10","PH11","PH12","PH13","PH14","PH15","INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" -;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1096 + engineMake = string, ASCII, 1096, 32 + engineCode = string, ASCII, 1128, 32 +;no TS info - skipping unusedAtOldBoardConfigurationEnd offset 1160 vvtDisplayInverted = bits, U32, 1464, [0:0], "false", "true" fuelClosedLoopCorrectionEnabled= bits, U32, 1464, [1:1], "false", "true" isVerboseIAC = bits, U32, 1464, [2:2], "false", "true" @@ -1095,7 +1097,7 @@ page = 1 afterstartEnrich = array, F32, 6184, [8], "%", 1, 0, 0, 600, 1 afterstartDecayTime = array, F32, 6216, [8], "Seconds", 1, 0, 0, 100, 1 boostTableOpenLoop = array, U08, 6248, [8x8],"", 2, 0 , 0, 3000, 0 - boostMapBins = array, U08, 6312, [8], "", 2, 0, 0, 600.0, 1 +;no TS info - skipping unused6312 offset 6312 boostRpmBins = array, U08, 6320, [8], "RPM", 50, 0, 0.0, 12000.0, 0 boostTableClosedLoop = array, U08, 6328, [8x8],"", 2, 0 , 0, 3000, 0 boostTpsBins = array, U08, 6392, [8], "%", 2, 0.0, 0, 100.0, 2 @@ -1613,7 +1615,6 @@ fileVersion = { 20200310 } ; todo: generate this section programatically LM_PLAIN_MAF = {0}, LM_ALPHA_N = {1}, - LM_MAP = {2}, LM_SPEED_DENSITY = {3}, LM_REAL_MAF = {4} @@ -1662,6 +1663,10 @@ fileVersion = { 20200310 } maintainConstantValue = tpsMax, { (calibrationMode == 1 ) ? calibrationValue : tpsMax } maintainConstantValue = tpsMin, { (calibrationMode == 2 ) ? calibrationValue : tpsMin } + maintainConstantValue = etb_pFactor, { (calibrationMode == 3 ) ? calibrationValue : etb_pFactor } + maintainConstantValue = etb_iFactor, { (calibrationMode == 4 ) ? calibrationValue : etb_iFactor } + maintainConstantValue = etb_dFactor, { (calibrationMode == 5 ) ? calibrationValue : etb_dFactor } + requiresPowerCycle = warningLedPin requiresPowerCycle = runningLedPin requiresPowerCycle = binarySerialTxPin @@ -1990,7 +1995,7 @@ fileVersion = { 20200310 } table = boostTableTbl, boostMapOpen, "", 1 xBins = boostRpmBins, RPMValue - yBins = boostMapBins, MAPValue + yBins = boostTpsBins, TPSValue zBins = boostTableOpenLoop table = boostTable2Tbl, boostMapClosed, "", 1 @@ -2727,7 +2732,6 @@ cmd_test_inj14 = "w\x00\x13\x00\x0e" cmd_test_inj15 = "w\x00\x13\x00\x0f" cmd_test_inj16 = "w\x00\x13\x00\x10" -; cmd_test_fuel_pump = "w\x00\x14\x00\x01" cmd_calibrate_tps_1_closed = "w\x00\x14\x00\x02" cmd_calibrate_tps_1_wot = "w\x00\x14\x00\x03" @@ -2743,6 +2747,7 @@ cmd_etb_autotune = "w\x00\x14\x00\x0C" cmd_enable_self_stim = "w\x00\x14\x00\x0D" cmb_etb_auto_calibrate = "w\x00\x14\x00\x0E" cmd_disable_self_stim = "w\x00\x14\x00\x0F" +cmd_etb_autotune_stop = "w\x00\x14\x00\x10" cmd_test_radiator_fan = "w\x00\x15\x00\x01" cmd_test_check_engine_light = "w\x00\x16\x00\x01" @@ -2834,17 +2839,18 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" field = "Ignition Pin 1", ignitionPins1, {isIgnitionEnabled == 1} ; see rusefi_config.txt comment next to 'ignitionPin2logic' which says ; this section is auto-generated by FiringOrderTSLogic.java - field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 1) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12)))} - field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9)))} - field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12)))} - field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12)))} - field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 )} - field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11)))} - field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} - field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount > 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11)))} + field = "Ignition Pin 2", ignitionPins2, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 2) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 2) || (firingOrder == 7) || (firingOrder == 9) || (firingOrder == 11) || (firingOrder == 12) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 3", ignitionPins3, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 3) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 1) || (firingOrder == 3) || (firingOrder == 4) || (firingOrder == 5) || (firingOrder == 9) || (firingOrder == 13) || (firingOrder == 14) || (firingOrder == 15) || (firingOrder == 18) || (firingOrder == 20)))} + field = "Ignition Pin 4", ignitionPins4, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 4) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 7) || (firingOrder == 12) || (firingOrder == 14) || (firingOrder == 16) || (firingOrder == 17)))} + field = "Ignition Pin 5", ignitionPins5, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 5) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 4) || (firingOrder == 12) || (firingOrder == 15) || (firingOrder == 18)))} + field = "Ignition Pin 6", ignitionPins6, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 6) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 13)))} + field = "Ignition Pin 7", ignitionPins7, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 7) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 11) || (firingOrder == 15) || (firingOrder == 16) || (firingOrder == 19) || (firingOrder == 20)))} + field = "Ignition Pin 8", ignitionPins8, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 8) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 5) || (firingOrder == 11) || (firingOrder == 16) || (firingOrder == 18) || (firingOrder == 19)))} + field = "Ignition Pin 9", ignitionPins9, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 9) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 15)))} + field = "Ignition Pin 10", ignitionPins10, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 10) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 14) || (firingOrder == 16) || (firingOrder == 18)))} + field = "Ignition Pin 11", ignitionPins11, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 11) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 15)))} + field = "Ignition Pin 12", ignitionPins12, {isIgnitionEnabled == 1 && (ignitionMode != 0 && cylindersCount >= 12) && (ignitionMode !=2 || twoWireBatchIgnition == 1 || ((firingOrder == 18)))} + field = "This is useful to have tachometer working" field = " while converting from distributor" field = "Dizzy out Pin", dizzySparkOutputPin, {isIgnitionEnabled == 1} @@ -2866,6 +2872,8 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" dialog = baseEngineConfig, "Engine Configuration" ; field = "Engine Preset", engineType + field = "Engine Make", engineMake + field = "Engine Code", engineCode field = "Number of Cylinders", cylindersCount field = "Engine Displacement", displacement field = "Firing Order", firingOrder @@ -4042,11 +4050,14 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00" panel = hbridgeHardware, { throttlePedalPositionAdcChannel != 16 || useStepperIdle && useHbridges } dialog = etbAutotune, "PID Autotune" - field = "!Set debug mode below to 'ETB Autotune' to show results" - field = "Debug mode", debugMode - commandButton = "ETB PID Autotune", cmd_etb_autotune + commandButton = "Start ETB PID Autotune", cmd_etb_autotune + commandButton = "Stop ETB PID Autotune", cmd_etb_autotune_stop + commandButton = "Auto Calibrate TPS", cmb_etb_auto_calibrate + field = "!Set debug mode below to 'ETB Autotune' to show more detail" + field = "Debug mode", debugMode + dialog = etbDialogRight panel = etbIdleDialog panel = etbPidDialog diff --git a/java_console/.idea/runConfigurations/FiringOrderTSLogic.xml b/java_console/.idea/runConfigurations/FiringOrderTSLogic.xml index a8e616a2ad..34c72682ce 100644 --- a/java_console/.idea/runConfigurations/FiringOrderTSLogic.xml +++ b/java_console/.idea/runConfigurations/FiringOrderTSLogic.xml @@ -1,7 +1,7 @@