Power Distribution Validation
Intro
Power distribution has two main functions:
Receiving CAN messages from centre console and translating them into GPIO/IO expander changes
Measuring current from the BTS7200s and publishing the data over CAN
There are slight differences between front and rear power distribution. To differentiate the two, on rear power distribution, pin C13 should be grounded; if this isn’t done yet or you only have one board, you can uncomment the #define at the top of power_distribution/src/main.c to force rear power distribution. Steps for only front or rear are marked.
I apologize for the sheer repetitiveness of the test plan, there’s a crap ton of CAN messages this board responds to. Some of the repetitive stuff could be skipped for time if the rest of it works.
Setup - common
Action | Expected Result | Actual / Notes | |
---|---|---|---|
1 | Compile | No compilation errors | PASS |
2 | Connect CAN dongle | Nothing, project not flashed yet |
|
3 | Run | All unit tests pass |
|
4 | Flash project and open minicom | No errors; message “Hello from power distribution, initialized on [front/rear]” depending on detected board |
|
5 | Run | Every 0.5s, 22 CAN messages: |
|
Front power distribution only
Action | Expected Result | Actual / Notes | |
---|---|---|---|
1 | Send CAN message: 0x15 | Driver display LED turns on |
|
2 | Apply load on driver display plug | LS 2 bytes of CAN message with MS 2 bytes 0x07 varies proportionally to current through load |
|
3 | Send CAN message: 0x15 | Driver display LED turns off, CAN msg with MS 2 bytes 0x07 no longer varies with current |
|
4 | Repeat 1-3 with first u16 0x01, current on steering plug | As 1-3 with steering LED and MS 2 bytes 0x02 |
|
5 | Repeat 1-3 with first u16 0x02, current on centre console plug | As 1-3 with centre console LED and MS 2 bytes 0x00 |
|
6 | Repeat 1-3 with first u16 0x03, current on pedal plug | As 1-3 with pedal LED and MS 2 bytes 0x01 |
|
7 | Repeat 1-3 with first u16 0x04, current on DRL plug | As 1-3 with DRL LED and MS 2 bytes 0x0E |
|
8 | Send CAN message: 0x18 | DRL LED turns on |
|
9 | Send CAN message: 0x18 | DRL LED turns off |
|
10 | Send CAN message: 0x18 | Right front turn light LED blinks at 0.5s intervals |
|
11 | Apply load on right front turn light plug | LS 2 bytes of CAN message with MS 2 bytes 0x0D vary proportionally to current through load |
|
12 | Send CAN message: 0x18 | Left & right front turn light LEDs blink together at 0.5s intervals |
|
13 | Apply load on left front turn light plug | LS 2 bytes of CAN msg with MS 2 bytes 0x0C vary proportionally to current |
|
14 | Send CAN message: 0x17 | Left & right front turn light LEDs immediately turn on for 0.5s, then continue blinking |
|
15 | Send CAN message: 0x18 | No change |
|
16 | Send CAN message: 0x18 | No change |
|
17 | Send CAN message: 0x18 | Right front turn light LED stops blinking, stays at GND |
|
18 | Send CAN message: 0x18 | Left front turn light LED stops blinking, stays at GND |
|
19 | Send CAN message: 0x19 | Horn LED turns high |
|
20 | Apply load on horn plug | LS 2 bytes of CAN msg with MS 2 bytes 0x11 vary proportionally to current |
|
21 | Send CAN message: 0x19 | + pin of horn plug turns to GND, CAN msg stops varying proportionally |
|
22 | Send CAN message: 0x06 | ACK CAN message ID 0x06, the following LEDs go high: driver display, steering, centre console, pedal, speaker, left display, right display, main display, rear display, left camera, right camera, main rPi, rear rPi |
|
23 | Apply load on left display plug | CAN msg: 0x08 varies |
|
24 | Apply load on right display plug | CAN msg: 0x09 varies |
|
25 | Apply load on main display plug | CAN msg: 0x05 varies |
|
26 | Apply load on rear display plug | CAN msg: 0x06 varies |
|
27 | Apply load on left camera plug | CAN msg: 0x03 varies |
|
28 | Apply load on right camera plug | CAN msg: 0x04 varies |
|
29 | Apply load on main rPi plug | CAN msg: 0x0A varies |
|
30 | Apply load on rear rPi plug | CAN msg: 0x0B varies |
|
31 | Apply load on speaker plug | CAN msg: 0x10 varies |
|
32 | Send CAN message: 0x08 | ACK CAN msg ID 0x08, the following LEDs turn off: left camera and right camera (the rest stay high) |
|
33 | Send CAN message: 0x07 | ACK CAN msg ID 0x07, all LEDs EXCEPT centre console and pedal turn off |
|
34 | Power off board | CAN messages stop, LEDs turn off (unless there’s a ghost in the STM32) |
|
Note: may get updated as issues get fixed (namely SOFT-311, SOFT-312).
Rear power distribution only
Action | Expected Result | Actual / Notes | |
---|---|---|---|
1 | Send CAN message: 0x18 | Left, centre, and right rear brake light LEDs turn on |
|
2 | Apply load on left brake light plug | LS 2 bytes of CAN msg with MS 2 bytes 0x1E varies with current through load |
|
3 | Apply load on centre brake light plug | CAN msg: 0x1F varies |
|
4 | Apply load on right brake light plug | CAN msg: 0x20 varies |
|
5 | Send CAN message: 0x18 | Left, centre, right brake rear brake light LEDs turn off |
|
6 | Send CAN message: 0x18 | Strobe light LED blinks on and off every 0.1s |
|
7 | Apply load on strobe light plug | CAN msg: 0x21 varies (unless blinking is too fast) |
|
8 | Send CAN message: 0x18 | Strobe light LED stops blinking, rests at off |
|
9 | Send CAN message: 0x18 | Right rear turn light LED blinks on and off every 0.5s Every 10 blinks (5s), a CAN msg ID 0x17 |
|
10 | Send CAN message: 0x18 | Left rear turn light LED blinks in sync with right rear turn light LED |
|
11 | Apply load on left rear turn light plug | CAN msg: 0x1C varies |
|
12 | Apply load on right rear turn light plug | CAN msg: 0x1D varies |
|
13 | Send CAN message: 0x18 | No change |
|
14 | Send CAN message: 0x18 | No change |
|
15 | Send CAN message: 0x18 | Right rear turn light LED stops blinking (left continues) |
|
16 | Send CAN message: 0x18 | Left rear turn light LED stops blinking, CAN messages 0x17 |
|
17 | Send CAN message: 0x06 | ACK CAN msg ID 0x06, the following LEDs turn on: BMS carrier, MCI, solar sense, telemetry, charger, rear camera |
|
18 | Apply load on BMS carrier plug | CAN msg: 0x16 varies |
|
19 | Apply load on MCI plug | CAN msg: 0x17 varies |
|
20 | Apply load on charger plug | CAN msg: 0x18 varies |
|
21 | Apply load on solar sense plug | CAN msg: 0x19 varies |
|
22 | Apply load on telemetry plug | CAN msg: 0x1A varies |
|
23 | Apply load on rear camera plug | CAN msg: 0x1B varies |
|
24 | Send CAN message: 0x08 | ACK CAN msg ID 0x08, MCI and rear camera LEDs turn off |
|
25 | Send CAN message: 0x07 | ACK CAN msg ID 0x07, all LEDs EXCEPT BMS carrier, solar sense, charger turn off |
|
26 | Power off board | All LEDs turn off, CAN messages stop (unless the board is haunted) |
|