Closed ThirteenFish closed 10 years ago
The BQ3060 updates values once every second. These are the registers we are interested in.
State of Charge
MaxError 0x0c
Relative State of Charge 0x0d -read only -percentage of charge remaining
Remaining Capacity - 0x0f
Full Charge Capacity - 0x10
Run Time To Empty - 0x11 -read -predicted battery life 0-65534 minutes
Average Time to Empty - 0x12
Average Time To Full - 0x13 -read
CapM
AverageCurrent - 0x0b
AtRate - 0x04
AtRateTimeToFull - 0x05
AtRateTimeToEmpty - 0x06
AtRateOk - 0x07
0 = true
SafetyAlert - 0x50
SafetyStatus - 0x51 -read
PFAlert - 0x52
PFStatus - 0x53
The registers SafetyAlert, PFAlert, and PFStatus respectively contain values for items which are nearing alert thresholds, pending safety issues which have not yet yet caused a failure, and permanent failures.
A possible way to handle these situations is to:
I talked with Andrew tonight. He said that in situations where there is anything wrong with the battery, it should prevent the rocket from arming if it isn´t already armed. If it is, it should just send the error state down the wire. I have created a branch called rnh_safety_events which polls all three of the safety registers. If any of them read nonzero an event is triggered. Right now this event just sends the contents of all three registers onto the wire. A todo item is to go over the arming code and add in the ability to prevent arming should the need arise.
This is apparently fixed in commit 4990e651fec6e387d908d2d482c8872c81dfac1a
It generates lots of cool information about the batteries like voltage and temperature and stuff. We need to determine exactly what we want, create the code to get it, and then have this information sent to the FC over the RocketNet.
Additionally it has a bunch of safety features. We should see if we can read the status of them or get notifications of when they change, and then send this to the FC over the error channel.