PWM controller frequency adjustment - low pass filter

May be this is the forum section for this question.

From my reading of PWM inverters, applied to TEC control, my understanding is;

The output of a PWM controller (lm494, ka3525a) is dependent on the internal oscillator frequency, which should be dependent on the PWM value supplied by the Arduino PWM pin. That is, varying the PWM value will regulate output voltage of the PWM controller. At least, that's how I understand it.

In that case, frequency adjustment is provided by the Arduino PWM value and separate frequency adjustment is not required at the external PWM controller. I think that is correct.

Finally, a low pass filter is required to smooth out the waveform. Component values might be a challenge here. Google should produce examples of low pass filter design.

The output of a PWM controller (lm494, ka3525a) is dependent on the internal oscillator frequency

Yes.

which should be dependent on the PWM value supplied by the Arduino PWM pin.

Why how do you plan to connect it up? I would say normally no.

That is, varying the PWM value will regulate output voltage of the PWM controller.

No the output will still be PWM. You need to smooth it with a filter to get a varying voltage.

The frequency has no baring on the voltage output, even after filtering.

I think this is correct, using an online design tool.

With an unmodified Arduino PWM of ~490hz

duty cycle 50%.

0 - 5v

frequency regulation at PWM controller set for an output of

1hz - passive simple RC filter

~0.02v pk - pk, settle time

~0.33 seconds

100R , 0.01uF.

Other values cause pk - pk and settle time too high, as far as I can tell using an on- line calculator.

Perhaps there is a better way of doing this?

OK. Every new concept that I tackle is a steep learning curve - scratch the previous.

I need a minimum of 2khz to drive a TEC properly to avoid damage. Arduino PWM pins may function > 500hz using TCCR0B? which in turn affects delay(); and Millis on which critical functions depend.

To achieve acceptable voltage ripple through an RC filter PWM should be ~3+kHz.

If frequency can be further adjusted through a KA3525A then that might avoid playing with the Arduino PWM outputs. Not sure how effective this might be.

E.g. PWM pin 10 ~500hz - increase to ~ 3-5khz with KA325A frequency adjust and 2khz through RC filter. Just guessing values and not sure if the freq adjust is viable.

I want to keep complexities to a minimum, so getting the PWM value adjustment off the board should help.

The PWM frequency is set by the three timers, if you use timer two then you won't affect those other timer dependant functions. I think this timer controls pins 11 and 3.

e.g. set pin11 to 31250hz and get 5mhz at the TEC. Ripple 3.99E-6. Recovery 0-90% without ripple 0.23 secs. RC filter values 1k and 0.33uF.

Voltage ripple should I guess be as low as practical, but I'm not sure about the importance of recovery time.

Yes you can do that.

but I'm not sure about the importance of recovery time

I am not sure what it is, I have never come across the term.

http://sim.okawa-denshi.jp/en/PWMtool.php

Should have posted link earlier. Spent some time playing with this.

Recovery time looks like the time for voltage to ramp up to 50% duty cycle. I guess at power up.

If you are concerned about the ripple then simply implement a higher order of filter than this simple first order filter.
Have you seen my page on PWM?
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

Thks GM. I did read previously, which got me started. Understand the concepts a little more now. I am trying to avoid the complexity of an opamp or dedicated controller, but my reading tells me that I need to minimize ripple as much as practical to avoid thermal damage, breakdown of the TEC pn junctions. I think a better filter will also help stabilize temperature sensing. I note that an RC filter is needed for the sensor application too - average out the bumps.

to avoid thermal damage, breakdown of the TEC pn junctions

Not sure I understand how ripple can do that to a circuit.
You don't need an op amp for a higher order filter, you can make a second order filter with an LC circuit, that is twice as good as an RC circut.

Not sure I understand how ripple can do that to a circuit.

Perhaps I'm confusing the concepts. Running a TEC at < 2khz is apparently not good for it, or so I am led to believe. And if the PWM to the FET gate is not smoothed, effectively the TEC is being cycled on/off (0 - 12v) at the PWM frequency - does that matter at higher frequencies?

You don't need an op amp for a higher order filter, you can make a second order filter with an LC circuit, that is twice as good as an RC circut.

