idle_min through FSIO not working as intended

#1553

we now re-activated idle PID even in deadzone for half a second after A/C toggle
This commit is contained in:
rusefi 2020-07-06 16:40:16 -04:00
parent f09896fb54
commit b1ab455f31
1 changed files with 4 additions and 1 deletions

View File

@ -315,8 +315,11 @@ static percent_t automaticIdleController(float tpsPos DECLARE_ENGINE_PARAMETER_S
rpm = GET_RPM();
}
// #1553 we need to give FSIO variable offset or minValue a chance
bool acToggleJustTouched = (getTimeNowUs() - engine->acSwitchLastChangeTime) < MS2US(500);
// check if within the dead zone
if (absI(rpm - targetRpm) <= CONFIG(idlePidRpmDeadZone)) {
if (!acToggleJustTouched && absI(rpm - targetRpm) <= CONFIG(idlePidRpmDeadZone)) {
engine->engineState.idle.idleState = RPM_DEAD_ZONE;
// current RPM is close enough, no need to change anything
return engine->engineState.idle.baseIdlePosition;