From effdbce4ca9d3386acd276d28473869d72746728 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 4 May 2023 16:35:17 -0400 Subject: [PATCH] apparently we duplicated idle position, field renaming #98 (cherry picked from commit 304458961315f3f2dbf4cb93c15e6e73d0017d0e) --- firmware/console/binary/output_channels.txt | 18 +++++++---------- firmware/console/status_loop.cpp | 4 ---- .../controllers/actuators/idle_thread.cpp | 20 +++++++++---------- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/firmware/console/binary/output_channels.txt b/firmware/console/binary/output_channels.txt index 1986c75c43..09d1717bc6 100644 --- a/firmware/console/binary/output_channels.txt +++ b/firmware/console/binary/output_channels.txt @@ -22,12 +22,10 @@ bit sd_msd bit isFan2On bit unusedBitLAtwfs; bit toothLogReady; -bit unused3123 bit isTpsError; bit isCltError; bit isMapError; bit isIatError; -bit unused131313; bit isTriggerError; bit hasCriticalError; bit isWarnNow; @@ -40,7 +38,7 @@ bit isIdleClosedLoop; uint16_t RPMValue;@@GAUGE_NAME_RPM@@;"RPM",1, 0, 0, 8000, 0 -uint16_t rpmAcceleration;dRPM;"RPM/s",1, 0, 0, 5, 2 +uint16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2 uint16_t autoscale speedToRpmRatio;@@GAUGE_NAME_GEAR_RATIO@@;"value",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 2 uint8_t unusedVehicleSpeedKph;@@GAUGE_NAME_VVS@@;"kph",1, 0, 0, 0, 1 @@ -63,7 +61,7 @@ uint16_t rpmAcceleration;dRPM;"RPM/s",1, 0, 0, 5, 2 uint16_t autoscale baroPressure;;"kPa",{1/@@PACK_MULT_PRESSURE@@}, 0, 0, 0, 1 uint16_t autoscale lambdaValue;@@GAUGE_NAME_LAMBDA@@;"",{1/@@PACK_MULT_LAMBDA@@}, 0, 0, 0, 3 - uint8_t autoscale idleCurrentPosition;;"%", 0.5, 0, 0, 100, 1 + uint8_t autoscale knockRetard;@@GAUGE_NAME_KNOCK_RETARD@@;"deg",{1/10}, 0, 0, 0, 1 uint16_t autoscale VBatt;@@GAUGE_NAME_VBAT@@;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 0, 2 @@ -253,20 +251,18 @@ int8_t[4] unusedPadding uint16_t autoscale mafEstimate;@@GAUGE_NAME_AIR_FLOW_ESTIMATE@@;"kg/h",{1/@@PACK_MULT_MASS_FLOW@@}, 0, 0, 0, 0 uint16_t instantRpm;sync: instant RPM;"rpm", 1, 0, 0, 0, 0 - - uint16_t systemEventReuse;;"counter", 1, 0, 0, 0, 0 uint16_t autoscale rawMap;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 5, 3 uint16_t autoscale rawAfr;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 5, 3 - uint8_t tpsAccelFrom;;"%", 1, 0, 0, 100, 0 - uint8_t tpsAccelTo;;"%", 1, 0, 0, 100, 0 + uint8_t tpsAccelFrom;Fuel: TPS AE From;"%", 1, 0, 0, 100, 0 + uint8_t tpsAccelTo;Fuel: TPS AE To;"%", 1, 0, 0, 100, 0 float calibrationValue2;;"", 1, 0, 0, 0, 0 bit isMainRelayOn; bit isUsbConnected;isUsbConnected\nOriginal reason for this is to check if USB is connected from Lua - uint32_t luaInvocationCounter;;"count",1, 0, 0, 0, 0 - uint32_t luaLastCycleDuration;;"nt",1, 0, 0, 0, 0 + uint32_t luaInvocationCounter;Lua: Tick counter;"count",1, 0, 0, 0, 0 + uint32_t luaLastCycleDuration;Lua: Last tick duration;"nt",1, 0, 0, 0, 0 uint8_t testBenchIter;;"count",1, 0, 0, 0, 0 uint8_t tcu_currentRange;"Current Range";"", 1, 0, 0, 0, 0 @@ -377,7 +373,7 @@ bit vvtChannel4 uint32_t outputRequestPeriod float mapFast - float[LUA_GAUGE_COUNT iterate] luaGauges;;"value",1, 0, 0, 50000, 3 + float[LUA_GAUGE_COUNT iterate] luaGauges;Lua: Gauge;"value",1, 0, 0, 50000, 3 uint16_t autoscale rawMaf2;;"V",{1/@@PACK_MULT_VOLTAGE@@}, 0, 0, 5, 3 uint16_t autoscale mafMeasured2;@@GAUGE_NAME_AIR_FLOW_MEASURED_2@@;"kg/h",{1/@@PACK_MULT_MASS_FLOW@@}, 0, 0, 0, 1 diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index d63e0dc299..d77bf05cae 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -712,10 +712,6 @@ DcHardware *getdcHardware(); tsOutputChannels->egt[i] = getMax31855EgtValue(i); #endif /* EFI_MAX_31855 */ -#if EFI_IDLE_CONTROL - tsOutputChannels->idleAirValvePosition = getIdlePosition(); -#endif - tsOutputChannels->warningCounter = engine->engineState.warnings.warningCounter; tsOutputChannels->lastErrorCode = static_cast(engine->engineState.warnings.lastErrorCode); for (int i = 0; i < 8;i++) { diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index d79eaac205..3bcd55a430 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -332,12 +332,12 @@ float IdleController::getIdlePosition(float rpm) { iacPosition = engine->blipIdlePosition; idleState = BLIP; } else { - // Always apply closed loop correction + // Always apply open loop correction iacPosition = getOpenLoop(phase, rpm, clt, tps, crankingTaper); baseIdlePosition = iacPosition; useClosedLoop = tps.Valid && engineConfiguration->idleMode == IM_AUTO; - // If TPS is working and automatic mode enabled, add any automatic correction + // If TPS is working and automatic mode enabled, add any closed loop correction if (useClosedLoop) { iacPosition += getClosedLoop(phase, tps.Value, rpm, targetRpm); } @@ -348,14 +348,14 @@ float IdleController::getIdlePosition(float rpm) { #if EFI_TUNER_STUDIO && (EFI_PROD_CODE || EFI_SIMULATOR) engine->outputChannels.isIdleClosedLoop = phase == Phase::Idling; - if (engineConfiguration->idleMode == IM_AUTO) { - // see also tsOutputChannels->idlePosition - getIdlePid()->postState(engine->outputChannels.idleStatus); - } else { - engine->outputChannels.idleCurrentPosition = iacPosition; - extern StepperMotor iacMotor; - engine->outputChannels.idleTargetPosition = iacMotor.getTargetPosition(); - } + if (engineConfiguration->idleMode == IM_AUTO) { + // see also tsOutputChannels->idlePosition + getIdlePid()->postState(engine->outputChannels.idleStatus); + } + + engine->outputChannels.idleAirValvePosition = iacPosition; + extern StepperMotor iacMotor; + engine->outputChannels.idleTargetPosition = iacMotor.getTargetPosition(); #endif /* EFI_TUNER_STUDIO */ currentIdlePosition = iacPosition;