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 bd0646ef75
commit 33eb2eab62
4 changed files with 8 additions and 14 deletions

View File

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

View File

@ -57,6 +57,8 @@ static Logging *logger;
EXTERN_ENGINE;
static bool prettyClose = false;
static bool shouldResetPid = false;
// 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).
@ -370,7 +372,8 @@ static percent_t automaticIdleController(float tpsPos DECLARE_ENGINE_PARAMETER_S
if (engineConfiguration->isVerboseIAC && engine->engineState.isAutomaticIdle) {
// 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");
}
@ -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())
if (absF(iacPosition - engine->engineState.idle.currentIdlePosition) < idlePositionSensitivityThreshold) {
engine->engineState.idle.idleState = (idle_state_e)(engine->engineState.idle.idleState | PWM_PRETTY_CLOSE);
if (prettyClose) {
engine->engineState.idle.idleState = (idle_state_e)(engine->engineState.idle.idleState);
return; // value is pretty close, let's leave the poor valve alone
}
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
applyIACposition(engine->engineState.idle.currentIdlePosition);
#endif /* EFI_UNIT_TEST */

View File

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

View File

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