LFO getting stuck, is there a stability criteria?

Started by thomasha, October 18, 2022, 02:08:41 PM

Previous topic - Next topic

thomasha

Hi,

working on a delay kind of effect with modulation I am currently experiencing problems with the LFO, where it won't oscillate.
If I touch one of the pins of the IC it oscillates for a short amount of time and stops.

The LFO generates a triangular wave with the combo Schmitt trigger + integrator. I am currently using the TL062 IC, which works really good for other designs.
Some characteristics that might be causing this kind of lack of oscillation is the low frequency I am trying to achieve added to the fact that instead of half the supply, here a 9V wall wart, I am using 5V from directly from a voltage regulator. 

My goal here is to achieve really low oscillations, as one would use in a jet flanger.
The schematic looks like this:


Is there a stability (or oscillation) criteria, which could be used as a rough estimation for this kind of LFO, so that it will always oscillate?
Are there any design changes that could improve the performance of the LFO for frequencies below 1 Hz?
The range is not as important of the speed control is not as important in this case.

Another interesting aspect is if Spice software can predict this kind of behaviour?
In my opinion, in real life there are many perturbations, that would lead the circuit to oscillate, which are not present in the simulation. Funny enough, it oscillates in the simulation...

Another aspect is, that the simulation predicts a symmetric triangular wave, while in real life the oscilloscope shows a very weak and deformed wave at low frequencies (0.4Hz). Is it the load introduced by the oscilloscope, or am I missing something here?

It works if instead of the voltage regulator I use a 10k voltage divider and a capacitor. It also works if I add a 10k resistor between the voltage regulator and the LFO, but the voltage drops. 

ElectricDruid

#1
The basic principles for oscillation are that the feedback needs to be positive (e.g. in phase with the signal) and the gain needs to be large enough to overcome any losses. If those criteria are met, the circuit will oscillate - whatever it is. This applies to drive pedals and delays as well as LFOs, notably!

In terms of why your circuit doesn't work, I'd wonder first whether the op-amp you're using operates well at 5V? TL062 probably won't, since the datasheet I checked suggest +/-5V as the minimum. Whether the sim bothers with these details, I dunno - depends on the model.

You're also right to worry whether Spice is the right tool to determine this kind of thing. It *can* be, but there are plenty of gotchas lurking with oscillator circuits, so you need to understand what you think you're doing and what the sim thinks it's doing and whether those two things are the same or different!

Fundamentally though - it's a typical LFO circuit and you should be able to get it working in the sim, but you need an op-amp that works at 5V if that's what you're running it off. That rules out many of the common candidates.


thomasha

QuoteIn terms of why your circuit doesn't work, I'd wonder first whether the op-amp you're using operates well at 5V? TL062 probably won't, since the datasheet I checked suggest +/-5V as the minimum.

I think it was not clear, but I am operating it at 9V. The 5V supply is just a way of saving some components to bias pins 3 and 6. Normally I would use a voltage divider consisting of two resistor plus a large capacitor. Here, I thought I could use the same 5V used for the digital IC. The duty cycle will be a little off, but it still should oscillate.

I also gave this one a try:
https://tinyurl.com/2z3vg5t8
It works better with logic simulations than normal Spice programs.

Rob Strand

#3
On your original ckt, try changing the 100k to 82k.

When Vref is offset from the middle of the swing of the Schmitt-trigger, one of the Schmitt
thresholds can get pushed closer to one of the supply rails.

If it gets pushed too close the integrator doesn't have enough swing to hit the Schmitt threshold
and the oscillator stops.

For example,
Vcc =9V, Vref = 5.2V.
Opamp swing  2V from each rail, ie. 2V to 7V.  ; that applies to both the Schmitt and the Integrator.
R1 = 100k and R2=150k
Schmitt trigger thresholds are 7.33V and 4.0V

Since the integrator swing is limited to 7V it cannot reach the 7.33V threshold.

If we change R1=82k then the Schmitt thresholds are 4.2V and 6.95V,  just scraping through.

Alternatively if Vref was in the middle of the opamp swing, (2+7)/2 = 4.5V then
with R1 = 100k and R2 = 150k the Schmitt thresholds are 5.87V and 3.13V.
In this case the integrator swing of 2V to 7V will easily hit the thresholds.

When the integrator's Vref is not in the middle of the Schmitt output swing the duty cycle waveform is non-square.

If you want the integrator to swing about a different voltage than mid-rail you can use two Vrefs,
one for the Schmitt and one for the Integrator.  This lets you keep the waveform square.

You can see the general idea in the Small Clone, two Vrefs come from the 180k+68k+82k divider.  The integrator
swings about 4.09V and the Schmitt thresholds are centered on 2.2V.
https://sites.google.com/a/davidmorrin.com/www/home/trouble/troubleeffects/electro-harmonix-small-clone

QuoteAnother interesting aspect is if Spice software can predict this kind of behaviour?

Forgot to mention, yes spice can do all this stuff.  However, a lot of spice models do not have the correct output swing.   So if you to simulate circuit like this you need to match the model swing with the swing of the actual part. (The swing tabulated in the datasheet often is no help.  The internal circuits are some help.)  I've got quite a number of LM741 and LM324 opamp models and only a couple of the models have output swings like the real parts.


