Old BMS Hardware Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

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

Re: Serial Eeprom

Postby GregsGarage » Mon Dec 28, 2009 6:15 pm

retepsnikrep wrote:I'm going to add the i2c AT24C512B 128kb serial eeprom chip to the master board v2 shortly.


Great idea Peter, and this time you mentioned it before I placed an order to Farnell. :wink: That part number appears to be for a 64K byte version. I think we need this.

Just working on the software. I propose to log the cell voltage and/or all the BMS data once a second. The data will start recording at the begining of the eeprom each time the BMS is switched on, overwriting previous data.


It could be useful to have some sort of user configuration routine. Being able to select when to log, how often to sample, and if data should be automatically overwritten or stop capturing when full would be nice features.
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:

Postby retepsnikrep » Tue Dec 29, 2009 8:14 am

I think that's my mistake then, you can order which one you like, I have the 64k version then not the 128k as I thought :roll:

That list of features is a big ask Greg :shock: Perhaps over the summer.

The three of us, You, Me & Rick need to get our installs sorted now. I hope to finish mine by end of January.

Rick the Master software already displays the highest and lowest cell voltages so you can do a quick calculation in your head re IR etc.

So say the voltage of the lowest cell at rest is 3.30v but at 50A load it is 3.05v then voltage drop is 250mv R= V/I = 0.005R Does that sound right?

Do you have that display working?
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:

Postby GregsGarage » Tue Dec 29, 2009 9:28 am

retepsnikrep wrote:I think that's my mistake then, you can order which one you like, I have the 64k version then not the 128k as I thought :roll:


I am going to be placing a order with Farnell on Monday and can get you one of the 128k versions if you like. I still need to send you thie missing caps and resistors from the last order, was going to post those today, but if you need other bits and pieces, let me know and I can send them all together ( I assume you aren't in a hurry for the caps and resistors ).

Also was looking at this cable for connecting the slaves to the cells. It has 18 cores and would make for a nice tidy connection using some round 17 pin connectors.

That list of features is a big ask Greg :shock: Perhaps over the summer.


Sorry, I get a bit carried away sometimes. Still we do need to decide what to do when the chip gets full during logging , do we start overwriting at the beginning or stop logging?

The three of us, You, Me & Rick need to get our installs sorted now. I hope to finish mine by end of January.


I should have my cells next week, so am aiming for Febuary. I have been busy building the pcbs, master and remote finished and slaves underway. Still need to get a programmer for the pics.
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:

Postby retepsnikrep » Tue Dec 29, 2009 11:37 am

I bought some of this cable earlier for my boards as I thought with the wires next to each other it would be easier to see if you got out of sequence.

http://uk.farnell.com/jsp/search/produc ... KU=1202514

Don't worry about the ram chips I'll order some if I need any.

When you get on the road I'll come up again for a check out in my newest lithium creation.

Re-read some of the recent posts/e-mails in relation to the Master/slave board as I changed a couple of values don't forget. I also used some different values on the slave mult board.

For instance dont include the capacitors C9 or C7 on the master board. R8 you can try with 330R if 1k doesn't work reliably at 9600buad. Try without R18 as well first for the display. There is also a mistake on the master pcb at D7 if I remember correctly which should be an led not a normal diode as shown on the ident.

RE logging, the BMS will overwrite eeprom data from the begining each time it is switched on, So basically it records the last journeys data upto a max of XX minutes depending on eeprom size. If you want to save it/dump it to pc, then don't switch off at the end of journey until you have downloaded it. I might be able to add a button/feature which can generate some stats on the BMS screen from the accumulated data at the end of each journey on press of a button. Some wizzard (not me) with excel will also be able to generate some pretty graphs from the data on a PC i'm sure.

I'll probably store all the data the BMS collects each second to start with until I get the code right. So that means.

Every cell voltage, (50 cells/bytes in my case)
Amps, 1 or 2 bytes
Temp, 1 or 2 bytes
Soc, 2 bytes
Alarms, 1 byte
Speed, 1 byte
Odo, 2 bytes

Thats 60 bytes a second 35 minutes logging with a 128kb eeprom.

If we only record data once every 10 seconds say then that is 350 minutes.
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 Dec 29, 2009 3:46 pm

Peter,

Yes, I got the display working fine. Your calcs for IR seem correct to me also.

I have the basics of the system working now. That is the slave boards are working well with the master (V1.0) and I have adjusted the code to work with a LEM current sensor. I am currently working on getting the wireless communication operational. My next step is to communicate with a charger via CAN bus. I hope to have my full install with V2.0 master in the February time frame.

Your original drawing for the master V2.0 shows a 512K EEPROM. I am curious why you chose 128K instead.

Is there a particular relay you are using for your charger relay?

What does the elimination of R18 do for the video output?

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

Postby retepsnikrep » Tue Dec 29, 2009 4:03 pm

I'm not sure we can use the 128kbyte eeprom with the picaxe? I don't understand the adressing well enough to be sure. So i suggest we go with 64kbyte chips initially which are less than half price as well.

Edit

Rick bits and bytes are getting confused.

The 512kbit chip is a 64k byte chip
The 1024kbit chip is a 128k byte chip

What versions of the software are you using please and how have you modified the hardware/software to work with the different current sensor.

I'm using a 12v coil double pole relay rated at 16A 240v AC for the charger relay.

Any 12v relay with a coil voltage the same as the master board supply voltage max current 400ma should do. You need to stay within the spec for the bc337 drive transistor.

R18 makes the display darker but is normally incorporated in most monitors anyway. It ensures the impedance is 75ohm for standard RCA video signal ASFAIK. Add or remove/adjust to suit your display.

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.

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

Postby steiner » Tue Dec 29, 2009 9:19 pm

My mistake on the chip. I saw 512K and didn't take the time to read bit and assumed byte.

I am running V1.7 on the software since I am still using V1.0 on the master.

The modification I did to the software was simply remed out your line:
BatCurrent = 512 - BatCurrent / 3 ;Subtract sensor offset to get a positive number (0-512 = 0-100A-) &

and inserted the following 2 lines:
BatCurrent = 505-BatCurrent*234/100 ;Convert sensor reading to amps (LEM Hass 300-S) {Rick}
BatCurrent = BatCurrent*10+5/10 ;Used to round number correctly

If you substitue 390 for the 234 it will work on the LEM Hass 500-S. The reason that I used 505 vs 512 had to do with the fact that at zero current, the output wasn't exactly 2.5 volts. This offset may vary with sensors and I thought about introducing an offset in the "constants" section of your code to account for this. Obviously I also changed the equivalent line pertaining to discharge.

The above code will only work up to an A/D of +/-280 (232 to 792) which is about 650 amps before you will get an overflow. I previously handled this in PicBasic with the */ command and it worked very nicely without any overflows. I need to figure out how to implement it in the picaxe software.
Last edited by steiner on Tue Dec 29, 2009 11:17 pm, edited 1 time in total.

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

Postby GregsGarage » Tue Dec 29, 2009 11:07 pm

retepsnikrep wrote:I bought some of this cable earlier for my boards as I thought with the wires next to each other it would be easier to see if you got out of sequence.

http://uk.farnell.com/jsp/search/produc ... KU=1202514


I looked at that cable last night as well, what connectors are you planning on using with it?


When you get on the road I'll come up again for a check out in my newest lithium creation.


O.K. I try and not keep you waiting too long, mind you with the weather lately that might not be a bad thing. :)

