Skip to content

Commit 06ef308

Browse files
matt-mekhaalicedimaurocyberneel
authored
[VCU] event modes, energy metering (#289)
* autox * pedal tune * endurance * vcu emits current event * fixed params * packet * energy metering * im a fat chud * schema: regenerate generated artifacts from CSV mm/autox added event_mode (0x1C7) and net_energy/regen_energy (0x1C9) to the CSV but didn't run the full schema-gen chain, so the schema-drift CI was failing on stale artifacts. Pure regen of the non-firmware codegen outputs: - drivers/longhorn-lib/can.json + protobuf/can_packets.proto - BEVO can.json / can_packets.proto / sensor_data.desc / generated_mapping.rs - telemtry sensor.proto / orion.proto / Prisma / SQL / ORM models Firmware-side can_ids.h / can_ids.c are intentionally NOT regenerated here — Matt is updating those alongside the new packet handlers and will commit them separately. --------- Co-authored-by: alicedimauro <alicedimauro@utexas.edu> Co-authored-by: cyberneel <neelesh.chevuri25@gmail.com>
1 parent 9ae4885 commit 06ef308

7 files changed

Lines changed: 162 additions & 80 deletions

File tree

BEVO/sensor_data.desc

Lines changed: 105 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
�;
3-
$nonhermetic/assets/can_packets.protoorion"
2+
Ÿ9
3+
$nonhermetic/assets/can_packets.protoorion"¡
44
OrionSensorData
55
time (Rtime
66
packet_id (RpacketId+
@@ -10,7 +10,7 @@ $nonhermetic/assets/can_packets.protoorion"
1010
diagnostics_high ( 2.orion.DiagnosticsHighRdiagnosticsHigh>
1111
diagnostics_low ( 2.orion.DiagnosticsLowRdiagnosticsLow(
1212
thermal ( 2.orion.ThermalRthermal5
13-
board_status ( 2.orion.BoardStatusR boardStatus"
13+
board_status ( 2.orion.BoardStatusR boardStatus"Ï
1414
BoardStatus%
1515
csm_last_seen_s (R csmLastSeenS%
1616
dui_last_seen_s (R duiLastSeenS%
@@ -19,7 +19,7 @@ $nonhermetic/assets/can_packets.protoorion"
1919
pdu_last_seen_s (R pduLastSeenS%
2020
tsm_last_seen_s (R tsmLastSeenS%
2121
usm_last_seen_s (R usmLastSeenS%
22-
vcu_last_seen_s (R vcuLastSeenS"
22+
vcu_last_seen_s (R vcuLastSeenS"þ
2323
Dynamics
2424
gps (Rgps
2525
gps_imu (RgpsImu
@@ -34,15 +34,21 @@ $nonhermetic/assets/can_packets.protoorion"
3434
(R brWheelSpeed$
3535
fl_wheel_speed (R flWheelSpeed$
3636
fr_wheel_speed (R frWheelSpeed&
37-
steer_col_angle (RsteerColAngle
37+
steer_col_angle
38+
(R
39+
steerColAngle
3840
bl_gyro (RblGyro&
39-
bl_sprung_accel (RblSprungAccel
41+
bl_sprung_accel (R
42+
blSprungAccel
4043
br_gyro (RbrGyro&
41-
br_sprung_accel (RbrSprungAccel
44+
br_sprung_accel (R
45+
brSprungAccel
4246
fl_gyro (RflGyro&
43-
fl_sprung_accel (RflSprungAccel
47+
fl_sprung_accel (R
48+
flSprungAccel
4449
fr_gyro (RfrGyro&
45-
fr_sprung_accel (RfrSprungAccel$
50+
fr_sprung_accel (R
51+
frSprungAccel$
4652
bl_ride_height (R blRideHeight)
4753
bl_strain_gauge_v (RblStrainGaugeV
4854
bl_sus_pot_v (R blSusPotV$
@@ -58,7 +64,7 @@ $nonhermetic/assets/can_packets.protoorion"
5864
ride_height" (R
5965
rideHeight
6066
wheel_speed# (R
61-
wheelSpeed"
67+
wheelSpeed"Ý
6268
Controls
6369
motor_speed (R
6470
motorSpeed'
@@ -74,32 +80,38 @@ motorSpeed'
7480
(Rbpps2V
7581

7682
brake_bias (R brakeBias&
77-
brake_light_pct (RbrakeLightPct(
78-
brake_pressure_f (RbrakePressureF.
83+
brake_light_pct (R
84+
brakeLightPct(
85+
brake_pressure_f
86+
(RbrakePressureF.
7987
brake_pressure_rall (RbrakePressureRall.
8088
brake_pressure_rbll (RbrakePressureRbll
8189
bse1_v (Rbse1V
8290
bse2_v (Rbse2V
8391
bse3_v (Rbse3V%
84-
lights_current (RlightsCurrent
92+
lights_current (R
93+
lightsCurrent
8594
rpm_request (R
8695
rpmRequest%
87-
torque_command (RtorqueCommand!
96+
torque_command (R
97+
torqueCommand!
8898
torque_limit (R torqueLimit%
89-
torque_request (RtorqueRequest)
99+
torque_request (R
100+
torqueRequest)
90101
commanded_torque (RcommandedTorque
91102
motor_angle (R
92103
motorAngle
93104
direction (R direction
94105
enable (Renable*
95106
line_lock_enabled (RlineLockEnabled%
96-
torque_shudder (RtorqueShudder
107+
torque_shudder (R
108+
torqueShudder
97109
bse3 (Rbse3
98110

99111
event_mode' (R eventMode
100112

101113
net_energy( (R netEnergy!
102-
regen_energy) (R regenEnergy"
114+
regen_energy) (R regenEnergy"Û
103115
Pack
104116
bus_voltage (R
105117
busVoltage*
@@ -108,24 +120,30 @@ busVoltage*
108120
cells_v (RcellsV
109121
dc_bus_v (RdcBusV0
110122
delta_resolver_angle (RdeltaResolverAngle#
111-
inverter_freq (R inverterFreq(
123+
124+
inverter_freq (R inverterFreq(
112125
neutral_output_v (RneutralOutputV"
113-
time_since_on (R timeSinceOn
126+
127+
time_since_on (R timeSinceOn
114128
vab_vq_v
115129
(RvabVqV
116130
vbc_vd_v (RvbcVdV
117131
cells_temps (R
118132
cellsTemps$
119-
dc_bus_current (R dcBusCurrent
133+
dc_bus_current
134+
(R dcBusCurrent
120135
hv_c (RhvC
121136
hv_pack_v (RhvPackV
122137
hv_soc (RhvSoc
123138
lv_batt_c (RlvBattC
124139
lv_batt_t (RlvBattT
125140
lv_batt_v (RlvBattV&
126-
phase_a_current (RphaseACurrent&
127-
phase_b_current (RphaseBCurrent&
128-
phase_c_current (RphaseCCurrent"�
141+
phase_a_current (R
142+
phaseACurrent&
143+
phase_b_current (R
144+
phaseBCurrent&
145+
phase_c_current (R
146+
phaseCCurrent"Ì
129147
DiagnosticsHigh
130148
prndl_state (R
131149
prndlState)
@@ -136,28 +154,37 @@ postFaults
136154

137155
run_faults (R runFaults)
138156
apps1_disconnect (Rapps1Disconnect&
139-
apps1_out_range (Rapps1OutRange)
157+
apps1_out_range (R
158+
apps1OutRange)
140159
apps2_disconnect (Rapps2Disconnect&
141-
apps2_out_range (Rapps2OutRange#
142-
apps_implause
160+
apps2_out_range (R
161+
apps2OutRange#
162+
163+
apps_implause
143164
(R appsImplause#
144-
apps_mismatch (R appsMismatch$
165+
166+
apps_mismatch (R appsMismatch$
145167
batt_fans_fuse (R battFansFuse$
146-
batt_pump_fuse (R battPumpFuse
168+
batt_pump_fuse
169+
(R battPumpFuse
147170
boards_fuse (R
148171
boardsFuse)
149172
bpps1_disconnect (Rbpps1Disconnect&
150-
bpps1_out_range (Rbpps1OutRange)
173+
bpps1_out_range (R
174+
bpps1OutRange)
151175
bpps2_disconnect (Rbpps2Disconnect&
152-
bpps2_out_range (Rbpps2OutRange#
153-
bpps_mismatch (R bppsMismatch(
176+
bpps2_out_range (R
177+
bpps2OutRange#
178+
179+
bpps_mismatch (R bppsMismatch(
154180
brake_light_fuse (RbrakeLightFuse'
155181
bse1_disconnect (Rbse1Disconnect$
156182
bse1_out_range (R bse1OutRange'
157183
bse2_disconnect (Rbse2Disconnect$
158184
bse2_out_range (R bse2OutRange
159185
ll_fuse (RllFuse&
160-
motor_pump_fuse (RmotorPumpFuse
186+
motor_pump_fuse (R
187+
motorPumpFuse
161188

162189
r2d_buzzer (R r2dBuzzer
163190
rtd_fuse (RrtdFuse
@@ -169,33 +196,43 @@ shtdn_fuse (R shtdnFuse0
169196
spare_fuse (R spareFuse
170197
stomp_fault! (R
171198
stompFault&
172-
tssi_green_fuse" (RtssiGreenFuse"
173-
tssi_red_fuse# (R tssiRedFuse(
199+
tssi_green_fuse" (R
200+
tssiGreenFuse"
201+
202+
tssi_red_fuse# (R tssiRedFuse(
174203
neg_hv_contactor$ (RnegHvContactor(
175204
pos_hv_contactor% (RposHvContactor/
176-
precharge_contactor& (RprechargeContactor"
205+
precharge_contactor& (RprechargeContactor"
177206
DiagnosticsLow(
178207
precharge_r_temp (RprechargeRTemp$
179208
bmb_comm_error (R bmbCommError5
180209
imd_gnd_isolation_error (RimdGndIsolationError%
181-
r2d_authorized (Rr2dAuthorized
210+
r2d_authorized (R
211+
r2dAuthorized
182212

183213
r2d_status (R r2dStatus#
184-
shutdown_leg1 (R shutdownLeg1#
185-
shutdown_leg2 (R shutdownLeg2#
186-
shutdown_leg3 (R shutdownLeg3#
187-
shutdown_leg4 (R shutdownLeg4
214+
215+
shutdown_leg1 (R shutdownLeg1#
216+
217+
shutdown_leg2 (R shutdownLeg2#
218+
219+
shutdown_leg3 (R shutdownLeg3#
220+
221+
shutdown_leg4 (R shutdownLeg4
188222

189223
temp_imd_1
190224
(RtempImd1
191225

192226
temp_imd_2 (RtempImd2&
193-
temp_shutdown_1 (RtempShutdown1&
194-
temp_shutdown_2 (RtempShutdown2'
227+
temp_shutdown_1 (R
228+
tempShutdown1&
229+
temp_shutdown_2
230+
(R
231+
tempShutdown2'
195232
charger_current (RchargerCurrent'
196233
charger_voltage (RchargerVoltage'
197234
charger_enabled (RchargerEnabled
198-
imd_led (RimdLed"
235+
imd_led (RimdLed"ÿ
199236
Thermal0
200237
batt_cooling_current (RbattCoolingCurrent2
201238
motor_cooling_current (RmotorCoolingCurrent!
@@ -205,25 +242,35 @@ motor_temp (R motorTemp-
205242
batt_loop_batt_temp (RbattLoopBattTemp4
206243
batt_loop_rad_fan_speed (RbattLoopRadFanSpeed+
207244
batt_loop_rad_temp (RbattLoopRadTemp&
208-
battery_fan_rpm (RbatteryFanRpm"
209-
bus_bar_temp1 (R busBarTemp1"
210-
bus_bar_temp2
245+
battery_fan_rpm (R
246+
batteryFanRpm"
247+
248+
bus_bar_temp1 (R busBarTemp1"
249+
250+
bus_bar_temp2
211251
(R busBarTemp2"
212-
bus_bar_temp3 (R busBarTemp3(
252+
253+
bus_bar_temp3 (R busBarTemp3(
213254
cell_bottom_temp (RcellBottomTemp"
214-
cell_top_temp (R cellTopTemp(
255+
256+
cell_top_temp
257+
(R cellTopTemp(
215258
coolant_flow_lpm (RcoolantFlowLpm!
216259
coolant_temp (R coolantTemp(
217260
discharge_r_temp (RdischargeRTemp
218261
fan_rpm (RfanRpm(
219262
gate_driver_temp (RgateDriverTemp2
220263
inverter_hotspot_temp (RinverterHotspotTemp#
221-
inverter_temp (R inverterTemp(
264+
265+
inverter_temp (R inverterTemp(
222266
max_cell_voltage (RmaxCellVoltage(
223267
min_cell_voltage (RminCellVoltage"
224-
module_a_temp (R moduleATemp"
225-
module_b_temp (R moduleBTemp"
226-
module_c_temp (R moduleCTemp7
268+
269+
module_a_temp (R moduleATemp"
270+
271+
module_b_temp (R moduleBTemp"
272+
273+
module_c_temp (R moduleCTemp7
227274
motor_loop_inverter_temp (RmotorLoopInverterTemp1
228275
motor_loop_motor_temp (RmotorLoopMotorTemp-
229276
motor_loop_rad_temp (RmotorLoopRadTemp
@@ -233,9 +280,12 @@ temp_ams_1 (RtempAms1
233280
temp_ams_2 (RtempAms2$
234281
temp_command_1 (R tempCommand1$
235282
temp_command_2 (R tempCommand2"
236-
temp_output_1! (R tempOutput1"
237-
temp_output_2" (R tempOutput2,
283+
284+
temp_output_1! (R tempOutput1"
285+
286+
temp_output_2" (R tempOutput2,
238287
max_charge_current# (RmaxChargeCurrent,
239288
max_charge_voltage$ (RmaxChargeVoltage
240289
bms_led% (RbmsLed%
241-
charger_enable& (RchargerEnablebproto3
290+
charger_enable& (R
291+
chargerEnablebproto3

VCU/firmware/Core/Inc/params/default_params.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,30 +89,6 @@
8989
}, \
9090
.regen_linelock = { \
9191
.disable = true, \
92-
.pressure_only_test_mode = false, \
93-
.dc_bus_current_regen_is_negative = true, \
94-
.rear_pressure_zero_torque_psi = 0.0f, \
95-
.rear_pressure_reference_psi = 500.0f, \
96-
.rear_pressure_min_engage_psi = 10.0f, \
97-
.regen_torque_at_reference_pressure_nm = 67.0f, \
98-
.absolute_regen_torque_cap_nm = 230.0f, \
99-
.pedal_torque_open_pulse_threshold_nm = 70.0f, \
100-
.pedal_torque_open_pulse_cancel_threshold_nm = 50.0f, \
101-
.linelock_open_pulse_ms = 250u, \
102-
.linelock_close_delay_ms = 200u, \
103-
.pack_current_limit_a = 45.0f, \
104-
.hard_cut_margin_pct = 0.20f, \
105-
.hard_cut_reset_pressure_psi = 100.0f, \
106-
.pack_terminal_voltage_limit_v = 546.0f, \
107-
.pack_resistance_ohm = 0.442f, \
108-
.pack_series_cell_count = 130.0f, \
109-
.dynamic_voltage_reserve_v = 6.0f, \
110-
.pack_ocv_enable_v = 520.11f, \
111-
.pack_ocv_disable_hysteresis_v = 2.0f, \
112-
.max_cell_voltage_regen_disable_v = 4.05f, \
113-
.min_cell_temp_c = 10.0f, \
114-
.max_cell_temp_c = 55.0f, \
115-
.min_motor_speed_rpm = 219.49f, \
11692
}, \
11793
.buzzer_duration_ms = 1200u, \
11894
.brake_enable_threshold = 0.1f

VCU/firmware/Core/Inc/params/endurance_params.h

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,31 @@
66
static const vcu_parameters_t endurance_params = {
77
VCU_DEFAULT_PARAMS,
88
.regen_linelock = { \
9-
.disable = false, \
9+
.disable = false, \
10+
.pressure_only_test_mode = false, \
11+
.dc_bus_current_regen_is_negative = true, \
12+
.rear_pressure_zero_torque_psi = 0.0f, \
13+
.rear_pressure_reference_psi = 500.0f, \
14+
.rear_pressure_min_engage_psi = 10.0f, \
15+
.regen_torque_at_reference_pressure_nm = 67.0f, \
16+
.absolute_regen_torque_cap_nm = 230.0f, \
17+
.pedal_torque_open_pulse_threshold_nm = 70.0f, \
18+
.pedal_torque_open_pulse_cancel_threshold_nm = 50.0f, \
19+
.linelock_open_pulse_ms = 250u, \
20+
.linelock_close_delay_ms = 200u, \
21+
.pack_current_limit_a = 45.0f, \
22+
.hard_cut_margin_pct = 0.20f, \
23+
.hard_cut_reset_pressure_psi = 100.0f, \
24+
.pack_terminal_voltage_limit_v = 546.0f, \
25+
.pack_resistance_ohm = 0.442f, \
26+
.pack_series_cell_count = 130.0f, \
27+
.dynamic_voltage_reserve_v = 6.0f, \
28+
.pack_ocv_enable_v = 520.11f, \
29+
.pack_ocv_disable_hysteresis_v = 2.0f, \
30+
.max_cell_voltage_regen_disable_v = 4.05f, \
31+
.min_cell_temp_c = 10.0f, \
32+
.max_cell_temp_c = 55.0f, \
33+
.min_motor_speed_rpm = 219.49f, \
1034
}, \
1135
.event_mode = 4, \
1236
};

0 commit comments

Comments
 (0)