Dedicated small powerful charger, some development questions

Teh Stork

1 kW
Joined
May 25, 2011
Messages
463
Hello.

I've finished my first prototype, and some questions have popped up. This is a small smps charger designed for current controlled charging with power factor correction. It checks pack health via middle point balance, thermistors and ah-in - ah-out.

1. As of this moment I get 12 bit resolution on my voltage measurements. This works out to ~25mV resolution on under 100V packs. Lesser for higher voltage packs (bypass jumper allows higher voltages). I could add 16 bit voltage reading, but at higher cost. Worth it, or unnessecary given you don't need high accuracy for bulk charging?

Programming/Interface. Comments on these would be appreciated highly.
2a. LCD/pushbuttons programming and looking at pack state, ahrs consumed, middle point balance and temperatures. This seems to be the hardest way to implement, as i don't have much experience with ldc screens and such.

2b. Interfacing towards android (iPhone functionality will be outsourced probably) via usb cable. All programming and a separate app will be used for programming and showing all parameters. Ease of upgrading. Possible fancy GUI.

2c. Simple interfacing towards pc. Feedback from leds. Press a button, 'it should work' - as you programmed. But it sucks not being able to witness it.

Thermistors.
3. How many? I'd recon you'd like some for your engine aswell - what would you deem appropriate?

Power.
4. Would you like a fuse popping 4kW monster - or a 800W smallish thing. Right now I use a ~40g type 77 ferrite core with homewound windings, being operated at 250 khz - this isn't very efficient - clocking in at around 85% efficiency for 850W out. I could design something awefully powerful - but the cost and weight rises exponentially, things does not get cheaper with more power in smps design.

Enclosure.
5. I had some nice success spreading the heat from the converter throughout my aluminum bike frame. It worked better than expected as a heatsink. I realize most frames aren't aluminium, and I've yet to test it on steel. Would you have a very discrete 'frame cooled' charger, or is a fan (with the additional hole and environmental exposure (and tiny performance boost)) worth it?
 
Temperature settings I think only matter for the motor. Lithium batteries typically do not have devastating heat build up in charge. You might have one as a saftey mechanism for shutoff in case of fire or something. Not sure how much help it is at that point. You could also perhaps add functionality for a saftey pressure gauge sensor. All the videos I've watched of LiPo blowing up have had the cells puff up before they blew. This would not be useful for LiFePO4, though, or LiNMC, as far as I'm aware (dont know much about the last one).

It sounds like you're developing a device for dedicated use on the bike side, and a separate charger that can interface with the device. At least, if you're going to put so much functionality into the device, I think it would be helpful make the part with the display and careful battery measurement something that can be used other than only when charging.

If you want to keep LCD costs down, as you might have considered, you could have the phone app be the LCD interface. A nice LCD tends to cost a bit, but the 2 line character LCDs can be had very cheap. Character lcds are relatively easy to code for, as I understand it, compared to graphic ones. (On the arduino, it has been insanely easy because I just pick up lcds with chipsets that are supported by one of the several LCD libraries- these can sometimes work for other devices, depending on how you program and code for your device).



Out of curiosity, what kind of microcontroller platform are you using? Is this a custom board you made, or something common like the arduino family? I happen to have just started a short project with Arduino that I was a bit flustered because the 10 bit adc is just shy of what I need for resolution. 12 bit would be great, and I've thought of adding an external higher res adc, but I will probably use a different method to solve the whole problem (I'll probably use some differential op amps to reduce the scale of what I'm measuring, since they're all relative to each other by a similar margin). I've also looked into oversampling/dithering, which you might find useful at getting a slightly higher effective resolution. I don't fully understand the parameters though, so I threw out that idea for my project.


P.s, 4kw seems above most people's needs or interests. 3kw might be max interest for those in the places with the nice high voltage. 1.6kw before losses for most u.s outlets. I guess if you want to go all out you could just have a nice 800 watt unit and a huge higher power unit to be connected to the high amp high volt outlets that your house hopefully has (we have a few, but most are taken).
 
Interesting - what topology?

I'm currently working on a 1.5Kw buck topology at the moment, but no PFC as yet...
 
Cool project.

So you are designing an on-board balancing charger?

