PWM to voltage conversion - OpAmp offset.

Discussion in 'The Projects Forum' started by vojtik, Mar 7, 2012.

  1. vojtik

    Thread Starter New Member

    Mar 7, 2012
    Hi all.
    I'm strugling with PWM to voltage converter. PWM duty 0-100%, ampl. 5V, freq.300Hz-3kHz. PWM signal is produced as High Side Driver (pull down resistor at converter's side). Current capability up to 2mA .

    Please help me to debug the following circuit which is supposed to convert PWM to voltage (there can be also 0-5V voltage at the input to the circuit- in this case the circuit must serve as voltage follower ).


    The circuit should be working well (tested by a friend of mine) with Opamp LMC662CN used with unipolar supply ( Anyway, I'm not able to make a test as I dont have this OpAmp.

    I was forced to used OpAmp TLC271, supplied with unipolar 12V. This is not a rail2rail kind but should it mind when high Vdd used?!
    In simulation works quite fine.
    Reality differs. The voltage following is ok.
    PWM to voltage conversion is NOK. the difference is huge (50%PWM is not 2.5V but about 2.63V, 10% PWM is about 0.7V and not the expected half volt). Vcc always 5V+/- 0.002V.
    I'm already desperate and dont understand why there is the offset. ANy thoughts why LMC662 works and TLC271 doesn't? Any important parameter I overlooked? Please could any of you propose an alternative OpAmp which would work and explain why.
    Thanks a lot.
  2. #12


    Nov 30, 2010
    Here's a datasheet.

    As for the answer...I don't know yet.
  3. praondevou

    AAC Fanatic!

    Jul 9, 2011
    That means at 0% PWM the output is 0V (almost), at 100% it's 5V output and in between the output voltage is wrong?

    Are the bias pin and offset pins connected to anything?
  4. jimkeith

    Well-Known Member

    Oct 26, 2011
    The circuit is a basic low-pass filter that looks like it should work OK--recheck your wiring again--the op amp looks good for the application--common mode input range goes to zero so it is good for single positive supply operation--common mode input range extends to Vcc-1.5V, so a +12V supply is good--output stage is supposed to be rail to rail, so that also looks good.

    My suggestion: connect a pot so that you can easily apply a zero to 5V DC signal to the input to the circuit--output should follow the input voltage exactly. If that still does not work, connect as a simple voltage follower only and see if it works. Also, if you have a scope, see if it may be oscillating as that will drive it crazy.

    On the bias pin, wire it to +12V rail for low bias operation--this will slow it down so it is less likely to oscillate because you do not need or want high speed operation in your low-pass filter--check spec sheet for bias selection info.
  5. vojtik

    Thread Starter New Member

    Mar 7, 2012
    Guys, I checked once again the circuit. It's correct.
    As previously mentioned the circuit with DC input works as perfect voltage follower. The bias pin is connected to VCC from the beginning.
    Also tried to play with the C1,C2 and resistor values according to different designs in Microchip FilterLab.
    Used a different piece of TLC271...and no success. No more ideas why this doesn't work.

    What just crossed my mind - N1 and N2 are not connected to anything. Could this be the reason under the circumstances??