Old BMS Software Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

danmachen
Posts: 22
Joined: Fri Nov 11, 2011 11:26 am

Re: Old BMS Software Thread

Postby danmachen » Tue Apr 10, 2012 9:38 pm

yeah thought so! Thats a pretty big balancing current... nearly 500mA. Does it work well? We've gone for around 350mA, but don't really want to push it much further.

isaac_alaska1
Posts: 100
Joined: Sun Apr 03, 2011 7:41 pm

Re: Old BMS Software Thread

Postby isaac_alaska1 » Tue Apr 10, 2012 9:48 pm

it works but it's hard to keep cooled. i'm adding a couple of fans to the box though which should help a lot. i need to pull the box apart today and see if the cell is actually low or if the board is just giving me funny readings. cause i expected it to come up more than it did when i tried charging the pack yesterday

isaac_alaska1
Posts: 100
Joined: Sun Apr 03, 2011 7:41 pm

Re: Old BMS Software Thread

Postby isaac_alaska1 » Wed Apr 11, 2012 1:33 am

do you have an idea of how much current the BMS draws per cell when it's turned off?
i used this graph to get an idea of how many aH the low cell is off by:
http://www.google.com/imgres?hl=en&safe ... ,s:0,i:102

the high cells are at 4 volts and the low one is at 3.8V about 1aH on a 5aH pack, and i have nine strings so that's about 9aH total imbalance. estimated it's been connected for about 2 months (1440 hours) which comes out to be be a draw of 6.25mA more than the rest of the cells.

i'm going to do some tests (hopefully tonight) and figure out if the culprit is the board or a cell.

isaac_alaska1
Posts: 100
Joined: Sun Apr 03, 2011 7:41 pm

Re: Old BMS Software Thread

Postby isaac_alaska1 » Sun Apr 15, 2012 7:51 am

okay, so now it turns the loads on.

load cut in default is set at 4.1V
i sent command 5 three times, to decrease cut in to 3.95V
lowest cell is at 4.00

all loads come on when i tell it to start charging, but the charger isn't turned off automatically (which i think it should be, because all the loads are on)

this should be the relevant code:

Code: Select all

   if PackV > MaxPackV then      'If PackV > Maximum pack voltage then set Alarm
      Alarms = 7            'set Alarms to 7 (Pack over Maximum Voltage)
   endif

   
    if PackV < MinPackV then      'If PackV < Minimum pack voltage then set Alarm
       Alarms = 8            'set Alarms to 8 (Pack under Minimum Voltage)
    endif
   
   if ChgBit = 1 then         'If Charger is operating (1) then Chg End FullBit Detection routine
      VarA2 = 1            'Charge End test Byte all Cells full = 1   
      for VarA1 = 1 to Cells         'Check FullBit array status  (0 = Cell Not Full) (1 = Cell Full)
          if FullBit [VarA1] = 0 then       'Check if FullBit for Cell is set
              VarA2 = 0            'if it isnt set, clear Charge End Temporay Byte VarA2
          endif
      next VarA1            'Check Next Cell
      if VarA2 = 1 then         'If VarA2 is 1 then all cells have reached balancing voltage during cycle
          Alarms = 6            'Set Alarms to 6 (Indicates End of Charge)
      endif   
   endif   


i'm also attaching the full code
Attachments
isaac slave code.zip
(4.61 KiB) Downloaded 371 times
isaac master code pic18F2680.zip
(20.11 KiB) Downloaded 355 times

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

Re: Old BMS Software Thread

Postby retepsnikrep » Mon Apr 16, 2012 8:31 am

The problem is when you send command 5 to reduce the load switch on point it changes CutInV in the slave, but does not change CutInVD in the Master.

So the loads turn on correctly as the cell V is over CutInV in the slave, but the cell V is not over the CutinVD in the master so the FullBit for that cell is not set.

Only if all the FullBits are set or there is an error will the charge be terminated.

The charger is designed to stop as soon as allthe cells have reached the balancing voltage (CutInV / CutInVD) during this charge cycle.

Another issue is that CutInVD is a constant in the Master not a variable :roll: so that's a bad choice by me, you need to change it to a WORD variable and then set it so that it matches CutInV in the slave. If you are clever you could add some code to the commands routine so that it changes CutInVD automatically each time you send Command 5. If you change CutInVD to a variable don't forget to give it a value at the program start. and if you change it you will need to store it in eeprom and reload it each time master is run.

For a quick test I suggest leave CutInVD as a constant but change it to the value you are using in the slaves for CutInV after you have sent the command 5 x 3.

So set CutInVD to 3.95 in the Master. Then use command 5 to bring CutInV into line with that. The charge will then terminate as soon as all cells are > 3.95V


The Master code needs tweaking to address this issue I'll look at if for the next update.
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.

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

Re: Old BMS Software Thread

Postby retepsnikrep » Mon Apr 16, 2012 8:38 am

isaac_alaska1 wrote:do you have an idea of how much current the BMS draws per cell when it's turned off?


IIRC < 1ma
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.

danmachen
Posts: 22
Joined: Fri Nov 11, 2011 11:26 am

Re: Old BMS Software Thread

Postby danmachen » Mon Apr 23, 2012 9:05 pm

Here comes probably an overasked question
.. so please forgive me....Just wanted to ask the logic of why all the serial signals are inverted from the PIC? e.g. N9600..

Why would the signal need to be inverted, instead of say making it true the entire time?

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

Re: Old BMS Software Thread

Postby retepsnikrep » Tue Apr 24, 2012 3:43 am

Something to do with having the optos off rather than on all the time. Also something to do with sinking the optos into the pic as a more effcient driving method at low voltages. I can't remember really it's a along time ago since I did the original design.
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.

danmachen
Posts: 22
Joined: Fri Nov 11, 2011 11:26 am

Re: Old BMS Software Thread

Postby danmachen » Tue Apr 24, 2012 7:23 pm

Ah right ok, so the opto inverts the signal and so you invert it again in the master code.

isaac_alaska1
Posts: 100
Joined: Sun Apr 03, 2011 7:41 pm

Re: Old BMS Software Thread

Postby isaac_alaska1 » Thu Nov 29, 2012 5:15 pm

getting a few more issues fixed up with these last systems i'm setting up. the old slave boards i used in the past work great, but switching to new boards is giving incorrect voltage readings. i think it has something to do with the new opto's i put on the boards. probably should have tested them before i soldered up 10 boards worth......

i'm thinking if i decrease the baud rate it might fix the problem, but i don't know where the relevant code would be. do i have to change the master and slave software? i'll upload my code and you can take a look at it if you'd like. i'm only planning to use 32 cells with these boards so i think the slower baud rate wont' be an issue.

just change the extensions on the attached files to .txt instead of .zip, it was easier to change them than to compress the files. this code is for the PIC18F2680
Attachments
isaac_ebus_slave(V27_variant).zip
change the extension to .txt (this is NOT a zip file)
(14.2 KiB) Downloaded 328 times
isaac_ebus_master(V31_variant).zip
change the extension to .txt (this is NOT a zip file)
(73.65 KiB) Downloaded 340 times


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 3 guests