idle_min through FSIO not working as intended #1553

making logging less confusing
This commit is contained in:
rusefi 2020-07-01 16:37:25 -04:00
parent 70d2e3c083
commit 14fc5a54df
3 changed files with 8 additions and 10 deletions

View File

@ -57,6 +57,8 @@ static Logging *logger;
EXTERN_ENGINE; EXTERN_ENGINE;
static bool prettyClose = false;
static bool shouldResetPid = false; static bool shouldResetPid = false;
// The idea of 'mightResetPid' is to reset PID only once - each time when TPS > idlePidDeactivationTpsThreshold. // The idea of 'mightResetPid' is to reset PID only once - each time when TPS > idlePidDeactivationTpsThreshold.
// The throttle pedal can be pressed for a long time, making the PID data obsolete (thus the reset is required). // The throttle pedal can be pressed for a long time, making the PID data obsolete (thus the reset is required).
@ -370,7 +372,8 @@ static percent_t automaticIdleController(float tpsPos DECLARE_ENGINE_PARAMETER_S
if (engineConfiguration->isVerboseIAC && engine->engineState.isAutomaticIdle) { if (engineConfiguration->isVerboseIAC && engine->engineState.isAutomaticIdle) {
// todo: print each bit using 'getIdle_state_e' method // todo: print each bit using 'getIdle_state_e' method
scheduleMsg(logger, "state %d", engine->engineState.idle.idleState); scheduleMsg(logger, "Idle state %d%s", engine->engineState.idle.idleState,
(prettyClose ? " pretty close" : ""));
idlePid.showPidStatus(logger, "idle"); idlePid.showPidStatus(logger, "idle");
} }
@ -483,14 +486,15 @@ static percent_t automaticIdleController(float tpsPos DECLARE_ENGINE_PARAMETER_S
} }
} }
prettyClose = absF(iacPosition - engine->engineState.idle.currentIdlePosition) < idlePositionSensitivityThreshold;
// The threshold is dependent on IAC type (see initIdleHardware()) // The threshold is dependent on IAC type (see initIdleHardware())
if (absF(iacPosition - engine->engineState.idle.currentIdlePosition) < idlePositionSensitivityThreshold) { if (prettyClose) {
engine->engineState.idle.idleState = (idle_state_e)(engine->engineState.idle.idleState | PWM_PRETTY_CLOSE); engine->engineState.idle.idleState = (idle_state_e)(engine->engineState.idle.idleState);
return; // value is pretty close, let's leave the poor valve alone return; // value is pretty close, let's leave the poor valve alone
} }
engine->engineState.idle.currentIdlePosition = iacPosition; engine->engineState.idle.currentIdlePosition = iacPosition;
engine->engineState.idle.idleState = (idle_state_e)(engine->engineState.idle.idleState | ADJUSTING); engine->engineState.idle.idleState = (idle_state_e)(engine->engineState.idle.idleState);
#if ! EFI_UNIT_TEST #if ! EFI_UNIT_TEST
applyIACposition(engine->engineState.idle.currentIdlePosition); applyIACposition(engine->engineState.idle.currentIdlePosition);
#endif /* EFI_UNIT_TEST */ #endif /* EFI_UNIT_TEST */

View File

@ -950,8 +950,6 @@ case IM_MANUAL:
} }
const char *getIdle_state_e(idle_state_e value){ const char *getIdle_state_e(idle_state_e value){
switch(value) { switch(value) {
case ADJUSTING:
return "ADJUSTING";
case BLIP: case BLIP:
return "BLIP"; return "BLIP";
case Force_4bytes_size_idle_state_e: case Force_4bytes_size_idle_state_e:
@ -962,8 +960,6 @@ case PID_UPPER:
return "PID_UPPER"; return "PID_UPPER";
case PID_VALUE: case PID_VALUE:
return "PID_VALUE"; return "PID_VALUE";
case PWM_PRETTY_CLOSE:
return "PWM_PRETTY_CLOSE";
case RPM_DEAD_ZONE: case RPM_DEAD_ZONE:
return "RPM_DEAD_ZONE"; return "RPM_DEAD_ZONE";
case TPS_THRESHOLD: case TPS_THRESHOLD:

View File

@ -916,9 +916,7 @@ typedef enum {
TPS_THRESHOLD = 1, TPS_THRESHOLD = 1,
RPM_DEAD_ZONE = 2, RPM_DEAD_ZONE = 2,
PID_VALUE = 4, PID_VALUE = 4,
PWM_PRETTY_CLOSE = 8,
PID_UPPER = 16, PID_UPPER = 16,
ADJUSTING = 32,
BLIP = 64, BLIP = 64,
/** /**
* Live Docs reads 4 byte value so we want 4 byte enum * Live Docs reads 4 byte value so we want 4 byte enum