DIY TEC controller - Page 1
Forum section: electronics / general

author: mimmus78
author_rank: Unknown
timestamp: January 19, 2017, 11:09:26 am
content: I was thinking to build a DIY TEC controller to help me with mymetrologyvolt nut experiments but then I found this project that it seems quite up to the my needs and almost a turnkey solution.https://hackaday.io/project/11218-i2c-tec-controllerWhat do you think? Worth a try don't you think?

author: SvanGool
author_rank: Regular Contributor
timestamp: January 19, 2017, 11:27:02 am
content: There is at least one disadvantage, if you ever want to run it on batteries: a PWM driven TEC is not so efficient as an analog driven TEC.Another one could be, that you don't want any heavy switching currents in the neighborhood of very sensitive circuitry.

author: mimmus78
author_rank: Unknown
timestamp: January 19, 2017, 11:38:00 am
content: So we need an analogue solution ...Quote from: SvanGool on January 19, 2017, 11:27:02 am

author: ap
author_rank: Frequent Contributor
timestamp: January 19, 2017, 11:47:18 am
content: There are TEC controller hybrids being sold e.g. on the bay US. Also, an option may be used controllers from e.g. Thorlabs or ILX.

author: kony
author_rank: Regular Contributor
timestamp: January 19, 2017, 12:07:49 pm
content: Quote from: mimmus78 on January 19, 2017, 11:38:00 amOr simply filter the chopped PWM drive output to reasonable level of ripple (<10%).

author: 2N3055
author_rank: Super Contributor
timestamp: January 19, 2017, 12:35:50 pm
content: Datasheet for ADN8831 mentioned in that document mentions "no more than 0,5% ripple" after filter...So more than good enough for TEC use...

author: mimmus78
author_rank: Unknown
timestamp: January 19, 2017, 01:54:33 pm
content: Is it me ... or datasheet of ADN8831 is in chinglish?http://www.analog.com/media/en/technical-documentation/data-sheets/ADN8831.pdf"For best stability, the thermal sensor is to be closed to the object.""Adjusting the PID network optimizes the step response of the TEC control loop. A compromised settling time and the maximum current ringing become available when this is done."

author: tszaboo
author_rank: Super Contributor
timestamp: January 19, 2017, 01:57:43 pm
content: http://www.linear.com/product/LTC1923QuoteShould be easy-peasy.

author: mimmus78
author_rank: Unknown
timestamp: January 19, 2017, 05:17:25 pm
content: So it seems worth a try, I really like this because I can connect it to my raspberry that already run GPIB stuff for the various instrument.I will get this project pcb when I order pcbs for my next project. Let see how it works!

author: bertik
author_rank: Contributor
timestamp: January 19, 2017, 05:27:36 pm
content: Oh here I can throw in my design, recently finished:http://hololaser.kwaoo.me/electronics/Arduino_TEC/Arduino-TEC.htmlBTW an analog controller is never a efficient as a PWM controller (assuming that thePWM signal is filtered like for a DC supply). Actually to avoid noise this is mandatory forcritcial applications anyway.

author: kony
author_rank: Regular Contributor
timestamp: January 19, 2017, 05:40:17 pm
content: Not *that* mandatory. You can usually synchronise clock of such offending noisesource to sampling of data aquisition ADC, which makes the spurs disappear in the measured signal, as it aliases exactly on Nyquist zones boundaries (worst case adding some DC offset to the signal - but if you are into precision measurements, you are very likely to have the measured value riding on AC carrier signal anyway).

author: Kleinstein
author_rank: Super Contributor
timestamp: January 19, 2017, 05:48:23 pm
content: The ADN8831 combines switched mode regulation for the supply voltage and a linear more MOSFET for the final adjustments and ripple reduction. So in principle this could give a good efficiency and very low ripple. However the final possible EMI problems depend an the construction.The regulator itself is analog and thus adjustments of the PID loop might not be very easy and limited in range - it could be a problem with a very slow system. Also operation of the TEC near it's limit (e.g. more than 70% of nominal current) is not good, as linear operation is assumed.For a large, relatively slow system a µC based regulator is likely better. This could include three more improvements over the simple analog PID regulator:1) proper anti windup, to limit overshoot on startup or operation near the edge.2) correction for the nonlinear current to power relationship of the TEC3) use of a second sensor on the other side of the TEC. This can improve response, as the path from the hot side of the TEC is a major path for external disturbance. It is also highly recommended for protection against overheating.

