Old BMS General Thread

Threads relating to the BMS system begun by Peter Perkins

Moderators: GregsGarage, retepsnikrep

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

More Software

Postby retepsnikrep » Mon Jul 28, 2008 11:54 am

The Watchdog PIC and the Master PIC have seperate programing inputs on the Master board so they can be updated independently.

http://www.solarvan.co.uk/bms/Master280708_v81.txt

http://www.solarvan.co.uk/bms/WatchDog280708_v02.txt

http://www.solarvan.co.uk/bms/Slave280708_v63.txt

Final Master (inc WatchDog & Video Chips) and Slave Schematic for V1.00

http://www.solarvan.co.uk/bms/Master280708.jpg

Ignore the terminal label text inside the U6 Video IC outline, I had to make the chip up, as no library part existed, but I can't get rid/edit the terminal text to label the pins correctly at the moment. Bloody hell the schematic program is hard work :roll: Any Proteus guru's want to make me up the component or show me how!!

http://www.solarvan.co.uk/bms/Slave150708.jpg

Going off to man in China later this week 8)
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:

Further Software Ramblings

Postby retepsnikrep » Tue Jul 29, 2008 12:09 am

:lol: Thinking out loud again.

At the moment the Master sends a simple Interrupt style (Pull Slave Input High) data request signal to the first Slave, which sends it's Cell V data to the Master, that Slave then sends the same (Pull Slave Input High) data request signal to the next Slave in the Pack which transmits it's data and so on.

Now we have nice opto isolated comms, why not send commands rather than a simple send data/interrupt signal.

So now the Master sends the Interrupt style (Pull Slave Input High) data request signal to the first Slave followed by a Command/Data byte.

The command/data byte can tell the Slave to do anything, but let's assume if we send a 1 then the Slave sends it's Cell V data as before on the Master Bus. However instead of just passing the wake up signal it passes the command/data byte as well to the next Slave and so on. :shock:

So now we can send commands/data to the whole pack which may be very useful for calibration etc.

A few commands spring to mind

Send 1 = Slave transmit cell V (As now basically)
Send 2 = Slave adjust oversampling rate +1
Send 3 = Slave adjust oversampling rate -1
Send 4 = Slave adjust adc temp compensation (Not implemented yet!)
Send 5 = Slave go into sleep/low power mode
Send 6 = Slave adjust CPU speed
Send 7 = Slave adjust Cell V Max setting +.01v (Move balancing point up)
Send 8 = Slave adjust Cell V Max setting -.01v (Move balancing point down)

Blah Blah etc etc Anything else?

Anyhow I have incorporated this code/idea into Slave and Master software 8)

Also been thinking about how I can send a specific command to a single Slave amongst the entire pack, whilst keeping all the Slave software identical :?

If you had 50 different versions of the Slave Software, each with an ID number hard programmed in, say 1-50 then sending a command to the specific cell within the pack is quite easy.

1) Send Slave ID 1-50
2) Send command you want executed.

Each Slave receives and passes on the above but only acts on it, if it's ID matches the ID byte. However it's a nightmare to keep 50 different versions of the Slave Software updated and bug free :shock: I could add some hardware to each slave board, perhaps some simple potential divider dip switch type arrangement so each Slave has a hardware code of sorts.

:lol: :P :lol:

The answer I think is add the cell number of the target Slave to 128 (Say Slave 30 in this example) 128 + 30 = 158

1) Send 158, this tells the 1st Slave message is for onward transmission, but not for it because number > 128. The slave then deducts 1 from 158 and transmits 157 to next Slave along with the command that follows it.

2) Next Slave again tests number, and if > 128 then not for it, so deducts another 1 from total 157 - 1 = 156 and transmits to next Slave. etc etc

3) When it eventually reaches Slave (30) and number is 128, that Slave knows following command is to be executed.

So we now have two methods to update the Slaves on the fly.

A) Updates all Slaves in series by sending one command/data byte along Bus.

B) Update individual Slaves by sending target byte and command/data byte along Bus.

I'll incorporate this as we go along if I need to do individual Slave updates.

The BMS can cope with 128 cells per Master. This new scheme gives us 128 potential messages/commands to choose from, which can be sent to all or any one of the 128 Slaves now.

Pretty pleased with that :D

I've added a data bus testing/burn in routine to the Master Software.
This sends test values out through the Slave Data Bus and counts/checks each byte as it is received back on the Master Data Bus. For my 50 Cell pack each value should be received back by the Master 50 times as it propogates through the Slaves.

