Skip to content

Commit

Permalink
Simplify heartbeats + annotate alerts (#1282)
Browse files Browse the repository at this point in the history
### Changelist 
<!-- Give a list of the changes covered in this PR. This will help both
you and the reviewer keep this PR within scope. -->

A few changes that should make driving less fragile.

1. Changed the heartbeat dependency graph. Now, board A only checks the
heartbeat of board B if A uses a signal from board B. There currently
are a few instances of boards checking other boards' heartbeats, but
then not actually using signals from them. In my mind this is
unnecessary and could only lead to unnecessary faults down the line.
(check me on this!). This for example means the FSM and BMS checks no
other boards heartbeats.

2. Moved various faults on the VC related to the LV battery and currents
to warnings. If `AccumulatorRailOvercurrentFault` and
`BatteryRailOvercurrentFault` is set, we'd probably see total loss of
the LV bus, so no need to just exit drive state. If just one is set,
there is no immediate reason to stop driving. If there is a
`LvChargeFault` or `BoostControllerFault`, there is also no need to exit
drive state (we'd probably only notice the consequences of the failure
on the next power cycle). By making these faults instead of warnings we
reduce the chances of spurious shutdowns.

3. Added descriptions for all alerts.

### Testing Done
<!-- Outline the testing that was done to demonstrate the changes are
solid. This could be unit tests, integration tests, testing on the car,
etc. Include relevant code snippets, screenshots, etc as needed. -->

Unit testing only.
  • Loading branch information
gtaharaedmonds authored Jun 2, 2024
1 parent 1f82a39 commit b2d8cbe
Show file tree
Hide file tree
Showing 22 changed files with 196 additions and 401 deletions.
128 changes: 62 additions & 66 deletions can_bus/quadruna/BMS/BMS_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,115 +4,111 @@
"warnings_counts_id": 152,
"faults_counts_id": 153,
"warnings": {
"StackWaterMarkHighTask1Hz" : {
"id" :101,
"description" : "Example"
"StackWaterMarkHighTask1Hz": {
"id": 101,
"description": "Example"
},
"StackWaterMarkHighTask100Hz" : {
"id" :102,
"description" : "Example"
"StackWaterMarkHighTask100Hz": {
"id": 102,
"description": "Example"
},
"StackWaterMarkHighTask1kHz" :{
"id" :103,
"description" : "Example"
"StackWaterMarkHighTask1kHz": {
"id": 103,
"description": "Example"
},
"StackWaterMarkHighTaskCanRx": {
"id" :104,
"description" : "Example"
"id": 104,
"description": "Example"
},
"StackWaterMarkHighTaskCanTx":{
"id" :105,
"description" : "Example"
"StackWaterMarkHighTaskCanTx": {
"id": 105,
"description": "Example"
},
"WatchdogTimeout" :{
"id" :106,
"description" : "Example"
"WatchdogTimeout": {
"id": 106,
"description": "Example"
},
"TxOverflow": {
"id" :107,
"description" : "Example"
"id": 107,
"description": "Example"
},
"RxOverflow" : {
"id" :108,
"description" : "Example"
"RxOverflow": {
"id": 108,
"description": "Example"
},
"MissingVCHeartbeat": {
"id": 109,
"description": "Example"
}
},
"faults": {
"MissingVCHeartbeat":{
"id" :151,
"description" : "Example"
},
"MissingRSMHeartbeat":{
"id" :152,
"description" : "Example"
},
"StateMachine" :{
"id" :154,
"description" : "Example"
"StateMachine": {
"id": 154,
"description": "Example"
},
"CellUndervoltage": {
"id" :155,
"description" : "Example"
"id": 155,
"description": "Example"
},
"CellOvervoltage": {
"id" :156,
"description" : "Example"
"id": 156,
"description": "Example"
},
"ModuleCommunicationError": {
"id" :157,
"description" : "Example"
"id": 157,
"description": "Example"
},
"CellUndertemp": {
"id" :158,
"description" : "Example"
"id": 158,
"description": "Example"
},
"CellOvertemp": {
"id" :159,
"description" : "Example"
"id": 159,
"description": "Example"
},
"Charger": {
"id" :160,
"description" : "Example"
"id": 160,
"description": "Example"
},
"ChargerDisconnectedDuringCharge": {
"id" :161,
"description" : "Example"
"id": 161,
"description": "Example"
},
"ChargerExternalShutdown": {
"id" :162,
"description" : "Example"
"id": 162,
"description": "Example"
},
"TractiveSystemOvercurrent": {
"id" :163,
"description" : "Example"
"id": 163,
"description": "Example"
},
"PrechargeFailure": {
"id" :164,
"description" : "Example"
"id": 164,
"description": "Example"
},
"OpenWireCheckFault": {
"id" :165,
"description" : "Example"
"id": 165,
"description": "Example"
},
"OpenWireCheck_Segment0_GND": {
"id" :166,
"description" : "Example"
"id": 166,
"description": "Example"
},
"OpenWireCheck_Segment1_GND": {
"id" :167,
"description" : "Example"
"id": 167,
"description": "Example"
},
"OpenWireCheck_Segment2_GND": {
"id" :168,
"description" : "Example"
"id": 168,
"description": "Example"
},
"OpenWireCheck_Segment3_GND": {
"id" :169,
"description" : "Example"
"id": 169,
"description": "Example"
},
"OpenWireCheck_Segment4_GND": {
"id" :170,
"description" : "Example"
"id": 170,
"description": "Example"
}
}
}
}
3 changes: 1 addition & 2 deletions can_bus/quadruna/BMS/BMS_rx.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"messages": [
"RSM_Vitals",
"VC_Vitals",
"BRUSA_Vitals",
"Debug_Charging",
"Debug_CanMode",
"Debug_CellBalancing",
"Debug_ResetSoc"
]
}
}
50 changes: 25 additions & 25 deletions can_bus/quadruna/CRIT/CRIT_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,54 +5,54 @@
"faults_counts_id": 551,
"warnings": {
"StackWaterMarkHighTask1Hz": {
"id" :201,
"description" : "Example"
"id": 201,
"description": "1Hz task stack watermark exceeded."
},
"StackWaterMarkHighTask100Hz": {
"id" :202,
"description" : "Example"
"id": 202,
"description": "100Hz task stack watermark exceeded."
},
"StackWaterMarkHighTask1kHz": {
"id" :203,
"description" : "Example"
"id": 203,
"description": "1kHz task stack watermark exceeded."
},
"StackWaterMarkHighTaskCanRx": {
"id" :204,
"description" : "Example"
"id": 204,
"description": "CAN RX task stack watermark exceeded."
},
"StackWaterMarkHighTaskCanTx": {
"id" :205,
"description" : "Example"
"id": 205,
"description": "CAN TX task stack watermark exceeded."
},
"WatchdogTimeout": {
"id" :206,
"description" : "Example"
"id": 206,
"description": "Watchdog timeout detected."
},
"TxOverflow": {
"id" :207,
"description" : "Example"
"id": 207,
"description": "CAN TX queue has overflowed."
},
"RxOverflow": {
"id" :208,
"description" : "Example"
"id": 208,
"description": "CAN RX queue has overflowed."
}
},
"faults": {
"MissingBMSHeartbeat": {
"id" :251,
"description" : "Example"
"id": 251,
"description": "Missing heartbeat signal from the BMS."
},
"MissingFSMHeartbeat": {
"id" :252,
"description" : "Example"
"id": 252,
"description": "Missing heartbeat signal from the FSM."
},
"MissingRSMHeartbeat": {
"id" :253,
"description" : "Example"
"id": 253,
"description": "Missing heartbeat signal from the RSM."
},
"MissingVCHeartbeat": {
"id":254,
"description" : "Example"
"id": 254,
"description": "Missing heartbeat signal from the VC."
}
}
}
}
4 changes: 0 additions & 4 deletions can_bus/quadruna/FSM/FSM_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@
"SappsOCSC": {
"id": 353,
"description": "Secondary accelerator pedal voltage out of acceptable range (OCSC)."
},
"MissingBMSHeartbeat": {
"id": 354,
"description": "BMS heartbeat no longer captured."
}
}
}
1 change: 0 additions & 1 deletion can_bus/quadruna/FSM/FSM_rx.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"messages": [
"BMS_Vitals",
"Debug_CanMode"
]
}
6 changes: 5 additions & 1 deletion can_bus/quadruna/RSM/RSM_alerts.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@
"id": 452,
"description": "VC Missing Heart beat"
},
"MissingBMSHeartbeat": {
"id": 452,
"description": "BMS Missing Heart beat"
},
"MissingFSMHeartbeat": {
"id": 453,
"description": "FSM Missing Heart beat"
"description": "FSM Missing Heartbeat"
}
}
}
Loading

0 comments on commit b2d8cbe

Please sign in to comment.