author: Andreas
author_rank: Super Contributor
timestamp: January 19, 2017, 07:26:47 pm
content: Quote from: mimmus78 on January 19, 2017, 11:09:26 amBut only if the area to cool/heat is very small. (Like a laser diode).1-3Amps is way too little for typical cigarette to cigar box large devices.In other cases the peltier with its heat sinks is way too slow.Quote from: Kleinstein on January 19, 2017, 05:48:23 pmEven cheap Peltier car cooler boxes use a mechanical thermostat switch.I would never trust a processor alone.How will you explain your fire assurance that you have trusted a microcontroller?I have a different strategy:use a peltier car cooler box. (50-60W)Let the cooler run most of the time from 32 deg C down to 10 deg C and up to 15 deg C.For the rest use simple heater foils 2*12W (with reduced voltage) on a aluminium plate to heat for fast temperature control.I usually also use 2 temperature sensors: one at the aluminump plate (fast reaction P-controller)the other at the place of interest to do fine adjustment. (I-controller).with best regardsAndreas

author: Conrad Hoffman
author_rank: Super Contributor
timestamp: January 19, 2017, 08:49:43 pm
content: That control method sounds crazy at first, but it's exactly the way environmental chambers work- run the refrigeration full tilt, then adjust the outlet air termperture with very fast heaters. Works well, but it's inefficient. TECs are absurdly inefficient too, but they get the job done. I've never ordered from these people, but the deals seem to be good-http://www.banggood.com/search/thermoelectric.html

author: mimmus78
author_rank: Unknown
timestamp: January 19, 2017, 09:12:57 pm
content: So basically you stick a TEC to cool the outside box of the chamber and than you control inside temperature by circulating air over a heating resistor inside?

author: Andreas
author_rank: Super Contributor
timestamp: January 19, 2017, 10:04:42 pm
content: some pictures are here:https://www.eevblog.com/forum/metrology/t-c-measurements-on-precision-resistors/msg462298/#msg4622981)the TEC cooler box (under the table)2)the heat spreader (aluminium sheet) with the heater foils. (car mirror heaters).I usually use a shoe box to put the heat spreader together with the D.U.T. into avoid direct air draft / dripping water by the cooler fans.with best regardsAndreas

author: Kleinstein
author_rank: Super Contributor
timestamp: January 19, 2017, 10:41:56 pm
content: TEC efficiency gets considerably better if you only use the current needed to get the required temperature difference. So it can really help to reduce the power of the TEC.They can also be rather fast in reaction - it is mainly the heat transfer inside the chamber that sets the speed. The TEC itself can heat / cool in seconds.The rather high thermal conductivity across the TEC is one weakness, as it gives an easy way for external changes to the regulated side. Using also a sensor for the outer side of the TEC allows for accurate control, as one already measures the main path of external disturbance.

author: mimmus78
author_rank: Unknown
timestamp: January 21, 2017, 12:00:38 pm
content: So I tested my 120W TEC with 12V and 6A.It went down to -10°C and up to more than 40°C from ambient temperature in pretty reasonable time.The TEC was attached to one of this Hammond alluminum case 14x10x8 cm very poorly insulated.So this 60W~ of power are more than enough for my small thermal chamber.Anyway as for safety I will use thermo mecanical cut off switch (the same I used in my resistor heater) and maybe also a fusible switch as last resort and third level of redundancy.I was also planning to use fiber glass as insulant and all not inflammable materials for the external case. Hope this will be more safe than the car fridge ...Inviato dal mio Nexus 6P utilizzando Tapatalk

author: TiN
author_rank: Super Contributor
timestamp: January 21, 2017, 12:53:17 pm
content: Even 20-40W TEC will be just fine, as for metrology needs you just need power to maintain thermal differential, and our DUT resistors or references does not generate much power to dissipate/cool.Based on readings from 2510, TEC module barely draws 10W to maintain +50c with +23c ambient. Also be careful going below ambient temperature, as humidity and condensate can easily ruin your DUT.

author: Echo88
author_rank: Frequent Contributor
timestamp: January 21, 2017, 03:43:15 pm
content: What would be the most cost efficient method to regulate a TEC in a winecooler-chamber to get <0,050°C stability? I thought about using a industrial PID-controller, which has a 4-20mA-Output (used, from ebay for little money). I would convert that current to 0-10V and use it to control a suitable power supply (dimmable Meanwell-supply for example) for the TEC.Question is, if the controller is fast enough to stabilise the winecooler when i attach the temperature sensor on the cold side of the TEC.

author: Andreas
author_rank: Super Contributor
timestamp: January 21, 2017, 04:05:43 pm
content: Quote from: Echo88 on January 21, 2017, 03:43:15 pmThis stability without a oil bath with stirring oil?you are kidding.With best regardsAndreas

