-
Notifications
You must be signed in to change notification settings - Fork 0
Home
We thought it would be funny to nickname the VC the "TurboCharger". It was not that funny. But that's why some documents on the drive related to this say "Turbo" on them.
The Vehicle Controller (VC) is an stm32 microcontroller on the shutdown circuit that acts as the throttle of the car. The VC also controls the start button and ready-to-drive sequence. Some controls related safety checks required by the competition rules are also performed by the VC.
There are two linear potentiometers built into the accelerator pedal of the car. A linear potentiometer is rod that moves within a casing (like a telescope). The device has three wire connections: power, ground, and signal. The voltage on the signal line changes proportionally with the distance the rod has telescoped out of the casing. These sensors are attached to the accelerator pedal such that they move with the pedal through their whole range. This means the voltage on the signal line is proportional to the accelerator pedal position. The two potentiometer signal lines are connected to two ADC (Analog to Digital Converter) inputs on the stm32 microcontroller. We'll refer to these potentiometers as accelerator position sensors.
The VC's main task is, in real time, reading the accelerator position sensors and requesting torque from the motor controller accordingly. At a rate of 100Hz, the VC reads the pedal position using the ADC, inputs this position into a function to determine how much torque to request, and sends a CAN message requesting this torque to the motor controller (this is very simplified, there are more intermediate steps and safety checks).
The following safety checks are performed in relation to the accelerator/brake pedals. Some of these checks are required by the Formula SAE/Student competition rules. These rules refer to some of these checks with the acronym "APPS" (Accelerator Pedal Position Sensor).
- Sensor Agreement Check
- This is required by the rules (APPS). The two accelerator position sensors are supposed to read within 10% of one another. If the difference in readings is beyond 10%, no torque is commanded from the motor controller.
- Double Pedal Check
- This is required by the rules (APPS). If the accelerator and brake pedals are pressed simultaneously, no torque is commanded from the motor controller.
- Brake Sensor Rationality Check
- The brake sensor changes its output voltage with the pressure input to the brake system by the driver's foot. If the pressure indicated by this sensor isn't realistic, no torque is commanded from the motor controller.
These three conditions are known as "Faults". A fault is a known and detectable failure mode of the VC. The VC maintains a state machine (see the VehicleState module). When this state is "faulted", no torque is commanded from the motor controller. A fault is not to be confused with a "fault condition", which is a state of inputs in which a fault should be detected and declared by the VC.
There's some rules involved here, but this is also required for basically any electric car with today's architecture. The Ready-to-Drive (RTD) sequence is the VC checking several inputs before moving into a state where it will command torque from the motor controller. The VehicleState module is the high level actor in this sequence. This sequence involves waiting for the driver to press the push-to-start button (known as the RTD button) and triggering the RTD sound. The VC must also enable the motor controller during this process.
When this system was conceived, we decided it could fit on the shutdown circuit. This gave us a cool opportunity to read and log the shutdown circuit fault lines (different from VC faults, these physically disable the high voltage system). The shutdown faults are connected to digital inputs on the microcontroller and polled at a rate of 1kHz. A CAN message containing the state of these lines is also sent out at this rate. This is purely a logging feature meant for debugging the car when seemingly random shutdown circuit faults occur. It's important to note here that the circuitry for monitoring these lines does not directly connect them to the microcontroller, as doing so would allow us to write code to disable hardware faults. The VC cannot physically disable hardware faults. The car may not pass technical inspection at competition if this is not clear to the judges.
The VC also handles inputs from the dashboard. These include the RTD button (mentioned above) and several switches and/or buttons. The additional inputs have no purpose currently, but options include changing torque profiles and playing fart sounds on demand.