Something else, and more likely the problem.  The LED is hanging off the output of the integrator.   The LED pulls a fair bit of current and that will cause the integrator swing to be further away from the +V rail than if there were no LED load.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Vivek

#4
Spice has levels of detail while simulating Opamps

Try changing to maximum detail.

Right click the Opamp and change detail level.


I also found while simulating these types of LFO and in real life, the LED can act as a clamp to maximum voltage swing. (like a zener across the Opamp output)

Increasing the CLR helps the Opamp output to rise to necessary level.



In real life, the leakage of caps and the bias currents of Opamps become important if the time constants are very large

thomasha

Thanks Rob and Vivek for the suggestions
QuoteIf we change R1=82k then the Schmitt thresholds are 4.2V and 6.95V,  just scraping through.
I will give the real circuit a try. At the time being I'm playing with the falstad simulator to understand which changes affect the frequency significantly.

I got it to stop swinging when the speed potentiometer is lower than 50% (10k and 90k resistors in the simulation)
https://tinyurl.com/22nejabn
By changing the reference of the 4.7k resistor at the base of the speed potentiometer from ground to +5v it started to swing again.

QuoteIn real life, the leakage of caps and the bias currents of Opamps become important if the time constants are very large
Yes, I saw that by adding a cap at one of the inputs kind of helps starting the oscillation.

antonis

Quote from: thomasha on October 19, 2022, 01:51:24 PM
QuoteIn real life, the leakage of caps and the bias currents of Opamps become important if the time constants are very large
Yes, I saw that by adding a cap at one of the inputs kind of helps starting the oscillation.

You may consider that cap placement as a "reverse hysteresis" configuration.. :icon_wink:
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

Rob Strand

#7
QuoteI got it to stop swinging when the speed potentiometer is lower than 50% (10k and 90k resistors in the simulation)
https://tinyurl.com/22nejabn
By changing the reference of the 4.7k resistor at the base of the speed potentiometer from ground to +5v it started to swing again.

It seems to be working for me with any pot setting and either 82k or 100k.

The way the simulation is set-up I would not expect any *circuit* problems.  If you see problems then it's probably a quirk of the simulator.  I only use falstad when people post problems on the forum.

If you right click/edit on the opamps you can set the swing.  Currently it is at 0V and 9V.   A 0V to 9V swing is not expected to cause problems.

The 100k to 82k is expected to change the frequency.

The fact the opamps in the simulator do not match real opamps means you will also see a difference between the simulated behaviour and the real circuit behaviour.    That's the key point about simulators, the opamps need to behave the same as the real parts otherwise the simulation cannot be expected to work like the real thing.

The motivation to change 100k to 82k was to make the real circuit work, assuming the problem was the real opamps were not swinging enough.

When you get to building a real circuit you it would help see what the voltages are at the output of the Schmitt trigger.  If you entered those voltages into the falsted opamp parameters then the simulation should behave more like the real circuit.

The issue Vivek mentioned where LEDs on the opamp output cause clamping is a whole different issue.   It can be an issue with the real parts or the models.   The issue here is the opamps have a current limit and if you  draw more current than that limit the output voltage will clamp.   Tweaking the current in the simulator might get the simulation to work but the real issue is will real opamp clamp?.   In order for the simulation to represent reality the current limit in the simulator must match the current limit of the real part.   As far as the falstad simulator goes there are no current limits on the opamps.

On real opamps the output swing of the opamp isn't fixed.  It can vary a bit.  More loads means less swing.   The falstad opamps don't have this behaviour so they can't represent real opamps at this level.

There's many factors to consider matching simulation to reality.

Putting all that a side when the simulators have weird quirks it can put you on a path which doesn't exist in the real circuit.   There's potential issues in both domains.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

thomasha

QuoteThe fact the opamps in the simulator do not match real opamps means you will also see a difference between the simulated behaviour and the real circuit behaviour.    That's the key point about simulators, the opamps need to behave the same as the real parts otherwise the simulation cannot be expected to work like the real thing.

The motivation to change 100k to 82k was to make the real circuit work, assuming the problem was the real opamps were not swinging enough.
You were totally right! I tested the circuit and the real IC was swinging between 1.2V and 8V at the output of the first OpAmp.
Changing the 100k resistor fixed the problem. Many thanks!

QuoteThe issue Vivek mentioned where LEDs on the opamp output cause clamping is a whole different issue.
I thought it could have been an issue, since I have a modulation LED right after the second OpAmp. But there is also a resistor in series, which might help.

Rob Strand

QuoteYou were totally right! I tested the circuit and the real IC was swinging between 1.2V and 8V at the output of the first OpAmp.
Changing the 100k resistor fixed the problem. Many thanks!
Ah cool.

So with those opamp swings and Vref = 5.2V:
- 100K + 150k gives Schmitt thresholds of 7.9V and 3.3V
- 82k + 150k  gives Schmitt thresholds of 7.4V and 3.7V

The integrator has the LED load so the swing under load for the integrator might be a little less than 8V.   With the 100K that would mean the integrator might not make the 7.9V threshold and the oscillator stops.

QuoteI thought it could have been an issue, since I have a modulation LED right after the second OpAmp. But there is also a resistor in series, which might help.
The 3k3 will limit the current to the LED but it still puts some extra load on the opamp.  The load is well within the opamp's capabilities but the side effect is it decreases the swing of the integrator just enough to affect the circuit.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.