Maker Pro
Maker Pro

Converting PWM output into a voltage using low pass filter.

dinhquochuy

Jul 3, 2013
5
Joined
Jul 3, 2013
Messages
5
Hi guys, it's me with my noob-ish questions agains, :D

I am building a microcontroller controlled regulator circuit, the idea is to use the feed back from the voltage (Through the microcontroller's ADC) to increase or dedrease the output voltage by adjusting the PWM duty cycle. A MOSFET is used as an electrical gate for the battery (such as one in a H-bridge circuit). My battery is 12.6 V and I want a 10V on the output.

I have tested the circuit and so far it has been working well, the MOSFET opens and closes with a small delay time. The only problem remains averaging the output so that it is smooth and is proportional to the duty cycle.

I've read that a low-pass filter with a cut-off frequency much lower than PWM's frequency can do this, but my load on the output is a motor which may draw up to 9A when starting, so I do not think a regular resistor may withstand that. :D What should I do?

Thank you in advance
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
The nomal way is to use an inductor. These can be seen in computer power supplies, they are wound on ferrite torroids. the wire should be thick enough to take the maximum average current, the starting current should not be a problem unless the motor is reluctant to start.

A diode from ground to inductor may be needed, then a capacitor after the inductor to ground.

Note that a motor has inductance and even though the input voltage varies greatly, the current may not vary much.
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
Motors are typically driven by a PWM without filtering it to produce a constant voltage. Is there a special reason this will not work for you?

Bob
 

dinhquochuy

Jul 3, 2013
5
Joined
Jul 3, 2013
Messages
5
Yeah, the controlling of motor speed is handled by a separate circuit with a PWM-driven H-bridge
because this circuit is a regulator so it is supposed to supply the motor with a steady current of 10V :D I think 2 layers of PWM would not work well except when the supply PWM has a much higher frequency right? But as I read from the osciloscope the MOSFET would not respond well to a frequency above 1KHz.
(Forgive me if any of my assumption is wrong, I'm a newbie)
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
But as I read from the osciloscope the MOSFET would not respond well to a frequency above 1KHz.
Then your driving circuit is not suited to the task. A typical MOSFET switches at much higher frequncies than 1kHz. (e.g. in a switch mode power supply the frequency is typically 50kHz and more).
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
You need to run the switching converter at a fairly high frequency (50 kHz or more is typical) otherwise the inductor will be too big.

A normal microcontroller won't be able to generate a finely controlled pulse width at these high frequencies. Also, a microcontroller won't be able to detect and respond to changes in the feedback voltage quickly and accurately enough to give good regulation.

I would use a dedicated switching supply controller IC. Linear Technology and National Semiconductor (now Texas Instruments) make a range of ICs for this function; many of them include the MOSFET - all you need is an inductor, a catch diode, and the output capacitor.

You said you want 10V output. That's no problem. If you need to vary the output voltage using the microcontroller, you can modify the feedback network so that a DAC or smoothed PWM output from the micro can vary the regulated output over a moderate range.
 

dinhquochuy

Jul 3, 2013
5
Joined
Jul 3, 2013
Messages
5
Thank you guys for the suggestions, I will try using the switching regulator IC :D Thanks a bunch ^^
 
Top