PDA

View Full Version : Pulse charging amp ratings???


Kaos116
Sep 28, 2004, 11:18 AM
Hello all,

I posted this in the battery/charger forum with no responses. This might be a more appropriate place.

Firstly I am not looking to buy a charger. I like to build stuff and want to build one. I want to use a PICMicro controller (16f84) to develop a peak detector NiMH charger. As far as the peak detection, I have that all figured out. I want to cut down the number of lines I have out controlling the charge rate. I have 5 now for rates of 2A,1A,500ma,250ma, and 50ma (trickle). I turn these on through switching transistors depending on how I have it configured. What I would like to know is, If I pulse a 2A charge at rates that would overall be equal to lower rates, is this the same? Pulse 2A on for 1 second, off for 1 second. Is that the same as 1A constant current? If I did the math right at 50ma it would be on for 1 second at 2A and 39 seconds off. If I could use this method of current charge control without damaging cells I could actually set it up to charge at any rate from 3a to ~0a. I am not thinking of adding a 'discharge' or 'burp' pulse. Just pulsing the charge rate.

Your thoughts?

Thanks,
Kaos

Comatose
Sep 28, 2004, 12:59 PM
kaos, what you're really asking about is PWM. Many Pics have this built in, you can set the frequency from a few hundred Hz to a couple hundred kHz, then set the duty cycle from 0% to 100%. At those frequencies, its functionally the same. 1 second on and 39 seconds off is NOT the same, you'll toast cells that need a 50 mA charge.

You can do it in software on the pic16f84, certainly. If you don't need extreme values (duty cycle from say 20% of the time to 80%) then a timer interrupt will work fine. For most things a few kHz should work fine.

You should be aware, though, that the pic16f84 is pretty much a dinosaur anymore, and an expensive dinosaur to boot. For $4 each you get 1.5k of flash, 68 bytes of RAM and one timer. A better option would be the pic16f818, which is the same 18 pin form factor but costs $1.75, has hardware PWM (what you're looking for), the same program space, twice the ram, three timers, and a hardware synchronous serial port. It also has 8mHz internal oscillation, so no mucking about with crystals or whatnot most of the time. Maybe not for this project, but before your next one check it out. The pic16f684 is also a great little chip, and even cheaper.

Dan Baldwin
Sep 28, 2004, 01:14 PM
Kaos

I did respond in the batteries and chargers forum, but I need to modify my response. Comatose is right. Instead of using a separate DAC or an analog pot you could use a high rate PWM output, then smooth out the voltage to control charge current.

Dan

Kaos116
Sep 29, 2004, 01:08 AM
Thanks Dan. I got your message on the other forum and did post it here. And to Comatose too. Thanks. I did alot of online reading about PWM tonight. I think that might be a bit over my head right now. I might get some time this weekend to play around. The other issue I might run into is the method of peak detect. If I change the 'pulse' to just milliseconds I am not sure that it will be enough time to get a good reading on pack voltage. But this is what I like about building stuff. Trial and error learning.
As to why I still use the good ol' 16f84 is I bought them in bulk a few years back and have a few left. I did look at the 16f684 tonight and I think I might buy a batch of those. I just need to make sure I can program them. I know I will atleast need an adapter to go from the 18 pin config to 14 on my programmer. I never looked into how my programmer programmed. I just always used the f84's.
Comatose, you seem to be well versed in the picmicros' is there an easy way to get a 'real time clock' setup internally? It actually doesn't need to have the correct time or date...just something I can call at the beggining of a routine and look at periodically to see how much time has lapsed? I am using PicBasic Pro to write code, but have dabbled in ASM. If I could do this then the PWM might not be such an issue, if I can stop the PWM every minute or 2 to do a peak detect reading.

Thanks again.

Kaos

Dan Baldwin
Sep 29, 2004, 11:15 AM
My favorite PIC at present is the 12F675/16F676. They are basically the same chip, but one is 8 pins with 6 IO max, the other is 14 pins with 12 IO max. I like them because they are small and cheap. You can buy a programmer for them for $36.00, but the programmer will only work with these chips. They have 4 analog in and 8 analog in respectively. The analog resolution is 10 bits. They have an internal 4 MHZ RC oscillator, so they will run with no external components, although you can use a crystal if you need higher frequencies or a more precise clock. They do not have PWM output, however.

I think you're right that pulse charging would make it very difficult to detect the peak.

Dan

Kaos116
Sep 29, 2004, 12:42 PM
I looked at what my programmer and software will program and it seems that I will need a new programmer. It appears the 16F684 is new and lots of programming software is now adding it to there lists of chips. Something else to build :D might even try building a USB programmer.

I certainly could have used smaller pics in some of my projects. Quite a few of them could have been done with an 8 pinner. Only needing 2-3 I/Os. I think I might look for something that will do ICSP. It would be nice not having to straighten pins or lose that space on the breadboard with a zif.

But, still thinking of the NiMH peak charger. I think at this moment I might scale it back a bit for the initial build. This project is using a few new techniques (LCDs, Serialout and a nifty 555 voltage detector). I may drop the LCD on this project if I don't select the amp rating through software. This will free up a few I/Os. It will also reduce the physical size that will be needed for the enclosure too.

Ahhh... I love this stuff. :p

Thanks

Kaos

Dan Baldwin
Sep 29, 2004, 01:17 PM
I love the smell of hot resistors in the morning

Dan