launch control: merging two settings into one

This commit is contained in:
Andrey 2024-03-09 09:42:41 -05:00 committed by rusefillc
parent cb285ff483
commit 09b787adf3
6 changed files with 7 additions and 10 deletions

View File

@ -108,7 +108,7 @@ static angle_t getRunningAdvance(int rpm, float engineLoad) {
if (engineConfiguration->launchSmoothRetard) {
float launchAngle = engineConfiguration->launchTimingRetard;
int launchRpm = engineConfiguration->launchRpm;
int launchRpmWithTimingRange = launchRpm + engineConfiguration->launchTimingRpmRange;
int launchRpmWithTimingRange = launchRpm + engineConfiguration->launchRpmWindow;
// interpolate timing from rpm at launch triggered to full retard at launch launchRpm + launchTimingRpmRange
return interpolateClamped(launchRpm, advanceAngle, launchRpmWithTimingRange, launchAngle, rpm);
} else {

View File

@ -518,9 +518,8 @@ static void setDefaultEngineConfiguration() {
// wow unit tests have much cooler setDefaultLaunchParameters method
engineConfiguration->launchRpm = 3000;
// engineConfiguration->launchTimingRetard = 10;
engineConfiguration->launchTimingRpmRange = 500;
engineConfiguration->launchRpmWindow = 500;
engineConfiguration->launchSpeedThreshold = 30;
engineConfiguration->hardCutRpmRange = 500;
engineConfiguration->engineSnifferRpmThreshold = 2500;
engineConfiguration->sensorSnifferRpmThreshold = 2500;

View File

@ -116,7 +116,7 @@ void LaunchControlBase::update() {
or it is supposed to be referencing 'launchTimingRpmRange'?
+ (engineConfiguration->enableLaunchRetard ? engineConfiguration->launchAdvanceRpmRange : 0)
*/
+ engineConfiguration->hardCutRpmRange;
+ engineConfiguration->launchRpmWindow;
if (!combinedConditions) {
// conditions not met, reset timer

View File

@ -964,10 +964,10 @@ bit verboseCan2,"Print all","Do not print";Print incoming and outgoing second bu
antiLagActivationMode_e antiLagActivationMode;
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 launchRpmWindow;Starting Launch RPM window to activate (subtracts from Launch RPM);"RPM", 1, 0, 0, 8000, 0
int launchSparkSkipPercent;Spark Skip Transition Target;"%", 1, 0, 0, 100, 0
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 unusedIntPadding
float turbochargerFilter
int launchTpsThreshold;;"", 1, 0, 0, 20000, 0
float launchActivateDelay;;"", 1, 0, 0, 20000, 0

View File

@ -4667,8 +4667,7 @@ dialog = tcuControls, "Transmission Settings"
field = "Speed Threshold", launchSpeedThreshold, {launchControlEnabled == 1}
field = ""
field = "Launch RPM", launchRpm, {launchControlEnabled == 1}
field = "Ignition Retard Adder", launchTimingRpmRange, {launchControlEnabled == 1 && enableLaunchRetard == 1}
field = "Hard Cut RPM Adder", hardCutRpmRange, {launchControlEnabled == 1}
field = "Launch Control Window", launchRpmWindow, {launchControlEnabled == 1}
field = "TPS Threshold", launchTpsThreshold, {launchControlEnabled == 1}
field = "Ignition Retard enable", enableLaunchRetard, {launchControlEnabled == 1}
field = "Ignition Retard", launchTimingRetard, {launchControlEnabled == 1 && enableLaunchRetard == 1}

View File

@ -154,10 +154,9 @@ TEST(LaunchControl, CombinedCondition) {
static void setDefaultLaunchParameters() {
engineConfiguration->launchRpm = 4000; // Rpm to trigger Launch condition
// engineConfiguration->launchTimingRetard = 10; // retard in absolute degrees ATDC
engineConfiguration->launchTimingRpmRange = 500; // Rpm above Launch triggered for full retard
engineConfiguration->launchRpmWindow = 500; // RPM window (Launch RPM - Window) for transitioning to full retard
engineConfiguration->launchSparkCutEnable = true;
engineConfiguration->launchFuelCutEnable = false;
engineConfiguration->hardCutRpmRange = 500; //Rpm above Launch triggered +(if retard enabled) launchTimingRpmRange to hard cut
engineConfiguration->launchSpeedThreshold = 10; //maximum speed allowed before disable launch
engineConfiguration->launchFuelAdderPercent = 10; // Extra fuel in % when launch are triggered
engineConfiguration->launchBoostDuty = 70; // boost valve duty cycle at launch