STM32 Files:
FEB_CAN_ID.h
: A header file that stores all CAN Message IDs.FEB_CAN.c
: A file that handles CAN library initialization and received message handling. Additional CAN files will build of this one. File contains template code for writing additional CAN files.FEB_CAN.h
: Header file forFEB_CAN.c
.
Other files:
FEB_CAN_ID.csv
: A CSV file that stores names of CAN messages without assigned CAN IDs. This file is used to generate dynamic CAN IDs.FEB_CAN_Static_ID.csv
: A CSV file that sores names of CAN messages and their assigned CAN ID.generate.py
: This file uses data fromFEB_CAN_ID.csv
andFEB_CAN_Static_ID.csv
to generateFEB_CAN_ID.h
.FEB_CAN_ID.py
: This file storse all CAN Message IDs. Used for the CAN Monitor.
- Add CAN Message: To add a CAN message with a static CAN ID, update
FEB_CAN_Static_ID.csv
file. To add a CAN message without a static CAN ID, update theFEB_CAN_ID.csv
file. - Generate: Run
generate.py
script. This will update theFEB_CAN_ID.h
header file. - Documentation: Document the new CAN message in this readme file.
- GitHub: Push all changes to GitHub to ensure the CAN Library is up to date for everyone.
Byte | Value | Factor | Offset | Datatype | Unit |
---|---|---|---|---|---|
0 | Bank [1, 7] | 1 | 0 | uint8_t | - |
1 | Cell [1, 20] | 1 | 0 | uint8_t | - |
2-3 | Voltage | 10-4 | 0 | uint16_t | V |
Byte | Value | Factor | Offset | Datatype | Unit |
---|---|---|---|---|---|
0 | Bank [1, 7] | 1 | 0 | uint8_t | - |
1 | Cell [1, 20] | 1 | 0 | uint8_t | - |
2-3 | Temperature | 10-1 | 0 | int16_t | oC |
Byte | Value | Datatype |
---|---|---|
0 | BMS State | uint8_t |
1 | Relay State | uint8_t |
BMS State Value | BMS State |
---|---|
0 | Pre-charge |
1 | Charge |
2 | Balance |
3 | Drive |
4 | Shutdown |
Relay State Bit | Relay | State |
---|---|---|
2 | Shutdown | 0 if closed else 1 |
1 | AIR+ | 0 if closed else 1 |
0 | Pre-charge | 0 if closed else 1 |
Byte | Value | Factor | Offset | Datatype | Unit |
---|---|---|---|---|---|
0 | Bank [1, 7] | 1 | 0 | uint8_t | - |
1-3 | Cell balance state | 1 | 0 | - | - |
4-5 | Target voltage | 10-4 | 0 | uint16_t | V |
Cell balance state bit | Value |
---|---|
24-20 | 0 |
19-0 | 1 if cell balance else 0. Bit i for cell (i + 1). |
Byte | Value | Datatype |
---|---|---|
0 | Bank [1, 7] | uint8_t |
1-3 | Temperature Sensor | - |
Temperature sensor state bit | Value |
---|---|
24-20 | 0 |
19-0 | 1 if enabled else 0. Bit i for cell (i + 1). |
Byte | Value | Datatype |
---|---|---|
0 | Desired fan speed for fan 1, with 0 being fan off and 255 being fan at full speed | uint8_t |
1 | Equivalent for fan 2 | uint8_t |
2 | Equivalent for fan 3 | uint8_t |
3 | Equivalent for fan 4 | uint8_t |
4 | Equivalent for fan 5 | uint8_t |
Byte | Value | Datatype |
---|---|---|
0-4 | Normalized Brake | float |
Byte | Value | Datatype |
---|---|---|
0 | addr | uint8_t |
2 | r/w command | boolean |
3 | NA | - |
4-5 | data | uint8_t |
6-7 | NA | - |
R/W Command Value | State |
---|---|
0 | Read |
1 | Write |
Addr Value | State |
---|---|
20 | Fault Clear |
148 | CAN Active Messages Lo Wor |
Byte | Value | Datatype |
---|---|---|
0-1 | Torque Command | Torque |
2-3 | Speed Command | Angular Velocity |
4 | Direction | boolean |
5.0 | Inverter Enable | boolean |
5.1 | Inverter Discharge | boolean |
5.2 | Speedmode Enabled | boolean |
6-7 | Command Torque Limited | Torque |
Byte | Value | Datatype |
---|---|---|
0 | BSPD State | uint8_t |
BSPD State Value | BSPD State |
---|---|
0 | False / Not Triggered |
1 | True / Triggered |
Byte | Value | Datatype |
---|---|---|
0-4 | TPS Current | float |
The DASH_Breakout Board transmits a 1 byte message corresponding to status of the I/O on the I/O expander, the bits in the message are broken down in the table below:
Bit | Value | Datatype |
---|---|---|
0 | Buzzer State | bool |
1 | Button 1 (Ready-To-Drive) | bool |
2 | Button 2 | bool |
3 | Button 3 | bool |
4 | Button 4 | bool |
5 | Switch 1 (Coolant Pump) | bool |
6 | Switch 2 (Radiator Fans) | bool |
7 | Switch 3 (Accumulator Fans) | bool |
Byte | Value | Datatype |
---|---|---|
0 | Measured fan speed for fan 1, with 0 being fan off and 255 being fan at full speed | uint8_t |
1 | Equivalent for fan 2 | uint8_t |
2 | Equivalent for fan 3 | uint8_t |
3 | Equivalent for fan 4 | uint8_t |
4 | Equivalent for fan 5 | uint8_t |