fix typo, move bit to idle state (#4484)

This commit is contained in:
Matthew Kennedy 2022-08-25 17:26:12 -07:00 committed by GitHub
parent 211b348353
commit f3a5c28f07
3 changed files with 7 additions and 6 deletions

View File

@ -38,7 +38,6 @@ bit isKnockChipOk;
bit launchTriggered;
bit isTps2Error;
bit isIdleClosedLoop;
bit isIdleCoasting;
uint16_t autoscale RPMValue;@@GAUGE_NAME_RPM@@;"RPM",1, 0, 0, 8000, 0

View File

@ -15,7 +15,7 @@ bit mightResetPid;The idea of 'mightResetPid' is to reset PID only once - each t
bit shouldResetPid;idle: shouldResetPid
bit wasResetPid;idle: wasResetPid\nThis is needed to slowly turn on the PID back after it was reset.
bit mustResetPid;idle: mustResetPid\nThis is used when the PID configuration is changed, to guarantee the reset
bit isCoasting;idle: coasting
bit isCranking;idle: cranking
bit useIacTableForCoasting
bit notIdling
bit needReset;idle: reset
@ -28,6 +28,7 @@ bit looksLikeCoasting
bit looksLikeCrankToIdle
bit useInstantRpmForIdle
bit isVerboseIAC
bit isIdleCoasting;idle: coasting
int targetRpmByClt;idle: target by CLT
int targetRpmAcBump;idle: A/C bump

View File

@ -116,15 +116,17 @@ percent_t IdleController::getRunningOpenLoop(float clt, SensorResult tps) {
percent_t IdleController::getOpenLoop(Phase phase, float clt, SensorResult tps, float crankingTaperFraction) {
percent_t crankingValvePosition = getCrankingOpenLoop(clt);
isCoasting = phase == Phase::Cranking;
isCranking = phase == Phase::Cranking;
isIdleCoasting = phase == Phase::Coasting;
// if we're cranking, nothing more to do.
if (isCoasting) {
if (isCranking) {
return crankingValvePosition;
}
// If coasting (and enabled), use the coasting position table instead of normal open loop
// TODO: this should be a table of open loop mult vs. RPM, not vs. clt
useIacTableForCoasting = engineConfiguration->useIacTableForCoasting && phase == Phase::Coasting;
useIacTableForCoasting = engineConfiguration->useIacTableForCoasting && isIdleCoasting;
if (useIacTableForCoasting) {
return interpolate2d(clt, config->iacCoastingBins, config->iacCoasting);
}
@ -349,7 +351,6 @@ float IdleController::getIdlePosition() {
#if EFI_TUNER_STUDIO && (EFI_PROD_CODE || EFI_SIMULATOR)
engine->outputChannels.isIdleClosedLoop = phase == Phase::Idling;
engine->outputChannels.isIdleCoasting = phase == Phase::Coasting;
if (engineConfiguration->idleMode == IM_AUTO) {
// see also tsOutputChannels->idlePosition