EV managment module

Chat about all things battery in here.
Need to know what type to use or size or capacity then again place your thoughts here
GregsGarage
Posts: 870
Joined: Tue Apr 01, 2008 5:27 pm
Location: Galashiels, Scottish Borders
Contact:

EV managment module

Postby GregsGarage » Wed Aug 13, 2008 2:18 pm

I have been working on a BMS system for use with my new Li-ion cells fitted to my Fiat 126. The car is using a Agni 95 turn PM DC motor with a Kelly KD72401 controller that gives regenerative braking. While looking for options for a BMS system I found, among others, Reap systems 14 cell boards and Cedric Lynch's cell controllers, also available from the Agni motors website. Reap's BMS is a top-end product, highly recommended with a price tag to match! Cedric's cell protectors would have to be modified to suit the lower operating voltages of these cells, but he is working on a new design that will work with the greater range of cells coming onto the market.

I decided to see what was available "off the shelf" and found that BMS boards are available for e-bikes that have the correct voltage settings for my cells. These BMS boards connect between the negative terminal of the battery pack and the controller as well as the charger. They simply shut-off the pack if they encounter a low or high voltage condition. This brings 2 problems for use in a car.

1. They can't handle the higher currents of a car, all the current goes through the BMS board.

2. They shut off with no warning, not a problem in a bike, you just pedal but not good in a car unless your name is Fred Flinstone!

Problem 1 can be addressed with a simple relay, problem 2 requires something a bit cleverer. The systems mentioned above use a PWM signal to reduce power output gradually. What I have done is come up with a system that will sound a audible alarm and warning light if cell voltages get low and start a 15 second timer before shutting down the motor/controller completely. So it will rely on the driver to reduce throttle when the batteries are getting low, and as long as the driver was the one who signed the cheque for the batteries it should work fairly well.

I have found a programmable controller made by a company called http://www.splatco.com. Their controllers will work on 12 or 24 vdc. I am using their CC16 controller. It has 16 pins that can be configured for either inputs or outputs. They also do other controllers that can drive LCD displays and have analogue inputs, etc..

I originally bought this to use as a speed limiter for my Volvo as it has some counter functions built in. Haven't gotten around to doing that yet, but I still have a couple of spare inputs, so it could possibly be added to this project. I am calling this a EV Management System as I am not directly measuring the Li-ion cells but using the measurements taken from the cells by separate boards as well as inputs from the rest of the vehicle to control when the vehicle can be driven or charged. This set-up should be able to use Peter's slave boards which have the advantage that because they are individual boards, they could be independently calibrated. It should also be possible to use this system without the battery monitoring, so that for example the car can't be driven while still plugged in!

The actual program will be in the following post. I have only done very limited testing with the simulation software provided. There may still be bugs that I haven't found. This is still very much a work in progress.

Any thoughts, suggestions, comments greatly appreciated, although due to time constraints it may sometimes take me a while to respond.

Greg Fordyce
Greg Fordyce

Daewoo Matiz
http://www.evalbum.com/4191

GregsGarage
Posts: 870
Joined: Tue Apr 01, 2008 5:27 pm
Location: Galashiels, Scottish Borders
Contact:

Program

Postby GregsGarage » Wed Aug 13, 2008 2:20 pm

Code: Select all

; Li-Ion Battery/Vehicle Management Software by Gregory Fordyce.

; For use with Splatco CC16 programable controller (www.splatco.com)

; and "off the shelf" BMS modules designed for e-bikes, etc.

; Version 0.3   -   6 Sep 2008



;This BMS program and hardware implementation carry no warranty or guarantee

;of any kind! They are used at your own risk, and I make no claims as to their

;suitability for a particular function.

;Prospective users must evaluate the system before using it, and no

;liability will be entertained by myself in any shape or form whatsoever.

;The software has been provided for the benefit of the EV & electronic community.

;The software is available free via the internet.

