diff --git a/firmware/controllers/actuators/vvt.cpp b/firmware/controllers/actuators/vvt.cpp index a0bf5f7a19..7d5f3c96ea 100644 --- a/firmware/controllers/actuators/vvt.cpp +++ b/firmware/controllers/actuators/vvt.cpp @@ -90,12 +90,7 @@ expected VvtController::getClosedLoop(angle_t target, angle_t observa } #if EFI_TUNER_STUDIO - static constexpr const debug_mode_e debugModeByIndex[4] = {DBG_VVT_1_PID, DBG_VVT_2_PID, DBG_VVT_3_PID, DBG_VVT_4_PID}; - - if (engineConfiguration->debugMode == debugModeByIndex[index]) { - m_pid.postState(&engine->outputChannels); - engine->outputChannels.debugIntField3 = (int)(10 * target); - } + m_pid.postState(engine->outputChannels.vvtStatus[index]); #endif /* EFI_TUNER_STUDIO */ // User labels say "advance" and "retard" diff --git a/firmware/controllers/algo/auto_generated_enginetypes.cpp b/firmware/controllers/algo/auto_generated_enginetypes.cpp index 1f5de641c5..d904d8b50f 100644 --- a/firmware/controllers/algo/auto_generated_enginetypes.cpp +++ b/firmware/controllers/algo/auto_generated_enginetypes.cpp @@ -136,14 +136,8 @@ case DBG_UNUSED41: return "DBG_UNUSED41"; case DBG_UNUSED_42: return "DBG_UNUSED_42"; -case DBG_VVT_1_PID: - return "DBG_VVT_1_PID"; -case DBG_VVT_2_PID: - return "DBG_VVT_2_PID"; -case DBG_VVT_3_PID: - return "DBG_VVT_3_PID"; -case DBG_VVT_4_PID: - return "DBG_VVT_4_PID"; +case DBG_7: + return "DBG_7"; case UNUSED23: return "UNUSED23"; } diff --git a/firmware/controllers/algo/engine_types.h b/firmware/controllers/algo/engine_types.h index a66bf7821c..e797d22728 100644 --- a/firmware/controllers/algo/engine_types.h +++ b/firmware/controllers/algo/engine_types.h @@ -243,7 +243,7 @@ typedef enum __attribute__ ((__packed__)) { DBG_EL_ACCEL = 4, DBG_TRIGGER_COUNTERS = 5, DBG_SOFT_SPARK_CUT = 6, - DBG_VVT_1_PID = 7, + DBG_7 = 7, DBG_8 = 8, DBG_9 = 9, DBG_10 = 10, @@ -299,9 +299,6 @@ typedef enum __attribute__ ((__packed__)) { DBG_46 = 46, DBG_TCU = 47, DBG_LUA = 48, - DBG_VVT_2_PID = 49, - DBG_VVT_3_PID = 50, - DBG_VVT_4_PID = 51, } debug_mode_e; diff --git a/firmware/hw_layer/sensors/cj125.cpp b/firmware/hw_layer/sensors/cj125.cpp index ec3d69826b..9efa07a3de 100644 --- a/firmware/hw_layer/sensors/cj125.cpp +++ b/firmware/hw_layer/sensors/cj125.cpp @@ -298,9 +298,7 @@ void CJ125::calibrate() { cjPrintData(); #if EFI_TUNER_STUDIO - if (engineConfiguration->debugMode == DBG_CJ125) { - cjPostState(&engine->outputChannels); - } + // todo: reimplement as explicit CJ PID status if desired cjPostState(&engine->outputChannels); #endif /* EFI_TUNER_STUDIO */ vUaCal += vUa; diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index a5bacb4a9a..a1023fe3fe 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -302,7 +302,7 @@ float baseFuel;+Base mass of the per-cylinder fuel injected during cranking. Thi int16_t rpm;+This sets the RPM limit below which the ECU will use cranking fuel and ignition logic, typically this is around 350-450rpm. \nset cranking_rpm X;"RPM", 1, 0, 0, 3000, 0 end_struct -#define debug_mode_e_enum "INVALID", "TPS acceleration enrichment", "INVALID", "Stepper Idle Control", "Engine Load accl enrich", "Trigger Counters", "Soft Spark Cut", "VVT1 PID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "SD card", "sr5", "Knock", "INVALID", "Electronic Throttle", "Executor", "Bench Test / TS commands", "INVALID", "Analog inputs #1", "INSTANT_RPM", "INVALID", "Status", "CJ125", "INVALID", "MAP", "Metrics", "INVALID", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "INVALID", "INVALID", "Boost Control", "INVALID", "INVALID", "ETB Autotune", "Composite Log", "INVALID", "INVALID", "INVALID", "Dyno_View", "Logic_Analyzer", "INVALID", "TCU", "Lua", "VVT2 PID", "VVT3 PID", "VVT4 PID", "mode 52", "mode 53" +#define debug_mode_e_enum "INVALID", "TPS acceleration enrichment", "INVALID", "Stepper Idle Control", "Engine Load accl enrich", "Trigger Counters", "Soft Spark Cut", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "SD card", "sr5", "Knock", "INVALID", "Electronic Throttle", "Executor", "Bench Test / TS commands", "INVALID", "Analog inputs #1", "INSTANT_RPM", "INVALID", "Status", "CJ125", "INVALID", "MAP", "Metrics", "INVALID", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "INVALID", "INVALID", "Boost Control", "INVALID", "INVALID", "ETB Autotune", "Composite Log", "INVALID", "INVALID", "INVALID", "Dyno_View", "Logic_Analyzer", "INVALID", "TCU", "Lua" custom debug_mode_e 1 bits, U08, @OFFSET@, [0:5], @@debug_mode_e_enum@@ #define VM_VVT_INACTIVE 0 diff --git a/firmware/util/math/efi_pid.cpp b/firmware/util/math/efi_pid.cpp index fe1f0f40b5..cbbb501fb4 100644 --- a/firmware/util/math/efi_pid.cpp +++ b/firmware/util/math/efi_pid.cpp @@ -131,9 +131,6 @@ void Pid::setErrorAmplification(float coef) { } #if EFI_TUNER_STUDIO -void Pid::postState(TunerStudioOutputChannels *tsOutputChannels) const { - postState(tsOutputChannels, 1); -} void Pid::postState(pid_status_s& pidStatus) const { pidStatus.output = output; @@ -142,24 +139,6 @@ void Pid::postState(pid_status_s& pidStatus) const { pidStatus.iTerm = iTerm; pidStatus.dTerm = dTerm; } - -/** - * see https://rusefi.com/wiki/index.php?title=Manual:Debug_fields - */ -void Pid::postState(TunerStudioOutputChannels *tsOutputChannels, int pMult) const { - tsOutputChannels->debugFloatField1 = output; - tsOutputChannels->debugFloatField2 = iTerm; - tsOutputChannels->debugFloatField3 = getPrevError(); - tsOutputChannels->debugFloatField4 = getI(); - tsOutputChannels->debugFloatField5 = getD(); - tsOutputChannels->debugFloatField6 = dTerm; -// tsOutputChannels->debugFloatField6 = parameters->minValue; - tsOutputChannels->debugFloatField7 = parameters->maxValue; - tsOutputChannels->debugIntField1 = getP() * pMult; - tsOutputChannels->debugIntField2 = getOffset(); - tsOutputChannels->debugIntField3 = resetCounter; - tsOutputChannels->debugIntField4 = parameters->periodMs; -} #endif /* EFI_TUNER_STUDIO */ void Pid::sleep() { diff --git a/firmware/util/math/efi_pid.h b/firmware/util/math/efi_pid.h index 16df09fd11..dc24365f18 100644 --- a/firmware/util/math/efi_pid.h +++ b/firmware/util/math/efi_pid.h @@ -59,8 +59,6 @@ public: void setErrorAmplification(float coef); #if EFI_TUNER_STUDIO void postState(pid_status_s& pidStatus) const; - void postState(TunerStudioOutputChannels *tsOutputChannels) const; - void postState(TunerStudioOutputChannels *tsOutputChannels, int pMult) const; #endif /* EFI_TUNER_STUDIO */ void showPidStatus(const char* msg) const; void sleep();