From 0c6062be45bf80b61cbb7ede427f0080d23993e5 Mon Sep 17 00:00:00 2001 From: Andrey Date: Wed, 12 Apr 2023 15:24:23 -0400 Subject: [PATCH] We need to reshuffle timing calculation a bit, add one more gauge #5235 --- firmware/console/binary/output_channels.txt | 2 +- firmware/controllers/algo/ignition_state.txt | 3 +++ firmware/integration/rusefi_config.txt | 1 + firmware/tunerstudio/rusefi.input | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/firmware/console/binary/output_channels.txt b/firmware/console/binary/output_channels.txt index 1faf57e41c..15f4c2a962 100644 --- a/firmware/console/binary/output_channels.txt +++ b/firmware/console/binary/output_channels.txt @@ -101,7 +101,7 @@ uint16_t rpmAcceleration;dRPM;"RPM/s",1, 0, 0, 5, 2 uint16_t canReadCounter;;"",1, 0, 0, 0, 0 int16_t autoscale tpsAccelFuel;@@GAUGE_NAME_FUEL_TPS_EXTRA@@;"ms",{1/@@PACK_MULT_MS@@}, 0, 0, 0, 3 ! Ignition - int16_t autoscale ignitionAdvance;@@GAUGE_NAME_TIMING_ADVANCE@@;"deg",{1/@@PACK_MULT_ANGLE@@}, 0, 0, 0, 1 + int16_t autoscale ignitionAdvance;ignitionAdvance;"deg",{1/@@PACK_MULT_ANGLE@@}, 0, 0, 0, 1 uint16_t unusedDwellWasHere uint16_t autoscale coilDutyCycle;@@GAUGE_NAME_DWELL_DUTY@@;"%",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 0 diff --git a/firmware/controllers/algo/ignition_state.txt b/firmware/controllers/algo/ignition_state.txt index 19a783ee6f..00102a2850 100644 --- a/firmware/controllers/algo/ignition_state.txt +++ b/firmware/controllers/algo/ignition_state.txt @@ -10,6 +10,9 @@ struct_no_prefix ignition_state_s int16_t autoscale timingIatCorrection;"Ignition: IAT correction";"deg",{1/@@PACK_MULT_PERCENT@@},0, -20,20, 2,@@GAUGE_CATEGORY_TIMING@@ int16_t autoscale timingPidCorrection;"Ignition: PID correction";"deg",{1/@@PACK_MULT_PERCENT@@},0, -20,20, 2,@@GAUGE_CATEGORY_TIMING@@ + int16_t autoscale baseIgnitionAdvance;@@GAUGE_NAME_TIMING_ADVANCE@@;"deg",{1/@@PACK_MULT_ANGLE@@}, 0, 0, 0, 1 + int16_t autoscale correctedIgnitionAdvance;@@GAUGE_NAME_ADJUSTED_TIMING@@;"deg",{1/@@PACK_MULT_ANGLE@@}, 0, 0, 0, 1 + float dwellVoltageCorrection;"Ignition: dwell corr" float luaTimingAdd;"Ignition: Lua add";"deg",1, 0, -20, 20, 2, @@GAUGE_CATEGORY_TIMING@@ diff --git a/firmware/integration/rusefi_config.txt b/firmware/integration/rusefi_config.txt index 6184789e30..1f79563f8b 100644 --- a/firmware/integration/rusefi_config.txt +++ b/firmware/integration/rusefi_config.txt @@ -1866,6 +1866,7 @@ end_struct #define GAUGE_NAME_TC_RATIO "Torque Converter Ratio" #define GAUGE_NAME_TIMING_ADVANCE "Timing: base ignition" +#define GAUGE_NAME_ADJUSTED_TIMING "Timing: ignition" #define GAUGE_NAME_VVS "Vehicle Speed" #define GAUGE_NAME_GEAR_RATIO "Gearbox Ratio" #define GAUGE_NAME_DETECTED_GEAR "Detected Gear" diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index b67ed659c5..800d794aa3 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -1352,7 +1352,8 @@ gaugeCategory = VVT gaugeCategory = Ignition sparkCutReasonGauge = sparkCutReason,"Spark Cut Code", "code", 0.0,0.0, 0.0,0.0, 0.0,0.0, 0,0 - ignadvGauge = ignitionAdvance, @@GAUGE_NAME_TIMING_ADVANCE@@, "degrees", -100, 100, -999, -999, 999, 999, 1, 1 + baseIgnAdvGauge = baseIgnitionAdvance, @@GAUGE_NAME_TIMING_ADVANCE@@, "degrees", -100, 100, -999, -999, 999, 999, 1, 1 + ignadvGauge = correctedIgnitionAdvance, @@GAUGE_NAME_TIMING_ADVANCE@@, "degrees", -100, 100, -999, -999, 999, 999, 1, 1 dwellGauge = sparkDwell, "Dwell", "mSec", 0, 10, 0.5, 1.0, 6.0, 8.0, 1, 1 coilDutyCycleGauge = coilDutyCycle, @@GAUGE_NAME_DWELL_DUTY@@, "%", 0, 110, 0, 0, 90, 100, 1, 1 ignitionLoadGauge = ignitionLoad, @@GAUGE_NAME_IGNITION_LOAD@@, "%", 0, 300, 0, 0, 300, 300, 1, 1