Old BMS Software Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Postby steiner » Sun Jun 28, 2009 6:44 pm

Thanks for the information. I had already caught a few of the lines that were remed out. I had set the number of slaves to 2 (that is all that I built right not). I am using 90 Ahr Thundersky batteries. I changed the code to allow 650 Ahr cells max. I am using a simple 16x2 LCD display for now. I plan on ordering one similar to yours. I am trying to find one with 640x480 resolution, a flat screen, and a maximum height of 70mm. I plan on flush mounting mine in the dash and only have a small area to mount it.

Correct me if I am wrong, but I was under the impression that you had your system working very well on the bench. It wasn't until you installed it in your vehicle that you started having problems. I assume they were EMI related issues. Have you tried it with shielded twisted pair wiring?

How is the multi-slave board progressing?

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

Postby retepsnikrep » Sun Jun 28, 2009 8:08 pm

My Master code does not support a 16x2 display unless you have modified all the routines/code. It needs a 16x9 display to work.

Yes it all worked fine on the bench with 50 cells but my Honda Insight is an RF nightmare, I just havent had time to redo all the connections with twisted pair etc.

The multi cell board is progressing but I've got some other higher priority stuff ongoing at present.

I've just bought a cheaper version of the display I'm using.

item=260432922233
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.

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Postby steiner » Sun Jun 28, 2009 9:35 pm

I know, I updated the code to work with the 16x2 LCD.

I saw that display before. I believe it is only a 480 x 234 resolution. My biggest concern with this display was the curved front surface which will not mount in my application very well.

I have a question about how you are sensing the battery voltage. I thought I understood it until I hooked it up in a simple circuit with an adjustable power supply. I connected the 100K ohm resistor to the positive supply and the center pin (+) of the LM385. I then connected the bottom pin (-) of the LM385 to the ground connection on the power supply and left the FB pin floating. I then measured the voltage between the two pins (+ and -) on the LM385 while changing the output of the power supply from 2 volts to 5 volts. My readings only varied by .002 volts between 2.0 volts to 5.0 volts. That equates to less than one count on the 10 bit A/D. What am I missing?

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Postby steiner » Sun Jun 28, 2009 10:40 pm

