Dedicated sensors for wastegate + idle position (#1805)
* config * add sensor * listen to new adc channels * fix * add gauges to TS * add gauge values * TS UI
This commit is contained in:
parent
6c88cbe533
commit
3d6a6398ac
|
@ -239,11 +239,18 @@ typedef struct {
|
|||
|
||||
scaled_voltage rawPpsSecondary; // 248
|
||||
|
||||
int8_t knockLevels[12];
|
||||
int8_t knockLevels[12]; // 250
|
||||
|
||||
int8_t tcuDesiredGear; // 262
|
||||
int8_t padding2[1]; // 263
|
||||
|
||||
uint8_t unusedAtTheEnd[22]; // we have some unused bytes to allow compatible TS changes
|
||||
scaled_voltage rawIdlePositionSensor; // 264
|
||||
scaled_voltage rawWastegatePositionSensor; // 266
|
||||
|
||||
scaled_percent wastegatePosition; // 268
|
||||
scaled_percent idlePositionSensor; // 270
|
||||
|
||||
uint8_t unusedAtTheEnd[16]; // we have some unused bytes to allow compatible TS changes
|
||||
|
||||
// Temporary - will remove soon
|
||||
TsDebugChannels* getDebugChannels() {
|
||||
|
|
|
@ -660,6 +660,12 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->idlePosition = getIdlePosition();
|
||||
#endif
|
||||
|
||||
tsOutputChannels->idlePositionSensor = Sensor::get(SensorType::IdlePosition).value_or(0);
|
||||
tsOutputChannels->rawIdlePositionSensor = Sensor::getRaw(SensorType::IdlePosition);
|
||||
|
||||
tsOutputChannels->wastegatePosition = Sensor::get(SensorType::WastegatePosition).value_or(0);
|
||||
tsOutputChannels->rawWastegatePositionSensor = Sensor::getRaw(SensorType::WastegatePosition);
|
||||
|
||||
#if EFI_PROD_CODE
|
||||
tsOutputChannels->isTriggerError = isTriggerErrorNow();
|
||||
|
||||
|
|
|
@ -76,6 +76,9 @@ static const char* s_sensorNames[] = {
|
|||
"Aux Temp 2",
|
||||
|
||||
"Lambda",
|
||||
|
||||
"Wastegate Position",
|
||||
"Idle Valve Position",
|
||||
};
|
||||
|
||||
static_assert(efi::size(s_sensorNames) == efi::size(s_sensorRegistry));
|
||||
|
|
|
@ -50,6 +50,9 @@ enum class SensorType : unsigned char {
|
|||
|
||||
Lambda,
|
||||
|
||||
WastegatePosition,
|
||||
IdlePosition,
|
||||
|
||||
// Leave me at the end!
|
||||
PlaceholderLast
|
||||
};
|
||||
|
|
|
@ -8,11 +8,10 @@
|
|||
* At the moment rusEfi does not allow to have more than 16 ADC channels combined. At the moment there is no flexibility to use
|
||||
* any ADC pins, only the hardcoded choice of 16 pins.
|
||||
*
|
||||
* Slow ADC group is used for IAT, CLT, AFR, VBATT etc - this one is currently sampled at 20Hz
|
||||
* Slow ADC group is used for IAT, CLT, AFR, VBATT etc - this one is currently sampled at 500Hz
|
||||
*
|
||||
* Fast ADC group is used for TPS, MAP, MAF HIP - this one is currently sampled at 10KHz
|
||||
* Fast ADC group is used for MAP, MAF HIP - this one is currently sampled at 10KHz
|
||||
* We need frequent MAP for map_averaging.cpp
|
||||
* We need frequent TPS for better TPS/TPS enrichment and better ETB control
|
||||
*
|
||||
* 10KHz equals one measurement every 3.6 degrees at 6000 RPM
|
||||
*
|
||||
|
@ -544,6 +543,9 @@ static void configureInputs(void) {
|
|||
addChannel("TPS 2 Primary", engineConfiguration->tps2_1AdcChannel, ADC_SLOW);
|
||||
addChannel("TPS 2 Secondary", engineConfiguration->tps2_2AdcChannel, ADC_SLOW);
|
||||
|
||||
addChannel("Wastegate Position", engineConfiguration->wastegatePositionSensor, ADC_SLOW);
|
||||
addChannel("Idle Position Sensor", engineConfiguration->idlePositionSensor, ADC_SLOW);
|
||||
|
||||
addChannel("Fuel Level", engineConfiguration->fuelLevelSensor, ADC_SLOW);
|
||||
addChannel("Acc Pedal1", engineConfiguration->throttlePedalPositionAdcChannel, ADC_SLOW);
|
||||
addChannel("Acc Pedal2", engineConfiguration->throttlePedalPositionSecondAdcChannel, ADC_SLOW);
|
||||
|
|
|
@ -33,6 +33,12 @@ RedundantSensor pedal(SensorType::AcceleratorPedal, SensorType::AcceleratorPedal
|
|||
// This sensor indicates the driver's throttle intent - Pedal if we have one, TPS if not.
|
||||
ProxySensor driverIntent(SensorType::DriverThrottleIntent);
|
||||
|
||||
// These sensors are TPS-like, so handle them in here too
|
||||
LinearFunc wastegateFunc(PACK_MULT_VOLTAGE);
|
||||
LinearFunc idlePosFunc(PACK_MULT_VOLTAGE);
|
||||
FunctionalSensor wastegateSens(SensorType::WastegatePosition, MS2NT(10));
|
||||
FunctionalSensor idlePosSens(SensorType::IdlePosition, MS2NT(10));
|
||||
|
||||
static void configureTps(LinearFunc& func, float closed, float open, float min, float max) {
|
||||
func.configure(
|
||||
closed, 0,
|
||||
|
@ -82,6 +88,10 @@ void initTps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
initTpsFuncAndRedund(tps2, tpsFunc2s, tpsSens2s, CONFIG(tps2_2AdcChannel), CONFIG(tps2SecondaryMin), CONFIG(tps2SecondaryMax), min, max);
|
||||
initTpsFunc(pedalFuncPrimary, pedalSensorPrimary, CONFIG(throttlePedalPositionAdcChannel), CONFIG(throttlePedalUpVoltage), CONFIG(throttlePedalWOTVoltage), min, max);
|
||||
initTpsFuncAndRedund(pedal, pedalFuncSecondary, pedalSensorSecondary, CONFIG(throttlePedalPositionSecondAdcChannel), CONFIG(throttlePedalSecondaryUpVoltage), CONFIG(throttlePedalSecondaryWOTVoltage), min, max);
|
||||
|
||||
// TPS-like stuff that isn't actually a TPS
|
||||
initTpsFunc(wastegateFunc, wastegateSens, CONFIG(wastegatePositionSensor), CONFIG(wastegatePositionMin), CONFIG(wastegatePositionMax), min, max);
|
||||
initTpsFunc(idlePosFunc, idlePosSens, CONFIG(idlePositionSensor), CONFIG(idlePositionMin), CONFIG(idlePositionMax), min, max);
|
||||
}
|
||||
|
||||
// Route the pedal or TPS to driverIntent as appropriate
|
||||
|
@ -107,4 +117,7 @@ void reconfigureTps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
|
||||
configureTps(pedalFuncPrimary, CONFIG(throttlePedalUpVoltage), CONFIG(throttlePedalWOTVoltage), min, max);
|
||||
configureTps(pedalFuncSecondary, CONFIG(throttlePedalSecondaryUpVoltage), CONFIG(throttlePedalSecondaryWOTVoltage), min, max);
|
||||
|
||||
configureTps(wastegateFunc, CONFIG(wastegatePositionMin), CONFIG(wastegatePositionMax), min, max);
|
||||
configureTps(idlePosFunc, CONFIG(idlePositionMin), CONFIG(idlePositionMax), min, max);
|
||||
}
|
||||
|
|
|
@ -724,8 +724,11 @@ pin_input_mode_e throttlePedalUpPinMode;
|
|||
uint8_t fsio_visible acIdleExtraOffset;+Additional idle PID offset while A/C is active;"Percent", 1, 0, 0, 255, 0
|
||||
|
||||
int can2SleepPeriodMs;CANbus thread period, ms;"ms", 1, 0, 0, 1000.0, 2
|
||||
int unusedAt716;;"units", 1, 0, -20, 100, 0
|
||||
int unusedAt720;;"units", 1, 0, -20, 100, 0
|
||||
uint16_t wastegatePositionMin;Voltage when the wastegate is closed.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0
|
||||
uint16_t wastegatePositionMax;Voltage when the wastegate is fully open.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0
|
||||
uint16_t idlePositionMin;Voltage when the idle valve is closed.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0
|
||||
uint16_t idlePositionMax;Voltage when the idle valve is open.\nYou probably don't have one of these!;"mv", 1, 0, 0, 5000, 0
|
||||
|
||||
int unusedAt724;;"units", 1, 0, -20, 100, 0
|
||||
|
||||
uint32_t tunerStudioSerialSpeed;Secondary TTL channel baud rate;"BPs", 1, 0, 0,1000000, 0
|
||||
|
@ -797,7 +800,7 @@ output_pin_e acFanPin;+Optional Radiator Fan used with A/C
|
|||
|
||||
custom uart_device_e 1 bits,U32, @OFFSET@, [0:1], "Off", "UART1", "UART2", "UART3"
|
||||
int16_t sdCardPeriodMs;+SD card logging period, in milliseconds;"ms", 1, 0, 0, 30000, 0
|
||||
uint8_t unused806;;"units", 1, 0, -20, 100, 0
|
||||
adc_channel_e idlePositionSensor;
|
||||
brain_pin_e debugMapAveraging;
|
||||
output_pin_e starterRelayDisablePin;
|
||||
pin_output_mode_e starterRelayDisableMode;On some vehicles we can disable starter once engine is already running
|
||||
|
@ -1188,7 +1191,8 @@ int16_t tps2Max;Full throttle#2. tpsMax value as 10 bit ADC value. Not Voltage!\
|
|||
brain_pin_e can2TxPin;set_can2_tx_pin X
|
||||
brain_pin_e can2RxPin;set_can2_rx_pin X
|
||||
pin_output_mode_e starterControlPinMode;
|
||||
uint8_t[5] unused_former_warmup_target_afr;;"units", 1, 0, -20, 100, 0
|
||||
adc_channel_e wastegatePositionSensor;
|
||||
uint8_t[4] unused_former_warmup_target_afr;;"units", 1, 0, -20, 100, 0
|
||||
|
||||
float boostCutPressure;kPa value at which we need to cut fuel and spark, 0 if not enabled;"kPa", 1, 0, 0, 500, 0
|
||||
|
||||
|
|
|
@ -360,6 +360,11 @@ enable2ndByteCanID = false
|
|||
knock7 = scalar, S08, 256, "dbv", 1, 0
|
||||
knock8 = scalar, S08, 257, "dbv", 1, 0
|
||||
|
||||
rawIdlePositionSensor = scalar, U16, 264, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
|
||||
rawWastegatePosition = scalar, U16, 266, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
|
||||
wastegatePositionSensor = scalar, S16, 268, "%",{1/@@PACK_MULT_PERCENT@@}, 0
|
||||
idlePositionSensor = scalar, S16, 270, "%",{1/@@PACK_MULT_PERCENT@@}, 0
|
||||
|
||||
;
|
||||
; see TunerStudioOutputChannels struct
|
||||
;
|
||||
|
@ -889,6 +894,8 @@ gaugeCategory = Sensors - Extra 2
|
|||
knockLevelGauge = knockLevel,"Knock level", "volts", 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
|
||||
wastegatePosGauge = wastegatePositionSensor, "Wastegate position sensor", "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
idlePosSensGauge = idlePositionSensor, "Idle position sensor", "%", 0, 100, 0, 0, 100, 100, 1, 1
|
||||
|
||||
gaugeCategory = ECU Status
|
||||
warningCounterGauge = warningCounter, "Warning count", "", 0, 100, 0, 0, 100, 100, 0, 0
|
||||
|
@ -993,6 +1000,8 @@ gaugeCategory = Sensors - Raw
|
|||
rawIatGauge = rawIat , "Raw IAT", "volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
rawOilPressureGauge = rawOilPressure, "Raw Oil Pressure", "volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
rawPpsSecondaryGauge = rawPpsSecondary,"Raw Pedal Secondary","volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
rawIdlePositionSensorGauge = rawIdlePositionSensor, "Raw Idle Position", "volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
rawWastegatePositionGauge = rawWastegatePosition,"Raw Wastegate Position","volts", 0, 5, 0, 0, 5, 5, 3, 0
|
||||
|
||||
gaugeCategory = Transmission
|
||||
desiredGearGauge = tcuDesiredGear, "Desired", "gear", -1, 10, -1, -1, 10, 10, 0, 0
|
||||
|
@ -1397,6 +1406,7 @@ menuDialog = main
|
|||
subMenu = speedSensor, "Vehicle speed sensor"
|
||||
subMenu = oilPressureSensor, "Oil pressure"
|
||||
subMenu = egtInputs, "EGT" @@if_ts_show_egt
|
||||
subMenu = wastegateIdlePos, "Wastegate and idle position sensors"
|
||||
|
||||
menu = "&Controller"
|
||||
subMenu = ecuStimulator, "ECU stimulator"
|
||||
|
@ -1867,7 +1877,31 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
|
|||
panel = pedalSensorLeft, West
|
||||
panel = pedalGauges, East
|
||||
|
||||
dialog = mc33Dialog, "GDI Dreams"
|
||||
dialog = wastegatePosConfig, "Wastegate position sensor"
|
||||
field = "Input pin", wastegatePositionSensor
|
||||
field = "Min (fully closed, most boost)", wastegatePositionMin
|
||||
field = "Max (fully open, least boost)", wastegatePositionMax
|
||||
|
||||
dialog = idlePosConfig, "Wastegate position sensor"
|
||||
field = "Input pin", idlePositionSensor
|
||||
field = "Min (valve closed, low idle)", idlePositionMin
|
||||
field = "Max (valve open, high idle)", idlePositionMax
|
||||
|
||||
dialog = wastegateIdlePosLeft, ""
|
||||
panel = wastegatePosConfig
|
||||
panel = idlePosConfig
|
||||
|
||||
dialog = wastegateIdlePosGauges, ""
|
||||
gauge = rawWastegatePositionGauge, West
|
||||
gauge = wastegatePosGauge, East
|
||||
gauge = rawIdlePositionSensorGauge
|
||||
gauge = idlePosSensGauge
|
||||
|
||||
dialog = wastegateIdlePos, "", border
|
||||
panel = wastegateIdlePosLeft, West
|
||||
panel = wastegateIdlePosGauges, East
|
||||
|
||||
dialog = mc33Dialog, "Low-Z injector control (MC33816)"
|
||||
field = "MC33816 cs", mc33816_cs
|
||||
field = "MC33816 rstb", mc33816_rstb
|
||||
field = "MC33816 flag0", mc33816_flag0
|
||||
|
|
Loading…
Reference in New Issue