author: tszaboo
author_rank: Super Contributor
timestamp: January 21, 2017, 04:15:04 pm
content: Quote from: Andreas on January 21, 2017, 04:05:43 pmI linked a controller what supposed to do that...I guess all you need is a big bag of thermal mass in it, and a PT100x to measure it correctly.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 21, 2017, 04:36:28 pm
content: How good the temperature stability is, depends on the temperature changes on outer side of the TEC. If this temperature is not changing fast (e.g. a massive heat sink with some thermal mass) a standard PIC controller could be good enough. It is more the thermal setup than the regulator that sets the limits. I don't know how good the typical wine coolers are in this respect. My guess is that a really well tuned PID regulator might be just good enough if the external temperature is not changing fast. Things can get tricky at low temperatures, when more than about 50% of the maximum cooling is needed, as the system starts to get nonlinear and efficiency gets lower and thus more heating to the cold side. It get much more difficult if there are active heat sources inside the chamber - this is something that might require a stirred bath.Having a second sensor on the outer side of the TEC too can react considerably faster and better. Actually measuring the temperature difference over the TEC could also reduce variations in the heat flow by some thing like a factor of 10 (possibly more if the adjustment is really good). In this case something like a small µC board and specially programmed µC would be the way to go. A PID controller that support feed forward from a second sensor would also work. As an approximation (linear part of TEC and thus small currents) one might use analog circuitry for the 2 nd sensor (e.g. add some of the sensor signal to the 0-10 V control).For the power stage, a dimable power supply could be a problem, if one needs really low voltage and changing the direction of current flow. So one might need something like a relay to switch polarity and something to include this in the regulator.

author: Andreas
author_rank: Super Contributor
timestamp: January 21, 2017, 04:38:43 pm
content: Hello,who wants a "setpoint stability" of 0.1K (as offered in the linked data sheet)when a actual stability of 0.05K is required?When I do a temperature controller for a chamber and have 25.0 deg C at the sensor.The DUT may be 2-3 deg C above due to self-heating(45 mW for a voltage reference with 3mA*15V and a package of 80-150 K/W.)And at different points within the chamber you also have some deg C temperature difference.with best regardsAndreas

author: Echo88
author_rank: Frequent Contributor
timestamp: January 21, 2017, 05:47:39 pm
content: If youre referring to the LTC1923: it states 0,01°C-setpoint stability, not 0,1°C. Depending on cooling/heating-mode even better 0,002°C stability is achievable:http://cds.linear.com/docs/en/application-note/an89.pdfOf course the absolute temperatures of each module (DVM, reference...) in the thermal chamber doesnt really matter, as long as sufficient temperature stability ensures reliable measurements.

author: mimmus78
author_rank: Unknown
timestamp: January 24, 2017, 10:47:29 pm
content: @Echo88I'm not convinced a "hardware" solution is the ideal in our case. We will use different stuff inside the chamber, with different thermal mass and sometimes it will also produce heat so fiddling with hardware components for defining PID parameters is just not practical to do.So my idea is still implementing something my own. I just found a very good explanation of how a PID controller must work. I will do some experiments with a arduino and a h-brigde ... let see how it works.http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

author: bertik
author_rank: Contributor
timestamp: January 25, 2017, 01:36:42 pm
content: Quote from: mimmus78 on January 24, 2017, 10:47:29 pmJust to repeat, Arduino + H-brige PWM Controller using the autotune PID software of your link, has been implemented and tested over a couple of months inside out, it is describend in the link I gave at the beginning of this thread. The software needs however still some finishing touches, for which I need to find some time.

author: mimmus78
author_rank: Unknown
timestamp: January 25, 2017, 02:31:18 pm
content: @bertikmy plan is to use some big ass off the shelf Arduino shield h-bridge to drive bigger thermal mass than a laser diode (my plan is to use up to 10A).Because I don't need super temperature stability or accuracy like in laser cooling my plan is to use a more simple setup than yours without any custom PCB, just readily available Arduino shields.So I'd like to slap together an Arduino a BME280 the TEC and the H-brigde and get it working as soon as possible.Than after this, if it come out to be a good and easy to reproduce project I may also decide to share all the process (including source code) here.

author: Kleinstein
author_rank: Super Contributor
timestamp: January 25, 2017, 03:07:01 pm
content: The TEC do not like PWM very much, especially at higher currents. So the normal H bridges are really good to drive a TEC. It would need an extra filter inductor or similar to smooth out the PWM signal. The normal arduino PWM is rather slow and thus a rather large inductor would be needed and one might hear it.

