Modules:
charger_controller
uses mcp2515’s driver to send charging messages
methods:
charger_controller_init
charger_controller_activate
charger_controller_deactivate
charger_contoller_fault_monitor
registers can rx callbacks to find faults.
in case of a fault, broadcasts it to the rest of the car.
charger_control_pilot_monitor
when PWM_READING_REQUEST is raised, it will use PWM to do a reading for max current.
raises a PWM_READING 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, CHARGER_DISCONNECTED, 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
it begins PWM reading by raising a PWM_READING_REQUEST
then it will wait for MAX_CURRENT_AVAILABLE
then it will set the state of the control pilot
then it activates charger_controller and charging begins.
stop_charge_fsm
it will stop the charger_controller
it will set the control pilot pin
it will broadcast a CHARGER_DISCONNECTED CAN message. So centre console can allow for power state transitions.
battery_voltage_monitor
repeatedly receives CAN_(battery_voltage)
if more than a threshold, begins the stop_charge_fsm
Incoming CAN Messages:
Message | ||
---|---|---|
CHARGING_GRANTED | ||
BM |
Outgoing CAN Messages:
Message | ||
---|---|---|
REQUEST_TO_CHARGE | ||
CHARGER_CONNECTION | 1: connected 0: disconnected | |
CHARGER_STATUS |
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.
CAN Communication
Speed: 250Kbps
Addresses
Messages
Message 1:
This is the message we send to the charger.
Sender: 0xF4 → BMS
Receiver: 0xE5 → Charger Control System
Rest of the Message: 0x1806
Priority: 6
R: 0
DP: 0 (fixed)
PF: 6
Message 2
This is the status message charger sends to us.
Sender: 0xE5 CCS
Receiver: 0x50
CAN Communication
MCP2515 is responsible for sending and receiving CAN messages.
SAE J1772 Standard Notes
J1772 Plug Pinout
Control Pilot PWM
Circuit:
Proximity Pin (PP) or Proximity Detection
page 18 of standard:
Proximity Sense:
GPIO Address: PA7
Design Options:
periodic ADC running always
periodic ADC only activated when the charger is powered (PB1)
Charging Operation:
car should be in park not neutral
we can either be in a undervoltage state, or neutral
we’re also charging from solar
need to have a threshold for opening the solar relays
that threshold is not necessarily the overvoltage fault
cells are 95% charged
whenever solar closed, battery has to be closed
we should always make sure
motor controllers must not be connected
when car’s in parking, mci should disconnect
unless we’re not in an “undervoltage charge state” and we’re in “park” we should be able to charge
there needs to be continuous communication between BMS and the charger to taper the charging.
for MVP we keep it simple “two states”
once charging done:
tell evse by setting the switch
tell charger to stop
open the relay
shouldn’t go to neutral or drive again, unless we pull out the charger
After charging:
bms needs to send a taper message
bms needs to send a fully charged message
talk to liam
Richard’s Notes
Notes on Charger CAN Comm:
Receiving Data:
· Every second from BMS with CAN ID 1806E5F4
· 8 bytes of Voltage and Current requested
· If no valid CAN message, charger stops charging until valid CAN message received
Sending Data:
· Sends CAN message every second with Voltage, Current, and status information
· Source Address - BMS – 2244(0xF4)
Stats & Errors:
· Sends 2 messages, one to BMS and one to CCS
· Output Voltage and Current (2 Bytes each)
· Ex: if Byte = 1234 corresponds to 123.4V
· Status Flags (Byte 5)
· Each status takes a bit (uses 5/8 bits)
Hardware Failure | |
0: Normal | 1: Hardware Failure |
Temperature of Charger | |
0: Normal | 1: Over Temperature Protection |
Input Voltage | |
0: Normal | 1: Wrong Input Votage |
Starting State | |
0: Charger Detects battery voltage and starts charging | 1: Charger stays turned off (to prevent reverse polarity) |
Communication State | |
0: Normal | 1: Communication receive time-out |
Pre-Charging Safety Requirements:
· All Status Flags are 0
· Received valid CAN message from BMS (or CCS) 5 seconds or earlier
Controlled Relays & Hardware
View file | ||
---|---|---|
|
View file | ||
---|---|---|
|
View file | ||
---|---|---|
|
View file | ||
---|---|---|
|