Re-read some of the recent posts/e-mails in relation to the Master/slave board as I changed a couple of values don't forget. I also used some different values on the slave mult board.

For instance dont include the capacitors C9 or C7 on the master board. R8 you can try with 330R if 1k doesn't work reliably at 9600buad. Try without R18 as well first for the display. There is also a mistake on the master pcb at D7 if I remember correctly which should be an led not a normal diode as shown on the ident.


Got most of those, but missed the one on C7 and C9. Guess I will be doing a bit of desoldering.

I'm not sure we can use the 128kbyte eeprom with the picaxe? I don't understand the adressing well enough to be sure. So i suggest we go with 64kbyte chips initially which are less than half price as well.


1 byte should give 128 unique addresses, unless it needs a bit for something else. I'm not in a despearte hurry to order so will wait a bit or might order both. :shock:

EDIT: Ignore that last comment about addressing, we need 128K unique addresses, not 128. A quick look at the data sheets shows the 128K is more complex, porobably doable but the 64K looks simpler. I have put a socket on the master so can easily change it later if required.
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:

Postby retepsnikrep » Wed Dec 30, 2009 6:04 am

GregsGarage wrote: http://uk.farnell.com/jsp/search/produc ... KU=1202514
I looked at that cable last night as well, what connectors are you planning on using with it?


50 way d-sub for my 48 cell pack I need 49 wires.

http://uk.farnell.com/multicomp/5501-50 ... dp/1084683

http://uk.farnell.com/multicomp/5501-50 ... dp/1084676

http://uk.farnell.com/amphenol/md5pl50s ... dp/1306848

http://uk.farnell.com/amphenol/md5pl50s ... dp/1306849

Thanks for that info Rick useful to Greg.

So the 300A sensor you used has a simple 5v supply and outputs a linear voltage with 2.5v = 0 Amps ?

0V = ?
5V = ?
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 » Wed Dec 30, 2009 6:29 am

Peter,

Here is the link for the LEM current sensor http://www.lem.com/docs/products/hass_e.pdf

As I mentioned, the one I am using is the Hass 300-S. It either adds or subtracts .625 volts from 2.5 volts (0 amps) when the sensor sees 300 amps. It is a linear relationship all the way to 900 amps. Above that it is no longer linear. Therefore the useful range is only from +900 amps (.625 volts) to -900 amps (4.375 volts). I have no idea what the current would be at zero volts or 5 volts. I don't even know if it is capable of getting to these levels.

It does have a Vref pin but all that does is move the zero current point. It doesn't increase the sensitivity in one particular direction which would be very nice.


Return to “BMS thread”

Who is online

Users browsing this forum: No registered users and 69 guests