launch control: Speed threshold depends on launch mode, also zero speed limit handling #5419

only: change zero setting handling
This commit is contained in:
Andrey 2023-07-20 16:09:52 -04:00
parent 3c090129e6
commit dabae98f16
3 changed files with 8 additions and 9 deletions

View File

@ -45,12 +45,13 @@ bool LaunchControlBase::isInsideSwitchCondition() {
}
/**
* Returns True in case Vehicle speed is less then threshold.
* This condition would only return true based on speed if DisablebySpeed is true
* The condition logic is written in that way, that if we do not use disable by speed
* then we have to return true, and trust that we would disable by other condition!
* Returns True when Vehicle speed ALLOWS launch control
*/
bool LaunchControlBase::isInsideSpeedCondition() const {
if (engineConfiguration->launchSpeedThreshold == 0) {
return true; // allow launch, speed does not matter
}
int speed = Sensor::getOrZero(SensorType::VehicleSpeed);
return (engineConfiguration->launchSpeedThreshold > speed) || (!(engineConfiguration->launchActivationMode == ALWAYS_ACTIVE_LAUNCH));

View File

@ -875,7 +875,7 @@ custom maf_sensor_type_e 1 bits, S08, @OFFSET@, [0:1], @@maf_sensor_type_e_enum@
bit multisparkEnable
bit enableLaunchRetard
bit unfinishedenableLaunchBoost
bit unfinishedlaunchDisableBySpeed
bit unusedBitLDBS
bit enableCanVss;Read VSS from OEM CAN bus according to selected CAN vehicle configuration.
bit enableInnovateLC2
bit showHumanReadableWarning
@ -924,7 +924,7 @@ bit verboseCan2,"Print all","Do not print";Print incoming and outgoing second bu
custom antiLagActivationMode_e 1 bits, S08, @OFFSET@, [0:0], @@antiLagActivationMode_e_enum@@
antiLagActivationMode_e antiLagActivationMode;
int launchSpeedThreshold;Disabled above this speed;"Kph", 1, 0, 0, 300, 0
int launchSpeedThreshold;Launch disabled above this speed if setting is above zero;"Kph", 1, 0, 0, 300, 0
int launchTimingRpmRange;Range from Launch RPM for Timing Retard to activate;"RPM", 1, 0, 0, 8000, 0
int launchFuelAdded;Extra Fuel Added;"%", 1, 0, 0, 100, 0
int launchBoostDuty;Duty Cycle for the Boost Solenoid;"%", 1, 0, 0, 100, 0

View File

@ -40,7 +40,6 @@ TEST(LaunchControl, VSSCondition) {
}
TEST(LaunchControl, ZeroVSSCondition) {
EngineTestHelper eth(engine_type_e::TEST_ENGINE);
@ -51,8 +50,7 @@ TEST(LaunchControl, ZeroVSSCondition) {
engineConfiguration->launchSpeedThreshold = 0;
Sensor::setMockValue(SensorType::VehicleSpeed, 10.0);
EXPECT_FALSE(dut.isInsideSpeedCondition());
EXPECT_TRUE(dut.isInsideSpeedCondition());
}
TEST(LaunchControl, VSSConditionWithSwitch) {