Add ETB status gauges, fix gauge menus (#863)

* testing

* fix offsets

* consolidate ts config

* cleanup

* typo

* unwind some

* fix etb idle range setting

* unwind
This commit is contained in:
Matthew Kennedy 2019-06-26 16:24:32 -07:00 committed by rusefi
parent 264ef741c0
commit e3a14e5979
4 changed files with 74 additions and 63 deletions

View File

@ -173,7 +173,10 @@ typedef struct {
int16_t debugIntField4; // 292
int16_t debugIntField5; // 294
int16_t recentErrorCodes[8]; // 298
int unused3[11];
float etbTarget; // 312
float etb1DutyCycle; // 316
float etb1Error; // 320
int unused3[8];
/* see also [OutputChannels] in rusefi.input */
} TunerStudioOutputChannels;

View File

@ -253,6 +253,11 @@ private:
if (engineConfiguration->isVerboseETB) {
pid.showPidStatus(&logger, "ETB");
}
tsOutputChannels.etbTarget = targetPosition;
tsOutputChannels.etb1DutyCycle = currentEtbDuty;
// Error is positive if the throttle needs to open further
tsOutputChannels.etb1Error = targetPosition - actualThrottlePosition;
}
};

View File

@ -1060,7 +1060,7 @@ tChargeMode_e tChargeMode;
uint8_t[3] unusedSpiPadding8;
float etbIdleThrottleRange
float etbIdleThrottleRange; ETB idle authority; "%", 1, 0, 0, 15, 0
int[590] mainUnusedEnd;
@ -1192,7 +1192,7 @@ end_struct
#define GAUGE_NAME_INJECTOR_LAG "fuel: injector lag"
#define GAUGE_NAME_FUEL_TPS_ROC "fuel: TPS change"
#define GAUGE_NAME_FUEL_CHARGE_TEMP "fuel: charge T"
#define GAUGE_NAME_FUEL_CHARGE_TEMP "fuel: Estimated charge temperature"
#define GAUGE_NAME_FUEL_TPS_EXTRA "fuel: TPS acceleration extra fuel ms"
#define GAUGE_NAME_FUEL_EL_EXTRA "fuel: engine load acceleration extra fuel"
#define GAUGE_NAME_FUEL_CLT_CORR "fuel: CLT correction"
@ -1200,9 +1200,9 @@ end_struct
#define GAUGE_NAME_FUEL_VE "fuel: VE"
#define GAUGE_NAME_FUEL_CRANKING "fuel: cranking"
#define GAUGE_NAME_FUEL_RUNNING "fuel: running"
#define GAUGE_NAME_FUEL_LAST_INJECTION "fuel: last injection"
#define GAUGE_NAME_FUEL_LAST_INJECTION "fuel: Last injection"
#define GAUGE_NAME_FUEL_BASE "fuel: base"
#define GAUGE_NAME_FUEL_PID_CORR "fuel: short correction"
#define GAUGE_NAME_FUEL_PID_CORR "fuel: Short-term closed loop correction"
#define GAUGE_NAME_FUEL_WALL_AMOUNT "fuel: wall amount"
#define GAUGE_NAME_FUEL_WALL_CORRECTION "fuel: wall corr ms"

View File