Here is my 2 cents worth.
- forget iphone/android/PC interfaces unless absolutely necessary. They will just waste time for not much value.
- ideally a charger would be just plug in and go once setup, so I would even be tempted to make the display optional if possible.
- if you need a display the HD44780 character LCD displays are cheap, and easy to interface to, this is what most RC chargers use
- if it is on-board then size, mounting, and weather-proofing will be definite design constraints
- keep the power down to size/cost in check and not blow fuses
- make it scaleable so you can have different power levels, (1) low power for typical overnight/at work charging ~0.2C, (2) big power for quick/opportunity charging, ~2C but below fuse limit, so 1-2kW
- if it is onboard and ahrd mounted to the frame, then make sure it can survive all the vibrations. ie. Glue down big parts hanging off the PCB.
- make sure there is very low parasitic drain on the battery from the charger, I have had a battery killed due to the BMS slowly draining a cells over a month on sitting in the garage unattended
- make it startup as soon as the power is plugged in, no button presses required.
- consider making an on bike, and off-bike version. Not everyone will want to carry their charger with them.

Now to answer your actual quetions
1) Volt Accuracy: 25mV on pack voltage is fine, but we would want better at the cell level
2) Programming/Interface: I would vote for 2c with automatic on when plugged in, LED feedback (red - charging, orange - balancing, green - done), with an option of a display.
3) Thermistors: No temp sensors, unless required as a last chance safety thing.
4) Power: Two models, (a) small/light/cheap for at work/at home charging maybe 200-400w, (b) fast/opportunity charger 1-2kw, I would prefer 1kw if it was a lot cheaper. And make the big one available as standalone unit
5) Enclosure: No fan. Water Proof for on bike. Whatever works for off-bike.

Good luck, Adrian
 
Kin said:
Temperature settings I think only matter for the motor. Lithium batteries typically do not have devastating heat build up in charge. You might have one as a saftey mechanism for shutoff in case of fire or something. Not sure how much help it is at that point. You could also perhaps add functionality for a saftey pressure gauge sensor. All the videos I've watched of LiPo blowing up have had the cells puff up before they blew. This would not be useful for LiFePO4, though, or LiNMC, as far as I'm aware (dont know much about the last one).

It sounds like you're developing a device for dedicated use on the bike side, and a separate charger that can interface with the device. At least, if you're going to put so much functionality into the device, I think it would be helpful make the part with the display and careful battery measurement something that can be used other than only when charging.

If you want to keep LCD costs down, as you might have considered, you could have the phone app be the LCD interface. A nice LCD tends to cost a bit, but the 2 line character LCDs can be had very cheap. Character lcds are relatively easy to code for, as I understand it, compared to graphic ones. (On the arduino, it has been insanely easy because I just pick up lcds with chipsets that are supported by one of the several LCD libraries- these can sometimes work for other devices, depending on how you program and code for your device).

Good points, learnt something new about charging too. What does Nissan "sense" to slow down fast charge on their leaf? NMC is certainly a different chemistry than what normal ebikers use, but out of interest I'm curious :p

LCD, I'll probably end up with something like the CA. The thing is, I've got the experience with app making using java and whatnot - so I'm tempted to use this. The charger relies on a current sensor during charging - one witch can be used as a battery current draw sensor while driving. This is one of the main functionalities with the CA, I hope this will be a selling point.

Kin said:
Out of curiosity, what kind of microcontroller platform are you using? Is this a custom board you made, or something common like the arduino family? I happen to have just started a short project with Arduino that I was a bit flustered because the 10 bit adc is just shy of what I need for resolution. 12 bit would be great, and I've thought of adding an external higher res adc, but I will probably use a different method to solve the whole problem (I'll probably use some differential op amps to reduce the scale of what I'm measuring, since they're all relative to each other by a similar margin). I've also looked into oversampling/dithering, which you might find useful at getting a slightly higher effective resolution. I don't fully understand the parameters though, so I threw out that idea for my project.

I use Atmels ATXMEGA microcontroller. It's the generation after the ATMEGA used in arduinoes. Via oversampling I get the actual 12 bit accuracy that the ATXMEGA delivers. Due to dynamic non linearity and offsets you can never expect to get anything over the bit resolution with oversampling (Some say you do, but I dissagree) - just the actual resolution. I've tried a 16 bit ADC from TI, it was a pain in the butt to transfer I2C data from it - but it worked well. I'm using a evaluation board for testing, but it will all go on a pcb at last.