;Users may modify or adapt the system as they see fit. If you are not fully

;competent to work on potentially lethal battery systems and high voltages,

;then do not experiment with or use this system. Be aware that vehicle

;modifications can lead to invalidated insurance and warranty issues. You the

;end user remain fully liable for any modifications made to your vehicle.     



;Define inputs.

;Variable names on left are assigned to a input pin

HV   iEQU   4   ;High voltage cuttoff for pack 1

LV      iEQU      6      ;Low voltage cuttoff for pack 1

RPM   iEQU   7   ;RPM input

SW1      iEQU      8      ;Regen switch (brake light switch will trigger regen)

SW2      iEQU      9      ;Throttle switch

ACIN      iEQU   10      ;Detect if car is being charged from mains

IGN      iEQU   11      ;Detect ignition switch on or off

HOT      iEQU   12      ;Detect if any temp snap switches have tripped



;Define outputs

;Variable names on left are assigned to a output pin

;Output loads are spread across the 2 driver chips

ACOUT   oEQU      0   ;Controls AC power to charger

SW1OUT    oEQU      1   ;Regen signal to controller, connect to SW1

SW2OUT  oEQU      2   ;Throttle signal to controller, connect to SW2

BATT      oEQU      3   ;Battery warning light on dash

VACPMP    oEQU   5   ;Vacuum pump relay

TEMP      oEQU      13   ;Tempurature warning light on dash

BUZZ      oEQU      14   ;Warning buzzer

;DCPWR   oEQU   15   ;DC-DC convertors, also cuts power to the Splat controller! Not yet implemented.

         ;Idea here is that if vehicle is left unattended for a long period of time,

         ;complete battery power can be shutoff if cells drop below safe voltage.



;Define semaphores

DrvWarning   defSEM

Shutdown   defSEM



;Define other variables

VACTIMER   EQU   300   ; 3 second run time

MAXRPM   EQU   17   ;To calculate figure required for a given rpm use following formula;

         ;MAXRPM=rpm*pulses per revolution/600. 17 gives a max rpm of just over 5000

         ;with 2 pulses per revolution



;Define and start Multitrack. All tasks run concurrently.

   LaunchTask   Drive   

   LaunchTask   Charge

   LaunchTask   Pump

   LaunchTask   Fault_timer

   RunTasksForever   ;These 2 tasks will run forever.



;--------------------------------------------------------------------------------

;                                    ;

;      Drive routine passes idle and regen requests to controller      ;

;                        When it is o.k. to do so.                   ;

;                              ;

;--------------------------------------------------------------------------------



Drive

   OBCA_Mode  0   ;Disable On Board Counter A

      Off      BATT

      Off      TEMP

   Off   BUZZ

      Off   SW1OUT   ;Turn off regen output.     

      Off   SW2OUT   ;Turn off throttle output.   

      WaitOn   IGN   ;Waits here until ignition is switched on.

   OBCA_Mode   1;Enable On Board Counter A and set to 0.1 second reading interval.



Drive1

         GoIfInOff   IGN,Drive   ;Go back to start of routine if ignition switched off.

      YieldTask   ;

   OBCA_GoIfNoRdg   Drive1;Stays in this loop until OBCA has rpm reading, every 100ms

   OBCA_fRead      ;loads rpm value into W register

   fLoadQ   17;Loads maximum rpm into Q register

   fCompareR   ;Compares W and Q registers and stores result code in R register

   BranchR   ;Depending on the results in R register program will either goto drive

         ;shutting down controller if max rpm exceded or continue to next line.

   Target   Drive

   Target   Drive

   Target   Drive2

   Target   Drive2

   Target   Drive2



Drive2

   

      Gosub   Read_inputs