@ -279,20 +279,23 @@ fileVersion = { 20171101 }
fuelPidCorrection = scalar, F32, 268, "ms", 1, 0
coilDutyCycle = scalar, F32, 272, "perc", 1, 0
accelerationX = scalar, S16, 276, "G", 0.01, 0
accelerationY = scalar, S16, 276, "G", 0.01, 0
accelerationY = scalar, S16, 278, "G", 0.01, 0
oilPressure = scalar, F32, 280, "kPa", 1, 0.0
fuelConsumptionPerHour=scalar, F32, 284, "kPa", 1, 0.0
injectionOffset = scalar, F32, 288, "deg", 1, 0;
debugIntField4 = scalar, S16, 292, "val", 1, 0.0;
debugIntField5 = scalar, S16, 294, "val", 1, 0.0;
recentErrorCode0 = scalar,U16, 298, "error", 1, 0
recentErrorCode1 = scalar,U16, 300, "error", 1, 0
recentErrorCode2 = scalar,U16, 302, "error", 1, 0
recentErrorCode3 = scalar,U16, 304, "error", 1, 0
recentErrorCode4 = scalar,U16, 306, "error", 1, 0
recentErrorCode5 = scalar,U16, 308, "error", 1, 0
recentErrorCode6 = scalar,U16, 310, "error", 1, 0
recentErrorCode7 = scalar,U16, 312, "error", 1, 0
recentErrorCode0 = scalar,U16, 296, "error", 1, 0
recentErrorCode1 = scalar,U16, 298, "error", 1, 0
recentErrorCode2 = scalar,U16, 300, "error", 1, 0
recentErrorCode3 = scalar,U16, 302, "error", 1, 0
recentErrorCode4 = scalar,U16, 304, "error", 1, 0
recentErrorCode5 = scalar,U16, 306, "error", 1, 0
recentErrorCode6 = scalar,U16, 308, "error", 1, 0
recentErrorCode7 = scalar,U16, 310, "error", 1, 0
etbTarget = scalar,F32, 312, "%", 1, 0
etb1DutyCycle = scalar,F32, 316, "%", 1, 0
etb1Error = scalar,F32, 320, "%", 1, 0
;
@ -747,9 +750,7 @@ fileVersion = { 20171101 }
[GaugeConfigurations]
; warmupEnrichGauge = warmupEnrich, "Warmup Enrichment", "%", 100, 150, -1, -1, 101, 105, 0, 0
; accelEnrichGauge = accDecEnrich, "Accel Enrich", "%", 50, 150, -1, -1, 999, 999, 0, 0
gaugeCategory = Sensors - Extra 2
egt1Gauge = egt1, "EGT#1", "C", 0, 2000
egt2Gauge = egt2, "EGT#2", "C", 0, 2000
egt3Gauge = egt3, "EGT#3", "C", 0, 2000
@ -759,19 +760,15 @@ fileVersion = { 20171101 }
egt7Gauge = egt7, "EGT#7", "C", 0, 2000
egt8Gauge = egt8, "EGT#8", "C", 0, 2000
rpmAccelerationGa = rpmAcceleration, "rpm delta", "dRpm", 0, 3, 0, 1, 3, 4, 1, 1
massAirFlowValueGa = massAirFlowValue,"Air Flow", "kg/hr", 0, 50, -999, -999, 999, 999, 1, 1
knockCountGauge = knockCount,"Knock count", "count", 0, 120, 10, 10, 100, 100, 1, 1
knockLevelGauge = knockLevel,"Knock level", "volts", 0, 7, 10, 10, 100, 100, 1, 2
fuelTankLevelGauge = fuelTankLevel,"Fuel", "x", 0, 7, 10, 10, 100, 100, 1, 2
fuelTankLevelGauge = fuelTankLevel,"Fuel level", "x", 0, 7, 10, 10, 100, 100, 1, 2
speedToRpmRatioGauge = speedToRpmRatio, "speed2rpm", "", 0, 100, 0, 0, 100, 100, 4, 4
gaugeCategory = Status
warningCounterGauge = warningCounter, "Counter", "", 0, 100, 0, 0, 100, 100, 0, 0
lastErrorCodeGauge = lastErrorCode, "Latest Error", "", 0, 18000, 0, 0, 18000, 18000, 0, 0
triggerErrorsCounterGauge = triggerErrorsCounter, "trg err", "count", 0, 15000, 0, 0, 6000, 6000, 0, 0
gaugeCategory = ECU Status
warningCounterGauge = warningCounter, "Warning count", "", 0, 100, 0, 0, 100, 100, 0, 0
lastErrorCodeGauge = lastErrorCode, "Last error", "", 0, 18000, 0, 0, 18000, 18000, 0, 0
triggerErrorsCounterGauge = triggerErrorsCounter, "Trigger error count", "count", 0, 15000, 0, 0, 6000, 6000, 0, 0
recentErrorCode0Gauge = recentErrorCode0, "Error#1", "", 0, 18000, 0, 0, 18000, 18000, 0, 0
recentErrorCode1Gauge = recentErrorCode1, "Error#2", "", 0, 18000, 0, 0, 18000, 18000, 0, 0
recentErrorCode2Gauge = recentErrorCode2, "Error#3", "", 0, 18000, 0, 0, 18000, 18000, 0, 0
@ -780,8 +777,9 @@ gaugeCategory = Status
recentErrorCode5Gauge = recentErrorCode5, "Error#6", "", 0, 18000, 0, 0, 18000, 18000, 0, 0
recentErrorCode6Gauge = recentErrorCode6, "Error#7", "", 0, 18000, 0, 0, 18000, 18000, 0, 0
recentErrorCode7Gauge = recentErrorCode7, "Error#8", "", 0, 18000, 0, 0, 18000, 18000, 0, 0
firmwareVersionGauge = firmwareVersion , "version", "%", 0, 100, 0, 0, 100, 100, 0, 0
firmwareVersionGauge = firmwareVersion , "ECU Software Version", "%", 0, 100, 0, 0, 100, 100, 0, 0
timeSecondsGauge = timeSeconds, "Uptime", "sec", 0, 100, 0, 0, 100, 100, 0, 0
gaugeCategory = Debug
debugFloatField1Gauge = debugFloatField1, @@GAUGE_NAME_DEBUG_F1@@, "%", 0, 100, 0, 0, 100, 100, 4, 4
debugFloatField2Gauge = debugFloatField2, @@GAUGE_NAME_DEBUG_F2@@, "%", -100, 100, 0, 0, 100, 100, 4, 4
@ -795,61 +793,58 @@ gaugeCategory = Debug
debugIntField3Gauge = debugIntField3, "debug i3", "%", 0, 100, 0, 0, 100, 100, 0, 0
debugIntField4Gauge = debugIntField4, "debug i4", "%", 0, 100, 0, 0, 100, 100, 0, 0
debugIntField5Gauge = debugIntField5, "debug i5", "%", 0, 100, 0, 0, 100, 100, 0, 0
timeSecondsGauge = timeSeconds, "Uptime", "sec", 0, 100, 0, 0, 100, 100, 0, 0
gaugeCategory = Sensors
RPMGauge = RPMValue, "Engine Speed", "RPM", 0, 15000, 200, 500, 6000, 6000, 0, 0
gaugeCategory = Sensors - Basic
RPMGauge = RPMValue, "RPM - engine speed", "RPM", 0, 15000, 200, 500, 6000, 6000, 0, 0
#if CELSIUS
CLTGauge = coolant, "Coolant Temp", "deg C", -40, 140, -15, 1, 95, 110, 1, 1
CLTGauge = coolant, "Coolant temp", "deg C", -40, 140, -15, 1, 95, 110, 1, 1
#else
CLTGauge = coolant, "Coolant Temp", "deg F", -40, 285, 5, 35, 205, 230, 1, 1
CLTGauge = coolant, "Coolant temp", "deg F", -40, 285, 5, 35, 205, 230, 1, 1
#endif
#if CELSIUS
IATGauge = intake, "Intake Air Temp", "deg C", -40, 140, -15, 1, 95, 110, 1, 1
IATGauge = intake, "Intake air temp", "deg C", -40, 140, -15, 1, 95, 110, 1, 1
#else
IATGauge = intake, "Intake Air Temp", "deg F", -40, 285, 5, 35, 205, 230, 1, 1
IATGauge = intake, "Intake air temp", "deg F", -40, 285, 5, 35, 205, 230, 1, 1
#endif
TPSGauge = TPSValue, "Throttle Position", "%", 0, 100, 0, 0, 100, 100, 2, 2
afr1Gauge = AFRValue, "Air:Fuel Ratio 1", "", 10, 19.4, 12, 13, 15, 16, 2, 2
MAFGauge = MAFValue, "Mass Air Flow", "v", 0, 5, 0, 1, 3, 4, 1, 1
VBattGauge = VBatt, "Battery Voltage", "V", 8, 21, 9, 10, 17, 19, 1, 1
afr1Gauge = AFRValue, "Air fuel ratio", "", 10, 19.4, 12, 13, 15, 16, 2, 2
MAFGauge = MAFValue, "Mass air flow", "v", 0, 5, 0, 1, 3, 4, 1, 1
VBattGauge = VBatt, "Battery voltage", "V", 8, 21, 9, 10, 17, 19, 1, 1
MAPGauge = MAPValue, "MAP", "kPa", 0, 300, 10, 10, 200, 200, 0, 0
tpsADCGauge = tpsADC1, "tps1 ADC", "ADC", 0, 1024, 0, 0, 0, 0, 0, 0
massAirFlowValueGa = massAirFlowValue,"Mass air flow", "kg/hr", 0, 50, -999, -999, 999, 999, 1, 1
gaugeCategory = Sensors2
VSSGauge = vehicleSpeedKph, "Speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1
pedalPositionGauge = pedalPosition,"Throttle Pedal Position", "%", 0, 120, 10, 10, 100, 100, 1, 1
gaugeCategory = Sensors - Extra 1
VSSGauge = vehicleSpeedKph, "Vehicle speed", "kmh", 0, 200, 0, 1, 3, 4, 1, 1
accelerationXGauge = accelerationX, @@GAUGE_NAME_ACCEL_X@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
accelerationYGauge = accelerationY, @@GAUGE_NAME_ACCEL_Y@@, "acc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
atmPresCGauge = baroPressure, "Baro", "kPa", 0, 1024, 0, 0, 0, 0, 0, 0
atmPresCGauge = baroPressure, "Barometric pressure", "kPa", 0, 1024, 0, 0, 0, 0, 0, 0
vvtPositionGauge = vvtPosition, "VVT position", "deg", 0, 100, 0, 0, 720, 720, 0, 0
internalMcuTemperatureGauge = internalMcuTemperature, @@GAUGE_NAME_ECU_TEMPERATURE@@, "C", 0, 100, 0, 0, 100, 100, 0, 0
internalMcuTemperatureGauge = internalMcuTemperature, @@GAUGE_NAME_ECU_TEMPERATURE@@, "C", 0, 100, 0, 0, 75, 100, 0, 0
OilPressGauge = oilPressure, "Oil Pressure", "kPa", 0, 750, 35, 75, 550, 700, 0, 0
fuelConsumptionPerHourGauge=fuelConsumptionPerHour, "f","kPa", 0, 750, 35, 75, 550, 700, 0, 0
idleAirValvePositionGauge = idleAirValvePosition, "idle position", "%", 0, 100, 0, 0, 100, 100, 1, 1
idleAirValvePositionGauge = idleAirValvePosition, "Idle position", "%", 0, 100, 0, 0, 100, 100, 1, 1
gaugeCategory = Spark Data
ignadvGauge = ignitionAdvance, "Ignition Advance 1", "degrees", -100, 100, -999, -999, 999, 999, 1, 1
gaugeCategory = Ignition
ignadvGauge = ignitionAdvance, "Ignition timing", "degrees", -100, 100, -999, -999, 999, 999, 1, 1
dwellGauge = sparkDwellValue, "Dwell", "mSec", 0, 10, 0.5, 1.0, 6.0, 8.0, 1, 1
coilDutyCycleGauge = coilDutyCycle, @@GAUGE_NAME_DWELL_DUTY@@, "perc", -11, 11, 1.0, 1.2, 100, 100, 3, 1
gaugeCategory = Accel Data
engineLoadDeltaGauge = engineLoadDelta,"fuel: load change","value", 0, 120, 10, 10, 100, 100, 1, 1
engineLoadAccelExtraGauge = engineLoadAccelExtra,"fuel: load extra","value", 0, 120, 10, 10, 100, 100, 1, 1
deltaTpsGauge = deltaTps, "fuel: TPS change", "", 0, 120, 10, 10, 100, 100, 1, 1
tpsAccelFuelGauge = tpsAccelFuel,"fuel: TPS enrich", "ms", 0, 120, 10, 10, 100, 100, 1, 1
wallFuelAmountGauge = wallFuelAmount, "fuel: wall amount", "ms", 0, 100, 0, 0, 100, 100, 0, 0
wallFuelCorrectionGauge = wallFuelCorrection, "fuel: wall correction extra", "ms", 0, 100, 0, 0, 100, 100, 0, 0
gaugeCategory = Acceleration Enrichment
engineLoadDeltaGauge = engineLoadDelta,"AE: load change","value", 0, 120, 10, 10, 100, 100, 1, 1
engineLoadAccelExtraGauge = engineLoadAccelExtra,"AE: load extra","value", 0, 120, 10, 10, 100, 100, 1, 1
deltaTpsGauge = deltaTps, "AE: TPS change", "", 0, 120, 10, 10, 100, 100, 1, 1
tpsAccelFuelGauge = tpsAccelFuel,"AE: TPS enrich", "ms", 0, 120, 10, 10, 100, 100, 1, 1
wallFuelAmountGauge = wallFuelAmount, "AE: wall amount", "ms", 0, 100, 0, 0, 100, 100, 0, 0
wallFuelCorrectionGauge = wallFuelCorrection, "AE: wall correction extra", "ms", 0, 100, 0, 0, 100, 100, 0, 0
gaugeCategory = Fuel Data
gaugeCategory = Fueling
;Name Var Title Units Lo Hi LoD LoW HiW HiD vd ld
#if CELSIUS
tChargeGauge = tCharge, @@GAUGE_NAME_FUEL_CHARGE_TEMP@@, "deg C", -40, 140, -15, 1, 95, 110, 1, 1
#else
tChargeGauge = tCharge, @@GAUGE_NAME_FUEL_CHARGE_TEMP@@, "deg F", -40, 285, 5, 35, 205, 230, 1, 1
#endif
baroCorrectionGauge = baroCorrection,"BaroCorr", "ratio", 0.5, 1.5, 0.6, 0.7, 1.3, 1.4, 1, 1
baroCorrectionGauge = baroCorrection,"Fuel: Barometric pressure correction", "ratio", 0.5, 1.5, 0.6, 0.7, 1.3, 1.4, 1, 1
crankingFuelGauge = crankingFuelMs, @@GAUGE_NAME_FUEL_CRANKING@@, "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
iatCorrectionGauge = iatCorrection, @@GAUGE_NAME_FUEL_IAT_CORR@@, "mult", 0, 3, 0, 0, 3, 3, 2, 2
cltCorrectionGauge = cltCorrection, @@GAUGE_NAME_FUEL_CLT_CORR@@, "mult", 0, 3, 0, 0, 3, 3, 2, 2
@ -861,7 +856,16 @@ gaugeCategory = Fuel Data
fuelRunningGauge = fuelRunning, @@GAUGE_NAME_FUEL_RUNNING@@, "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
baseFuelGauge = baseFuel, @@GAUGE_NAME_FUEL_BASE@@, "mSec", 0, 25.5, 1.0, 1.2, 20, 25, 3, 1
fuelPidCorrectionGauge = fuelPidCorrection, @@GAUGE_NAME_FUEL_PID_CORR@@, "mSec", -11, 11, 1.0, 1.2, 20, 25, 3, 1
gaugeCategory = Throttle Body (incl. ETB)
pedalPositionGauge = pedalPosition, "Throttle pedal position", "%", 0, 120, 0, 0, 100, 100, 1, 1
tpsADCGauge = tpsADC1, "tps1 ADC", "ADC", 0, 1024, 0, 0, 0, 0, 0, 0
TPSGauge = TPSValue, "Throttle position", "%", 0, 100, 0, 0, 100, 100, 1, 1
etbTargetGauge = etbTarget, "ETB position target", "%", 0, 100, 0, 0, 100, 100, 1, 1
etbErrorGauge = etb1Error, "ETB position error", "%", -20, 20, -10, -5, 5, 10, 2, 0
etbDutyCycleGauge = etb1DutyCycle, "ETB duty cycle", "%", -100, 100, -75, -50, 50, 75, 0, 0
[WueAnalyze]
@ -1551,6 +1555,8 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
dialog = pedalSensor, "Accelerator pedal"
field = "Accelerator position sensor", throttlePedalPositionAdcChannel
field = "Up voltage", throttlePedalUpVoltage
field = "Down (WOT) voltage", throttlePedalWOTVoltage
; Sensor Inputs
dialog = otherSensorInputs, "Other Sensor Inputs"
@ -2453,14 +2459,11 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
field = "No2 Direction #2", etb2_directionPin2, {throttlePedalPositionAdcChannel != 16}
field = "Two-wire mode", etb2_use_two_wires, {throttlePedalPositionAdcChannel != 16}
field = "No2 Control #1", etb2_controlPin1, {throttlePedalPositionAdcChannel != 16 && etb2_use_two_wires == 0}
field = "etbDeadband", etbDeadband, {throttlePedalPositionAdcChannel != 16}
panel = etbPidDialog
dialog = etbDialogRight
field = "!https://rusefi.com/s/debugmode"
field = "Debug mode", debugMode
field = "TPS1", tpsADC
field = "Pedal", throttlePedalPositionAdcChannel
field = "use ETB for idle", useETBforIdleControl
field = "ETB idle maximum angle", etbIdleRange
field = "Press buttons to calibrate sensors"