...
periodically transmits over CAN the current, cell voltages, cell temps, and relay states
only need to transmit fan states if it’s bad, we don’t need to log all the time
Note: may be switched to an alternate form of communication, pending raspberry pi integration
...
Statically sets relay state, updates stored state, and returns whether the relay state set was successful.
Exposes set_relay_state
Note: may need to have a delay when setting relay states to avoid drawing too much current at once
Read the relay state through GPIO expander upon receiving interrupt
Current_sense
Registers an interrupt to update the stored current value based on ADC reading
If the updated current value is above a threshold, raise overcurrent fault
If the overcurrent fault bit is set and the updated current value is below the threshold, drop the fault bit
Should read at ideally 100hz
Exposes init
...
To be ported from MSXII firmware.
measures voltages through the AFEs
measures temperatures through the auxiliary GPIO pins on the AFEs through the ADG731 multiplexer
Raises / lowers faults similar to current_sense, including overcharge, over temperature, under charge
General structure is an FSM that usually remains in idle state, but moves to a “voltage reading” state or “temp reading” state whenever reading.
will likely use this approach for passive balancing as well
Fan_control
Periodically updates the fan speed based on the temperature
Uses an offset linear fan control curve based on the desired operating temperature of the battery (refer to datasheet)
Exposes init
will need a driver for the ADT7470 fan controller
Passive_balancing
determines which cell voltage is the highest
balancing is not required if cells are within 25 mV of each other
periodically sends raises an event to the AFE FSM to send a broadcast command to set the balance_control pin for whichever cell needs balancing
Can_handler
has access to main storage
handles relay can messages
handles center console can messages
Raspi
toggle the 5V_EN pin when we want to turn the raspi on
send data to the raspi through UART
Receive data from raspi through UART
Other questions:
What’s passive balancing?
Balancing is making sure cells are all at the same voltage so one module doesn’t limit the charging current
Passive balancing is using up charge from high voltage packs through a resistor
Toggle balance control on the highest voltage cell
Look at AFE data sheet for how this works
“We tried” in MSXII, probably not implemented
The difference between the highest and lowest voltage cell should be < 25 mV
How do you tell if the battery is charging? Re: directional temperature faults
Current sense gives positive vs negative current
Ask Liam if positive is in or out / if negative or in and out
What timing is needed for the relays?
Part number EV200HAANA, datasheet has specs of current in it
100 ms 4A, afterwards 130mA
We don’t want to draw 4A from more than one relay at once, so wait at least 200 ms
Relays have a sanity check in an aux coil: aux coil will mimic the main coil.
Relay control: always check after toggling state, if it didn’t toggle, either retry or fault. Waiting 100 ms between closing it and checking the state is good.
Does order matter for relays / what order?
Always close HV_GND first.
Note: there’s a relay for MCI and for Charger interface
What’s considered fast for current sense measurements?
Theoretically should do 14 khz
100 hz is good, below 20 is bad
Based on coulomb counting, current always has sinusoidal components (from motor controllers, since we drive motors with sinusoidal phases), so higher frequency means better SOC accuracy, also MPPTs don’t have perfect DC output
What’s / Why UART?
We have a library so we’re good
Do we have to receive anything from the pi?
Right now no. Eventually, yes. No sending over UART either for MVP elec.
What’s needed for the RPI software?
Nothing right now.
...