author: mimmus78
author_rank: Unknown
timestamp: January 25, 2017, 08:10:36 pm
content: Arduino is capable of 64KHz pwm, even more if overclocked to 20MHz. Eventually if for any reason I can't do filtering at this frequency my plan B is to use a raspberry that will go up to some MHz if needed... hope than to not convert the pwm circuit into a radio ...

author: Kleinstein
author_rank: Super Contributor
timestamp: January 25, 2017, 09:09:06 pm
content: The Arduino hardware can do fast PWM, but AFAIK the the Arduino software does not support this. The other point is that many H bridges have a limited speed, as they are made for Motors and thus high inductance.

author: mimmus78
author_rank: Unknown
timestamp: January 25, 2017, 11:32:50 pm
content: Well this can be one reason my project with of the shelf parts can fail... anyway worth trying. It will be still an experiment where I can learn something.Inviato dal mio Nexus 6P utilizzando Tapatalk

author: Kleinstein
author_rank: Super Contributor
timestamp: January 26, 2017, 04:35:30 pm
content: Some of the H-Bridges are fast enough to work with a reasonable PWM speed, at least in the 20 KHz range. At least one should check the speed, when choosing a chip of module. Slow PWM can still work if there is a inductor of sufficient size.AFAIK there is not big deal using PWM directly from the registers and thus fast enough from the Arduino environment.One should not use PWM without filtering. Using PWM, RC filtering and than analog (linear) control is still more efficient (for cooling) than PWM directly without and filtering.For the start I would keep the voltage / current low - well below the maximum rating of the TECs. This can also help to improve efficiency, when you don't need the full temperature difference. It also helps to make the control fail safe so no fast HW damage from a SW problem. If needed one can have two TEC in series.

author: TiN
author_rank: Super Contributor
timestamp: January 27, 2017, 09:44:45 am
content: Quote from: Andreas on January 21, 2017, 04:05:43 pmMy last night test data shows getting 0.05C stability without any oilbath voodoo is easy-peasyI used this setup almost 24/7 over last 2 months to test tempco of over 50 resistors. Cooking article with data results.The orange line is temperature of YSI 44031 thermistor in the small die-cast box with TEC on it's bottom side.Time period on graph is 3 hours.Yes, this is not a winecooler with large volume, I grant you that.With bit more care on insulation and larger thermal mass block 0.01C stability should be not hard to achieve.

author: Theboel
author_rank: Frequent Contributor
timestamp: January 28, 2017, 12:46:17 am
content: Hi TiN,What TEC controller do You use ?

author: TiN
author_rank: Super Contributor
timestamp: January 28, 2017, 07:03:42 am
content: Using Keithley 2510 I was lucky enough to snag 3 years ago on fleabay andfix and calibrate it.

author: Theboel
author_rank: Frequent Contributor
timestamp: January 28, 2017, 08:14:21 am
content: Quote from: TiN on January 28, 2017, 07:03:42 amOk thats explain the stability

author: Kleinstein
author_rank: Super Contributor
timestamp: January 28, 2017, 09:19:50 am
content: The Keithley 2510 acts as a really good quality regulator, and this way still shows that thermal setup is capable to get the good stability. However using one the one sensor also used for regulation is kind of cheating - it does not tell very much on how stable the temperature is at other positions in the box. The small box also helps a lot, as this makes it fast (time constant is proportional to the square of the dimensions). A faster system can have more feedback at a given frequency.If the Ke2510 is using the build in PID function, there are still two points where a special purpose TEC regulator could improve on it: The nonlinear current to power curve is usually relatively well known and the other side temperature can also be compensated.The critical part for true stability is the sensor and the part to get the temperature reading, not the output part of the controller. So if you want to build a controller it is about the ADC, not so much the PWM (or DAC) resolution. With a suitable sensor, it is not that difficult to get mK resolution for the temperature reading.The stability does not even look that good - at least with a second sensor a purpose made TEC controller should get better stability.

author: TiN
author_rank: Super Contributor
timestamp: January 28, 2017, 09:50:40 am
content: Last year for some other tempco tests I was using two sensors (one on box wall, connected to 2510 to close the loop, second on resistor body, measured by K2001). Both sensors were same, Honeywell HEL-705 Pt1000 RTDs, and tracked well together.Edit:dataloghere (CSV data there too).

