From 2bc4fd909db66db9e7e5afb36a035ab431539904 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Wed, 20 Jul 2022 18:48:55 -0400 Subject: [PATCH] Launch control bug? "range" thing is confusing #4348 a typo and configurable behaviour without UI --- firmware/controllers/algo/launch_control.cpp | 3 ++- firmware/integration/rusefi_config.txt | 2 +- firmware/tunerstudio/rusefi.input | 1 + unit_tests/tests/test_launch.cpp | 6 +++--- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/firmware/controllers/algo/launch_control.cpp b/firmware/controllers/algo/launch_control.cpp index f9e54761fa..283b979df4 100644 --- a/firmware/controllers/algo/launch_control.cpp +++ b/firmware/controllers/algo/launch_control.cpp @@ -67,7 +67,8 @@ bool LaunchControlBase::isInsideTpsCondition() const { return false; } - return engineConfiguration->launchTpsTreshold < tps.Value; + // todo: should this be 'launchTpsThreshold <= tps.Value' so that nicely calibrated TPS of zero does not prevent launch? + return engineConfiguration->launchTpsThreshold < tps.Value; } /** diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 2006a0f549..25b93755e9 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -960,7 +960,7 @@ bit verboseCan2,"Print all","Do not print";Print incoming and outgoing second bu int launchBoostDuty;+Duty Cycle for the Boost Solenoid;"%", 1, 0, 0, 100, 0 int hardCutRpmRange;Range from Launch RPM to activate Hard Cut;"RPM", 1, 0, 0, 3000, 0 int unused962 - int launchTpsTreshold;;"", 1, 0, 0, 20000, 0 + int launchTpsThreshold;;"", 1, 0, 0, 20000, 0 float launchActivateDelay;;"", 1, 0, 0, 20000, 0 stft_s stft diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index cf62a07694..5a9e38d0a7 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -3835,6 +3835,7 @@ dialog = tcuControls, "Transmission Settings" field = "Launch RPM", launchRpm, {launchControlEnabled == 1} ;field = "Extra Fuel", launchFuelAdded, {launchControlEnabled == 1} ;field = "Boost Solenoid Duty", launchBoostDuty, {launchControlEnabled == 1} + field = "TPS Threshold", launchTpsThreshold field = "Ignition Retard enable", enableLaunchRetard, {launchControlEnabled == 1} field = "Ignition Retard", launchTimingRetard, {launchControlEnabled == 1} field = "Ignition Retard RPM Range", launchTimingRpmRange, {launchControlEnabled == 1} diff --git a/unit_tests/tests/test_launch.cpp b/unit_tests/tests/test_launch.cpp index 0ad4fb2268..4070b9cb9f 100644 --- a/unit_tests/tests/test_launch.cpp +++ b/unit_tests/tests/test_launch.cpp @@ -7,7 +7,7 @@ TEST(LaunchControl, TpsCondition) { LaunchControlBase dut; - engineConfiguration->launchTpsTreshold = 10; + engineConfiguration->launchTpsThreshold = 10; // Should return false with failed sensor Sensor::resetMockValue(SensorType::DriverThrottleIntent); @@ -103,7 +103,7 @@ TEST(LaunchControl, CombinedCondition) { engineConfiguration->launchActivationMode = ALWAYS_ACTIVE_LAUNCH; engineConfiguration->launchRpm = 3000; - engineConfiguration->launchTpsTreshold = 10; + engineConfiguration->launchTpsThreshold = 10; //valid TPS Sensor::setMockValue(SensorType::DriverThrottleIntent, 20.0f); @@ -150,7 +150,7 @@ TEST(LaunchControl, CompleteRun) { engineConfiguration->launchSpeedThreshold = 30; engineConfiguration->launchRpm = 3000; - engineConfiguration->launchTpsTreshold = 10; + engineConfiguration->launchTpsThreshold = 10; engineConfiguration->launchControlEnabled = true; //valid TPS Sensor::setMockValue(SensorType::DriverThrottleIntent, 20.0f);