0
\$\begingroup\$

I tried to simulate the following PWM generator: enter image description here

The output at the PWM node records a constant voltage, not a PWM signal. So I simulated the sawtooth generator separately

enter image description here

And the output of this generator too isn't what it is supposed to be:

enter image description here

So what might be the problem with this sawtooth generator?

\$\endgroup\$
  • \$\begingroup\$ Why didn't you copy the original design? \$\endgroup\$ – Brian Drummond Feb 3 at 16:53
  • \$\begingroup\$ @BrianDrummond My bad, I uploaded the wrong diagram, I just edited the post with the correct one. (by the way, the previous one, i.e. the one I just removed, didn't work either.) \$\endgroup\$ – Hilbert Feb 3 at 16:58
  • 3
    \$\begingroup\$ Mainly, the LM358 is not a very good opamp (and the 741 will barely work at all off 5V). Opamps of that era don't work too well near their supply rails , so 10V gives more headroom. (The originally posted cct had 10V (+/-5), but then biased the input to 2.5V not 0V). Now look for a newer "rail to rail" opamp and it should be fine at 5V. \$\endgroup\$ – Brian Drummond Feb 3 at 17:21
  • 1
    \$\begingroup\$ Also this is a triangle generator not a sawtooth, but both work for PWM. It is a Schmitt Inverter Astable Oscillator that can be done with a logic inverter for the easiest method. Then the Pot has equal resistors on either side to go from 1/3 to 2/3Vcc using the inverter input triangle. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 3 at 17:37
  • 1
    \$\begingroup\$ Here's a variation of your design using the 1st comparator (preferably a high speed one), tinyurl.com/s5bssse as a PFM instead of PWM , which are often used in Boost converters. You choose a constant Pulse width, which changes with Pot bias voltage beween the rails of the analog output of asymmetric triangle to get an asymmetric PWM that changes like a VCO, except it is a constant pulse width PWM that changes duty cycle of the smallest pulse to be constant and then rapidly changes frequency due to the larger pulse width at extreme <10% or > 90% range. @Andyaka might like this version. \$\endgroup\$ – Tony Stewart Sunnyskyguy EE75 Feb 3 at 18:18
1
\$\begingroup\$

Try increasing the supply voltage to maybe 10 volts. – Andy aka

@Andyaka It worked! I really can't see why it had to do with supply voltage, would you mind giving a glimpse of the reason we had to increase it? – Hilbert

I believe that the reason it worked at 10 volts is because the hysteresis levels around U1a coupled with the inability of the opamp to drive close to the limited positive rail were just fighting against running at 5 volts. It might work at 6 volts of course but, a rail to rail output opamp would be better.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.