Electric Racecar Vehicle Control Unit
My primary technical project on the Model Year 2019 (MY19) vehicle was the C software for the vehicle control unit (VCU). The VCU is the most complex board on the car and handles the vehicle state machine, the vehicle controls, and the CAN bus data logging.
The vehicle state machine is the core function of the VCU. Many steps are required to safely take the vehicle from the point when the low voltage system turns on to the point when the motor is allowed to apply torque; the VCU enforces that safe start up sequence and also handles any faults the vehicle may experience.
Controls software also operates on the VCU. To see more about what that entails, see my page about controls on the MY20 vehicle.
The previous vehicle before MY19 was the first to implement full onboard CAN data logging, but for MY19 we wanted to move it onboard the VCU to allow the VCU to log internal signals without burdening the CAN bus with additional signals. The VCU logs all CAN data recieves to an SD card, which we then can parse and use for debugging and data analysis.
Key changes I implement on the VCU compared with previous years include the follows:
- Refactored state machine code to be easier to understand and to adhere to a documented state machine diagram
- Implemented on STM32 F4-series MCU (previous version use STM32 F2-series)
- SD card data logging moved from separate logger board to VCU
- FreeRTOS used to implement threading (previous versions were bare metal)
- Local unit testing (i.e., not cross compiled and able to be run without hardware)