0
\$\begingroup\$

I have built the following sawtooth generator using LM358 opamps:

enter image description here

In simulation everything works fine, however in reality I get only flat line on output. Anyone got any idea what's going on?

\$\endgroup\$
  • 1
    \$\begingroup\$ well, without seeing your real-world implementation of the device, we can't really guess what's going on. Start by checking your power supplies, as usual. \$\endgroup\$ – Marcus Müller May 13 at 12:08
  • \$\begingroup\$ also, use a larger voltage divider than your two 100Ω resistors – that thing just converts a lot of power (0.7W!) to heat. Chances are your resistors are getting really hot. \$\endgroup\$ – Marcus Müller May 13 at 12:09
  • \$\begingroup\$ Check your scope settings. Too fast a timebase will flatten most signals. Does your probe setting on the scope match the probe switch (x10)? and is your volts/div setting suitable? \$\endgroup\$ – Martin May 13 at 12:16
  • 1
    \$\begingroup\$ What is the flatline output voltage? 0v? VDD? VDD/2? +1v? +9v? \$\endgroup\$ – analogsystemsrf May 13 at 12:16
  • \$\begingroup\$ @analogsystemsrf Voltage on output is VDD. Power supplies are OK, and regarding votlage divider - same thing occurs when I do cirtual ground on 10k-10k resistors. Regarding scope - I tried different timebases, but sawtooth just isn't there \$\endgroup\$ – Em Ka May 13 at 12:25
1
\$\begingroup\$
  1. It is called a relaxation "astable" or oscillator with square & triangle outputs. Not a Sawtooth

  2. It is inherently "bistable" ( i.e. latched) if the loop gain <1 and Reference Voltage is not exactly mid-swing. Or in other words the 50% reduced Triangle wave is not enough to cross the 50% Vcc-Vee reference voltage

  3. To relax this tolerance but also reduce output swing, increase the loop ratio on left Op Amp by 1% or more to allow for error in 2.

Below is an example with 0 to 10V swing but positive feedback < 1 by 1% tolerance of feed resistor.

enter image description here

  • If R1/R2 < 1 It will not oscillate.

  • If R1/R2 > 1 it will oscillate with average voltage set by V+/2 ratio but Vpp swing will be reduced due to R Ratio gain increase.

  • If R1=R2 then it will be inherently unstable as an oscillator (astable) so it will be bistable or in one logic state or the other due to tolerance errors.
    Note even with xx digits of accuracy of simulator there are occasional flatspots.

This is a design flaw overall.

Same/similar circuit shown a different way. Sim Shows sliders for R and Vref to prove margin of instability changes with error tolerance.

There are better triangle generators ( but not shown here)

enter image description here

The Vref to both Op Amps must be the set to the average swing of the triangle output of the Op Amp.

My Design Equations

  1. Vref= Vo avg. ( Vout average max,min)
  2. Triangle Amplitude = R2/R1 (Vout+,Vout-) for R2/R1> 1
    ( positive feedback loop gain for stable oscillation)
  3. Frequency = R2/R1 * 1/2RC
\$\endgroup\$
  • \$\begingroup\$ Could you please explain what do you mean by "inherently bistable if loop gain <1" and " increase the loop ratio on left Op Amp by 1% or more"? \$\endgroup\$ – Em Ka May 13 at 12:34
  • \$\begingroup\$ you can remove your -1 now. It you do not understand then say so and which part. I assume you understand what Astable and bistable means \$\endgroup\$ – Sunnyskyguy EE75 May 13 at 12:43
  • \$\begingroup\$ I think I get it. I'll see if it works:) thanks! \$\endgroup\$ – Em Ka May 13 at 12:58
  • \$\begingroup\$ I know it will work! because I understand the fault in this design, due to loop gain error vs Vref error is critical. However I am too lazy to show you all the math to prove why it fails but explained how to make it work and the effect on reducing amplitude, \$\endgroup\$ – Sunnyskyguy EE75 May 13 at 13:22
  • \$\begingroup\$ WHo are the lame voters (-2)? \$\endgroup\$ – Sunnyskyguy EE75 May 13 at 13:23
4
\$\begingroup\$

Let's assume there's no trivial error, but something which needs a little math to be spotted. I guess the hysteesis is too wide. Put a 15kOhm resistor in the place of the current 10k between the output and the +input of the leftmost opamp. The output swing is currently too narrow to cause the Schmitt trigger to flip to both directions.

\$\endgroup\$
  • \$\begingroup\$ that's 49% more than what I suggested. \$\endgroup\$ – Sunnyskyguy EE75 May 13 at 12:34
  • \$\begingroup\$ +1 as user suggest, the LM358 isn't rail-rail output so it will never function with that level of hysteresis \$\endgroup\$ – sstobbe May 13 at 14:44
0
\$\begingroup\$

As above, the LM358 is not a rail-to-rail device at either its inputs or output, and your circuit requires that it is. Separate from that, your sim program thinks that it is, which is why the simulation works. The clue is the 10 Vpp output waveform with a 10 V Vcc.

Assigning ideal performance characteristics to decidedly non-ideal devices is a common problem with many sim programs. I love the LM358, but it has some relatively severe performance limitations.

Here is the classic function generator circuit from national Semiconductor's app note AN-31:

enter image description here

\$\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.