author: mimmus78
author_rank: Unknown
timestamp: January 28, 2017, 10:46:36 am
content: Kleinstein Actually I implemented sort of pid controller in python with a raspberry.It uses two temperature sensors to regulate the temperature and two big ass resistor as heater.It's used for measuring TCR for some resistors I want to use inside some LTZ1K.One temperature sensor is "attached" to the resistor, the other temperature sensor sense ambient temperature.Power to the resistor is calculated considering also variation in ambient temperature.Despite using digital sensors (lot less precision than a RTD and lot of noise) I got 0.03°C temperature stability with almost no thermal mass.If I get PWM circuit working, I think I will use 3 temperature sensors for this DIY controller.One will be attached inside the chamber just above the TEC (and this will represent chamber temperature with the limits we know).The second will measure temperature of the TEC heat sink.The third will measure ambient temperature.Now I still have another problem to solve. How to get info for the "the nonlinear current to power curve"?I spent 3 minutes with Google, but I find nothing on the subject.

author: 2N3055
author_rank: Super Contributor
timestamp: January 28, 2017, 11:04:23 am
content: http://www.meerstetter.ch/images/compendium/heating_cooling_chart.pngLike this?

author: Kleinstein
author_rank: Super Contributor
timestamp: January 28, 2017, 11:15:06 am
content: With a TEC there is likely no need for a third sensor on the outside for the ambient temperature, but if will not really hurt. One might want an extra sensor inside the box, closer to the DUT.The usual TEC follow a rather simple curve: Heat flow is mainly made up from 3 components: thermal conductivity between the two sides - proportional to the temperature difference, ohmic loss and the peltier effect.This gives a parabola with a maximum cooling near the so called optimum current usually noted in the DS. The other obvious point is zero current. The maximum reachable temperature difference (from the DS) gives the ratio of cooling power to thermal conductivity. This only leaves on unknown scaling factor for the power, that one does not need for the regulator, as it is just a factor in the gain of the whole system.

author: EmmanuelFaure
author_rank: Regular Contributor
timestamp: January 28, 2017, 06:03:27 pm
content: I agree with Kleinstein.@2N3055 & @mimmus78 : Here's attached a curve plotted for a jellybean 9A TEC.

author: 2N3055
author_rank: Super Contributor
timestamp: January 28, 2017, 06:58:15 pm
content: Quote from: EmmanuelFaure on January 28, 2017, 06:03:27 pmThanks Emanuel!! That is pretty much same diagram like I put, but plotted differently.Basically, like Kleinstein said, it's a parabola.. So, in order to have a predictable controller behaviour, linearization of current controller would be beneficial..Take care!!

author: mimmus78
author_rank: Unknown
timestamp: January 28, 2017, 07:32:03 pm
content: I do not have the datasheet for my sample. The I max is the number printed on the body of the peltier right?Inviato dal mio Nexus 6P utilizzando Tapatalk

author: mimmus78
author_rank: Unknown
timestamp: January 28, 2017, 07:36:24 pm
content: I think if you operate the peltier not at the limit current you can calibrate the parabola by finding some of the points.Inviato dal mio Nexus 6P utilizzando Tapatalk

author: Kleinstein
author_rank: Super Contributor
timestamp: January 28, 2017, 07:57:39 pm
content: The exact shape of the parabola is only important in the regions close to the maximum current. For mode moderate currents it is not that important where the optimum current is. One could find the optimum current from a few test points - depending on how good the thermal contact is, it can be shifted to lower currents compared to the ideal DS value anyway. So an experimental value for the current that yields the bet cooling / lowest temperature might be better anyway.Form the curves for different temperature differences show the parabola not perfectly parallel. So there seems to a slight deviation from the simple model - without individual temperatures it is hard to tell, if it is a temperature dependent peltier effect, thermal conductivity, or the usually small contribution of thermal EMF times current. Still I don't think one needs to care about the difference.

author: EmmanuelFaure
author_rank: Regular Contributor
timestamp: January 28, 2017, 11:53:13 pm
content: Quote from: 2N3055 on January 28, 2017, 06:58:15 pmYup, but mine is computed with actual valuesThis one is for a very common 'made in china' TEC1-12709.To anyone interrested in this, there are the full equations :http://electronicdesign.com/components/simple-design-equations-thermoelectric-coolers

author: Kleinstein
author_rank: Super Contributor
timestamp: January 29, 2017, 10:30:38 am
content: Thanks for the link:However, the equation for the cold side temperature has one obvious mistake: the last bracket is to much - you can't add thermal resistance to temperature.

author: mimmus78
author_rank: Unknown
timestamp: January 29, 2017, 05:43:48 pm
content: Also this link can be usefull:http://www.meerstetter.ch/compendium/tec-peltier-element-design-guideInviato dal mio Nexus 6P utilizzando Tapatalk

author: 2N3055
author_rank: Super Contributor
timestamp: January 29, 2017, 06:30:50 pm
content: Quote from: mimmus78 on January 29, 2017, 05:43:48 pmYep that is a good introductory page.. Diagram I linked to came from that page...