;Check for over temp or low voltage faults

      Recall   HOT      ;Load HOT value into X register.

      Recall   LV      ;Push X to Y register and load LV1 value into X register.

      Or         ;Performs logical OR on X and Y register, sets X to value.

   Push      ;Copies X register to Y register so value can be used twice.

      Output   BUZZ   ;Controls BUZZ based on above conditions.

   StoreS   DrvWarning;Semaphore set if BUZZ is set, else cleared.

      Recall   HOT      ;Read HOT value

      Output   TEMP   ;Turn temp warning on or off as required.



      Recall   LV      ;Load LV1 value into X register.

      Output   BATT   ;Turn batt warning on or off as required.



   GoIfST   Shutdown,Stop ;Stop if temp or LV fault persists for more than 5 seconds.

   

Regen

      Recall   HOT      ;Load HOT value into X register.

      Recall   HV      ;Push X to Y register and load HV value into X register.

      Or         ;Performs logical OR on X and Y register, sets X to value.

      Not         ;Invert X register

      Recall   SW1      ;Push X to Y register and load Regen/brake input

      And         ;Check to see if regen is allowed

      Output   SW1OUT ;Send Regen signal to controller.



Throttle

      Recall  SW2      ;Load throttle switch input to X register

      Recall  ACIN      ;Push X to Y register and load ACIN value into X register.

      Not         ;Invert ACIN value

      And         ;Only allow throttle if SW2 is on and ACIN is off.

      Output  SW2OUT    ;Send throttle signal to controller.

      Goto      Drive1  ;Return to start of drive1 routine.

   

Stop

      Off      BUZZ

      Blink   BATT

      Blink   TEMP

      Off      SW2OUT

      WaitOff HOT

      WaitOff LV

      Off      BATT

      Off      TEMP

      Goto      Drive1   ;Return to start of drive1 routine.



;--------------------------------------------------------------------------------

;                                    ;

;      Charge routine controls power to charger through a relay.      ;

;                              ;

;--------------------------------------------------------------------------------

Charge

      Off      ACOUT     ;Turn off charger.   

      WaitOn  ACIN      ;Waits here until mains power is connected.



Charge1

    GoIfInOff   ACIN,Charge      ;Go back to start of routine if AC power still connected.

      Gosub    Read_inputs

      Recall  HOT         ;Load HOT value into X register.

      Recall  IGN         ;Push X to Y register and load IGN value into X register.

      Or            ;Performs logical OR on X and Y register, sets X to value.

      Recall  HV         ;Push X to Y register and load HV value into X register.

      Or            ;Performs logical OR on X and Y register, sets X to value.

      Not            ;Invert result of X register

      Output  ACOUT      ;Turns on charger if all above conditions are false.

      Pause   100         ;1 second pause.

    Goto   Charge1      ;Return to start of Charge routine.



;--------------------------------------------------------------------------------

;

;   Vacuum pump, activated by input from brake switch

;

;--------------------------------------------------------------------------------

Pump

   Off   VACPMP      ;Turn off pump

   WaitOn   IGN      ;Wait until ignition switched on

   On   VACPMP      ;Turn on pump

   Pause   VACTIMER   ;Pump initially run to charge brake servo

   Off   VACPMP

Servo

   WaitOn   SW1      ;Wait here until brake pedal is pressed.

   On   VACPMP      ;

     WaitOffT   SW1,VACTIMER   ;Wait for brake pedal to be released or

            ;continue to next instruction after VACTIMER has elasped

    GoIfInOff   IGN,Pump   ;Goto start of Pump routine if ignition has been switched off.

   Off   VACPMP

   WaitOff   SW1      ;Wait here until pedal is actually released, if it timed out above.

    On   VACPMP      ;Recharge servo

   Pause   VACTIMER   ;

   Off   VACPMP

    GoIfInOff   IGN,Pump   ;Goto start of Pump routine if ignition has been switched off.

   Goto   Servo   



;-----------------------------------------------------------------------------

;

;  Fault timer routine. Gives 5 second warning if

;

;

;-----------------------------------------------------------------------------



Fault_timer



   ClrS      Shutdown

   WaitForST   DrvWarning

   SetTimer   0,50