I have been working on two separate approaches to this.

  1. Set PWM pin 11 to ~32khz, input to a KA3525A - set the output with frequency adjust and use an LC filter to smooth out the PWM ripple. The advantages are soft start and I presume more accurate frequency control.

Given that I have been running the TEC at the native pwm pin 490hz with reasonable results and no filters, is this level of complexity absolutely necessary.

  1. Alternatively, set pin 11 to ~3khz and smooth PWM with an LC filter and just run the TEC at whatever the result is. Which is easier, and I'm beginning to think, as much as the application requires.

Both approaches seem valid to me, if there is any truth to the 2khz theory. Otherwise I may as well just smooth out the 490hz :~

I am still not clear what you are controlling with this TEC and how you are wiring it up. Increasing the PWM frequency will let your filters smooth more but operating something on / off is more efficient and will cause less power dissipation than operating in the linear mode.

I presume more accurate frequency control.

At the end of the day you only have 8 bits accuracy on the PWM output anyway so smoothing it beyond that makes little difference.

This is it.

Fritzing file of the present TEC cooling set up - PWM pin 11 to FET gate with series current limiting resistor. TEC -ve to FET drain, FET source to GND (arduino and TEC), 12v to TEC +ve.

Project images- cold finger cooling of the dslr cmos and the working (roughly) model.

Can't post images? Here

or here for the complete set...

If you smooth the PWM signal going into the FET then you put the FET into the linear mode. This will drastically increase the power dissipation in the FET.

This is because with PWM the FET is either off, no current and high voltage across it, or on, large current but small voltage across it due to the small on resistance. Both those states equate to very little power.
If you smooth it then you have the situation where you have a large current flowing with a volt or two across it which works out to give a large power dissipation.

Given the wiring diagram I would add some large bulk capacitors across the supply of the TEC to minimise supply ripple.

Some people say PWM across a Peltier device is not good while others say it is fine, I am inclined to think it is OK. I have only ever used them in the full on / full off mode so I have no direct experience with this. Due to the thermal time constants the PWM frequency can be very low, in the order of seconds per cycle so I see no reason to increase the frequency. If you do go for a linear control then the small ripple on the Peltier device is not going to make any difference to the control you have.

Thanks GM. I will stick with your suggestions.

This is where I first started and think this is correct.

  1. Can I use pulse-width modulation to control my Peltier device if I keep the voltage at V M ax or below?
    Yes, and this is one of the most electrically-efficient ways to control voltage to your device—although you must observe some precautions. As long as you keep the voltage at V Max or below, you will effectively pump heat whenever the duty cycle applies voltage to your system; when the power is turned off, the heat pumping will stop. By pulse-width modulating a suitable voltage, you can easily control the extent of heat pumping by simply varying the duty cycle of the pulses. The great thing about this approach, is that it allows you to minimize power dissipation in your control circuit—especially if you use power MOSFET's for switching (a subject which goes beyond this particular question).
    Significant precautions must be employed with PWM, however. First of all, the PWM should be at a high enough frequency to minimize thermal stresses to the TE devices. While we like to keep the frequency in the low killihertz (Hz) range, in many applications these days we must compromise at around 120 Hz for the sake of electromagnetic compatibility. Another important issue is the potential for generating electro-magnetic interference (EMI) in the wiring to the TE device. If you are using PWM, you may need to shield your power wiring or keep it away from any sensitive electrical signals. A stitch in time to confront these issue early, can save a lot of corrective work deeper in the design cycle

All good stuff.

the PWM should be at a high enough frequency to minimize thermal stresses to the TE devices.

This is not thermal stress but rather mechanical stress caused by the rapid thermal expansion / contraction. It is mitigated by the low thermal time constant of the system.

in many applications these days we must compromise at around 120 Hz for the sake of electromagnetic compatibility.

Fortunately you are not trying to meet any EM standards like a commercial system would have to.
I understand (from other threads) you have your own issues with EM emissions interfering with your imaging system but that is totally different from trying to meet an emissions standard, it might be easier or worst though. Rapid switching of that much current is going to cause a lot of RFI (radio frequency interference).

Thanks again GM, appreciate your help, as always. That is all making sense now. I may need to start new threads about the EMI issues, although dc42 has kindly provided circuit diagrams. Still I have a few questions about some aspects.