1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Convert 0-3.3v PWM signal to +/-12v Please Help

Discussion in 'General Electronics Chat' started by milolouis, Sep 21, 2017.

  1. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,247
    Likes:
    961
    Location:
    Loveland, CO USA
    ONLINE
    What frequency? How much? "this one"??
     
    • Like Like x 1
  2. milolouis

    milolouis New Member

    Joined:
    Sep 21, 2017
    Messages:
    12
    Likes:
    0
    To be honest I'm sure it's something I did but with a 40KHz square wave on V1 at 50-99% duty cycle It will randomly drop from 12v to -12v and then back up every millisecond or so.
    Could you explain how it's supposed to work?
     
  3. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,247
    Likes:
    961
    Location:
    Loveland, CO USA
    ONLINE
    U2 is a low pass filter. The frequency sweep says that at 100hz it will pass the signal and give it gain. At 40khz it will only pass -60db of the signal. So it should remove the PWM signal but pass the "average" of the signal.

    U1 is an example of a simple RC filter. (with a buffer) How is it doing?
    You need to set V4 to 3.3 volts. (supply for your PWM source) "Set to 3.3 for DC. Set to 0 for AC study "
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,247
    Likes:
    961
    Location:
    Loveland, CO USA
    ONLINE

    You are right! It is oscillating. I have never pushed the gain beyond 2 or maybe 4. OK let me see why.
     
  6. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,247
    Likes:
    961
    Location:
    Loveland, CO USA
    ONLINE
    I changed C2 to 0.0047u and it is stable.
     
  7. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,247
    Likes:
    961
    Location:
    Loveland, CO USA
    ONLINE
    Stepping from 0 to 50%. Takes 6mS to get there. Seems stable.
    upload_2017-9-21_20-3-0.png
     
    • Like Like x 1
  8. milolouis

    milolouis New Member

    Joined:
    Sep 21, 2017
    Messages:
    12
    Likes:
    0
    Thanks Ron this, is fantastic thanks for the explanation as well. I get about 10mV noise with just one op-amp. Cut-off is a bit low however so just fiddling around with it a bit. Hoping to get 1000Hz pass through rail to rail. Or at least more than 500hz.
     
  9. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,242
    Likes:
    1,218
    Location:
    Cardiff, Wales
    Here' a 3V to +-12V switcher which should give a pretty clean output at 50kHz :
    3Vto+-12Vswitcher.PNG
     
    • Like Like x 1
  10. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,247
    Likes:
    961
    Location:
    Loveland, CO USA
    ONLINE
    Alec_t,
    What does the collector current look like? Q3, Q4
     
  11. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,242
    Likes:
    1,218
    Location:
    Cardiff, Wales
    Not very nice. There's considerable shoot-through :(.
    CollectorCurrent.PNG
     
  12. milolouis

    milolouis New Member

    Joined:
    Sep 21, 2017
    Messages:
    12
    Likes:
    0
    Still alec_t that's exactly what I was looking for originally. Spot-on Thanks so much.

    The target goals are:
    - 40-50KHz 0-3.3v PWM input
    -Smooth Analog Voltage output very low noise with effectively zero-drop off at 1KHz (PWM duty modulation)
    -Lowest part-count/cost
    -Must be able to reach less than 0.1v

    As there will be 8 of these on one board.

    So I think now with all the advice that probably the best way is two op-amps with RC filter before the voltage translator and then second op-amp as Sallen Key Filter.
    So 3-poles and translation with two-opamps.

    If you or anyone disagrees or thinks there is a better way better way then I'd love to hear it. I'll post a picture of the schematic when it's finalised
     
  13. ronsimpson

    ronsimpson Well-Known Member Most Helpful Member

    Joined:
    Apr 17, 2007
    Messages:
    7,247
    Likes:
    961
    Location:
    Loveland, CO USA
    ONLINE
    Alec_t,
    The shoot-through comes from two places.
    The first two transistors were really slow at turn off. So I made them "grounded base" and keep them out of saturation.
    The last two transistors need a "turn off" resistor.
    I have not gone back and checked each resistor. This is just a first try. Shoot through 10 to 15 mA.
    upload_2017-9-26_20-22-13.png
     

    Attached Files:

    • Like Like x 1
  14. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,242
    Likes:
    1,218
    Location:
    Cardiff, Wales
    That's a big improvement, Ron.
     

Share This Page