Voltage control using PWM from a PIC

Thread Starter

finne

Joined Jul 29, 2013
12
Hello, I have some questions regarding a project I'm working on.

Whats the recommended way to cool this LM1084 5A regulator? https://www1.elfa.se/data1/wwwroot/assets/datasheets/hrLM1084_data_e.pdf

I have these TO220 heatsinks http://www.fischerelektronik.de/uploads/pics/FK252gr_01.jpg but it seems that I need active cooling as well if I'm using the regulator to its full potential. However I have no experience in designing active cooling. Fan types, placement etc. There are some graphs with temperature shown in the LM1084 datasheet but I dont know what to make of them.

So the longer question. I'm designing a PIC controlled battery charger for lithium ion batteries and just want some general feedback on it. Actually it will have more functions than charging, including destructive stress testing which is why I need all the current. I have succesfully used this little guide to create a D/A converter for my PIC http://www.edn.com/design/analog/4363990/Control-an-LM317T-with-a-PWM-signal

The ciruit I have is this, simplified a bit to capture the essentials:





The PIC controls for example the current with a feedback loop, mesuring current using Ai0:

PWM_new = PWM_old - Measured_Current + Target_Current

So in general, what stupid mistakes have I made? :) What would you do differently?
 

Alec_t

Joined Sep 17, 2013
14,313
Actually it will have more functions than charging, including destructive stress testing
What would you do differently?
I wouldn't do the destructive testing bit :). Are you aware of the fire and explosion risks when charging/using lithium batteries?
 

Thread Starter

finne

Joined Jul 29, 2013
12
I wouldn't do the destructive testing bit :). Are you aware of the fire and explosion risks when charging/using lithium batteries?
Yes. We at this university have the labs needed to blow up batteries safely :) But thanks for caring.
 

ErnieM

Joined Apr 24, 2011
8,377
So in general, what stupid mistakes have I made? :) What would you do differently?
First off you need to determine where ground connects.

When reading the battery voltage you need to subtract the current sense voltage.

The current sense voltage will be very tiny and thus an inaccurate measurement. Use an amp here, and if you use a high side current monitor amp you can put the resistor before the battery.

Those are tiny tiny heat sinks. Buy one that is a big hunk of metal.
 

Lestraveled

Joined May 19, 2014
1,946
I second everything that ErnieM said.

I have integrated the PWM output from a PIC to make a cheap DAC. It works fairly well but is very slow and by its nature has ripple. You will need to account for this in your code, otherwise, you could run into instabilities in your control loop.
 

Thread Starter

finne

Joined Jul 29, 2013
12
First off you need to determine where ground connects.
Right now ground is the negative pole of the 7,5 V power supply. Is that ok? Also I was thinking of putting a diode in series with the battery in case someone puts a battery in the wrong way. Is that enough protection and will it affect my measurements?

When reading the battery voltage you need to subtract the current sense voltage.
Yep, thought about that.

if you use a high side current monitor amp you can put the resistor before the battery
Is it somehow better to have them in that order? Why?

Those are tiny tiny heat sinks. Buy one that is a big hunk of metal.
Fixed that issue, we had something lying around that's overkill but not needed for anything else. A cpu cooler+heatsink. Just drilled a hole in it. It's ugly and hilarious but works.

Heres something for you to read on heatsinking
http://sound.westhost.com/heatsinks.htm
Thanks! The problem is solved but that text will come in handy.

I wouldn't use almost 50% of my energy to heat the regulator. I would use buck SMPS topology controlled by PWM from the PIC.
I looked it up and I'm sure you're right. However from what I read it seems like it might make my project a bit too complex. My time is a bit limited I'm afraid.

Cool! Do we get video of your results so we don't have to do the experiment ourselves? :D
Haha. Actually maybe :) All previous destructive tests that I know of have been filmed.
 
Top