Latest Software as of 11:00 290708

http://www.solarvan.co.uk/bms/Master290708_v85.txt
2048 bytes out of 4096 available

http://www.solarvan.co.uk/bms/Slave290708_v66.txt
100 bytes out of 256 available

http://www.solarvan.co.uk/bms/Watchdog290708_v04.txt
24 bytes out of 256 available

There are quite a few ways to configure the Slaves as we can see.

We could also parallel all the Slave Data Bus opto's like the Master Data Bus but drive them simultaneously with a high current driver from the Master. Commands could be sent in a fraction of the time, responses would be problematic as each Slave would have to have a unique ID and different Software so it could respond with out all the Slaves jaming the Master Data Bus. In the cascade arrangement we have now the next Slave does not send the Interrupt style (Pull Slave Input High) data request signal to the next Slave until, it has finished transmitting itself. :)

I'm probably re-inventing the wheel with all this, but I'm enjoying it and learning a hell of a lot 8)
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:

Last Minute Tweaks!

Postby retepsnikrep » Wed Jul 30, 2008 3:20 pm

Due to some issues highlighted by a fellow Pic BMS designer below I have made a few late changes :roll:

http://endless-sphere.com/forums/viewto ... &start=465

It's nice to have the benefit of someone elses very recent experience :)

I am now sinking the Slave optos instead of sourcing them, and added a couple of trouble shooting jumpers. We will have to see about the noise issue once I get some boards up and running :shock:

The Master has had a couple of 5k multi turn trimpots added to the Charger and Controller opto outpus, this make it a simple two wire interface to my expensive :D charger/bench psu. People who don't need those components can simply omit them from the pcb.

http://www.solarvan.co.uk/bms/Slave300708_v68.txt

http://www.solarvan.co.uk/bms/Master300708_v86.txt

http://www.solarvan.co.uk/bms/Slave300708.jpg

http://www.solarvan.co.uk/bms/Master300708.jpg

Added the Commands feature to the Slave Software so they can now be adjusted on the fly by the Master :wink:
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:

Postby retepsnikrep » Thu Jul 31, 2008 11:54 am

:shock: Surprise minor changes to schematics today :shock: :lol:

http://www.solarvan.co.uk/bms/Master310708.jpg

http://www.solarvan.co.uk/bms/Slave310708.jpg

Software updated to reflect the sink/source issue on the Slaves.

http://www.solarvan.co.uk/bms/Slave310708_v70.txt

http://www.solarvan.co.uk/bms/Master310708_v87.txt

Also produced a draft parts list.

http://www.solarvan.co.uk/bms/BMSparts_v01.txt

Now I need to find a supplier for those old PC header pin female connector leads, you know the ones which went to the internal speaker and hd led, pwr sw connections on the Motherboard.
Two pin sil 0.1".

http://www.hardwarezone.com/img/data/ar ... stall3.jpg

I want a load of made up two core twisted leads say varying from 50 - 200mm long. They must be available in the skip full from somewhere :?

Then when Slave boards are bolted on it's a simple job to interconnect them. :wink: If I had kept all the old leads from the zillions of PC's I have had then I would be set up now :roll:

Anyone any ideas please :?:
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 » Thu Jul 31, 2008 10:45 pm

retepsnikrep wrote:I want a load of made up two core twisted leads say varying from 50 - 200mm long. They must be available in the skip full from somewhere :?


Peter,

Pretty much all modern cars have twisted pairs in the wiring harnesses for ABS, Airbags and loads of other things. You might be able to source some from car breakers.

Or how about stripping apart some CAT5 cable, 4 pairs of twisted leads.

Greg
Greg Fordyce

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

User avatar
dillond666
Posts: 139
Joined: Mon May 26, 2008 7:52 pm
Location: Central Scotland

Gotta love children!

Postby dillond666 » Sun Aug 03, 2008 5:21 pm

PROGRESS REPORT

At last, I've knocked up a prototype slave on some breadboard.
I've knocked three years off my lifespan by installing windows 2000 onto my spare pc.
Yesterday I decided to have a bash at the coding and familiarise myself with the program editor.
All the lights in the house went out.
Hmm I think I installed that new consumer unit correctly, my blood pressure is rising though.
10 mins investigation later.
Ha, found the culprit....it's my old monitor.
Check the cable with my meter.........it's ok.
Never mind, i'm an electronics guru now remember? I'll open up the monitor and fix it.
As I roll the monitor onto its screen to undo the screws I hear a tinkling sound.......hmm thats not good.
Opened it up and found a resistor lying in the bottom.........20 minutes and one pair of forceps later I had recovered the 18 resistors my 4 year old had posted through the ventilation holes on the back of the monitor!
Gotta love the little cherubs though :D
The monitor now works and I have made the load led flash on and off (kinda my "hello world" moment!).
Still enjoying tinkering.
Peter, re your interconnect issue, I quite like the idea of ethernet or USB connectors but haven't looked to see if ready made cables are cheap and available yet.

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

