Saturday, September 5, 2009

Peltier power supply and integrated PID controller

I am preparing to build a beer-brewing tank that will be temperature controlled. The goal is to keep the vessel at a very steady 72*F. Depending on the time of year, this might require heating and/or cooling 24 hours per day, or heating during the night and cooling during the day. Since the only heat load on the vessel is the heat leakage through its insulation, the total amount of heat that needs to be pumped is fairly low. This might be a good application for a Peltier heat pump since the heat load is low and the heat pump direction might need to be changed often.

As I mentioned in my aquarium chiller post, the Peltier module must not be controlled by PWM (pulse width modulation) or on/off thermostatic control. During the 'off' part of the cycle, heat will flow backward through the Peltier device and decrease efficiency almost to zero. Ideally, the PWM output should be smoothed with an L-C (inductor-capacitor) circuit to provide clean DC power to the device.

I happened to disassemble a thermoelectric refrigerator (and replaced its guts with a refrigerant-based system in a previous post) and had a 115VAC Peltier power supply and Peltier module. The power supply uses a TL494 IC to control a 115V->12V high-frequency transformer. The output of the transformer is smoothed with an L-C circuit. The TL494 is controlled by the output of a thermistor and digital thermostat, thus sending more power into the transformer when the fridge's temperature exceeds the thermostat set-point, and reducing power when the temperature falls below the set-point. I couldn't figure out the analog side of the circuit which had a few op-amps. Instead, I discovered that I could throttle the power supply by putting voltage on the TL494's DTC (dead-time control) pin, which wasn't used in the original circuit. Cool. So now I have an efficient power supply that I can throttle from 0V to 12.5V (full power) to the Peltier.

Next, I need a thermostat to control the power supply and also reverse the polarity of the Peltier device (to switch from heating to cooling). I thought about using an Arduino to do the whole thing: sense the temperature, provide a UI with LCD and buttons, process the PID loop, and send output to the power supply. My biggest worry was the UI. There are actually a lot of parameters in a PID loop, and I didn't feel like writing code to make all of them user-selectable. I also had another Eurotherm 2132 PID controller (same as the aquarium project) which I really like. I decided to use the Eurotherm and build a circuit to convert its output into a control signal for the power supply.

The Eurotherm has two outputs, a relay and a driver output for an external solid-state relay. I removed its internal relay and directed the relay's coil wire connections to the Eurotherm's rear terminals. I then used an optoisolator to interface the Eurotherm's floating outputs to the rest of my signal-converter circuit. The Eurotherm can be configured so that its output 'cycle' for each output is 1 second. Thus, it essentially outputs a PWM signal at 1Hz for cooling, and another 1Hz PWM signal for heating. I wrote a little code for an Atmel AVR ATMega8 that reads the two control signals from the Eurotherm and outputs a voltage that controls the Peltier power supply. It does this by generating high-frequency PWM and smoothing it with a simple R-C low-pass filter. The current draw is very low. The AVR also controls an NPN transistor that drives a DPDT relay. The relay will reverse the polarity of the Peltier device.


All of the above-mentioned circuitry is crammed into an acrylic box that I made for this project (left). The Peltier module has a small heatsink and a large heatsink with two fans (right).





I modified the power supply (by removing a fuse, and adding a fan), and tested it with two Peltier devices hooked in parallel. It seemed fine at 12.5V and 7A.

The next step is to mount the Peltier devices onto the brew tank and test it out.

The tank will hold 5 gallons. For thermodynamic analysis, I will assume it's water. So, that's about 20 liters, and water has a specific heat of 4.2J/g*C, so the tank will require 4.2(20)(1000)=84KJ to change 1*C. If the Peltiers are consuming 12.5(7)=88W, and are 50% efficient, they will be pumping about 44W (in cooling mode), which is 44J/s.

In order to change the tank's temperature by 1*C, the system will need 84000/44 = 1900 seconds, or 30 minutes. This is good and bad. The good news is that the tank will remain very stable, as it is not in danger of being quickly influenced by the Peltier. The bad news is that the tank must start out fairly close to the target temperature, or else it will take a long time to be regulated by the system.