Fault_loop

   Pause   10

   GoIfSF   DrvWarning,Fault_timer

   Test   0

   NOT

   StoreS   Shutdown

   Goto   Fault_loop



;------------------------------------------------------------------------------

;                        Start of subroutines                                 ;

;------------------------------------------------------------------------------



Read_inputs         ;Reads all inputs and writes result to memory location.

               ;All decisions will be made based on a snapshot of the inputs.

               ;Any changes to an input will be acted on in the next cycle.

   Input   HV      ;Overvoltage input from board 1

;   NOT            ;Invert input, optional

   Store   HV      ;

   Input   LV      ;Undervoltage input from board 1

;   NOT            ;Invert input, optional

   Store   LV      ;

   Input   SW1     ;Regen/brake switch

   Store   SW1     ;

   Input   SW2     ;Throttle switch

   Store   SW2     ;

   Input   ACIN    ;Mains power connected

   Store   ACIN    ;

   Input   IGN     ;Ignition switch

   Store   IGN     ;

   Input   HOT     ;Temp snap switches

   Store   HOT     ;

   Return









Fixed timer routine, newest code uploaded 22-12-08

Code updated 2 Sep 2008. Added routine for Vac pump and RPM limiter. Peter may have noticed that I have shamelessly copied his preamble, hope you don't mind. :shock:
Last edited by GregsGarage on Mon Dec 22, 2008 5:04 pm, edited 3 times in total.
Greg Fordyce

Daewoo Matiz
http://www.evalbum.com/4191

User avatar
retepsnikrep
Posts: 1387
Joined: Sat May 26, 2007 4:50 pm
Location: North Yorkshire England
Contact:

Good Work

Postby retepsnikrep » Wed Aug 13, 2008 2:27 pm

Excellent! Keep at it, I like the disclaimer it looks very familiar :wink: :lol:

No comments as yet I'm afraid. I'l put thinking cap on.

Peter
Regards Peter

Two MK1 Honda Insight's. One running 20ah A123 Lithium pack. One 8ah BetterBattery Nimh pack.
One HCH1 Civic Hybrid running 60ah A123 Lithium pack.

GregsGarage
Posts: 870
Joined: Tue Apr 01, 2008 5:27 pm
Location: Galashiels, Scottish Borders
Contact:

smoked bms board

Postby GregsGarage » Wed Aug 13, 2008 2:37 pm

The BMS boards I am using have been purchased from ebay seller Ping Battery. Pictures of the 24v version of these boards can be found here;
http://tech.ph.groups.yahoo.com/group/T ... rowse/5965

While connecting the first one up I had all the little wires attached to the board. These wires connect in turn to each positive terminal in the battery pack. I let one of the wires touch a terminal at a much higher voltage point in the pack and that "let the smoke out".

Lesson learned, disconnect the small wires from the board first and check the voltages before connecting to the board. :shock:
A stupid mistake that I won't make again.
Greg Fordyce

Daewoo Matiz
http://www.evalbum.com/4191

MalcolmB
Posts: 423
Joined: Sat Jun 23, 2007 8:07 pm

Postby MalcolmB » Wed Aug 13, 2008 3:19 pm

Nice work Greg! I will have to read through this a few times before it loads fully into my limited processing space, but just one very basic question to start with. What form do the outputs take, specifically "ACOUT oEQU 0" which is used to control a charger?

GregsGarage
Posts: 870
Joined: Tue Apr 01, 2008 5:27 pm
Location: Galashiels, Scottish Borders
Contact:

Postby GregsGarage » Wed Aug 13, 2008 3:36 pm

MalcolmB wrote:Nice work Greg! I will have to read through this a few times before it loads fully into my limited processing space, but just one very basic question to start with. What form do the outputs take, specifically "ACOUT oEQU 0" which is used to control a charger?


