idle duty cycle clamping
This commit is contained in:
parent
dc37b1686c
commit
934898f903
|
@ -200,14 +200,17 @@ void setIdleValvePosition(int positionPercent) {
|
||||||
|
|
||||||
#endif /* EFI_UNIT_TEST */
|
#endif /* EFI_UNIT_TEST */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clamps value into the [0, 100] range
|
||||||
|
*/
|
||||||
|
percent_t clampPercentValue(percent_t value) {
|
||||||
|
return maxF(minF(value, 100), 0);
|
||||||
|
}
|
||||||
|
|
||||||
static percent_t manualIdleController(float cltCorrection DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
static percent_t manualIdleController(float cltCorrection DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||||
|
|
||||||
percent_t correctedPosition = cltCorrection * CONFIG(manIdlePosition);
|
percent_t correctedPosition = cltCorrection * CONFIG(manIdlePosition);
|
||||||
|
|
||||||
// let's put the value into the right range
|
|
||||||
correctedPosition = maxF(correctedPosition, 0.01);
|
|
||||||
correctedPosition = minF(correctedPosition, 99.9);
|
|
||||||
|
|
||||||
return correctedPosition;
|
return correctedPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,7 +428,7 @@ static percent_t automaticIdleController(float tpsPos DECLARE_ENGINE_PARAMETER_S
|
||||||
engine->engineState.idle.idleState = BLIP;
|
engine->engineState.idle.idleState = BLIP;
|
||||||
} else if (!isRunning) {
|
} else if (!isRunning) {
|
||||||
// during cranking it's always manual mode, PID would make no sense during cranking
|
// during cranking it's always manual mode, PID would make no sense during cranking
|
||||||
iacPosition = cltCorrection * engineConfiguration->crankingIACposition;
|
iacPosition = clampPercentValue(cltCorrection * engineConfiguration->crankingIACposition);
|
||||||
// save cranking position & cycles counter for taper transition
|
// save cranking position & cycles counter for taper transition
|
||||||
lastCrankingIacPosition = iacPosition;
|
lastCrankingIacPosition = iacPosition;
|
||||||
lastCrankingCyclesCounter = engine->rpmCalculator.getRevolutionCounterSinceStart();
|
lastCrankingCyclesCounter = engine->rpmCalculator.getRevolutionCounterSinceStart();
|
||||||
|
@ -438,6 +441,8 @@ static percent_t automaticIdleController(float tpsPos DECLARE_ENGINE_PARAMETER_S
|
||||||
iacPosition = automaticIdleController(tps.Value PASS_ENGINE_PARAMETER_SUFFIX);
|
iacPosition = automaticIdleController(tps.Value PASS_ENGINE_PARAMETER_SUFFIX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
iacPosition = clampPercentValue(iacPosition);
|
||||||
|
|
||||||
// store 'base' iacPosition without adjustments
|
// store 'base' iacPosition without adjustments
|
||||||
engine->engineState.idle.baseIdlePosition = iacPosition;
|
engine->engineState.idle.baseIdlePosition = iacPosition;
|
||||||
|
|
||||||
|
|
|
@ -716,6 +716,6 @@ int getRusEfiVersion(void) {
|
||||||
if (initBootloader() != 0)
|
if (initBootloader() != 0)
|
||||||
return 123;
|
return 123;
|
||||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||||
return 20200419;
|
return 20200420;
|
||||||
}
|
}
|
||||||
#endif /* EFI_UNIT_TEST */
|
#endif /* EFI_UNIT_TEST */
|
||||||
|
|
Loading…
Reference in New Issue