stuck ego fix (#942)

Ego control gets stuck at 100% when ignitionCount wraps during an DFCO event because the test "if (ignitionCount < AFRnextCycle).." continues to fail until ignitionCount catches up with AFRnextCycle again - long time.
This fix also checks for ignitionCount < (AFRnextCycle - configPage6.egoCount)
This commit is contained in:
Jon Billings 2022-12-14 01:03:53 +00:00 committed by GitHub
parent f59d013714
commit 8e4b840325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -628,7 +628,7 @@ byte correctionAFRClosedLoop(void)
{
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)
if((ignitionCount >= AFRnextCycle) || (ignitionCount < (AFRnextCycle - configPage6.egoCount)))
{
AFRnextCycle = ignitionCount + configPage6.egoCount; //Set the target ignition event for the next calculation