Purpose (from IV):
A power distribution board is necessary to supply power to the various subsystems in the vehicle, including other microcontrollers. This board performs distribution, startup, shutdown and emergency shutdown as required in regulations. In addition to supporting powering the boards, it also powers components directly, such as the horn, camera and others.
The current electrical system design requires two instances of Power Distribution boards, a front PD and a rear PD. In MSXIV, the same firmware was flashed to both boards, with a startup condition used to determine which configuration was to be processed.
Essentially, power distribution has a set of outputs which it can turn on or off based on the state of the system. These outputs include:
Driver Lights and Indicators:
Right/left signal lights (located on front, side and rear of the car)
Hazard lights (same as those used for right/left)
BPS Fault strobe (Front PD only)
Part of driver display, if BPS fault occurs must pulse at 60-120hz
Horn (Front PD only)
Daytime running lights (Front PD only)
Brake lights (Rear PD only)
Cameras/Displays
Fans for driver ventilation
MCU Power - powers our boards:
Front PD:
Centre Console
Pedal
Steering
Rear PD
BMS
MCI
Solar Sense
SW Components:
The functionality of Power Distribution is broken into three Tasks
Master Task
Lights FSM task
Power Sequence FSM task
Master Task
Responsible for handling:
CAN functionality
FSM Cycles
Horn (Front PD only) - Triggered on Horn event over can from steering*
Brake lights (Rear PD only) - Triggered on brake event from pedal*
*NOTE: Brake and horn could be moved to power FSM, but makes sense to have them in main loop as they will always need to work, and this will make them extra responsive
Lights FSM
The lights FSM is responsible for handling the indicator light functionality for the turn signals, hazard lights and the fault indicators. Its inputs are steering events, received in CAN messages from the steering board, as well as BPS fault indicators. It has the following state diagram:
Transition events:
Left signal event (OFF/ON)
Triggered by left turn indicator on steering
Right Signal event (OFF/ON)
Triggered by Right turn indicator on steering
Hazard Event (OFF/ON)
Triggered by hazard button on steering
BPS Fault Event
Triggered by receiving a BPS_HEARTBEAT message with fault condition
Triggered if we don’t receive BPS Heartbeat after a predetermined amount of time (Comms failure)
States:
Init State
FSM is initialized into this state, and it it the default state of operation
It does not transition unless it received a steering event or a fault event
Left Signal
Periodically toggle left signal output light
Right Signal
Periodically toggle right signal output light
Hazard
Periodically toggle both right and left signal output lights
BPS Fault
Strobe BPS fault indicator
Trigger Hazard lights (toggle both right/left signals lights)
Signal power sequence FSM to begin shutdown
Power Sequence FSM
The Power Sequence FSM is responsible for handling what gets power in different power states of the car. Based on inputs from the rest of the system, and state changes from power select, it will alter the source of power and be responsible for turning on and off different boards as needed. It receives as inputs CAN messages which indicate power events.
State Diagram:
Transition events (Received over CAN from Center Console):
Power Main Driver BMS
First iteration of power on, only key indicators enabled
May be removed, as we no longer have a driver display
Power Main Everything on
Turn on all boards, enable the system
Power Aux Everything on
On BPS fault, we need to switch from main power to aux power
Enable only necessary systems
Power Everything OFf
BPS Fault Event
Triggered by receiving a BPS_HEARTBEAT message with fault condition
Triggered if we don’t receive BPS Heartbeat after a predetermined amount of time (Comms failure)
States:
Init State
Only Centre console and pedal are on
Driver Controls
Turns on all displays
TBD - May be able to remove
Activated if power pressed w/o brake
Power Main Everything on
Powers on all systems (boards, cameras, Daytime running lights (Front PD only))
Main Operation
State of normal operation. Will execute output function every iteration as long as no other state change has occurred
Responsible for
Fan Control - front and rear PD
Checking for state change
General Master task format:
MasterTask() { init_fsm(lights); init_fsm(power_sequence); while(true) { run_can_rx_cycle(); update_horn(); update_brake_lights; run_lights_cycle(); run_power_sequence_cycle(); run_can_tx_cycle(); } }
TBD:
Can monitor functionality will be required
New ICs are used in XV Power distribution and will need drivers
CAN Message definitions
Regs/Overall Car Design Questions:
Do we have our lights integrated into our mech design?
It looks like we can have one set of lights for brake/signal, is this something we want to pursue?
How are our cameras going to work? just on all the time? do regs say anything about this?