Skip to content

Modules

Chris Blust edited this page May 1, 2022 · 3 revisions

Application Modules

APPS

This module performs the two safety checks related to the accelerator position sensors. A periodic function, APPS_100Hz, runs at 100Hz. This function calls two helper functions that perform the following checks.

Sensor Agreement Check

The formula SAE rules require that no torque is requested from the motor if the accelerator position sensors read more than 10% differently for 100ms. The function for this check requires nothing more than the current positions indicated by each accelerator position sensor. It is implemented using a state machine, with four states. See F30/Electronics/firmware/VC/APPS_state_machine for a state diagram. Each iteration of this check advances the state machine by 10ms with the new positions as inputs. The output of this state machine sets and clears FaultCode_APPS_SENSOR_DISAGREEMENT.

Double Pedal Check

This check is run at the same cadence as the above, every 10ms within the top level APPS function. A basic hysteresis is used to set/clear the fault. If the brake is on and the average accelerator position is greater than a set point, FaultCode_APPS_DOUBLE_PEDAL is set. If the average accelerator position drops below a reset level, the fault is cleared. This hysteresis is mandated by competition rules.

Accelerator

This module is responsible for converting the two accelerator sensor ADC readings into accelerator positions. A simple linear conversion is used to convert the ADC reading to a voltage, and the voltage to an accelerator position. The two positions are averaged to produce an average accelerator position.

Brake

CAN

FaultManager

HeartBeatLed

MotorController

ShutdownMonitor

SoundController

Switches

TorqueConverter

TorqueLimiter

VC

VehicleState

main_bus

Driver Modules

HAL_Aio

HAL_Can

HAL_Clock

HAL_Dio

HAL_Uart

Common Modules

CanQueue

SIL Modules

VcCompat

VcEcu

VcHandle

Clone this wiki locally