Skip to content

Commit

Permalink
pdu can (#97)
Browse files Browse the repository at this point in the history
* pdu can

* incr period

* update

* made changes

* Added auto switch faults for PDU

* Fixed faults

* Fixed error led when preflight

---------

Co-authored-by: AdityaAsGithub <[email protected]>
  • Loading branch information
nverapae and AdityaAsGithub authored Mar 15, 2024
1 parent 5ff2e93 commit fbe4c8f
Show file tree
Hide file tree
Showing 14 changed files with 901 additions and 284 deletions.
90 changes: 65 additions & 25 deletions common/daq/can_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,6 @@
"msg_hlp":1,
"msg_pgn":34
},
{
"msg_name": "coolant_out",
"msg_desc": "outputs to coolant loops",
"signals": [
{"sig_name": "bat_fan", "type":"uint8_t", "unit": "%"},
{"sig_name":"dt_fan", "type":"uint8_t", "unit":"%"},
{"sig_name": "bat_pump", "type":"uint8_t", "length": 1},
{"sig_name": "bat_pump_aux", "type":"uint8_t", "length": 1},
{"sig_name": "dt_pump", "type":"uint8_t", "length": 1}
],
"msg_period": 1000,
"msg_hlp":1,
"msg_pgn":35
},
{
"msg_name": "gearbox",
"msg_desc": "Gearbox temps",
Expand Down Expand Up @@ -657,12 +643,12 @@
"msg_desc": "Cooling Pump/Fan requests from Dash LCD",
"signals": [
{"sig_name": "dt_pump", "type": "uint8_t"},
{"sig_name": "dt_fan", "type": "uint8_t"},
{"sig_name": "dt_fan", "type": "uint8_t", "unit":"%", "maximum":100},
{"sig_name": "batt_pump", "type": "uint8_t"},
{"sig_name": "batt_pump2", "type": "uint8_t"},
{"sig_name": "batt_fan", "type": "uint8_t"}
{"sig_name": "batt_fan", "type": "uint8_t", "unit":"%", "maximum":100}
],
"msg_period": 5,
"msg_period": 0,
"msg_hlp": 3,
"msg_pgn": 11
},
Expand Down Expand Up @@ -758,20 +744,74 @@
"node_ssa":31,
"tx": [
{
"msg_name":"pdu_test",
"msg_desc":"periodic dashboard heartbeat",
"msg_name":"v_rails",
"msg_desc":"PDU voltage rail readings",
"signals":[
{"sig_name": "test_1", "type":"uint8_t"},
{"sig_name": "test_2", "type":"uint8_t"},
{"sig_name": "test_3", "type":"uint8_t"}
{"sig_name": "in_24v", "type":"uint16_t", "unit":"mV"},
{"sig_name": "out_5v", "type":"uint16_t", "unit":"mV"},
{"sig_name": "out_3v3", "type":"uint16_t", "unit":"mV"}
],
"msg_period":15,
"msg_period":500,
"msg_hlp":1,
"msg_pgn":1040
"msg_pgn":1041
},
{
"msg_name":"rail_currents",
"msg_desc":"PDU rail currents",
"signals":[
{"sig_name": "i_24v", "type":"uint16_t", "unit":"mA"},
{"sig_name": "i_5v", "type":"uint16_t", "unit":"mA"}
],
"msg_period":500,
"msg_hlp":1,
"msg_pgn":1042
},
{
"msg_name":"pump_and_fan_current",
"msg_desc":"PDU pump and fan currents",
"signals":[
{"sig_name": "i_pump1", "type":"uint16_t", "unit":"mA"},
{"sig_name": "i_pump2", "type":"uint16_t", "unit":"mA"},
{"sig_name": "i_fan1", "type":"uint16_t", "unit":"mA", "length":12},
{"sig_name": "i_fan2", "type":"uint16_t", "unit":"mA", "length":12}
],
"msg_period":500,
"msg_hlp":1,
"msg_pgn":1043
},
{
"msg_name":"other_currents",
"msg_desc":"Other PDU currents",
"signals":[
{"sig_name": "i_sdc", "type":"uint16_t", "unit":"mA", "length":12},
{"sig_name": "i_aux", "type":"uint16_t", "unit":"mA", "length":12},
{"sig_name": "i_dash", "type":"uint16_t", "unit":"mA", "length":12},
{"sig_name": "i_abox", "type":"uint16_t", "unit":"mA", "length":12},
{"sig_name": "i_main", "type":"uint16_t", "unit":"mA", "length":12}
],
"msg_period":500,
"msg_hlp":1,
"msg_pgn":1044
},
{
"msg_name": "coolant_out",
"msg_desc": "outputs to coolant loops",
"signals": [
{"sig_name": "bat_fan", "type":"uint8_t", "unit": "%"},
{"sig_name":"dt_fan", "type":"uint8_t", "unit":"%"},
{"sig_name": "bat_pump", "type":"uint8_t", "length": 1},
{"sig_name": "bat_pump_aux", "type":"uint8_t", "length": 1},
{"sig_name": "dt_pump", "type":"uint8_t", "length": 1}
],
"msg_period": 1000,
"msg_hlp":1,
"msg_pgn":35
}
],
"rx": [
{"msg_name": "pdu_bl_cmd" , "callback": true}
{"msg_name": "pdu_bl_cmd" , "callback": true},
{"msg_name":"cooling_driver_request", "callback": true},
{"msg_name":"main_hb"}
]
},
{
Expand Down
77 changes: 54 additions & 23 deletions common/daq/per_dbc.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ BO_ 2214594689 coolant_temps: 4 Main_Module
SG_ battery_out_temp : 8|8@1- (1,0) [0|0] "C" Vector__XXX
SG_ battery_in_temp : 0|8@1- (1,0) [0|0] "C" Vector__XXX

BO_ 2214594753 coolant_out: 3 Main_Module
SG_ dt_pump : 18|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ bat_pump_aux : 17|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ bat_pump : 16|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ dt_fan : 8|8@1+ (1,0) [0|0] "%" Vector__XXX
SG_ bat_fan : 0|8@1+ (1,0) [0|0] "%" Vector__XXX

BO_ 2415921409 gearbox: 2 Main_Module
SG_ r_temp : 8|8@1- (1,0) [0|0] "" Vector__XXX
SG_ l_temp : 0|8@1- (1,0) [0|0] "" Vector__XXX
Expand Down Expand Up @@ -346,10 +339,10 @@ BO_ 2483028613 raw_throttle_brake: 8 Dashboard
SG_ throttle : 0|12@1+ (0.02442,0) [0|0] "%" Vector__XXX

BO_ 2348810949 cooling_driver_request: 5 Dashboard
SG_ batt_fan : 32|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ batt_fan : 32|8@1+ (1,0) [0|100] "%" Vector__XXX
SG_ batt_pump2 : 24|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ batt_pump : 16|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ dt_fan : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ dt_fan : 8|8@1+ (1,0) [0|100] "%" Vector__XXX
SG_ dt_pump : 0|8@1+ (1,0) [0|0] "" Vector__XXX

BO_ 2214593093 filt_throttle_brake: 3 Dashboard
Expand Down Expand Up @@ -385,10 +378,34 @@ BO_ 688 LWS_Standard: 5 Steering
SG_ LWS_SPEED : 16|8@1+ (4,0) [0|0] "deg/s" Vector__XXX
SG_ LWS_ANGLE : 0|16@1- (0.1,0) [0|0] "deg" Vector__XXX

BO_ 2214659103 pdu_test: 3 PDU
SG_ test_3 : 16|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ test_2 : 8|8@1+ (1,0) [0|0] "" Vector__XXX
SG_ test_1 : 0|8@1+ (1,0) [0|0] "" Vector__XXX
BO_ 2214659167 v_rails: 6 PDU
SG_ out_3v3 : 32|16@1+ (1,0) [0|0] "mV" Vector__XXX
SG_ out_5v : 16|16@1+ (1,0) [0|0] "mV" Vector__XXX
SG_ in_24v : 0|16@1+ (1,0) [0|0] "mV" Vector__XXX

BO_ 2214659231 rail_currents: 4 PDU
SG_ i_5v : 16|16@1+ (1,0) [0|0] "mA" Vector__XXX
SG_ i_24v : 0|16@1+ (1,0) [0|0] "mA" Vector__XXX

BO_ 2214659295 pump_and_fan_current: 7 PDU
SG_ i_fan2 : 44|12@1+ (1,0) [0|0] "mA" Vector__XXX
SG_ i_fan1 : 32|12@1+ (1,0) [0|0] "mA" Vector__XXX
SG_ i_pump2 : 16|16@1+ (1,0) [0|0] "mA" Vector__XXX
SG_ i_pump1 : 0|16@1+ (1,0) [0|0] "mA" Vector__XXX

BO_ 2214659359 other_currents: 8 PDU
SG_ i_main : 48|12@1+ (1,0) [0|0] "mA" Vector__XXX
SG_ i_abox : 36|12@1+ (1,0) [0|0] "mA" Vector__XXX
SG_ i_dash : 24|12@1+ (1,0) [0|0] "mA" Vector__XXX
SG_ i_aux : 12|12@1+ (1,0) [0|0] "mA" Vector__XXX
SG_ i_sdc : 0|12@1+ (1,0) [0|0] "mA" Vector__XXX

BO_ 2214594783 coolant_out: 3 PDU
SG_ dt_pump : 18|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ bat_pump_aux : 17|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ bat_pump : 16|1@1+ (1,0) [0|0] "" Vector__XXX
SG_ dt_fan : 8|8@1+ (1,0) [0|0] "%" Vector__XXX
SG_ bat_fan : 0|8@1+ (1,0) [0|0] "%" Vector__XXX

BO_ 2148059871 fault_sync_pdu: 3 PDU
SG_ latched : 16|1@1+ (1,0) [0|0] "" Vector__XXX
Expand Down Expand Up @@ -603,12 +620,6 @@ CM_ SG_ 2214594689 drivetrain_out_temp "Out flow temperature of drivetrain coola
CM_ SG_ 2214594689 drivetrain_in_temp "In flow temperature of drivetrain coolant loop";
CM_ SG_ 2214594689 battery_out_temp "Out flow temperature of battery coolant loop";
CM_ SG_ 2214594689 battery_in_temp "In flow temperature of battery coolant loop";
CM_ BO_ 2214594753 "outputs to coolant loops";
CM_ SG_ 2214594753 dt_pump "";
CM_ SG_ 2214594753 bat_pump_aux "";
CM_ SG_ 2214594753 bat_pump "";
CM_ SG_ 2214594753 dt_fan "";
CM_ SG_ 2214594753 bat_fan "";
CM_ BO_ 2415921409 "Gearbox temps";
CM_ SG_ 2415921409 r_temp "";
CM_ SG_ 2415921409 l_temp "";
Expand Down Expand Up @@ -887,10 +898,30 @@ CM_ SG_ 688 Cal "";
CM_ SG_ 688 Ok "";
CM_ SG_ 688 LWS_SPEED "";
CM_ SG_ 688 LWS_ANGLE "";
CM_ BO_ 2214659103 "periodic dashboard heartbeat";
CM_ SG_ 2214659103 test_3 "";
CM_ SG_ 2214659103 test_2 "";
CM_ SG_ 2214659103 test_1 "";
CM_ BO_ 2214659167 "PDU voltage rail readings";
CM_ SG_ 2214659167 out_3v3 "";
CM_ SG_ 2214659167 out_5v "";
CM_ SG_ 2214659167 in_24v "";
CM_ BO_ 2214659231 "PDU rail currents";
CM_ SG_ 2214659231 i_5v "";
CM_ SG_ 2214659231 i_24v "";
CM_ BO_ 2214659295 "PDU pump and fan currents";
CM_ SG_ 2214659295 i_fan2 "";
CM_ SG_ 2214659295 i_fan1 "";
CM_ SG_ 2214659295 i_pump2 "";
CM_ SG_ 2214659295 i_pump1 "";
CM_ BO_ 2214659359 "Other PDU currents";
CM_ SG_ 2214659359 i_main "";
CM_ SG_ 2214659359 i_abox "";
CM_ SG_ 2214659359 i_dash "";
CM_ SG_ 2214659359 i_aux "";
CM_ SG_ 2214659359 i_sdc "";
CM_ BO_ 2214594783 "outputs to coolant loops";
CM_ SG_ 2214594783 dt_pump "";
CM_ SG_ 2214594783 bat_pump_aux "";
CM_ SG_ 2214594783 bat_pump "";
CM_ SG_ 2214594783 dt_fan "";
CM_ SG_ 2214594783 bat_fan "";
CM_ BO_ 2148059871 "Fault status message";
CM_ SG_ 2148059871 latched "";
CM_ SG_ 2148059871 idx "";
Expand Down
81 changes: 81 additions & 0 deletions common/faults/fault_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,87 @@
"time_to_latch": 1000,
"time_to_unlatch": 2000,
"lcd_message": "HIGH PDU MCU TEMP"
},
{
"fault_name": "dash_rail",
"max": 1,
"min": 0,
"priority": "fatal",
"time_to_latch": 100,
"time_to_unlatch": 1000,
"lcd_message": "Dash Rail Down"
},
{
"fault_name": "abox_rail",
"max": 1,
"min": 0,
"priority": "warning",
"time_to_latch": 100,
"time_to_unlatch": 1000,
"lcd_message": "ABox Rail Down"
},
{
"fault_name": "main_rail",
"max": 1,
"min": 0,
"priority": "fatal",
"time_to_latch": 100,
"time_to_unlatch": 1000,
"lcd_message": "Main Rail Down"
},
{
"fault_name": "daq_rail",
"max": 1,
"min": 0,
"priority": "warning",
"time_to_latch": 100,
"time_to_unlatch": 1000,
"lcd_message": "DAQ Rail Down"
},
{
"fault_name": "v_crit",
"max": 1,
"min": 0,
"priority": "fatal",
"time_to_latch": 100,
"time_to_unlatch": 1000,
"lcd_message": "5v_crit down"
},
{
"fault_name": "v_noncrit",
"max": 1,
"min": 0,
"priority": "warning",
"time_to_latch": 100,
"time_to_unlatch": 1000,
"lcd_message": "5V_NC Rail Down"
},
{
"fault_name": "fan1",
"max": 1,
"min": 0,
"priority": "warning",
"time_to_latch": 100,
"time_to_unlatch": 1000,
"lcd_message": "Fan 1 Rail Down"
},
{
"fault_name": "bullet_rail",
"max": 1,
"min": 0,
"priority": "warning",
"time_to_latch": 100,
"time_to_unlatch": 1000,
"lcd_message": "Bullet Rail Down"
},
{
"fault_name": "fan2",
"max": 1,
"min": 0,
"priority": "warning",
"time_to_latch": 100,
"time_to_unlatch": 1000,
"lcd_message": "Fan 2 Rail Down"
}
]
},
Expand Down
Loading

0 comments on commit fbe4c8f

Please sign in to comment.