Advice for microprocessor (PI) controlled variable voltage power supply? - Page 1
Forum section: electronics / projects

author: h82fail
author_rank: Newbie
timestamp: October 02, 2019, 09:15:38 pm
content: I have a project where I want to control the voltage on a peliter with a PI (max would be 12v @ 6A). Its been a while since I've designed a proper circuit and I really just want a easy solution so I can get to the programming part of my project.My initial thoughts were to just purchase something like this:https://www.amazon.com/gp/product/B00C4QVTNUthen to replace the pot with a digital pot like MCP4151-503E/P. Then test the output voltage during programming and hope it stays consistent over time or add a DAC to the Pi and use a voltage divider to keep track of the voltage. This for a appliance, a wine fridge being turned into a cooled humidor so I want it to be reliable. I would replace those Chenxing caps as I don't trust them long term. Maybe it would be better to just build something from scratch I just don't trust designing it myself.Could i just use a N MOSFET with a proper filter to smooth the output (I know I would need a inductor/cap/diode just not sure how to size). I heard that driving it with PWM lowers the efficiency of a peltier quite a bit so I would want a decently smooth output. Or if anyone has a better solution, either something without a ton of parts or a better off the shelf variable step down. I have LTspice installed if anyone has any examples.Thanks a bunch for any help!

author: profdc9
author_rank: Frequent Contributor
timestamp: October 03, 2019, 01:54:56 am
content: If you are using the Peltier in a feedback loop to control temperature, would turning the Peltier on and off every few seconds be inefficient? How closely does the temperature need to be controlled? Is the inefficiency from having to charge and discharge the Peltier junction capacitance? Maybe a minimum on or off time of 5 seconds or more would prevent excessive energy from being expended in the junction.

author: NiHaoMike
author_rank: Super Contributor
timestamp: October 03, 2019, 01:57:23 am
content: Just use a low side switched buck converter topology driven from the PWM signal via a MOSFET driver.

author: jbb
author_rank: Super Contributor
timestamp: October 03, 2019, 02:13:03 am
content: Quote from: NiHaoMike on October 03, 2019, 01:57:23 amYes, I think this is a good starting point. Gate drivers to convert a 3.3V PWM signal to a 12V gate drive signal are cheap and readily available. I recommend against messing about with discrete transistor designs.As I understand it, Peltier elements aren’t much more efficient when driven with a steady variable DC current, instead of all on / all off control. This is because the Peltiers have quite a lot of resistance, so higher drive voltages = higher drive currents = much higher losses. Also the all on / all off cycles may cause fatigue.If you have a look around, you can find training videos from the Peltier manufacturers for how to size things. It turns out that you probably don’t want to run the Peltier at more than half it’s delta-T rating or wattage rating.Also, at least for cooling mode, hot side heatsinking to ambient is critical.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 03, 2019, 06:05:19 am
content: Quote from: profdc9 on October 03, 2019, 01:54:56 amYes. On/offing peltiers is not recommended for neither efficiency nor reliability.First, the Peltier efficiency drops at higher currents (so-called diminishing returns). So basically if you have a heat transfer of, say, 20W at 20W input power (100% COP), youwon'thave 40W heat transfer at 40W input power, but maybe only 35W (88% COP). (Made-up example numbers.) This starts to drop quite quickly when getting near to the nameplate power, so if youhaveto on/off control it, derate the power.This means, high current should be used only when high level of cooling is actually needed. 100%-0% control (very slow, or faster PWM, doesn't matter) always runs it at the lowest efficiency possible.Secondly, despite being marketed as a "solid state device", Peltiers have limited on/off cycles due to thermal stress and may resonate with higher PWM frequencies.Hence, voltage control is definitely recommended. It doesn't need to be super accurate, and a small amount of ripple won't kill it.Direct PWM with a MOSFET cannot be recommended for the reasons mentioned, butopen-loop buck, which basically is the same but with added output filter (inductor + capacitor), is well acceptable. (Remember the proper two-switch topology: a freewheeling diode is definitely needed once you add the inductor.) For sizing the inductor and the capacitor, look up for buck converter design aids. You'll find appnotes, spreadsheet calculators, etc.Although, in that case, just using a bog standard DC/DC converter IC is likely easier, because it implements overcurrent protection (which, again, becomes important when you addcapacitanceto the output).And yes, as a general rule of thumb, there is this physical law regarding Peltiers that the hot side cooling is always 3.14159 times more important and difficult than you thought it is, no matter how well you did your homework.This is because all experience people have on cooling electronics assumes some dT=60 (so that, for example, the semiconductor junction sits at 100 degC at 40 degC ambient). But using Peltiers efficienctly typically requires optimizing it below dT=10 degC in order to have any meaningful cooling, so it's completely different ball game. If you are dissipating 100W, you need to use solutions you'd normally use for dissipating 1kW.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 03, 2019, 07:31:27 am
content: Just on / off control is really not very efficient, this gets especially important when cooling with a relatively large dT. The peltier internal losses are proportional to the RMS current, while the wanted heat transport is proportional to the average current. The higher loss not only need more power but the extra heat (actually about half of it) also needs to be transported by the peltier element and ends up at the hot side.Even just linear control is more efficient than simple on / off: the extra heat is not dissipated in the peltier element but at the external control transistor.There is no real need to have a large capacitor for filtering the peltier current, the main part is usually from the inductor. A small capacitor can still help with possible EMI issues. There is no need to get very low ripply - the extra loss goes down with the square of the ripple amplitude. So 10% ripple can be acceptable.The nominal current for the peltier elements is current to get the most cooling in case of perfect cooling of the hot side. More current gives less cooling. Real world with a limited heat sink at the hot side this optimum current shifts down.If used in a temperature control, there is no need to have a feedback from the actual voltage or current. Just the PWM setting can be used as a control variable. For better regulation it may help to include the nonlinear current to power relationship of the peltier element.