ACOUT is a variable that I have assigned a value of 0. to turn on a pin you can simply say "ON 0" which will turn on pin 0, which can in turn activate a relay turning on the power to the charger. You can also say "ON ACOUT" and since I have told it ACOUT = 0 its the same thing.

The splat programming is quite low level, you can directly work with registers so I control the charger with the line "OUTPUT ACOUT".
The OUTPUT command will turn on the defined output (ACOUT or 0 in this case)if the X register is true and off if it is false. It's a bit different than basic programming, you will probably need to refer to the online documentation, which is quite good, to understand the program.
Greg Fordyce

Daewoo Matiz
http://www.evalbum.com/4191

User avatar
Jeremy
Posts: 472
Joined: Thu Jul 31, 2008 6:35 pm
Location: Salisbury

Postby Jeremy » Wed Aug 13, 2008 4:24 pm

There is another BMS kit that has been designed by a few guys on the Endless Sphere forum. I've just bought a 16 channel kit for my LiFePO4 pack.

The full circuit diagram, together with the story of the development of this project, is on these two ES forum threads: http://endless-sphere.com/forums/viewtopic.php?f=14&t=3345 and http://endless-sphere.com/forums/viewtopic.php?f=14&t=5416.

My complete 16 channel kit, including PCB, all components, connector and shipping cost around $100. It has a individual cell low voltage cut off signal that I'm using to trigger the half-speed circuit on my Alltrax controller as a warning. This is set to 2.1V per cell, which is OK for most LiFePO4 cells, I think.

The charge management part of the circuit uses shunts to switch up to about 500mA of current around any cell that reaches the charge maximum voltage of about 3.65 to 3.7V. At the same time, the circuit cuts the charge current to the whole pack down by switching the charging current on and off with a variable duty cycle, via a low Rdson, 100V, 75A rated FET. The board has the ability to be daisy chained with others for packs with more than 16 series connected cells. Packs don't need to be in multiples of 16 either, any board can be populated with as many, or as few, channels as needed.

Experimental evidence seems to suggest that a 500mA shunt balancing current would seem to be OK for charging packs up to around 50 to 100Ah. Anything over this is likely to need a bigger shunt current to ensure that the balancing phase of the charge doesn't take too long.

I have one of the Ping BMS boards on my ebike LiFePO4 battery and it works OK, but has a few flaws apart from the in-built current limit. The first is that you never get full charge, as the BMS discharges the highest voltage cells down to the lowest as part of it's balancing cycle. This may not be a real problem, as in all likelihood the charge still gets to around 98% or so. The second is that it takes a long time to balance even a 10Ah pack - my initial charge took well over 7 hours to balance, after the bulk charge phase was complete. The final problem is that you can't series connect them as they stand, as the current limit circuit blows if you do. These Ping boards are very cheap though and work OK for low current/voltage applications.

Hope this helps.

Jeremy

PS: Edited to add a direct link to the sales site for these kits: http://www.tppacks.com/proddetail.asp?prod=EBKE-BMS-Kit. They are currently out of stock, but Gary should have another batch ready in a few days.

GregsGarage
Posts: 870
Joined: Tue Apr 01, 2008 5:27 pm
Location: Galashiels, Scottish Borders
Contact:

Postby GregsGarage » Thu Aug 14, 2008 9:30 pm

Hi Jeremy,

Thanks for the link to tppacks. I had been aware of their project but didn't realize they were now selling them. They also have a simple low voltage cutoff board that can handle up to 16 cells. http://www.tppacks.com/proddetail.asp?prod=EBKE%2DLVC%2D16%2DCell
This may be of interest to people who have a charger that includes balancing and don't have regen braking on their vehicle. I know China Hipower is offering this type of charger with their packs, so another option for people. 8)

