diff --git a/firmware/controllers/algo/engine.h b/firmware/controllers/algo/engine.h index 561ae5afb1..1d50dfbbe4 100644 --- a/firmware/controllers/algo/engine.h +++ b/firmware/controllers/algo/engine.h @@ -196,7 +196,10 @@ public: cyclic_buffer triggerErrorDetection; GearControllerBase *gearController; +#if EFI_LAUNCH_CONTROL LaunchControlBase launchController; +#endif // EFI_LAUNCH_CONTROL + SoftSparkLimiter softSparkLimiter; #if EFI_BOOST_CONTROL diff --git a/firmware/controllers/algo/engine_types.h b/firmware/controllers/algo/engine_types.h index f532c427d1..ec41145acf 100644 --- a/firmware/controllers/algo/engine_types.h +++ b/firmware/controllers/algo/engine_types.h @@ -302,7 +302,7 @@ typedef enum { DBG_35 = 35, DBG_BOOST = 36, DBG_37 = 37, - DBG_LAUNCH = 38, + DBG_38 = 38, DBG_ETB_AUTOTUNE = 39, DBG_COMPOSITE_LOG = 40, DBG_UNUSED41 = 41, diff --git a/firmware/controllers/algo/launch_control.cpp b/firmware/controllers/algo/launch_control.cpp index 1f6eb5b4ed..1925777caf 100644 --- a/firmware/controllers/algo/launch_control.cpp +++ b/firmware/controllers/algo/launch_control.cpp @@ -80,18 +80,17 @@ bool LaunchControlBase::isInsideRPMCondition(int rpm) const { bool LaunchControlBase::isLaunchConditionMet(int rpm) { - bool activateSwitchCondition = isInsideSwitchCondition(); - bool rpmCondition = isInsideRPMCondition(rpm); - bool speedCondition = isInsideSpeedCondition(); - bool tpsCondition = isInsideTpsCondition(); + activateSwitchCondition = isInsideSwitchCondition(); + rpmCondition = isInsideRPMCondition(rpm); + speedCondition = isInsideSpeedCondition(); + tpsCondition = isInsideTpsCondition(); #if EFI_TUNER_STUDIO - if (engineConfiguration->debugMode == DBG_LAUNCH) { - engine->outputChannels.debugIntField1 = rpmCondition; - engine->outputChannels.debugIntField2 = tpsCondition; - engine->outputChannels.debugIntField3 = speedCondition; - engine->outputChannels.debugIntField4 = activateSwitchCondition; - } + // todo: implement fancy logging of all live data + engine->outputChannels.launchSpeedCondition = speedCondition; + engine->outputChannels.launchRpmCondition = rpmCondition; + engine->outputChannels.launchTpsCondition = tpsCondition; + engine->outputChannels.launchActivateSwitchCondition = activateSwitchCondition; #endif /* EFI_TUNER_STUDIO */ return speedCondition && activateSwitchCondition && rpmCondition && tpsCondition; @@ -124,12 +123,10 @@ void LaunchControlBase::update() { } #if EFI_TUNER_STUDIO - if (engineConfiguration->debugMode == DBG_LAUNCH) { - engine->outputChannels.debugIntField5 = engine->clutchDownState; - engine->outputChannels.debugFloatField1 = launchActivatePinState; - engine->outputChannels.debugFloatField2 = isLaunchCondition; - engine->outputChannels.debugFloatField3 = combinedConditions; - } + engine->outputChannels.clutchDownState = engine->clutchDownState; + engine->outputChannels.launchActivatePinState = launchActivatePinState; + engine->outputChannels.launchIsLaunchCondition = isLaunchCondition; + engine->outputChannels.launchCombinedConditions = combinedConditions; #endif /* EFI_TUNER_STUDIO */ } diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index f3e6bb8c35..b9d9886f15 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -291,7 +291,7 @@ float baseFuel;+Base mass of the per-cylinder fuel injected during cranking. Thi int16_t rpm;+This sets the RPM limit below which the ECU will use cranking fuel and ignition logic, typically this is around 350-450rpm. \nset cranking_rpm X;"RPM", 1, 0, 0, 3000, 0 end_struct -#define debug_mode_e_enum "INVALID", "TPS acceleration enrichment", "GPPWM", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "Soft Spark Cut", "VVT1 PID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "SD card", "sr5", "Knock", "INVALID", "Electronic Throttle", "Executor", "Bench Test / TS commands", "INVALID", "Analog inputs #1", "INSTANT_RPM", "INVALID", "Status", "CJ125", "INVALID", "MAP", "Metrics", "INVALID", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "INVALID", "INVALID", "Boost Control", "INVALID", "Launch", "ETB Autotune", "FSIO_COMPOSITE_LOG", "INVALID", "INVALID", "INVALID", "Dyno_View", "Logic_Analyzer", "rusEFI Wideband", "TCU", "Lua", "VVT2 PID", "VVT3 PID", "VVT4 PID", "mode 52", "mode 53" +#define debug_mode_e_enum "INVALID", "TPS acceleration enrichment", "GPPWM", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "Soft Spark Cut", "VVT1 PID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "SD card", "sr5", "Knock", "INVALID", "Electronic Throttle", "Executor", "Bench Test / TS commands", "INVALID", "Analog inputs #1", "INSTANT_RPM", "INVALID", "Status", "CJ125", "INVALID", "MAP", "Metrics", "INVALID", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "INVALID", "INVALID", "Boost Control", "INVALID", "INVALID", "ETB Autotune", "FSIO_COMPOSITE_LOG", "INVALID", "INVALID", "INVALID", "Dyno_View", "Logic_Analyzer", "rusEFI Wideband", "TCU", "Lua", "VVT2 PID", "VVT3 PID", "VVT4 PID", "mode 52", "mode 53" custom debug_mode_e 4 bits, U32, @OFFSET@, [0:5], @@debug_mode_e_enum@@ #define VM_VVT_INACTIVE 0 diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index 2da4dd8ef3..7644600896 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -214,7 +214,7 @@ enable2ndByteCanID = false ; wall of debug mode :) ; https://rusefi.com/wiki/index.php?title=Manual:Debug_fields -; Alternator TPS Acceleration GPPWM Idle Engine Load Acc Trigger Counters VVT1 PID Cranking Ignition Timing Fu Corr VSS SD Card Knock Wall Wetting ETB PID Executor InstantRpm CJ125 CAN MAP TLE8888 Analog inputs 2 Boost Start Launcher ETB Autotune Injector flow compensation DYNO_VIEW LOGIC_ANALYZER Wideband TCU Lua VVT2 PID VVT3 PID VVT4 PID +; Alternator TPS Acceleration GPPWM Idle Engine Load Acc Trigger Counters VVT1 PID Cranking Ignition Timing Fu Corr VSS SD Card Knock Wall Wetting ETB PID Executor InstantRpm CJ125 CAN MAP TLE8888 Analog inputs 2 Boost Start ETB Autotune Injector flow compensation DYNO_VIEW LOGIC_ANALYZER Wideband TCU Lua VVT2 PID VVT3 PID VVT4 PID ; 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 ; DBG_ALTERNATOR_PID DBG_TPS_ACCEL DBG_GPPWM DBG_IDLE_CONTROL debugFieldF1List = bits, U08, [0:7], "Alt: Controller Output", "From TPS", "GPPWM 1", "Idle: Controller Output", "Idle output", " ", "", "VVT1: Controller Output"," ", "", "Ign IAT Corr", "", "", "Total SD", "last volts", "", "WW: Alpha", "ETB Controller Output", "", "", "df1", "df1", "InstantRpm", "", "24:df1", "CJ125: output", "", "MAP Average", "", "", "", "", "TPS1 Pri/Sec Diff", "", "", "", "Boost Open Loop Duty", "S unused" "", "Osc Amplitude", "", "", "", "Pressure across injector(kpa)", "VSS", "", "WB: Pump DAC duty", "", "Lua Debug 1", "VVT2: Controller Output","VVT3: Controller Output","VVT4: Controller Output"