Re: Gotta love children!

Postby retepsnikrep » Mon Aug 04, 2008 3:54 pm

dillond666 wrote:The monitor now works and I have made the load led flash on and off (kinda my "hello world" moment!).
Still enjoying tinkering.


That makes it all worthwhile :D

I spent a very frustrating time with a duff monitor and poor instructions over the weekend but now have my display working 8) I wasted a whole day arseing about!!!

Anyway this sort of makes up for it. Easy peasy video chip as per my earlier posts driven by Picaxe makes in car display piece of cake :wink: OK it's not super VGA with fancy graphs, but it gets the info across in a non invasive multifunctional way! Master can drive anything with an rca composite video input socket.

The banding is a photo artefact, distortion at far right of display isn't, need a bit of filtering somewhere on my cheapo unit.

Chinese single din in car head unit with built in 5" lcd monitor.

http://www.solarvan.co.uk/VideoDisplay02.jpg

Desktop old crt telly with video input. Crisp and clean 8)

http://www.solarvan.co.uk/VideoDisplay01.jpg

Still tinkering with software, have lead on someone to help me with the Master Pcb so fingers crossed for that.

Added Highest Cell V, Lowest Cell V and Average Cell V to Master display today.

www.solarvan.co.uk/bms/Master050808.jpg

www.solarvan.co.uk/bms/Slave050808.jpg

www.solarvan.co.uk/bms/Master060808_v91.txt
Last edited by retepsnikrep on Wed Aug 06, 2008 9:03 am, edited 1 time in total.
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.

wjdennis
Posts: 17
Joined: Tue Aug 05, 2008 5:27 pm

Postby wjdennis » Tue Aug 05, 2008 10:34 pm

Peter, the parts list contains 2 LEDs for the Slave board, but I see only 1 in the current .jpg file. I think earlier versions had two LEDs. Are you planning to include the second LED again?

Bill

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

Postby retepsnikrep » Wed Aug 06, 2008 5:58 am

Bill

I have removed the indicator led which was driven by the data output line in paralell with the optocoupler, as there was little spare current available at the lower cell voltages to guarantee enought current to drive the optocoupler properly which must take priority. :(

The led visual indicator in paralell with the cell load resistor is still included as that only operates at high voltage when there is plenty of current.

I'm striving for reliability with the design. The Slave program could be adjusted to include a test mode during which it will flash the load led during data transmissions. I might include that later. 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.

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

Slaves without a Master!

Postby retepsnikrep » Sun Aug 10, 2008 2:42 am

Slaves without a Master! :wink:

With an alternative program loaded into the Slaves they can be used in a cheaper Analogue style system with limited, but still useful capabilities.

To implement this the Slave Master Bus optos are connected in parallel as per normal version. The Slave Bus Input optos are also connected in parallel, unlike the normal system where they cascade from one output to the next input.

The Slave (Analogue) system can :-

1) Still monitor the Cells and provide a combined over/under V warning using the Master Bus opto to activate a simple warning led/audible alarm.

2) Still control the balancing load

3) Still control a Charger via the Master Bus Opto, simple on/off is easy when cell reaches the cut off voltage, more sophisticated proportional control is possible with improvements to the software.

4) Flash an indicator led on each board to show they are alive.

5) Respond to a test signal on the Slave Bus to also indicate they are alive.

6) Be updated with new software as it is developed.

The Master is only reqd for more sophisticated display and control :shock: That said I personally would only use my system with the Master as I like all the info and much more sophisticated control/stats etc etc.

I'll upload the alternative Slave (Analogue) software later today.

With regard to the PCB's, finally the Slave and Master boards are in the hand of a pcb expert. I hope the layout of these will be finished next week and sent off for my first batch of 100 slaves and 5 Master's soon afterwards. My batteries are expected this tuesday/wednesday :D

http://www.solarvan.co.uk/bms/Master090808_v95.txt

http://www.solarvan.co.uk/bms/SlaveDigi ... 08_v71.txt

http://www.solarvan.co.uk/bms/SlaveAnal ... 08_v02.txt
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 4 guests