06-28-2012, 03:08 PM
|
#11 (permalink)
|
Administrator
Join Date: Dec 2007
Location: Germantown, WI
Posts: 11,203
Thanks: 2,501
Thanked 2,587 Times in 1,554 Posts
|
I have updated my schematic and the bill of material. I've added a bunch of small components to take care of a few issues. I also added a field for cost per cell which comes out to a pretty decent $7.34/cell (before shipping), if you go up to a 48 cell system you're down to under $3.70/cell.
The code is not updated. It has quite a few changes and I am fairly sure nobody has browsed through it in depth yet because I haven't had comments about how this and that won't work. I've fixed most of it with individual testing of one part here and there. I'm sure there will be bugs to fix once I try to get everything working properly together. I'll repost the code at that point.
|
|
|
Today
|
|
|
Other popular topics in this forum...
|
|
|
07-12-2012, 02:35 PM
|
#12 (permalink)
|
Administrator
Join Date: Dec 2007
Location: Germantown, WI
Posts: 11,203
Thanks: 2,501
Thanked 2,587 Times in 1,554 Posts
|
Looking ahead to putting this system into an EV (or something not PHEV related), I'd like to find a way to eliminate one of the more expensive components of the system, the celllog. I was thinking I might be able to use a multiplexing chip to increase the number of analog pins I have. Since cell voltages are well under 5V, I can read them all into an array or something. With that raw data I'll have much more data to work with and be able to do more with it. However, I've never used a multiplexing chip, and pulling individual voltages off a bank of many cells is also presents problems. Mainly, I have to move the ground reference every time I jump to the next cell. Currently, I'm not even grounded to the high voltage pack, just the 12V system. So, if anyone has any ideas I'm all ears.
|
|
|
07-13-2012, 03:33 AM
|
#13 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
Ideas are cheap ...
Quote:
Originally Posted by Daox
Mainly, I have to move the ground reference every time I jump to the next cell. Currently, I'm not even grounded to the high voltage pack, just the 12V system. So, if anyone has any ideas I'm all ears.
|
My experience in hardware design is from many many years ago, so take this information with a grain of salt and check it out before doing any circuit work ....
The BMS topic does interest me, so I did some digging and this is what I found ...
Most of the circuits that are out there for analog isolation use a voltage to frequency converter, then go through an optoisolator, and back through a frequency to voltage converter. Some use a transformer for isolation, but those circuits are pretty old.
The isolated side, the voltage to frequency converter, needs it's own isolated power supply. That also powers one half (the input side) of the optoisolator.
The other side of the optoisolator is powered from the microprocessor side as well as the frequency to voltage converter (if you use one). The frequency to voltage converter makes the frequency signal back into an analog signal 0 - 5VDC.
An elegant solution would be to power the (small and pretty trivial) V to F from the battery that it is measuring, then have the frequency put through the optoisolator. The resulting frequency, or train of pulses, comes out of the output of the optoisolator and is powered from the microprocessor. From there, the frequency can be read directly into the micro, or put through a mux so that fewer micrprocessor pins are used up as frequency counters, or converted back to analog by a frequency to voltage converter, and put through an analog mux ... you get the idea.
Each battery would have it's own small circuit with just a V to F and an optoisolator ... about 10 ma, depending on which chips you choose and how good you are at soldering surface-mount.
However ... I can locate no Voltage to Frequency converter that will accept the voltage drop that each cell can experience during acceleration ... I'm assuming a low of about 2.0V for acceleration when the batteries are low and someone stomps on the accelerator to a high of about 4.2V for charging. I can't locate such a thing for sale ... so the next idea makes things a bit more complicated ...
Use another chip to boost the power supply from your battery voltage of 2V - 4.2V to a solid 3.3V, which can be used to power the V to F and the optoisolator.
- TPS60240 boost power supply. This will take the 2 - 4.2V (in fact, it will go as low as 1.8V and as high as 5.5V) from your cell and put out a regulated 3.3V for the rest of the circuit. 50 microamps standby, so it won't unbalance your pack.
- AD7740 voltage to frequency converter has a supply voltage of 3 - 5.25V, so 3.3V is fine. 1.5mA supply current is pretty low. under a dollar for an 8-lead msop (I hate soldering surface-mount stuff). The input voltage from the battery will have to be divided since the max input voltage is 2.5V - maybe 2 10K resistors in series would keep the current down under 1 mA. You also need a crystal for a clock and to set the max output frequency of the output, which is up to 1 Mhz.
- and you need an optoisolator, say a NTE3086 - no pricing on that one.
As with any circuit, component selection is very important. The minimal research that I did gave me only one boost power supply that would deal with a voltage dropping to 2.0V - that's why it's surface mount. It has one fixed output voltage of 3.3V. If the output voltage could be 5V there are dozens of Voltage to Frequency converters available. The AD7740 is one of 2 that I found that would work down to 3V.
The crystal at under 1 Mhz should not be a big problem. The optoisolator is only rated for about 100 Khz. Keeping the frequency as high as possible will give you a low time to sample (the micro can tell what the input voltage is within a few pulses) each channel. You'll need to put in a current limiting resistor to avoid saturating the optocoupler input.
Last edited by thingstodo; 07-13-2012 at 03:34 AM..
Reason: spelling mistakes
|
|
|
The Following User Says Thank You to thingstodo For This Useful Post:
|
|
07-13-2012, 11:12 AM
|
#14 (permalink)
|
Administrator
Join Date: Dec 2007
Location: Germantown, WI
Posts: 11,203
Thanks: 2,501
Thanked 2,587 Times in 1,554 Posts
|
With all the electric vehicle work that has been going on, there has to be a IC that does a lot of this. I think I need to do more digging.
Anyone with a leaf/volt want to rip apart their power inverter and take pics for me?
|
|
|
07-16-2012, 02:44 PM
|
#15 (permalink)
|
Administrator
Join Date: Dec 2007
Location: Germantown, WI
Posts: 11,203
Thanks: 2,501
Thanked 2,587 Times in 1,554 Posts
|
So, I've been working on the finishing things up before the BMS goes into the car. Lately, most of the work has been in trying to increase the accuracy of the current sensor. To test the sensor's accuracy I simply wired it up and set it on my desk with no wire or current flowing through it. I count the Ah and spit out out via the serial print command.
Leaving it uncalibrated showed unacceptable accuracy. After only 10 minutes of testing the sensor showed .61Ah had been used. This gives us an inaccuracy of .06Ah/minute. On a 60 minute trip the measurement would be off by almost 3.7Ah. If you only have a 40Ah pack you're looking at nearly a 9% inaccruacy which means you should reduce the usable capacity of the battery pack by 9% to compensate. That is a big chunk of SOC to loose.
Manual calibration has been somewhat more successful. My best result was a .009Ah/minute variation over a 1.5 hr test period. This means that after 60 minutes the amp hour reading would be .54Ah off. Again, considering the 40Ah capacity, we're talking a little over 1% inaccuracy which should mean that you loose 1% capacity to avoid damaging the batteries.
This is much better, however, manual calibration is a pain in the butt. Every current sensor would need to be calibrated and this should be able to be done automatically by the software. That is what I am currently working on. I should be able to take a voltage reading from the current sensor with no current passing through it and set that as my zero. So far I haven't been able to get it to work. I think I am having some power ripple issues. Once I figure out if/where they are, I should be able to smooth them out and get more consistent readings.
|
|
|
07-17-2012, 08:56 AM
|
#16 (permalink)
|
Administrator
Join Date: Dec 2007
Location: Germantown, WI
Posts: 11,203
Thanks: 2,501
Thanked 2,587 Times in 1,554 Posts
|
Last night I got the automatic calibration working pretty well. There is still some tweaking needed, but in my testing I saw .0058Ah/minute drift. Looking at the 40Ah example again this puts the BMS at .87% off after 1 hour of use. This is pretty darn good and should be more than adequate for the BMS. Still, I want to repeat the test, try a few different things, and do a longer test to verify info.
|
|
|
07-18-2012, 09:40 AM
|
#17 (permalink)
|
Administrator
Join Date: Dec 2007
Location: Germantown, WI
Posts: 11,203
Thanks: 2,501
Thanked 2,587 Times in 1,554 Posts
|
More testing was done last night. The results remain the same. .0055Ah/min is where we are at, and unless I get some feedback that is where it is going to stay. Not that that is bad, but I wouldn't mind getting it a little better if its possible. I just don't know how to make it any better at this point.
The problem is that my output signal is jumping around just enough to throw things off. I'm getting output voltages that randomly vary by ~.015V. Doesn't seem like much, but after 1 hour of monitoring it adds up. I'm guessing that it is my USB power supply that is jumping around a little and therefore causing my output to jump around. However, I don't have a scope to verify this. I have put a 10uF capacitor across the 5V input on the current sensor and tested it. I then put the capacitor across the sensor output and retested. The capacitor had no effect on sensor accuracy in either test. I was getting the same .015V variance from the aref and output.
I hope that is clear enough and I'd love some input.
|
|
|
07-19-2012, 01:44 AM
|
#18 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
5.5 mAh/min
The code does not mention calibration for an amp sensor - is this what you mean?
Quote:
// interrupt to count amp hours used
ISR(TIMER1_COMPA_vect)
{
CurrentRead = analogRead(CurrentPin);
// Convert currentread to amps
CurrentRead = (CurrentRead - 512) * .78125;
// Convert to AH & add to total
AHused = AHused + (CurrentRead * .001);
}
|
If that's your manual calibration, I have one suggestion. See what you think:
Arduino floating point has 6 - 7 digits of precision. Your scale constant of 0.78125 uses up 5 of those digits.
1023 Max reading - 512 = 511. * 0.78125 and *.001 gives 0.39921875, which is already over the significant digits on the Arduino. Use another variable, let's call it AHusedLow, to keep track of some extra significant digits. Since your calculated number can't go over 0.4, we'll use 0.4 as the rollover
Quote:
CurrentRead = analogRead(CurrentPin);
// Convert currentread to amps
CurrentRead = (CurrentRead - 512) * .78125;
// Convert to AH & add to low partion of total
AHusedLow = AHusedLow + (CurrentRead * .001);
// Update AHused
if (AHusedLow > 0.4) {
AHused = AHused + 0.4;
AHusedLow = AHusedLow - 0.4;
}
|
I've used this technique of chaining together variables to fake double-precision floating point (and triple, and quad) before (and I likely will again) and it has served me well.
This needs to be well documented so that anyone changing the code knows about the method and how it works, to make sure that the rollover is high enough that it will not be exceeded in one call and as low as possible.
That's the only code issue that jumps out at me.
Depending on how many times per second your ISR is called (I could look it up from your code ... but I'm lazy) this could be a source of error ... but as far as I can see, this should not have anything to do with your observed .0055 Ah/minute drift.
|
|
|
07-19-2012, 01:58 AM
|
#19 (permalink)
|
Master EcoModder
Join Date: Sep 2010
Location: Saskatoon, canada
Posts: 1,488
Thanks: 746
Thanked 565 Times in 447 Posts
|
5.5 mAh/min
I worked out the .015V or 15 mV that you list is 3 counts on the A/D. It is pretty much impossible to have your numbers vary by less than 1 count, so 4.9 mV is expected.
You say that the output changes by 15 mV ... so you've already made sure that the error is not 5 mV several times in a row, it's 15mV a few times.
You saw the same error in the Aref measurement as in the measurement from the sensor. That points to something on your board dragging down the power supply, or to the power supply. The Aref is not changing - staying constant is what it is there for.
Do you have a USB hub with external power that you can use to power the Arduino? The older hubs that I have will put out a solid 500 mA per port ...
Remember to use good wiring techniques, good grounding, and catch all the issues that have bit you before. After that, it's luck as much as skill, experience or perseverance.
|
|
|
|