Ok guys, I'm about at the end of my rope with this one. I've got a peltier that I'm trying to control the temperature on. It's being run by an Arduino Due with an H-bridge (sorry I don't have the model- it's not listed on it oddly. I believe it might be an Adafruit one). Analogue PWM to the bridge which then powers the peltier. PWM range is 12-bit: 0-4095. It's set on an aluminium PC heat sink with arctic silver CPU compound for when I need to get it cold and an RTD thermistor set on the top edge fo the peltier (not having a significant effect since I've been having the same issue since before the thermistor was put on). I'm measuring the temperatures with an infrared camera and a calibrated black body.
The issue I'm having:
If I start at any given PWM value (typically 0) and step up to another value (say 500), the peltier settles at Temp A. If I then go back to 0 and let it cool to ambient, step up to say 250, then to 500, I get Temp B, which will usually be at least a few degrees C higher.
Things I've checked:
Yes, the PWM is the same each time- specifically, I'm using a PC and serial to manually input the exact PWM I want.
Checked the frequency coming out of the bridge with an oscilloscope and it hits the same frequency for a given PWM every time.
Ambient temp is near enough the same (within a half degree of C at most, typically within a quarter degree C) that I doubt it's the cause, esp since I can watch the peltier temp rise and fall within a certain range as the ambient temp changes.
The amperage going to the bridge is, as far as I can tell, exactly the same for the end PWM.
The internal resistance in the peltier is the same for the end PWM, so I'm not seeing why this would be the cause.
Is there anything that I've missed? Does anyone have any exp with trying to control a peltier and could maybe give some pointers?
Peltier devices require more current (typically 5 or 6 amperes at 12 V) than most of the readily available H-bridges and power supplies can handle. Describe the rest of your circuit for more informed help.
Power supply is a variable voltage/variable amperage supply. 0-36V and up to like 3A. No problems with the power consumption- only trying to take this up to 100C or so and I can well exceed that without maxing out the power supply. Power is running at 12V for this situation. H-bridge I'm using is also capable of handling more than I'm pulling on it right now. I've had it handling up to the full 36V for short periods (around 1A at the time if I remember right).
The max I've seen the bridge handle is 36W or better, and I'm usually running half that, if?
Checked the frequency coming out of the bridge with an oscilloscope and it hits the same frequency for a given PWM every time.
Does the 'scope show that the voltage is holding? It does sort-of sound like you're running into power problems/variations...
BTW - It's unusual to use PWM for heating/cooling. Usually, you turn the heat (or cooling) on 'till you hit your target temperature, then you turn it off 'till it drifts back out of the target range. i.e. Your home furnace switches on & off, your refrigerator switches on & off, etc.
..if I then go back to 0 and let it cool to ambient
Are you using the Peltier for heating and cooling? If you are using it for heating or cooling only, you don't need an H-bridge, although it's OK if that's what you happen to have.
And, if you are only using it for heating, a resistor makes a cheaper (and possibly more reliable) heating element than a Peltier device.
...which will usually be at least a few degrees C higher.
If a few degrees is a problem, you need feedback (like the thermostat for your furnace).
0-36V and up to like 3A. No problems with the power consumption- only trying to take this up to 100C or so and I can well exceed that without maxing out the power supply.
What's the voltage & current rating for the Peltier device? The device and the power supply don't "know" you want 100 C.
DVDdoug:
Does the 'scope show that the voltage is holding? It does sort-of sound like you're running into power problems/variations...
BTW - It's unusual to use PWM for heating/cooling. Usually, you turn the heat (or cooling) on 'till you hit your target temperature, then you turn it off 'till it drifts back out of the target range. i.e. Your home furnace switches on & off, your refrigerator switches on & off, etc.
If a few degrees is a problem, you need feedback (like the thermostat for your furnace).
I'm using the pwm (via the bridge) to regulate how much power is going to the peltier and is working great except for this one problem.
I checked the setup this past thursday/friday and made sure that the amperage is coming out the same, but I didn't double-check the voltage recently enough that I can remember the results.
As far as the feedback goes, I do have a total of three rtd's in my setup- one for the peltier, one for the aluminium heat sink, and one for ambient- but 1) they're uncalibrated (doing that once I get this figured out) and 2) they respond much more slowly to temp changes than the peltier does so I can't just take the rtd reading and adjust the pwm from there. I could potentially make it work but it would probably be slow enough to be impractical.
My issue/question is: why am I getting different temps for the same PWM?
KenF:
I don't have any experience with controlling peltier but I get the idea that pwm is not the right approach to control them.
Any suggestions for a replacement method/device? I need to control the voltage to the peltier in both a positive and negative flow via software in a small package.
At 12 Volts, the Peltier will draw around 5-6 amps regardless of what temperature interests you. Neither your power supply nor your H bridge can handle that at steady state, so the power supply voltage is sagging and the bridge heating up.
Since you are using PWM, the effects will be transient and you will need an oscilloscope to see the details.
jremington:
At 12 Volts, the Peltier will draw around 5-6 amps regardless of what temperature interests you. Neither your power supply nor your H bridge can handle that at steady state, so the power supply voltage is sagging and the bridge heating up.
Since you are using PWM, the effects will be transient and you will need an oscilloscope to see the details.
But from what you're describing, I'd expect to have unreliable results for a given PWM even as it sits at the PWM. I get different temps for the same PWM, but if I repeat the test... Let me try to explain it out below instead of describing it-
Test 1:
PWM: 0; Temp: amb
PWM: 500; Temp: t
PWM: 0; Temp: amb
PWM: 250; Temp: g
PWM: 500; Temp: x
Test 2:
PWM: 0; Temp: amb
PWM: 500; Temp: t
PWM: 0; Temp: amb
PWM: 250; Temp: g
PWM: 500; Temp: x
I can predict that in Test 3 I will get t and x for the temps at PWM: 500 and I do.
What I can't predict is what temp I'll get if I use, say, 500 and 1000 instead, or any other 2 numbers.
But from what you're describing, I'd expect to have unreliable results for a given PWM... even as it sits at the PWM. I get different temps for the same PWM, but if I repeat the test...
PWM: 500; Temp: x
...I can predict that in Test 3 I will get t and x for the temps at PWM: 500 and I do.
What I can't predict is what temp I'll get if I use, say, 500 and 1000 instead, or any other 2 numbers.
I'd expect unpredictable results since you are using a 3A power supply with a 6A Peltier.
And, I'd expect somewhat unreliable results if you don't use feedback... It's like trying to control the speed of a car without a speedometer.
And combining PWM with feedback is going to be a little tricky.
feedback is being accomplished with a infrared camera and calibrated blackbody that's accurate to .001*C. I set the PWM of the peltier, wait for it to level, and use the camera to match the blackbody to the peltier. The camera is using a 14-bit raw data read and I'm matching the blackbody to within 4, at most 5 data units (I'm talking out of sometimes 7-8000 units). They both fluctuate and stay within this 4 unit tolerance of each other, going up and down with the ambient air movement and temperature.
@DVDdoug- could you maybe explain peltiers a bit more to me? How would this having a 6A rating be causing this effect? (this is the best train of thought as far as what is going on / how to fix this, I'm just not sure how this would be an effect.) Would using a 3A one be better or worse?
I was under the impression that PWM just turned a signal on and off very very rapidly, not that it generated a positive and negative signal. Can someone else confirm which is correct?
The peltier is about as flush with the heatsink as I can get it without using a press of some sort- I can fit about 3 or 4 sheets of notebook paper in between the two. "Making better contact"... how would that lead to the testing results that I'm having? (Just asking for an explanation on that.)
I was under the impression that PWM just turned a signal on and off very very rapidly, not that it generated a positive and negative signal. Can someone else confirm which is correct?
PWM does just turn on and off a signal rapidly. It is possible to wire an H-bridge such that this action causes reversals of the current in the H-bridge load. However we don't know what H-bridge you have, or how you have wired it, so that can't be predicted at the moment.
There is no question that the Peltier is (in the long run) overloading your power supply, and most likely overloading the H-bridge as well. The end results of both effects will depend on the PWM value. Therefore, whether you can predict the outcome of applying a particular PWM value is irrelevant.
Rough sketch of it. I'm using 2 pins in my setup- one to send the signal for the current to go one way (hot) and the other to go the other way (cold). When one signal is on, the other is off. I have the "to peltier" boxes colored as the wires as inserted. There are 4 total inputs- the left 2 (white boxes) have just one control wire that turns the fan on the peltier's heatsink on or off (it's not since I'm not trying to make it cold). I also have a power input missing; it's 5V in only and unused.
So as far as the amperage of the peltier goes, regardless of if that's the problem or not, by it trying to draw more power than the PSU and the bridge are able to supply, it's wearing them out significantly?
MarkT:
Are you measuring the temperature of the heatsink?
... This I do not remember. I remember that I have had a temp zone box on it with the camera but I do not remember what the result was. I'll try to test this tomorrow. Any explanation on how it could be causing my issue though?
The L298 driver chip can supply about 1 ampere per channel on average before it begins to overheat and shut down, despite the optimistic claims of the data sheet. As even the data sheet makes clear, the absolute upper limit for current is 2.5 amps/channel, and for only very short times, repetitively. See this test: The Motor Driver Myth — Rugged CircuitsRugged Industrial Arduino Microcontrollers
However, you can parallel the bridge outputs to approximately double that.
If you want a motor driver than can handle the current your Peltier requires, this is one suggestion (I use these and am happy with their performance) Pololu - VNH5019 Motor Driver Carrier
Of course, you will need a beefier power supply too. Then, you can expect fully predictable performance from your system.
feedback is being accomplished with a infrared camera and calibrated blackbody that's accurate to .001*C. I set the PWM of the peltier, wait for it to level, and use the camera to match the blackbody to the peltier.
Apparently, you are not using this feedback to control the PWM. Apparently, you are sending PWM values of "500" or "1000" instead of varying the PWM value depending on the feedback.
BTW - What do these values of 500 & 1000 mean? The Arduino normally uses PWM values of 0-256. If you are trying to send values above 256 the last 8 bits might be getting used. In that case, the 8 least significant bits converted from a decimal number would look rather random.
@DVDdoug- could you maybe explain peltiers a bit more to me? How would this having a 6A rating be causing this effect?
You are trying to "pull" 6 Amps from a 3 Amp power supply! ...What happens if you plug too many toasters & hair dryers into the wall and pull too much current? Your power supply might not have a circuit breaker like your home, but the voltage might drop, or the power supply might overheat, etc., or it might "safely" go into current limiting and cut-back the voltage.
From [u]Ohm's Law[/u], current is Voltage/Resistance. The amperage depends on the voltage applied and the resistance of the Peltier. If the power supply cannot supply the full 6A at 12V, the voltage must drop, since Ohm's Law is a law of nature and it's always true.