I think I have gotten around the problem of connecting 2 or more Ping boards to a pack. The problem is that connected in series you can exceed the voltage ratings of the boards components. What I was going to do is to connect 2 reed relays between the charger and controller outputs and 12v positve (cell number 4). Low voltage will switch off one of the relays and high voltage will switch the other one off. I have 24 cells in total, each board handles 12 cells. The outputs of the 2 low voltage relays from both boards will be connected in series to my CC16. It will see a high input unless one (or both) boards cut out, then it sees low. Same for the 2 high voltage relays.

I don't see the fact that the Ping boards won't give a full charge because of the way they balance as a major problem. It has been reported on the yahoo thundersky group that longer life can be achieved by not full charging and discharging these cells, of course that was for thundersky but I suspect these hipower cells will be similar.

It will be interesting to see how they do on balancing, but as long as it can balance them overnight while I am sleeping, that is fine by me. I don't think they will require daily balancing. Of course I first have to see if I can fix the board that I smoked, it was only a small puff and I think I have identified a zenor diode rated for 4 volts that probably got 40! :shock:

Let us know how connecting your board to the half speed input on your controller works out. The Kelly controller also has a half speed input but I can't use it in that way because the controller assumes it to be a reverse input and shuts down if "reverse" is selected while driving. :?
Greg Fordyce

Daewoo Matiz
http://www.evalbum.com/4191

User avatar
Jeremy
Posts: 472
Joined: Thu Jul 31, 2008 6:35 pm
Location: Salisbury

Postby Jeremy » Fri Aug 15, 2008 6:29 am

I have an unused 16 channel LVC board from Gary, if anyone wants one. I was originally going to make my own charge balancing boards, but when Gary, Richard, Bob et al decided to make their "open source" project available as a kit I decided it simply wasn't worth the hassle of the DIY approach.

Putting big diodes around the Ping BMS boards allows them to be connected in series OK, according to at least one of the posters on the ES forum who has connected a pair of Ping packs together. The LVC circuit can be changed fairly easily too, so that it just gives an on/off signal instead of switching off the power. To make a couple of BMS boards work in series this LVC signal needs to be OR'ed via a couple of opto isolators, which is pretty straghtforward. This arrangement loses the BMS current limit functionality, but the limit is usually set to around 35A so is not much use for bigger EV use.

Jeremy

User avatar
EVguru
Posts: 305
Joined: Fri May 25, 2007 5:17 pm
Location: Luton
Contact:

Postby EVguru » Fri Aug 15, 2008 9:27 am

It has a individual cell low voltage cut off signal that I'm using to trigger the half-speed circuit on my Alltrax controller as a warning. This is set to 2.1V per cell, which is OK for most LiFePO4 cells, I think.


This seems to be a common approach where the battery monitoring system has a digital output, but I don't think it's a good one.

Ideally a 'warning' needs to be given at say 20% remaining charge, giving you the option to stop immediately, or know you can complete your journey with the remaining change. Cedric's analogue system simply won't let you get a cell below the cutoff, it just keeps reducing the throttle input limiting the power until you slow down and stop. Just going to half power at the cut-off voltage doesn't prevent you from over-discharging. There's too much temptation to think 'It's only another mile, I can make it fine'.

What you really need is a throttle control interface. When it receives a low cell signal, it limits the throttle input by a small amount. At a fixed time interval later if the low cell voltage signal is still present, it increases the throttle limit by another small amount. Eventually the throttle input would be limited to zero. The reverse would be true for reducing the limit if the low cell signal was removed. This way you get a dynamic balance between throttle (power limit) and the lowest cell voltage, albeit in small discrete steps rather than completely analogue.

I've been involved with running and building EVs for over 12 years and through the international EV mailing list have followed the experiences of others. From that combined knowledge I can say unless there are systems in place to physically prevent overdischarge of a battery, sooner or later it WILL happen.
Paul

http://www.compton.vispa.com/scirocco/
http://www.morini-mania.co.uk
http://www.compton.vispa.com/the_named


Return to “All things battery related”

Who is online

Users browsing this forum: No registered users and 30 guests