Need a Circuit to use PWM to generate variable Voltage output

Thread Starter

El3ctroded

Joined Feb 4, 2008
63
The title says it all. I am using a microcontroller which will output a PWM signal. This PWM needs to control voltage level to a motor. Normally I'd use the PWM to drive a FET which would directly drive the motor. However in this case the motor has a speed sensor which doesn't work properly with a PWM, so I need a constant, but variable, voltage output to preserve the speed sensor's operation.

So I thought: Why not filter the PWM output to a constant voltage level, since a 50% duty cycle PWM at 12V is equivalent in power to a constant 6volts, and a 75% duty cycle is equivalent to a constant 9Volts. But how to make the constant voltage from PWM?

I thought that it might work with a diode, cap to gnd after the diode, and linear drive transistor to the motor, but it didn't work so well. Maybe I had something wrong...

Anyone got any ideas?

Note: I have to use a PWM as I only have one pin available so can't use a DAC.

Thanks!!!
 

Caveman

Joined Apr 15, 2008
471
Try this. Note that the PWM is inverted due to the P channel FET. If you want better attenuation of the switching frequency, replace the resistor with an inductor for a two pole filter. You will need a logic level FET to properly turn on all the way. Or you could use a pnp transistor, but you will drop a bit of voltage and energy there.
 

Attachments

bertus

Joined Apr 5, 2008
22,278
Hello,

You can use an integrator after the PWM circuit.
On the output of the integrator you will get the mean value of the PWM signal.
See attachement:

Greetings,
Bertus
 

Attachments

Thread Starter

El3ctroded

Joined Feb 4, 2008
63
Thanks guys.

I'll give them both a try when I get a chance. The integrator looks sweet, but I don't want to deal with a dual supply on this project, and I don't think I have any single supply op-amps.

El3ctroded
 

Thread Starter

El3ctroded

Joined Feb 4, 2008
63
I wouldn't use the output directly to power the motor. I would use it to drive a linear power transistor which would drive the motor.
 

Ron H

Joined Apr 14, 2005
7,063
In principle , you can do it like this. Whether it is practical or not depends on how much current the motor draws, how much lag you can tolerate in the response time (the filter has delay), how much motor voltage ripple you can tolerate, what supply voltage you have available, etc. You can make a better filter, such as a Sallen-Key Butterworth, if you are willing to use a few more parts.
The details of the circuit design (if it turns out to be practical) would depend on these factors, and probably more.
 

Attachments

thingmaker3

Joined May 16, 2005
5,083
However in this case the motor has a speed sensor which doesn't work properly with a PWM, so I need a constant, but variable, voltage output to preserve the speed sensor's operation.
I am very curios. The only non-encoder speed sensor I am aware of is a back-EMF sensor. It actually relies on the null between pulses. May I know more about the speed sensor being used here?
 

Thread Starter

El3ctroded

Joined Feb 4, 2008
63
Thingmaker: It's a "brushless" DC fan motor with RPM sensor output from some integrated electronics in the motor which causes the RPM pulse to miss, and other things, when using PWM.

Ron, that looks great.

I haven't had a chance to try any. Will post back when I do.

Thanks everyone!
 

mik3

Joined Feb 4, 2008
4,843
The title says it all. I am using a microcontroller which will output a PWM signal. This PWM needs to control voltage level to a motor. Normally I'd use the PWM to drive a FET which would directly drive the motor. However in this case the motor has a speed sensor which doesn't work properly with a PWM, so I need a constant, but variable, voltage output to preserve the speed sensor's operation.

So I thought: Why not filter the PWM output to a constant voltage level, since a 50% duty cycle PWM at 12V is equivalent in power to a constant 6volts, and a 75% duty cycle is equivalent to a constant 9Volts. But how to make the constant voltage from PWM?

I thought that it might work with a diode, cap to gnd after the diode, and linear drive transistor to the motor, but it didn't work so well. Maybe I had something wrong...

Anyone got any ideas?

Note: I have to use a PWM as I only have one pin available so can't use a DAC.

Thanks!!!
Search in google for DC-DC converters, you will find lots of circuits. To be more specific search for a buck DC-DC converter
 

Thread Starter

El3ctroded

Joined Feb 4, 2008
63
mik3: I'm not sure that's the right path here. For this project, it needs to be simple and cheap and supply up to 1 amp. A DC-DC converter just doesn't seem like it would fit the bill.

The top results from a google search are all about chip based converters... I know that PWM is used with DC-DC chip-based circuits, where you don't provide the PWM, the chip does. So... :?

Thanks,
El3ctroded
 
Top