Need a Circuit to use PWM to generate variable Voltage output

Discussion in 'The Projects Forum' started by El3ctroded, Apr 18, 2008.

  1. El3ctroded

    Thread Starter Active Member

    Feb 4, 2008
    63
    0
    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!!!
     
  2. Caveman

    Active Member

    Apr 15, 2008
    471
    0
    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.
     
  3. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,345
    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
     
  4. El3ctroded

    Thread Starter Active Member

    Feb 4, 2008
    63
    0
    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
     
  5. Caveman

    Active Member

    Apr 15, 2008
    471
    0
    The opamp probably wouldn't be able to drive the motor anyway.
     
  6. El3ctroded

    Thread Starter Active Member

    Feb 4, 2008
    63
    0
    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.
     
  7. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    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.
     
  8. thingmaker3

    Retired Moderator

    May 16, 2005
    5,072
    6
    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?
     
  9. El3ctroded

    Thread Starter Active Member

    Feb 4, 2008
    63
    0
    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!
     
  10. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Search in google for DC-DC converters, you will find lots of circuits. To be more specific search for a buck DC-DC converter
     
  11. El3ctroded

    Thread Starter Active Member

    Feb 4, 2008
    63
    0
    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
     
Loading...