heathyoung said:
Interesting - what topology?

I'm currently working on a 1.5Kw buck topology at the moment, but no PFC as yet...

Buck-boost topology with a shared inductor. Diodes for full wave input rectification. This topology is simply an extra diode and transistor over a buck converter. The "buck only" topology has nicer efficiency - but worse pf. It's not isolated, so I'll make sure hacker fingers don't get to mess with it (Every wire is potentially live w.r.t ground).

adrian_sm said:
Cool project.

So you are designing an on-board balancing charger?

Good luck, Adrian

No, this is a bulk charger - it only uses middle point balance to check the two halves against each other. If these drifts out of balance, it will not charge and damage cells. The charger uses a current sensor - so you can manually set the charge current and voltage cutoff. A timer would also be doable.

Thanks for valuable feedback everyone. As of now I plan to size it up a notch - 1600W continous. I'll also test to see how much it can fast charge in 5 minutes without overheating (I guess around 2-2,5kW).
 
Teh Stork said:
Kin said:
I've also looked into oversampling/dithering, which you might find useful at getting a slightly higher effective resolution. I don't fully understand the parameters though, so I threw out that idea for my project.

I use Atmels ATXMEGA microcontroller. It's the generation after the ATMEGA used in arduinoes. Via oversampling I get the actual 12 bit accuracy that the ATXMEGA delivers. Due to dynamic non linearity and offsets you can never expect to get anything over the bit resolution with oversampling (Some say you do, but I dissagree) - just the actual resolution. I've tried a 16 bit ADC from TI, it was a pain in the butt to transfer I2C data from it - but it worked well. I'm using a evaluation board for testing, but it will all go on a pcb at last.

Tried it out today, used noise generation techniques to get to get the dithering to work synched with cpu-clock - and bam: Same result from the 12 bit internal adc with oversampling and dithering as the dedicated 16bit adc. Check out Atmel AVR1629 appnote for more info. The synchronized dithering was what I was missing :oops:
 
Wonderful^. The arduino's chip has a very similar document [Well, like, quite similar- since as you said your is just a more advanced version]. This encourages me to look into the technique again, as an added method in addition to some differential op amps (only relevant for what I'm doing).
 
So, uhm, I hope your project is going well. Without trying to hijack the thread, can I ask for some advice in finding chips?

Because I might need a higher resolution ADC in a future project, I'm considering solving my project with a higher resolution chip (or else seeing if oversampling and dithering works to give me enough accuracy...but this makes me slightly uncomfortable, on account of the fact I will not have any easy way to verify my voltage measurements consistency in the end. Actually, I suppose that should make me uncomfortable about ALL the potential solutions :p.)

The thing is, when I meandered onto digikey I'm totally overwhelmed by the options of chips. Having minimal knowledge myself, I tend to choose chips that I've seen other people use. But, I haven't seen enough microcontroller projects that use an external adc (just one or two, excluding those where it's integrated as for example with certain temperature chips). At the least, maybe I can ask you, what 16 bit ADC did you first try using?
 
Hehe, It's evolved into three half bridges, driving 6 fets, input rectification is done with fets - and the pfc looks really nice. Heat production is a bit high, seems like my diodes are a bit on the cheap side. It worked nicely on it's own, but it seems to be highly suceptible to outside noise :S Need to take it from engineer-construction to a real pcb now :p

There are quite a few schematics for high-precision voltage sources. Myself I use my schools 0-100v .xxx labsupply for testing the values i measure. I plan to use 5% resistors, and calibrate the adc towards a voltage source to get cheap and highly precise voltage reading.

I communicate to my pc with uart and putty for prototying purposes. If you know C++, reading datasheets and using avrstudio is highly reccomended. There is a reason why arduino builds on this software, it's good.

As for ADC chips. I'll say they are useless tbh. I can see the 0.001 voltage steps (slightly over 16 bit resolution) the labsupply does once calibrated (0-100V scaled). Shifting non-loaded pins creates good noise for dithering, you really should get a programmer and a xplained kit - the learning curve is steep, but the application notes are well written and files follow to get you going. Ask on avrfreaks.net if you have any trouble ;)

