Oscillation problem

Started by PBE6, December 12, 2014, 10:16:32 AM

Previous topic - Next topic

PBE6

I put together a perfboard prototype of an inverting opamp distortion circuit last night, and it works fine..except for that viciously annoying whistle it keeps emitting :(

Here's the schematic:



(All the "Vref"'s in the schematic are the same in real life, CircuitLab is just picky about duplicate names.)

It looked fine on the scope, but when I tried playing through it I got guitar plus a piercing whistle that changed pitch depending on the GAIN, SAT and SCOOP settings. The TONE and VOL controls didn't seem to affect the pitch.

Does anyone see anything obvious in the schematic itself that could be causing the whistle?

anotherjim

When on scope, did you have a jack cable in the output? Just wondering if it might be due to capacitive load on the last op-amp - because I don't see anything to make it unstable, unless it's a weak Vref (not on scheme). Try 100R after last amp if so.

PBE6

Thanks, I will try adding that resistor to the last opamp's output.

When I was checking it on the scope I didn't have anything connected to the circuit except the signal generator probe on the input and a probe on the output. It's entirely possible that I missed a tell-tale sign in the readout, but everything appeared to be behaving itself (i.e. no wiggles or sharp edges/spikes).

Vref is coming from the midpoint of two 5k6 resistors connected between the positive and negative terminals of a 9V battery. I did not attach a large capacitor to Vref, could that be an issue?

anotherjim

5k6 is "stiffer" than usual, so I doubt it's the problem. Some capacitance would help, but I don't think it's causing instability.

Output Op-amps can oscillate when a screened cable is plugged in the output due to the cables capacitive load. It won't show on scope without a cable in. 100R resistor usually cures it, at well as minimising output short circuit current.


PBE6

Do you think it's possible the Big Muff-style tone control is also presenting a capacitive load to the first opamp? Would a 100R resistor be an appropriate solution here if it is?

Side question - I chose the resistors for Vref so that the max current flow through them both was under 1mA, and assumed there would be enough current to run both opamps without significant sagging. In general, is it true that smaller resistors are better for Vref provided the current drain through them isn't so high that it wastes the battery?

anotherjim

Quote from: PBE6 on December 12, 2014, 03:50:02 PM
Do you think it's possible the Big Muff-style tone control is also presenting a capacitive load to the first opamp? Would a 100R resistor be an appropriate solution here if it is?

I've never seen it cause a problem interstage. Enough C direct to ground it could, but tone control is RC filters, there's enough R to buffer the C from ground

Side question - I chose the resistors for Vref so that the max current flow through them both was under 1mA, and assumed there would be enough current to run both opamps without significant sagging. In general, is it true that smaller resistors are better for Vref provided the current drain through them isn't so high that it wastes the battery?
10k Vref dividers are common with about 1 to 10uF bypass. It depends on the loading. The op-amps are insignificant, the tone network moderate. Your tone cap C6 could go to ground instead of Vref and thus take bass frequencies away from Vref

R.G.

Quote from: anotherjim on December 12, 2014, 02:41:02 PM
5k6 is "stiffer" than usual, so I doubt it's the problem. Some capacitance would help, but I don't think it's causing instability.

I think it might do that - as that's happened to me before when I accidentally left a bypass cap off.

@ OP: Hang 22uF or bigger cap from the Vref to ground. If the oscillation is still there, that wasn't it, but this certainly won't make it worse.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

PBE6

Oh.,

my..

gawd!!!

Thank you R.G.!! I put a 1000 uF across Vref and the whistle is gone! It was the easier fix to do between that and the 100R resistor, just because it didn't involve de-soldering anything, and it worked like a charm!

I was able to use the same trick to fix an old Super OCD build that had the same problem. Two pedals in one day, a new record!

Thanks to anotherjim as well, I really appreciate your attention to my problem and your suggested fix, I will give it a try on the next fresh build!

I love this place!! :D


Just out of curiosity, why did the cap fix the problem? I'm not sure I really understand what was happening in the first place to cause the whistle..

R.G.

Quote from: PBE6 on December 12, 2014, 08:06:12 PM
Just out of curiosity, why did the cap fix the problem? I'm not sure I really understand what was happening in the first place to cause the whistle..
Well, it was only a guess, based on having hurt myself in a similar way in the past.

The reference voltage is a direct input to every opamp in the circuit. Any noise that ever gets on it pollutes the signal path, and if there is anything that put signal back into the reference voltage, the stage is set for oscillation. Given the high gains of many circuits, it doesn't take much signal fed back into the reference to make it squeal. The cap shunts most of the AC to ground, usually so much that what remains is not enough to make the oscillation self-supporting.

It  could also have been a number of other things. I half expected you to post that this had half-worked, and that the oscillation was now less, and different sounding.  :icon_biggrin:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

PBE6

Aha! Perhaps that's why the GAIN, SAT and SCOOP controls affected the pitch, those controls affect what is getting shunted to Vref through the tone stack. The VOL control only feeds true ground, so no effect on the pitch.

Neat! And very handy to know.

PBE6

Ok..so I'm at a gig, and my guitar player tried the other "fixed" pedal (modified OCD). Here's the schematic I was working from:



(Added a blocking resistor between the clipping FET's and ground)

It was fine when it was the only gain source, but when he switched channels or added the Green Ringer after it, you could still hear a faint whine. Even when it was off. Almost fixed, but not quite.

I'll try redoing the circuit with a 100R resistor after any opamps, send any signals to ground instead of Vref, use bigger Vref resistors and double up on the Vref cap values. We'll see what happens tomorrow!

Any other suggestions on what it might be while I'm doing a re-design?

crb3

Quote from: R.G. on December 12, 2014, 08:14:14 PM
The reference voltage is a direct input to every opamp in the circuit. Any noise that ever gets on it pollutes the signal path, and if there is anything that put signal back into the reference voltage, the stage is set for oscillation.

The power draw of a typical op-amp varies with the signal put through it. There are bipolar-supply audio amplifier designs which drive discrete transistors with the supply-rail draw through resistors, thus making use of this loading.

With no decoupling, the op-amps' outputs tugging on the supply rail gets coupled through the divider; presto, instant oscillator.

I don't think anywhere near 1000 uF is needed in the final design, in fact A: the RC constant of that network will be such that at power-up it will take long seconds for it to stabilize at the intended Vref, and B: with that much juice stored in that cap, you can blow out your op-amps by cutting the power suddenly, unless you add a protective shunt network to safely discharge it into the Vcc rail. I'd throw a 10 uF at it, maybe with a 0.1 uF MC in parallel to catch the higher-frequency stuff the 'lytic bucks out, and see if that reliably shuts it up.

PeterPan

In the future if you have an OP amp to spare, consider making a virtual ground for your vRef. In such a scheme, you would tie the - input  of the spare op-amp to its output pin, and put your voltage divider center on the + input. In this case, your voltage divider resistors can be quite high (100k works well), and the capacitor you'd place from the midpoint to -V would only need to be about 0.1uf. This saves both battery power and space, and the small capicitr will remove any noise generated by the resistors. I typically put a capacitor on the output pin too, but never more than 0.1 to 1uF. Such a virtual ground is so stable, you can easily use it as the ground return point for dozens of circuit ends that require it. I've even used it as the main input/output ground when the supply is not feeding other devices, completely eliminating the need for input and output blocking capacitors. And of course, its still always a good idea (especially in a high gain circuit like a distortion pedal) to bring all gnd-ref points to the same physical location, as near to the junction of output of that OP amp and its (-) input as possible.

Even for extra expense of adding another op-amp if you don't have spare, you'll be very pleased with how quite and stable your circuits come out.

--Randy (PeterPan)
*         *                                              *
   *                             *
... Second Star to the Right, and Straight on Till Morning!
       *                  *                  *

anotherjim

It's usually the amp that's driving the output cable that can suffer oscillation due to cable capacitance.
You can read a lot about it. This for instance...
http://www.analog.com/library/analogdialogue/archives/31-2/appleng.html

In the OCD, there isn't any amp that isn't already buffered from capacitance by resistors.
Also, the only things using Vref are the first amp's + input bias and the clipping network.
All those down pointing arrows are connections to ground, not Vref.

You cannot send the clippers to ground instead of Vref without fitting AC coupling capacitors before and after the clippers. Then you would need to supply Vref bias to the second amp via an additional resistor to the + input. As it is in the schematic, the second amp's + input gets Vref from the first amp because it's all DC coupled.

As you have a scope, don't limit yourself to checking audio frequencies. Always switch the timebase from milliseconds up to microseconds to check for oscillations at really high frequencies. If it's a digital scope, the display can be very misleading if the timebase setting isn't compatible with the signals it's seeing.

PBE6

+1 PeterPan, good advice! I will try a buffered Vref next time for sure.

PBE6

+1 anotherjim, also good advice.

I'm going to try breadboarding a modified version of this OCD with AC coupling and all required bias resistors. Hopefully that will address the issue.

The other build works fine, no whistling whatsoever with the addition of the cap on Vref. I'm thinking I must have made some kind of error on the OCD, but to be honest the build quality was a bit sloppy so it's probably best to start again from scratch.

PBE6

Finally tried to rebuild my OCD pedal, but I'm still getting a faint whine when the pedal is bypassed. Here's the schematic:



Anyone see part of the circuit that may be the problem? No whine when the pedal is on, only when it's bypassed (standard 3PDT stompswitch).

PBE6

Question: what's going on in the circuit when the footswitch is disengaged? The way I wire up my boxes, the positive battery terminal is always connected to the circuit and the circuit is always grounded to the chassis. The switch engages the circuit inputs/outputs and connects the negative end of the LED to the circuit ground to light it up. The battery ground is only connected to the chassis when an input cable is inserted. This is pretty standard, no? But in this configuration, the circuit is always running in the background - just with no input. Could this be part of the problem? The faint whine is only audible when the circuit is *disengaged*, no problems when the circuit is engaged.

karbomusic

#18
Quote from: PBE6 on January 13, 2015, 11:10:10 AM
Question: what's going on in the circuit when the footswitch is disengaged?

The fact that the input to the circuit is now free floating when bypassed; it goes into oscillation and that finds its way into the output path. You can do a couple of things... Continue to fix the whine or if you are using a 3PDT and have that extra pin (the other side of the LED switch), run a jumper from the circuit input to that pin which will shunt it to ground when bypassed. There is a caveat with fixing it by grounding when bypassed... If you use any type of true bypass external switcher, you are still floating the input because the main pedal is engaged and the switcher does the floating so you'd have to account for it there as well, or fix the original whine. A buffered bypass may also fix it IIRC.

Let me know how it goes, I have a circuit of my own that has the issue and I ground the input on bypass since I've never fixed the original faint whine. I've used 4 different layouts (2 Vero, 2 Etched PCBs) as well as completely redesigning Vref and it persists.

PBE6

Thanks karbomusic, I will give it a try and see what happens.