Have a go at some new code Greg by all means. I'm not convinced your proposal is better than what we have with the new formula, but you may be able to persuade me
I'm working on the Master Proportional Charger control at the moment. Got my asus eec pc thingy very neat, loaded picaxe editor etc. Do you think wife will notice if I take it on holiday with us soon?
Old BMS General Thread
Moderators: GregsGarage, retepsnikrep
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
-
- Posts: 870
- Joined: Tue Apr 01, 2008 5:27 pm
- Location: Galashiels, Scottish Borders
- Contact:
retepsnikrep wrote:Got my asus eec pc thingy very neat, loaded picaxe editor etc. Do you think wife will notice if I take it on holiday with us soon?
Just bring the cable for your digital camera as well, then you might be able to convince her that you are bringing the eeepc so you can look at the all the lovely photos you have taken. Who knows, she might buy it!
I'll have a go at some simple code and see if it runs any faster without having to do any calculations.
Greg Fordyce
Daewoo Matiz
http://www.evalbum.com/4191
Daewoo Matiz
http://www.evalbum.com/4191
-
- Posts: 870
- Joined: Tue Apr 01, 2008 5:27 pm
- Location: Galashiels, Scottish Borders
- Contact:
retepsnikrep wrote:Have a go at some new code Greg by all means. I'm not convinced your proposal is better than what we have with the new formula, but you may be able to persuade me
Peter, here's some new code. Its very rough and ready, haven't even tried it in the picaxe editor.
Code: Select all
`Variables Constants and I/O definitions
`Variables 16bit
symbol RefADC = w1
`Constants
`Calculate voltage parameters with formula 63200/[var]*2
symbol MaxVOptoOn = 337
symbol MaxVOptoOff = 351
symbol LoadOn = 351
symbol LoadOff = 356
symbol MinVOptoOff = 506
symbol MinVOptoOn = 527
`Pins used for I/O and designations
`*** Digital high/low Outputs ***
symbol Load = 0
symbol HighOpto = 2
symbol LowOpto = 4
`*** Analogue ADC Inputs ***
symbol RefInput = 1
Main:
readadc10 RefInput, RefADC
if RefADC "less than" MaxVOptoOn then
low HighOpto
endif
if RefADC > MaxVOptoOff then
high HighOpto
endif
if RefADC "less than" LoadOn then
high Load
endif
if RefADC > LoadOff then
low Load
endif
if RefADC > MinVOptoOn then
low LowOpto
endif
if RefADC "less than" MinVOptoOff then
high LowOpto
endif
goto Main
The less than symbol makes everything go a bit funny, but this is the general idea.
Greg Fordyce
Daewoo Matiz
http://www.evalbum.com/4191
Daewoo Matiz
http://www.evalbum.com/4191
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
A bit of reverse logic reqd as it works backwards as well with higher numbers from ADC = lower cell voltages.
A spread sheet that worked out these values for you/us would be good. What I know about excel you can write on a full stop.
It might not work for the Digital Slaves as that only has one byte to transmit the cell voltage to the Master.
Also the Master would have to work a fair bit harder to re-create the actual voltages for display and calcuation purposes if it only got the raw adc data. At the moment it just performs a simple addition adding 175 to the the transmitted data to get the CellV. The Slaves do the donkey work and actually do the calculation of the CellV at present.
Yes I think you can use this for your own application, but I think the actual cell voltages are easier to understand for the average punter. It would be easy to make a costly mistake We may save a cpu few cycles and a few ua but it's quite a lot of effort.
Peter
A spread sheet that worked out these values for you/us would be good. What I know about excel you can write on a full stop.
It might not work for the Digital Slaves as that only has one byte to transmit the cell voltage to the Master.
Also the Master would have to work a fair bit harder to re-create the actual voltages for display and calcuation purposes if it only got the raw adc data. At the moment it just performs a simple addition adding 175 to the the transmitted data to get the CellV. The Slaves do the donkey work and actually do the calculation of the CellV at present.
Yes I think you can use this for your own application, but I think the actual cell voltages are easier to understand for the average punter. It would be easy to make a costly mistake We may save a cpu few cycles and a few ua but it's quite a lot of effort.
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.
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.
-
- Posts: 870
- Joined: Tue Apr 01, 2008 5:27 pm
- Location: Galashiels, Scottish Borders
- Contact:
retepsnikrep wrote:A bit of reverse logic reqd as it works backwards as well with higher numbers from ADC = lower cell voltages.
A spread sheet that worked out these values for you/us would be good. What I know about excel you can write on a full stop.
Or, even better a script that asked for the values you wanted and then output a program file. Possible, but a bit out of my league. If anyone wants to have a go, please do.
Your right, it is better to leave the digital slaves as they are.It might not work for the Digital Slaves as that only has one byte to transmit the cell voltage to the Master.
Also the Master would have to work a fair bit harder to re-create the actual voltages for display and calcuation purposes if it only got the raw adc data. At the moment it just performs a simple addition adding 175 to the the transmitted data to get the CellV. The Slaves do the donkey work and actually do the calculation of the CellV at present.
Yes I think you can use this for your own application, but I think the actual cell voltages are easier to understand for the average punter. It would be easy to make a costly mistake We may save a cpu few cycles and a few ua but it's quite a lot of effort.
Peter
I think the best compromise would to be to have the pic do the calculations. So you still have the section;
- symbol MaxVOptoOn = 365
symbol MaxVOptoOff = 360
symbol LoadOn = 355
symbol LoadOff = 350
symbol MinVOptoOff = 260
symbol MinVOptoOn = 250
But then you recalculate the values;
symbol MaxVOptoOn = RefVADC/MaxVOptoOn * 2
Not sure if this is a valid statement, but you probably get the idea of what I am trying to do. Carry this out for all 6 values, but it only has to be done once. So you save a few cpu cycles and a few ua but it is still understandable for the average punter.
Greg Fordyce
Daewoo Matiz
http://www.evalbum.com/4191
Daewoo Matiz
http://www.evalbum.com/4191
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
That's quite a good idea, althought your calculation is not a vaild Picaxe statement with symbol at the begining.
Symbol is used to define a constant, that can't be changed by the program.
We would have to use variables, which may be more of a problem due to the limited number available! There are only 7 word variables available.
A script or spreadsheet to generate the values/program may be better. User input voltages and gets the special numbers out
A way to save quite a few ua would be to increase the value of the vref load resistor R5 to >100K instead of 22k. (I miscalculated that) the lm385 only needs >10ua to function, the present value consumes over 100ua I shall change that on the Slave schematic to 100K I think.
Edit
Greg
Just did a quick bit of coding so try this. Please check accuracy and that it responds correctly on the bench before loading into your Slave boards
www.solarvan.co.uk/bms/SlaveAnalogueOnO ... _v1_12.txt
Symbol is used to define a constant, that can't be changed by the program.
We would have to use variables, which may be more of a problem due to the limited number available! There are only 7 word variables available.
A script or spreadsheet to generate the values/program may be better. User input voltages and gets the special numbers out
A way to save quite a few ua would be to increase the value of the vref load resistor R5 to >100K instead of 22k. (I miscalculated that) the lm385 only needs >10ua to function, the present value consumes over 100ua I shall change that on the Slave schematic to 100K I think.
Edit
Greg
Just did a quick bit of coding so try this. Please check accuracy and that it responds correctly on the bench before loading into your Slave boards
www.solarvan.co.uk/bms/SlaveAnalogueOnO ... _v1_12.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.
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.
-
- Posts: 870
- Joined: Tue Apr 01, 2008 5:27 pm
- Location: Galashiels, Scottish Borders
- Contact:
Great work Peter, I will give the new code a try as soon as I build another slave board. Was hoping I could get a chance today but it looks like work is going to have to come first. Seems there are a lot of broken cars on the road (or not as the case may be)! I'll try the new value for R5 as well.
Edit: I have just built a slave board for testing the new code. Will try it out tomorrow, as long as time permits at work.
Edit: I have just built a slave board for testing the new code. Will try it out tomorrow, as long as time permits at work.
Greg Fordyce
Daewoo Matiz
http://www.evalbum.com/4191
Daewoo Matiz
http://www.evalbum.com/4191
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
Cantop
I got a reply from Andrew, the Cantop man. Way over my head
He's too busy to join in by the sound of it.
I've asked him for the source files, and I'll put a link to them if anyone want's to tinker.
Back to the 16x9 text for now.
Cantop Source files for anyone interested here, means little to me sadly
http://sourceforge.net/project/download ... p&67572788
http://sourceforge.net/project/download ... p&34721473
He's too busy to join in by the sound of it.
I've asked him for the source files, and I'll put a link to them if anyone want's to tinker.
Back to the 16x9 text for now.
Hi Peter,
Thanks for your interest in CANTOP. I'm glad someone out there found it =).
In response to your request, CANTOP could probably be modified to work for you--though let me explain a little bit how it works before I get into that.
CANTOP is built around a server/client architecture where the server is written in a platform independent language (JAVA) and the client can be written in any language that implements TCP sockets (network). The client that I have written (the graphical part) is written in a language called QT, which is technically platform independent, so long as that platform provides a distribution of QT. I don't know if the palm pilots you are referring to implement QT, but the client could be rewritten in any language.
That said, it would probably make the most sense to use a modified CANTOP server backend (written in JAVA, which already has serial support) to do the parsing, and then write a new client frontend (the graphical part) in a language that is supported by the hand-held device.
While this all sounds interesting, I'm afriad I don't have time to be too involved in this process.
Please let me know if you have any questions, I will try to provide you with the resources to get you started if you want to persue this idea.
Thanks!
Andrew
Cantop Source files for anyone interested here, means little to me sadly
http://sourceforge.net/project/download ... p&67572788
http://sourceforge.net/project/download ... p&34721473
Last edited by retepsnikrep on Sun Nov 09, 2008 5:41 pm, edited 2 times 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.
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.
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
Master Issue
Working on the master proportional charger control I had an issue with the pwm output being corrupted
After much head scratching I posted to the picaxe forum and got this reply.
http://www.picaxeforum.co.uk/showthread ... #post81708
Looks like the 28X1 chips will have to have the firmware updated, I'm trying to get it done free, so I may ask those who I sent 28x1 chips to return them to me if they agree to re-do them.
I'll think about a work round but can't see one yet
Has anyone got an A4 firmware 28X1 chip?
After much head scratching I posted to the picaxe forum and got this reply.
http://www.picaxeforum.co.uk/showthread ... #post81708
Looks like the 28X1 chips will have to have the firmware updated, I'm trying to get it done free, so I may ask those who I sent 28x1 chips to return them to me if they agree to re-do them.
I'll think about a work round but can't see one yet
Has anyone got an A4 firmware 28X1 chip?
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.
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.
- retepsnikrep
- Posts: 1387
- Joined: Sat May 26, 2007 4:50 pm
- Location: North Yorkshire England
- Contact:
Picaxe have agreed to re-program or replace the A3 version 28X1 chips with the bug, so If I sent you one, send it back to me in a padded SAE ASAP. I'll send you the A4 version ones later.
I shall return them later this week. Hopefully they will be back for when I get back from my hols on 01/12
If I haven't got your's by friday then you'll be out of luck
The Master software requires the A4 firmware 28X1 chip for the proportional charger control to function correctly.
If you are happy with a simple charger on/off when any cell reaches ABSMAXV then you don't need the upgrade. But you will have to REM out the proportional charger control code from the Master Software.
It's not my fault so don't blame me. Perhaps someone can think of a workaround.
Roger, Greg & Derek I think this affects you.
Mike in US I hope you have an A4 version
I shall return them later this week. Hopefully they will be back for when I get back from my hols on 01/12
If I haven't got your's by friday then you'll be out of luck
The Master software requires the A4 firmware 28X1 chip for the proportional charger control to function correctly.
If you are happy with a simple charger on/off when any cell reaches ABSMAXV then you don't need the upgrade. But you will have to REM out the proportional charger control code from the Master Software.
It's not my fault so don't blame me. Perhaps someone can think of a workaround.
Roger, Greg & Derek I think this affects you.
Mike in US I hope you have an A4 version
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.
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.
Who is online
Users browsing this forum: No registered users and 12 guests