View Single Post
Old 06-04-2011, 09:36 PM   #300 (permalink)
Freyguy
EV Builder
 
Freyguy's Avatar
 
Join Date: Nov 2010
Location: Macungie, PA
Posts: 157
Thanks: 15
Thanked 64 Times in 40 Posts
Corrupted SOC value

So after driving my EV to the market, I glance at the SOC value and see 84% before turning off ignition. 20 minutes later I’m back in the car, and when I turn it on, the SOC shows 151%! I cycle power again, but it comes back to 151%. Hmmmm. I drive home, and the SOC percentage drops like normal from the 151% value. This is the first time I encountered this, but I believe I know what is happening.
The updated capacity is written to EEPROM every 60 seconds. I think it was in the midst of an EEPROM write while I powered it off, thereby corrupting the stored capacity value. I thought about various ways to handle this, but the most bulletproof (I think) is to check battery amps before writing capacity to EEPROM. If battery amp draw is less than 2 amps (vehicle is stopped) skip the EEPROM write. I left a 1 amp buffer since my DC/DC converter draws about that if my vacuum pump is running after I stop.

I’ll add this to version 1.4 along with the EEPROM write immediately after Resetting SOC . Still want to hold off release until 1.3 is beat up a bit more to uncover additional bugs. Required code changes below:

Insert these 5 lines after line 400-
tstfsz bAmpH ; test for battery amps
bra Tempmov ; less than 2 amps
movlw .1 ; if so, then
cpfsgt bAmpL ; skip SOC adjust
goto Alarm ; and writing to EEPROM

Add label “Tempmov” to line 406 (was line 401)
Tempmov movff bAmpL, bAmptempL

Add label “Alarm” to line 448 (was line 443)
Alarm movlw ALRM_lim
  Reply With Quote