Quadrature oscillator not producing perfect sine wave (flattening) - Page 1
Forum section: electronics / projects

author: Syllith
author_rank: Regular Contributor
timestamp: November 09, 2016, 05:34:34 pm
content: I recently built a quadrature oscillator and it worked flawlessly. While my board was at work, some of the wires and components got pulled out and I Just decided to rebuild it. When I did, I noticed it was working fine, but the top (and a bit of the bottom) of the wave got flattened. I rebuilt it about 4 times now with the same result. I tried different power sources just on a whim but no luck. The only thing I did differently from the first one was change the cap types out (ceramic to mylar). They're the same values. I only have 1 of the original ceramic caps (the others got lost) but I tried swapping it out with one of the new ones but it did absolutely nothing to the wave so I don't think the cap types make a difference here.Any clues on what may be going on?

author: JPortici
author_rank: Super Contributor
timestamp: November 09, 2016, 05:53:42 pm
content: Looks like the opamp is saturating. reduce the loop gain or use a rail-to-rail opamp

author: firehopper
author_rank: Frequent Contributor
timestamp: November 09, 2016, 06:01:03 pm
content: its called clipping, its being overdriven as the other guy said

author: Andy Watson
author_rank: Super Contributor
timestamp: November 09, 2016, 06:03:25 pm
content: Yes saturating - possibly because you have the two ends of the adjustment potentiometer connected together - thereby limiting the range of its adjustment.

author: Syllith
author_rank: Regular Contributor
timestamp: November 09, 2016, 06:57:18 pm
content: I have fixed the pot and tried changing the 2.2k resistors to something about 3 or 4 times as high but still no fix. I've posted the results below.

author: tatus1969
author_rank: Super Contributor
timestamp: November 09, 2016, 08:35:02 pm
content: you still have the same amplitude as in the first picture (7V peak-peak), seems that your effort to reduce it was not successful yet.

author: Syllith
author_rank: Regular Contributor
timestamp: November 09, 2016, 09:31:04 pm
content: So I played around with it a little bit and it seems to be only the top wave is peaking. Is there a reason only the top wave would peak and not the bottom?

author: bktemp
author_rank: Super Contributor
timestamp: November 09, 2016, 09:34:34 pm
content: LM324 can go almost to negative rail, but only about 1.5V less than positive rail. Therefore positive rail will clip first if the signal is centred between positive and negative supply.

author: Syllith
author_rank: Regular Contributor
timestamp: November 09, 2016, 09:38:13 pm
content: I just tried changing out the 10ks to 25ks and it seems to have helped a little bit not really. It's not so sporadic when it peaks but it's still flattening quite a bit. What component will I need to change to adjust gain? I figured it'd be the input (the 2.2ks) but that didn't help either.

author: bktemp
author_rank: Super Contributor
timestamp: November 09, 2016, 09:54:21 pm
content: Reducing the gain will not help much, because the oscillator will probably not start if the gain is too low. What happens if you adjust the potentiometer?The oscillator is similar to a Wien-bridge oscillator. It needs an amplitude control circuit that reduces the gain if the amplitude gets to high to avoid clipping.

author: Andy Watson
author_rank: Super Contributor
timestamp: November 09, 2016, 10:17:51 pm
content: Quote from: bktemp on November 09, 2016, 09:54:21 pmI think it is intended to be a state-variable oscillator - reducing the feedback byincreasingthe value of the potentiometer should prevent it from clipping. I wonder if the choice of LM324 was deliberate - i.e. below approx 1.5V the output has a weak, 50µA pull down in which the op-amp it still functional but with reduced effect - so there will a small window in which the "gain" appears to be perfect for maintaining oscillation?Edit: Also, is the loud-speaker present in the current design - it will affect the gain too.

author: Syllith
author_rank: Regular Contributor
timestamp: November 10, 2016, 12:06:19 am
content: No, no loudspeaker. Just the scope. The pot is only there to adjust frequency. Which it does well. I built this circuit like a month ago and it worked no problem. I'm so confused as to why it's doing this now.

author: Audioguru
author_rank: Super Contributor
timestamp: November 10, 2016, 12:21:08 am
content: A quadrature oscillator hasthreeRC phase shifts that are 180/3= 60 degrees apart. The pot is supposed to be one of the R's so it should be a fixed 10k resistor but it cheats the phase shift to reduce the gain and cause the oscillator to not start.There is nothing in the simple circuit to regulate the amplitude (a Jfet?) so the output keeps increasing until clipping occurs.Why is there a speaker? An LM324 is an opamp not a power amp.Here is a quadrature oscillator from Texas instruments. They say its distortion is not low.

author: Audioguru
author_rank: Super Contributor
timestamp: November 10, 2016, 12:24:51 am
content: When you adjust the pot it changes the phase shift, frequency and gain. With less gain then the output level might be less with less clipping but the oscillation might not start.If it has a Jfet circuit to regulate the gain then the gain will be high for it to reliably start then the gain is reduced to avoid clipping.

author: Syllith
author_rank: Regular Contributor
timestamp: November 10, 2016, 12:55:11 am
content: This is actually what Im trying to clone. Only difference in mine is I'm just regulating 12v down to 9v. Why am I not getting the same results as him? I tried it with a 9 volt battery too just to rule anything out as I'm using a homemade power supply. No change.

author: edavid
author_rank: Super Contributor
timestamp: November 10, 2016, 12:56:47 am
content: Quote from: Audioguru on November 10, 2016, 12:21:08 amNo, that's wrong. A quadrature oscillator must have a 90 degree phase shift between the 2 outputs (that's what quadrature means), and an additional 270 degree phase shift to close the loop.More discussion here:http://www.ti.com/sc/docs/apps/msp/journal/aug2000/aug_07.pdfOP, you will get a lower distortion output from the other op amp section, but this is not a good design to use if you don't need both outputs.

author: David Hess
author_rank: Super Contributor
timestamp: November 10, 2016, 05:52:54 am
content: A quadrature oscillator still requires some type of gain control. In this case it is being provided by output saturation of the operational amplifier.

author: Howardlong
author_rank: Super Contributor
timestamp: November 10, 2016, 10:09:16 am
content: Also there needs to be a low impedance mid-rail reference. I recommend a bypass cap across one of those 2.2k resistors, typically it would be on the lower one to GND, say 10uF // 100nF.