Never mind about how we calculate cell voltage. I remembered a link that you had referenced before (http://www.picaxeforum.co.uk/showthread.php?t=8624) that describes how it works.

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

Postby retepsnikrep » Mon Jun 29, 2009 6:38 am

I've got one of the 640x480 displays with the surround removed etc. Just the innards if you want it? It's a flat screen.

I suggest buy one of those cheapo ones and take it to bits to fit in your application, they are 640x480 ASFAIK.

As you gave discovered the diode and resistor simply provide a stable voltage reference for the Picaxe which has a changing supply voltage. Some maths then gives us our Cell Voltage.
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.

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Postby steiner » Tue Jun 30, 2009 1:27 am

Can you tell me what the width and heigth of the display is? How much do you want for it?

I am curious to know if the software that you sent me is the code that you had working properly on the bench. I am getting some strange results. When I first ran it, it was displaying that my cell was less than AbsMinCellVoltage. I then remed the code so the only thing that I have running in the "Main loop" is the "Check cells" and the "Display routine". I have the system stripped down to just the master and one slave. I have the number of cells set to 1. This particular cell measures 3.339 volts with a dmm. I also get a voltage reading of 1.231 volts across pins 6 and 8 on the slave. My calculations show the 10 bit A/D should be getting a reading of 377 (CellA). Plugging that into the equation gives CellV a value of 335 whick would be very close to the correct value. In the interrupt routine it subtracts 175 from CellV which would be 160 which is stored in b0 and b1.

If I understand the code correctly, the slave sends out "Vdata" which is the first byte (b0) of "CellV". The master brings this data in and stores it in the scratchpad ram. It then moves it to "VoltageData". I added a line of code to send "VoltageData" out to the LCD while it is still in the "Check Cells" routine. It is sending the ASCII code and I am getting 48. It then sends the High cell value to the LCD and I get 2.23 volts.

Can you explain how a value of 160 would be stored in two bytes? It would seem like 160 will fit in the first byte and therefore the second byte would be empty.

Rick

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

Postby retepsnikrep » Tue Jun 30, 2009 3:49 am

steiner wrote:Can you tell me what the width and heigth of the display is? How much do you want for it?

I am curious to know if the software that you sent me is the code that you had working properly on the bench. I am getting some strange results. When I first ran it, it was displaying that my cell was less than AbsMinCellVoltage. I then remed the code so the only thing that I have running in the "Main loop" is the "Check cells" and the "Display routine". I have the system stripped down to just the master and one slave. I have the number of cells set to 1. This particular cell measures 3.339 volts with a dmm. I also get a voltage reading of 1.231 volts across pins 6 and 8 on the slave. My calculations show the 10 bit A/D should be getting a reading of 377 (CellA). Plugging that into the equation gives CellV a value of 335 whick would be very close to the correct value. In the interrupt routine it subtracts 175 from CellV which would be 160 which is stored in b0 and b1.

If I understand the code correctly, the slave sends out "Vdata" which is the first byte (b0) of "CellV". The master brings this data in and stores it in the scratchpad ram. It then moves it to "VoltageData". I added a line of code to send "VoltageData" out to the LCD while it is still in the "Check Cells" routine. It is sending the ASCII code and I am getting 48. It then sends the High cell value to the LCD and I get 2.23 volts.

Can you explain how a value of 160 would be stored in two bytes? It would seem like 160 will fit in the first byte and therefore the second byte would be empty.

Rick


I don't think I ever tried the software with just 1 cell. I think you should try two as a minimum to start with.

CellV is a two byte word variable. By subtracting 175 from the ADC result in the slave we get a value which can fit into one byte and covers the working voltage range of the cell. Becasue the result is less than 255 we know it must be stored in byte b0 (The first byte of the word variable CellV) . That's why we only send one byte (VDATA b0) back to the master.

The master in the check cell routine loads the value into VoltageData a byte variable which is actually the first part of word variable CellVoltage.

The master does various checks and then adds back the value (175) that was taken off by the slave to recreate the correct cell voltage in the word variable CellVoltage.

Check the baud rate is the same in Master and Slave and that they are both running at 8mhz. (Setfreq M8)

I suggest post your modified code so we can look at it. sS you have changed the code it could have upset something? What lcd display are you using? How have you altered the display routine ?

You could modify the slave code to send a known test value say 200.

Loop1:
if pin3 = 1 then Loop1 ;Wait until interrupt signal is low before begining transmission
b0 = 200
low MasterBus ;Turn on MasterBus Optocoupler (Reqd due to sink driven)

You know the Master should then display 3.75v (200 + 175)

It does work but a bug could have slipped in, I haven't worked on the Master/Slave code for 6 months!

I don't know width height of display without removing it all from my setup, I just havent time at minute. It will be slightly smaller than the ones advertised on e-bay as it is minus the case.
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.

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Postby steiner » Thu Jul 02, 2009 12:18 am

Peter,

Thanks for the information. I will try what you suggested when I get back in town. I will let you know how it turns out.

Rick

steiner
Posts: 89
Joined: Mon Sep 08, 2008 1:50 am
Location: Florida

Postby steiner » Mon Jul 06, 2009 11:57 pm

I inserted what you suggested into the slave code (b0=200). For some strange reason when the master retrieves this information, it displays 188.

I tried copying the code into this reply but it looks very messy. What is the best method to copy the code and keeps its format?

[/list][/code][/quote]

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

Postby retepsnikrep » Tue Jul 07, 2009 12:44 am

Might be best to upload it somewhere as a simple text file.

Or send it to me direct as a txt attachment to an e-mail.

Send me the exact software you have uploaded to the pics + number of cells.

I'll have a look
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.


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 14 guests