Skip to content

Commit

Permalink
add wheel speed outputs/gauges
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Nov 7, 2024
1 parent 1072297 commit fa39fa1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions firmware/console/binary/output_channels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ int16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2

int16_t autoscale wastegatePositionSensor;@@GAUGE_NAME_WG_POSITION@@;"%",{1/@@PACK_MULT_PERCENT@@}, 0, 0, 0, 2

uint8_t wheelSpeedLf;@@GAUGE_NAME_WHEEL_SPEED_LF@@
uint8_t wheelSpeedRf;@@GAUGE_NAME_WHEEL_SPEED_RF@@

! These two fields indicate to TS that we'd like to set a particular field to a particular value
! We use a maintainConstantValue in TS for each field we'd like to set, like this:
! maintainConstantValue = tpsMax, { (calibrationMode == 1 ) ? calibrationValue : tpsMax }
Expand All @@ -146,6 +149,9 @@ int16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2
uint8_t calibrationMode;;"", 1, 0, 0, 0, 0
uint8_t idleStepperTargetPosition;Idle: Stepper target position;"", 1, 0, 0, 0, 0

uint8_t wheelSpeedLr;@@GAUGE_NAME_WHEEL_SPEED_LR@@
uint8_t wheelSpeedRr;@@GAUGE_NAME_WHEEL_SPEED_RR@@

! todo: this not needed in light of TS_SIGNATURE but rusEFI console still uses it. Need to migrate
! rusEFI console from TS_FILE_VERSION to TS_SIGNATURE :(
uint32_t tsConfigVersion;;"", 1, 0, 0, 0, 0
Expand Down
4 changes: 4 additions & 0 deletions firmware/console/status_loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,10 @@ static void updateVvtSensors() {
static void updateVehicleSpeed() {
#if EFI_VEHICLE_SPEED
engine->outputChannels.vehicleSpeedKph = Sensor::getOrZero(SensorType::VehicleSpeed);
engine->outputChannels.wheelSpeedLf = Sensor::getOrZero(SensorType::WheelSpeedLF);
engine->outputChannels.wheelSpeedRf = Sensor::getOrZero(SensorType::WheelSpeedRF);
engine->outputChannels.wheelSpeedLr = Sensor::getOrZero(SensorType::WheelSpeedLR);
engine->outputChannels.wheelSpeedRr = Sensor::getOrZero(SensorType::WheelSpeedRR);
#endif // EFI_VEHICLE_SPEED

#ifdef MODULE_GEAR_DETECT
Expand Down
4 changes: 4 additions & 0 deletions firmware/integration/rusefi_config_shared.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
#define GAUGE_NAME_TC_RATIO "TCU: Torque Converter Ratio"

#define GAUGE_NAME_VVS "Vehicle Speed"
#define GAUGE_NAME_WHEEL_SPEED_LF "Wheel speed: LF"
#define GAUGE_NAME_WHEEL_SPEED_RF "Wheel speed: RF"
#define GAUGE_NAME_WHEEL_SPEED_LR "Wheel speed: LR"
#define GAUGE_NAME_WHEEL_SPEED_RR "Wheel speed: RR"
#define GAUGE_NAME_GEAR_RATIO "Gearbox Ratio"
#define GAUGE_NAME_DETECTED_GEAR "Detected Gear"
#define GAUGE_NAME_TURBO_SPEED "Turbocharger Speed"
Expand Down
8 changes: 7 additions & 1 deletion firmware/tunerstudio/tunerstudio.template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,6 @@ gaugeCategory = Sensors - Basic
massAirFlowValueGa = mafMeasured, @@GAUGE_NAME_AIR_FLOW_MEASURED@@, "kg/h", 0, 50, -999, -999, 999, 999, 1, 1

gaugeCategory = Sensors - Extra 1
VSSGauge = vehicleSpeedKph, @@GAUGE_NAME_VVS@@, "kmh", 0, 200, 0, 1, 3, 4, 1, 1
turboSpeedGauge = turboSpeed, @@GAUGE_NAME_TURBO_SPEED@@, "hz", 0, 200, 0, 1, 3, 4, 1, 1
baroPressureGauge = baroPressure, @@GAUGE_NAME_BARO_PRESSURE@@, "kPa", 0, 130, 40, 50, 110, 120, 2, 0
internalMcuTemperatureGauge = internalMcuTemperature, @@GAUGE_NAME_ECU_TEMPERATURE@@, "C", 0, 100, 0, 0, 75, 100, 0, 0
Expand Down Expand Up @@ -1431,6 +1430,13 @@ gaugeCategory = VVT
vvtOutput3Gauge = vvtStatus3_output, "vvt: output 3", "", 00, 100, -60, -60, 60, 60, 0, 0
vvtOutput4Gauge = vvtStatus4_output, "vvt: output 4", "", 00, 100, -60, -60, 60, 60, 0, 0

gaugeCategory = Vehicle Speed
VSSGauge = vehicleSpeedKph, @@GAUGE_NAME_VVS@@, "kph", 0, 200, 0, 0, 200, 200, 1, 1
WssLfGauge = wheelSpeedLf, @@GAUGE_NAME_WHEEL_SPEED_LF@@, "kph", 0, 200, 0, 0, 200, 200, 1, 1
WssRfGauge = wheelSpeedRf, @@GAUGE_NAME_WHEEL_SPEED_RF@@, "kph", 0, 200, 0, 0, 200, 200, 1, 1
WssLrGauge = wheelSpeedLr, @@GAUGE_NAME_WHEEL_SPEED_LR@@, "kph", 0, 200, 0, 0, 200, 200, 1, 1
WssRrGauge = wheelSpeedRr, @@GAUGE_NAME_WHEEL_SPEED_RR@@, "kph", 0, 200, 0, 0, 200, 200, 1, 1

gaugeCategory = Ignition
sparkCutReasonGauge = sparkCutReason, "Ign: Cut code", "code", 0.0,0.0, 0.0,0.0, 0.0,0.0, 0,0
ignadvGauge = ignitionAdvance, "Ign: Timing", "degrees", -100, 100, -999, -999, 999, 999, 1, 1
Expand Down

0 comments on commit fa39fa1

Please sign in to comment.