Modules:
charger_controller
uses mcp2515’s driver to send charging messages
receives possible faults and raises events
charger_control_pilot_monitor
when the charger is connected, it will use PWM to do a reading for max current.
raises a MAX_CURRENT_AVAILABLE event with the max current reading.
charger_connection_sense
sets up the interrupt for when the charger gets powered from AC.
raises a CHARGER_CONNECTED event when the interrupt triggers.
permission_resolver
once the charger connects, it sends a permission request to centre console, here’s two cases:
centre console will grant permission
it starts the begin_charge_fsm
centre console won’t grant permission
charger does nothing, and waits for a disconnect and connect.
begin_charge_fsm
then it will wait for MAX_CURRENT_AVAILABLE
then it will set the state of the proximity circuit
then it activates charger_controller and charging begins.
stop_charge_fsm
it will stop the charger_controller
it will set the proximity circuit pin
it will broadcast a CHARGER_DISCONNECTED CAN message. So centre console can allow for power state transitions.
Incoming CAN Messages:
Message | ||
---|---|---|
CHARGING_GRANTED | ||
BM |
Outgoing CAN Messages:
Message | ||
---|---|---|
REQUEST_TO_CHARGE | ||
CHARGER_DISCONNECTED | ||
Operation Mode:
The BMS sends operating information (Message 1) to charger at fixed interval of 1s. After receiving the message, the charger will work under the Voltage and Current in Message. If the Message is not received within 5s, it will enter into communication error state and stop charging.
...