author: h82fail
author_rank: Newbie
timestamp: October 03, 2019, 08:25:27 am
content: Thanks everybody. Interesting info about the peltiers. I designed a simple dc/dc step down with the digital pot in LTspice (high side sw) that seems to work fine but picked some random sizing on the parts just to get it working. I will do more research on proper sizing and also try a low side sw design since so many recommended that style before I post the asc file and make myself look like a idiot! Any reason i should use a PWM vs digital pot controlled MOSFET? 8bit digital pot is only $1 and easy enough to control with the PI using SPI and that way I don't have to worry about filtering the output so much?As far as the peltier setup, I'm just using what came on the thing. I picked it up on craigslist for $9 because the control board was broken (one of the 3 MOSFETs on it looked like it exploded!). The peltier works fine, I have a bench psu that only goes up to 8v and from 4 to 8v its about 2.5ohm when the hot/cold sides are near the same temp and the resistance goes up a bit closer to 3 after it warms. The hot side heatsink on it probably actually is about 3.14159 times larger then the cold side and was barely warm at 8v without the fan running on it. The wine cooler is fairly small and I will only be cooling it to between 65-70F/18.5-21C in a space that will likely be 75-80F/24-26.5C so I probably wont need more then 8volts unless maybe house a/c failed. I also didn't want to run it at full power unnecessarily because of condensation since its going to be a humidor.Thanks again, I wasn't expecting everyone to be so friendly to a newb.

author: Kleinstein
author_rank: Super Contributor
timestamp: October 03, 2019, 08:44:29 am
content: With digi-pots one has to be careful with the voltage range. They usually need the analog voltages to be inside the supply range. So for the cheap parts this usually limits the voltage to some 5 V. Many chips use adjusting the feedback path for setting the voltage, so this can be a problem.PWM control can be relatively simple, for low power it could be as little as connecting to a suitable low level MOSFET as a low side switch.For the beginning it would be good if the supply voltage is low (possibly just 5 V in this case), so nothing bad would happen even if the µC stops working with the FET turned on. A lower voltage also reduces the needed size of the inductor.

author: Ian.M
author_rank: Super Contributor
timestamp: October 03, 2019, 11:33:24 am
content: A Pi is a poor choice for realtime control. You'd be side-stepping most of the issues if your digipot idea works out as the update rate is fairly non-critical, but its a PITA to get clean PWM out of a Pi and even tougher if you need a rapid acting trigger input for over-current.protection. Also it doesn't have any built in ADC so closing the loop for output voltage or with analog temperature sensors requires an external ADC.You'd be better off with a small MCU - an 8 bit one would be entirely adequate. Microchip have a whole bunch of 8 bit PICs that are well suited to switched mode converter applications (albeit not at very high operating frequencies), including cycle by cycle current limiting, or if you are a MCU novice you could go down the Arduino road. e.g. an Arduino Nano would do nicely. If you still want the Pi for a GUI or to support a fancy web interface etc., it could command and monitor the MCU, which would hold its last settings if the Pi was off, crashed or otherwise indisposed.

author: Siwastaja
author_rank: Super Contributor
timestamp: October 03, 2019, 12:03:05 pm
content: I would just use an off-the-shelf DC/DC buck and use Raspberry PI IO to inject a small current to the feedback voltage divider - i.e., a resistor from the divider to the IO pin. This way, by configuring the pin as high, floating or low, you have already three different voltage settings. Choose the series resistor wisely, do a bit of math in Excel, and you have five levels by configuring pullup/pulldown resistors on/off. Another option is to have 2 or 3 IO pins with different resistors, and you have a parallel DAC.Likely enough to do the job. You can slowly (no real-time capability needed) dither between two voltage levels and it will be good enough (order of magnitude better than on/off).