Finding chips? I get most as samples, just needs some well written emails and you have them on your door by the end of the week ^^,
 
Ah, the samples bit is fun: http://www.ladyada.net/library/procure/samples.html.
But the trick is knowing what chips to get. Since I am just a mechanical engineering student (or at least that's my excuse), i feel totally out of the water when I have to find the right chip. I can compare two chips and decide, but I can't sort through digikeys 1000 different options. Nor do I even know what kind of general allegiances I should hold.

If you really manage to get such high resolution with dithering and oversampling, I'm tempted to stop making this very overcomplicated setup to measure the 9 steps of 5.7v (total: 52v). I could just scale the whole thing down, if I think I can pull off the oversampling and dithering bit. It's the dithering that I will have to learn more about. But with plain 12 bit resolution I won't be close enough.

1% resistors aren't particularly expensive. I was surprised you'd use 5% ones. While you can characterize them, I thought 5% tend to be carbon film and have more thermal fluctuation than metal based 1% resistors. not arguing, just figuring there might be something here that i don't know.

Another option you have besides a stable reference voltage, is to use the internal band gap reference, if your chip has that (as the arduino uno and mega chips do, whichever that precise one was.) I'd search something like "Arduino Band gap reference" for info on that, if you have not heard of it. The band gap reference is pretty good, though not perfect, and if you have a very stable reference voltage perhaps that'll suit you more.

you really should get a programmer and a xplained kit - the learning curve is steep, but the application notes are well written and files follow to get you going. Ask on avrfreaks.net if you have any trouble
-I didn't quite follow. I assume a programmer is just a programmer for the chips; I've seen people program most AVR chips with an arduino as the programmer, which is simple enough for me, but I might pick up something dedicated on sparkfun (fast shipping). I don't know what you mean by an "xplained kit" though. Could you clarify? I've heard of avrfreaks.net, but actually was a little turned off by the semi-aggressive attitude a few people had there. Experts, no doubt, but I don't want to step on their toes. I am a noob and except to be for quite a while. I wish I could be a committed high level kid in the snap of my fingers, but I have quite a while to go and quite a few things to do. BUT, I'll definitively be more open to it in the future, especially as it looks like Arduino is starting me along the path of using the chips by myself.
 
First things first; you have to settle for a VCC voltage. For me, I've setteled on 3,3V. Arduino runs 5V and some run extremely low (1,6V) for power conservation. Really; you don't need that many chips. Order linear regulators if your green on smps step down regulators.

Step down of voltages i just use resistors with a bjt on the end. Connected and with no activity the power draw from the microprocessor is reduced to a bare minimum. Step up of voltages, i use a voltage follower for precision - or just the internal gain on the avr for quickies.

AVR does dead-time insertions on pwm - but there are gate drivers that do this for you. You will need to build and understand a bootstrap circuit. High side driving is cheaply done with a bootstrap. Some half bridge drivers have the bootstrap diode inside - you only need to add the cap.

Decouple everything, I reccomend a capacitor box from goldmine-elec. A capacitance and inductance meter can be had cheaply on ebay.

I'm well aware of the different voltage references a AVR boasts :p 2,56V, 1V, DAC ouput, VREF and any you'd supply on AREF. You can also activate fuses to decouple the internal selected reference via the AREF pin.

1% resistors aren't expensive, no - but they're too unaccurate. A calibration is needed any way. As for carbon deposition - you have a point there.

A xplained kit is much like the arduino - just that you need a programmer to connect everything. With a programmer you can enter the registers on the chip while it is actually running, making debugging much easier.

Many of the avrcrowd is more impressed with blinking leds in order than actually doing something with real integration, and many are not slow trying to bring you down. But then you have the really nice crowd, setting you straight and on path in a second.

A AVR datasheet might seem daunting with it's ~600 pages, but you'll only go through 10 at a time, setting up parameters. Once you get the hang of it, it goes smoothly.
 
What is the size here looking like? I've been really wanting to build a 600-1000w charger that has 30 or more watts per cubic inch.
 
Back
Top