From 04631d3143fe064796fd937b8eb0c93bc302cd56 Mon Sep 17 00:00:00 2001 From: Antti Muurikainen <55035659+muuris@users.noreply.github.com> Date: Fri, 24 Apr 2020 03:19:02 +0300 Subject: [PATCH 1/2] Fix ASE being simultaneously on with crank enrichment (#365) --- speeduino/corrections.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speeduino/corrections.ino b/speeduino/corrections.ino index 72d7d2f2..8f5c0e1f 100644 --- a/speeduino/corrections.ino +++ b/speeduino/corrections.ino @@ -214,7 +214,7 @@ byte correctionASE() } else { - if ( (runSecsX10 - aseTsnStart) < configPage2.aseTsnDelay ) + if (( (runSecsX10 - aseTsnStart) < configPage2.aseTsnDelay ) && (!BIT_CHECK(currentStatus.engine, BIT_ENGINE_CRANK)) ) //Cranking check needs to be here also, so cranking and afterstart enrichments won't run simultaneously { BIT_SET(currentStatus.engine, BIT_ENGINE_ASE); //Mark ASE as active. ASEValue = 100 + map((runSecsX10 - aseTsnStart), 0, configPage2.aseTsnDelay,\ From b060bccb03f8a5e8265c703f4dca646bf7960b0a Mon Sep 17 00:00:00 2001 From: bera-n Date: Fri, 24 Apr 2020 03:17:42 +0200 Subject: [PATCH 2/2] Dont miss egocorr at igncount rollover (#362) * Check and update ignition count target before checking other conditions to avoid peramently disabling ego correction in case ignition count rolls over while ego correction is disabled. * Fix previous commit. Ego was reset between update cycles. Co-authored-by: bera-n --- speeduino/corrections.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/speeduino/corrections.ino b/speeduino/corrections.ino index 8f5c0e1f..f855c263 100644 --- a/speeduino/corrections.ino +++ b/speeduino/corrections.ino @@ -529,6 +529,8 @@ byte correctionAFRClosedLoop() //Note that this should only run after the sensor warmup delay necause it is used within the Include AFR option if(currentStatus.runSecs > configPage6.ego_sdelay) { currentStatus.afrTarget = get3DTableValue(&afrTable, currentStatus.fuelLoad, currentStatus.RPM); } //Perform the target lookup + AFRValue = currentStatus.egoCorrection; //Need to record this here, just to make sure the correction stays 'on' even if the nextCycle count isn't ready + if(ignitionCount >= AFRnextCycle) { AFRnextCycle = ignitionCount + configPage6.egoCount; //Set the target ignition event for the next calculation @@ -536,7 +538,6 @@ byte correctionAFRClosedLoop() //Check all other requirements for closed loop adjustments if( (currentStatus.coolant > (int)(configPage6.egoTemp - CALIBRATION_TEMPERATURE_OFFSET)) && (currentStatus.RPM > (unsigned int)(configPage6.egoRPM * 100)) && (currentStatus.TPS < configPage6.egoTPSMax) && (currentStatus.O2 < configPage6.ego_max) && (currentStatus.O2 > configPage6.ego_min) && (currentStatus.runSecs > configPage6.ego_sdelay) ) { - AFRValue = currentStatus.egoCorrection; //Need to record this here, just to make sure the correction stays 'on' even if the nextCycle count isn't ready //Check which algorithm is used, simple or PID if (configPage6.egoAlgorithm == EGO_ALGORITHM_SIMPLE) @@ -580,6 +581,7 @@ byte correctionAFRClosedLoop() } else { AFRValue = 100; } // Occurs if the egoAlgorithm is set to 0 (No Correction) } //Multi variable check + else { AFRValue = 100; } // If multivariable check fails disable correction } //Ignition count check } //egoType