8 comments:

  1. Hi Ben, I hope that you can answer my post. I have a CAL3300 controller, very similar to your Eurothern. Please review my current situation:
    "The CAL3300 controller works in DIRECT mode to freeze and in REVERSE mode to heat. I need to freeze a liquid to 20ºC. The room temperature at day is 25ºC, so the controller should be programmed to DIRECT model to decrease the temperature in the fluid. But in the evening, night and morning the room temperature go down to 16ºC, then the controller should be programmed in REVERSE mode, to heat and rise the temperature to reach 20ºC set point. There is a way to avoid the continuous changes in programming?, this operation mode is not useful because makes the project very user dependant. The ideal method is that the controller could regulate the temperature at setpoint despite of the changes in room temperature"

    I have seen that you solved the problem. Could you help me?, I know that some SSR should be used, but i do not know where and how.
    if you post a comment here, please do not forget to send me a copy to esteban@blw.cl co check your blog again ans see your answer ;-)

    Esteben

    ReplyDelete
  2. Esteben, your controller has two outputs: an SSR relay driver and an internal relay contact. It sounds like you are only using the internal relay right now. In order to achieve heating and cooling control, you will need to use both the SSR output and the relay. Buy a solid-state relay (SSR) from eBay or www.jameco.com. Hook it up to the SSR outputs from your temp controller, and configure the controller to use the SSR for heating, and the relay contacts for cooling (or vice-versa). What are you using for your heating and cooling devices? If you are using a Peltier, you will need some additional circuitry to convert the heat/cool signals from the controller to +/- polarity for the Peltier. This is not really trivial, but you will need a little experience with electronics. What is your application?

    ReplyDelete
  3. hello Ben, I currently working on a liuid cooling project using Peliter modules.. I'm not to sure what I would need for a power supply and controller and was wondering if you could help me out.. The surface of what I would be cooling is 120mm x 360mm. I wasn't sure how many modules I would need maybe 12 per side... I want it to be as cold as it can get along with a custom heatsink I'll mill out after its be constructed.. I was wondering if you could tell me what a good power supply would be to keep these powered up and a controller that can controll them as well. i was hoping to run them parellel to each other so then they all can be controlled at one temp not all seperate. my email is detaildrawings@live.com... I can send you drawings of it done in Inventor for a better idea!!!

    Thanks

    ReplyDelete
  4. Susan, the number of Peltier modules that you need would depend on the total amount of heat that you need to pump. If you want to change the temperature of a tank of water, you should calculate the water's heat capacity (1 cal/mL), then decide how quickly you want to change the temperature of the water. These two pieces of information will determine how many modules that you need.

    If you do need 12 Peltier modules, wiring them in parallel may be difficult. The chances that the voltage-current curves for each Peltier will be identical is very low, so in parallel, some modules will be working much harder than others. Also, in parallel, you will need a power supply with a lot of current -- 12x7A = 84A @ 12V. That is not easy to find or build. I would wire the modules in series, so that you would need 7A @ 144 V. This way, you can just rectify 110VAC and feed it straight in with minimal circuitry. Ideally, you would need a controller than can continuously vary the DC voltage being supplied to the Peltier (as mentioned in this posting). That is certainly possible, but I don't know of any that exist commerically. You basically need a 0-144V DC supply capable of 7 or 10A.

    If this design is for commerical use, please do not ask me detailed questions about your design.

    ReplyDelete
  5. Hi Ben,
    I hope you can help.
    I need to make a mini-environment in work which controls the air temp continuosly to 30 degrees C.
    I was thinking of making a steel frame and then hang plastic sheeting over the edges to enlcose the sample area.
    The mini-environment will be approx 1m cube.
    There will also be motors in the area, so there may be alot of heat generated in the area

    Do you think a peltier system wil work ok, if so how do i go about making the system.

    Thanks

    ReplyDelete
  6. Anon, I described how I built my thermoelectric cooler in the blog post, and it's really not possible for me to describe how you would go about making your own system in the blog comments. There are entire books devoted to the subject. In general, thermoelectric coolers are not well suited to moving large amounts of heat. You said you will be testing motors. Think about the size of the motor and how much heat it will generate. You need to pump this much heat out of the box to maintain temperature.

    If you only need cooling and not heating, I would recommend hacking a refrigerator and adding in a thermostat that will allow you to select 30*C. The fridge will probably have enough cooling power for your application, even though you didn't give any details. The fridge is already an insulated space of about 1 m^3.

    ReplyDelete
  7. I now is an old post, hopefully you'll able to help me. I made a similar driver for a peltier with a relay to reverse the polarity. The control software was a kind of crude PID in Arduino. It had a lot of "chatter" at the set temperature, transitioning between cooling and heating and trying to keep the desire temperature. Did you have such a problem? How did you deal with it?

    ReplyDelete
    Replies
    1. Juan, thanks. Rapid switching between cooling and heating is a problem that faces commercial temperature controllers as well. There are a couple ways of solving the problem: 1. Implement some hysteresis, so that once in heating mode, the control loop will stay in heating mode until a sufficient error is reached in temperature (and vice-versa for cooling mode). 2. The hysteresis mentioned above can be applied to the whole control loop (not just around the heat/cool transition), and is called dead-band. 3. Use a cricuit driver that is able to switch from heating to cooling rapidly (ie an H-bridge) instead of a mechanical relay. I've been thinking about making an H-bridge driven peltier temperature controller, but haven't started on it yet.

      Delete