samsta / BatteryController

GNU General Public License v3.0
0 stars 0 forks source link

Determine what to do if/when write to USB port (teensy) fails #22

Open JimsterCoder opened 1 year ago

JimsterCoder commented 1 year ago

Currently when writing to the USB port fails a message (many!) are logged but no action is taken and, very oddly, the system seems to keep running, though it reports zeros in the log data but the invertered continues to function. BC must still be sending messages to the inverter, perhaps with incorrect data. This would be bad as we count on this message to stop the inverter when the battery is full/empty.

I have observed this twice in the past few weeks I have no explanation for why it happens. I don't recall exactly, but I think restarting the BC fixed it, maybe I had to unplug/replug the teensy. Will make a note next time it happens.

JimsterCoder commented 1 year ago

I suppose the simple answer, for now, is we need to shutdown or stop sending CAN messages to the inverter so that it shunts down.

JimsterCoder commented 1 year ago

Thinking a bit more about this... BC kept on responding to the heartbeat from the inverter so the inverter was happy... despite the fact BC was not sending it any other data. Nice, again, SinexHELL. 👎

NiallDarwin commented 1 year ago

BatteryController should be able to detect this failure. It should then change its inverter messages containing max amps/power to zero. We also need to flag this error to the end user. Where & how? In the 'finished product' do we think the operator will interact with battery controller as well as OEMS or OEMS alone?

JimsterCoder commented 11 months ago

As we saw this morning, the teensy was unable to trip the shunts because the serial port connection had failed. I have seen this failure approximately 4 times in the life of the project, the cause being unexplainable. Presently no action is taken by the battery controller but this is a serious issue so I will modify the code to open the main contractors when any error relating to communications to the Teensy's occurs.

NiallDarwin commented 11 months ago

For contactor life & reliability it is much better to switch off under zero load. If your shutdown can be staged to demand zero power from inverter then wait (5-10 seconds?) before opening the contactors that would be great. If you could do the reverse of startup that would be gold-plated goodness (Close pre-charge, open positive, open negative, open pre-charge).