From 52a1ac2b108112b4e17e936ecfd72a5a7f203b0e Mon Sep 17 00:00:00 2001 From: rusefi Date: Sun, 29 Jul 2018 16:36:18 -0400 Subject: [PATCH] better idle debug info --- firmware/controllers/engine_controller.cpp | 2 +- firmware/controllers/idle_thread.cpp | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/firmware/controllers/engine_controller.cpp b/firmware/controllers/engine_controller.cpp index 2597202933..1bf83275b1 100644 --- a/firmware/controllers/engine_controller.cpp +++ b/firmware/controllers/engine_controller.cpp @@ -733,5 +733,5 @@ int getRusEfiVersion(void) { if (initBootloader() != 0) return 123; #endif /* EFI_BOOTLOADER_INCLUDE_CODE */ - return 20180728; + return 20180729; } diff --git a/firmware/controllers/idle_thread.cpp b/firmware/controllers/idle_thread.cpp index 268ee29a02..474165b053 100644 --- a/firmware/controllers/idle_thread.cpp +++ b/firmware/controllers/idle_thread.cpp @@ -68,6 +68,7 @@ typedef enum { RPM_DEAD_ZONE = 2, PWM_PRETTY_CLOSE = 3, ADJUSTING = 4, + BLIP = 5, } idle_state_e; @@ -317,6 +318,7 @@ static msg_t ivThread(int param) { if (timeToStopBlip != 0) { iacPosition = blipIdlePosition; baseIdlePosition = iacPosition; + idleState = BLIP; } else if (!isRunning) { // during cranking it's always manual mode, PID would make no sence during cranking iacPosition = cltCorrection * engineConfiguration->crankingIACposition; @@ -346,11 +348,6 @@ static msg_t ivThread(int param) { engine->rpmCalculator.getRevolutionCounterSinceStart()); } - // The threshold is dependent on IAC type (see initIdleHardware()) - if (absF(iacPosition - currentIdlePosition) < idlePositionSensitivityThreshold) { - idleState = PWM_PRETTY_CLOSE; - continue; // value is pretty close, let's leave the poor valve alone - } if (engineConfiguration->debugMode == DBG_IDLE_CONTROL) { #if ! EFI_UNIT_TEST || defined(__DOXYGEN__) @@ -364,6 +361,12 @@ static msg_t ivThread(int param) { #endif } + // The threshold is dependent on IAC type (see initIdleHardware()) + if (absF(iacPosition - currentIdlePosition) < idlePositionSensitivityThreshold) { + idleState = PWM_PRETTY_CLOSE; + continue; // value is pretty close, let's leave the poor valve alone + } + currentIdlePosition = iacPosition; idleState = ADJUSTING; applyIACposition(currentIdlePosition);