Author Topic: Why is my circuit oscillating?  (Read 2216 times)

0 Members and 1 Guest are viewing this topic.

Offline matthuszaghTopic starter

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: us
Why is my circuit oscillating?
« on: February 26, 2023, 01:30:27 am »
I built a buffer amplifier for a low phase noise oscillator. This is not my design - it's taken from http://www.ko4bb.com/~bruce/OCXOBufferAmplifiers.html. However, I placed two of these buffers in series for improved reverse isolation and used two of the full 2-stage buffers from the same source to get two copies of the signal.

The purpose of the buffer is to raise the power of a 7 dBm clock to 13 dBm while adding minimal phase noise and providing reverse isolation. Each stage should provide about 40 dB reverse isolation. Several people have built this design with good success, though I don't know of anyone who has cascaded two stages in series, or used two buffers in parallel to get 2 copies of the buffered clock.

I'm getting some very large and nasty oscillations in this circuit. I've attached plots from a spectrum analyzer showing this. I've also attached the full schematic and images of the top and bottom of the fully assembled PCB.

I made these 3-winding transformers myself with fair-rite 67 toroids and 28 AWG magnet wire. This is my first time constructing my own transformers, so it's very possible I didn't do a very good job.

Notably, when I press down on the transformers most of the oscillations disappear. The SA plots show this for output 1. That's when I press down on the transformers for that output. But, I also see an effect when I press down on the transformers for the other output. Moreover, when I press down on all transformers, I no longer see any parasitic oscillations. In a way that's ok, because I will be fixturing these with a nylon screw, washers and nut, but I don't like the idea that this is prone to oscillation.

Another thing I should mention is that the resistor at the NPN's collector is 10R, not 0 as shown in the schematic.

My best guess would be that the oscillations are caused by one of the transformer windings plus some capacitance, but I don't really know. And I'm very confused by the fact that pressing down on the transformers removes the effect.

I suppose another thought is that by placing the toroids on top of each other, the magnetic fields from one are coupling into the other, though toroids should confine the magnetic field pretty well.
« Last Edit: February 26, 2023, 01:51:52 am by matthuszagh »
 

Offline Tomorokoshi

  • Super Contributor
  • ***
  • Posts: 1212
  • Country: us
Re: Why is my circuit oscillating?
« Reply #1 on: February 26, 2023, 01:44:54 am »
Those loosely-wound transformers may be changing inductance and capacitance characteristics while operating because of freedom of motion of the wiring. Pressing down restricts the motion. Secure the windings by wrapping more tightly, and then coat with something to hold them in place. As they are already assembled, coating might be enough. A 5-minute epoxy might be good enough.
 
The following users thanked this post: matthuszagh

Online Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1699
  • Country: ca
Re: Why is my circuit oscillating?
« Reply #2 on: February 26, 2023, 03:18:18 am »
Quote
However, I placed two of these buffers in series for improved reverse isolation and used two of the full 2-stage buffers from the same source to get two copies of the signal.

I suspect with the increased overall gain that you're getting feedback, probably from coupling between the two coils or the circuitry itself. Even though they are toroids, there will be a bit of coupling and your finger may be just enough absorption to stop the oscillations by lowering the gain or coupling. You may need a shield between the two stages.

EDIT: Plus, your Hi-Z input and one output are unterminated.
« Last Edit: February 26, 2023, 03:34:38 am by Kim Christensen »
 

Offline matthuszaghTopic starter

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: us
Re: Why is my circuit oscillating?
« Reply #3 on: February 26, 2023, 05:40:20 am »
I suspect with the increased overall gain that you're getting feedback, probably from coupling between the two coils or the circuitry itself. Even though they are toroids, there will be a bit of coupling and your finger may be just enough absorption to stop the oscillations by lowering the gain or coupling. You may need a shield between the two stages.

EDIT: Plus, your Hi-Z input and one output are unterminated.

Ah I was worried about that. I don't have a ton of space on this board, which is why the transformers are on top of each other like that. I might have space above the PCB though, so maybe I can stack two PCBs. Do I specifically need a magnetic shield (such as mu metal), or would something like aluminum do?

Putting my fingers on the transformers but not pressing down also kills most of the oscillation. There is still some, and pressing down does a better job, but I wonder if that's because pressing down also increases the contact area with my fingers.

Terminating the input didn't change the oscillations. Terminating the other output just resulted in different oscillations.
 

Online Bud

  • Super Contributor
  • ***
  • Posts: 7096
  • Country: ca
Re: Why is my circuit oscillating?
« Reply #4 on: February 26, 2023, 07:39:17 am »
You cant put transformers on top of each other, they will couple. Try turning one transformer on each PCB side 90 degree so every transformer is 90 degree with each other.
Facebook-free life and Rigol-free shack.
 

Offline matthuszaghTopic starter

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: us
Re: Why is my circuit oscillating?
« Reply #5 on: February 26, 2023, 11:28:25 pm »
From the point of view of magnetic coupling, does this layout look better? I tried to keep the transformers as far away from each other as possible. I haven't added any shields or other methods of increasing isolation. Is it likely I'll need that, or should the separation be enough?
 

Online Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1699
  • Country: ca
Re: Why is my circuit oscillating?
« Reply #6 on: February 26, 2023, 11:47:25 pm »
Looks a lot better. I would also move the inputs and outputs so that the signal flow is always in one direction and never doubles back on itself.
ie: You don't want the output feeding back into the input.

Very rough idea of what I mean:
 
The following users thanked this post: matthuszagh

Online Bud

  • Super Contributor
  • ***
  • Posts: 7096
  • Country: ca
Re: Why is my circuit oscillating?
« Reply #7 on: February 27, 2023, 01:16:34 am »
Use thicker tracks, your tracks are way too thin. Thin tracks add inductance.

Edit: and add some bulk capacitors to the power supply rails. Add at least 47uF to the outputs of each voltage regulator.
« Last Edit: February 27, 2023, 02:39:48 am by Bud »
Facebook-free life and Rigol-free shack.
 
The following users thanked this post: matthuszagh

Offline matthuszaghTopic starter

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: us
Re: Why is my circuit oscillating?
« Reply #8 on: February 27, 2023, 06:10:48 pm »
Ok, new layout including changes to location of input and outputs, thicker traces and added bulk capacitance. I've shown the back side too. I routed the connections to the SMAs (input and outputs) on the backside to minimize noise coupling from nearby unregulated power traces and other traces. This is a 4-layer board with both internal layers full ground planes.
« Last Edit: February 27, 2023, 06:19:27 pm by matthuszagh »
 

Offline matthuszaghTopic starter

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: us
Re: Why is my circuit oscillating?
« Reply #9 on: April 10, 2023, 07:24:25 am »
The re-layout completely fixed the oscillation issue (thanks for the help!). I've attached a picture of the new completed PCB as well as a plot of the harmonics and residual phase noise performance. I measured the reverse isolation to be 76 dB and 77 dB (two outputs, one input) and the isolation between outputs to be 59 dB and 49 dB (I'm a bit surprised these differ by 10 dB).
 
The following users thanked this post: boB, Kim Christensen

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1941
  • Country: us
Re: Why is my circuit oscillating?
« Reply #10 on: April 10, 2023, 08:27:38 pm »
The standard answer to that question is "Because you're trying to build an amplifier".

The opposite is also often true: The reason you have an amplifier is because you're trying to build an oscillator.
 

Offline matthuszaghTopic starter

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: us
Re: Why is my circuit oscillating?
« Reply #11 on: April 21, 2023, 11:36:42 pm »
Unfortunately, I've discovered there's still a major issue with this circuit: if I place a small amount of capacitance across the output, such as from a coaxial cable, it oscillates (shown in the attached image). When I leave the output open, the oscillations go away. I confirmed this by connecting the output directly to an oscilloscope's high-impedance input - the 10pF input was not enough to get it to oscillate. Also, when I connect a suitable resistive load across the capacitive load, such as into 50ohms, the oscillations are also not present.

I'll probably add some series resistance to the output to try to kill this. In retrospect it probably would have been a good idea to add a jumper resistor to the output in case I needed this. The output impedance is a bit low anyway (35ohms vs the 50ohm I was targeting).

I tested adding some series resistance and even a very small series resistance kills the oscillation. The smallest resistor I had handy was 1ohm, which still did the trick.

Other suggestions/thoughts welcome too!
« Last Edit: April 21, 2023, 11:51:08 pm by matthuszagh »
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22383
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Why is my circuit oscillating?
« Reply #12 on: April 22, 2023, 12:37:42 am »
Something to remember with transformers is the self inductance, leakage and self capacitance (or transmission line length in this case), and interaction with circuit capacitances (mainly the transistor itself here).  And since you have two cascaded, the same applies to input, middle, and output ports.

The thing that stands out to me is the completely unloaded collector, at certain frequencies.  U2C for example resonates with Q2 Ccb, which also feeds back to the input (Miller capacitance).  Now, magnetizing inductance is surely handled by emitter feedback (for which R9 acts as termination), but there could still be a mode with leakage where the collector has high voltage gain and wild phase shift, acting somewhat (if not entirely?) outside of feedback mechanisms.

The important part about such a mode is, it's also a path.  If it's U2C leakage against the other windings, then a voltage rise there corresponds to a current rise elsewhere; it could therefore be handled by some impedance above U2C (so, add ESR to C8, more or less?), or below U2A or B.  These would be alternatives to an R+C from collector to GND (the most obvious way to dampen a ringing capacitance).

And yes, some of these already have impedance -- that is, the bottom end of U2C has high impedance (well, except for Ccb), the top end of U2A has impedance, surely impedance at the other end doesn't matter?  Well, keep in mind there is a common mode element to the transformer.  It's not ideal, there is leakage and capacitance between windings, so it can matter which end has what impedance.

"Neutralization" could also be applied, i.e. some impedance C-B.  I use quotes, because a typical form is simply an R+C here, which basically kills gain above the cutoff frequency, not really neutralizing in the sense of cancelling capacitance or correcting phase shifts.  But that can do well enough anyway.

Now, I don't have this thing in front of me, I'm not probing it and testing which of these mechanisms is at play; and I don't have a good feel for the typical behavior of an emitter-feedback circuit like this.  So several of these might be completely off base.  This is more just to give some ideas to think about how it's behaving.

Also keep in mind, any given resonant mode has some characteristic frequency defined by its elements.  Example: say leakage (U2C referred) is 100nH, Ccb is ~5pF: they should resonate around 225MHz -- probably too high to be the culprit in question.  You can use the frequency or time constant to trace things around as well.

(My guess for 25MHz, being in the passband more or less, but towards the high end, is stray capacitance over the board, coupling just enough feedback to make it oscillate.  This would also be touch-sensitive, since touch disturbs the E-field over the board.  If not, perhaps it's a local feedback thing, and neutralization would do the best.)


Another thing that might help is, notice the inter-stage impedance is poorly defined.  The base input impedance is quite high due to emitter degeneration; collector output is basically Early effect, negligible compared to even core loss I'd guess.  This might give you very high gain, but it also makes an easy node for crosstalk or oscillation to be introduced.


A stability analysis should be able to show up any oscillation, or potential thereof, and, keep an eye on the transfer function too (peaks may suggest potential instability).

An "unconditionally stable" amplifier means no oscillation for any input *or* output impedance (anywhere on the half-plane of the Smith chart); this would obviously be a pain to test exhaustively, but there are methods to determine it from s parameters or what have you.


Cheers!

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: matthuszagh

Offline matthuszaghTopic starter

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: us
Re: Why is my circuit oscillating?
« Reply #13 on: April 23, 2023, 12:24:47 am »
A cut one of the output traces and inserted a 10ohm series resistor. This reduces the oscillation by a little less than half (in terms of Vrms), but it doesn't eliminate it and it's still quite large (6.7Vrms). When I'd tested this before modifying the board, I'd used a through-hole resistor with long leads. I suppose the larger inductance/lower capacitance of that setup could have made a difference with respect to the 0402 resistor I'm using now.

I tried adding a 1k resistor across the output, in addition to the series resistor. That cuts down the oscillation a bit more. But it's still 5.5Vrms. Unfortunately, I can't afford to load the output too much.

I did notice that touching the transformer just before the output that's oscillating affected the oscillation amplitude and a little bit the frequency too. Touching any of the other transformers didn't have an effect. So, one of those transformer windings is presumably involved in the oscillation. I still suspect the output winding with the output capacitance. I guess the 10ohm series resistor doesn't provide enough damping and isolation between the parallel LC.

As for the impedance between stages, I did add a 65ohm resistor across the first stage output. And I didn't notice any oscillations there.
« Last Edit: April 23, 2023, 12:29:56 am by matthuszagh »
 

Online Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1699
  • Country: ca
Re: Why is my circuit oscillating?
« Reply #14 on: April 23, 2023, 12:47:02 am »
The output impedance is a bit low anyway (35ohms vs the 50ohm I was targeting).

Not sure if a matching network would help... Unfortunately, a resistive one would give about 5.4db of loss. Might be worth the experiment to see how it effects stability:

 

Offline matthuszaghTopic starter

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: us
Re: Why is my circuit oscillating?
« Reply #15 on: April 23, 2023, 01:08:50 am »
Not sure if a matching network would help... Unfortunately, a resistive one would give about 5.4db of loss. Might be worth the experiment to see how it effects stability:

I can certainly try, although 5 dB loss is too much for me. I tried using smaller parallel resistors and they decrease the oscillation, but don't kill it.
 

Offline matthuszaghTopic starter

  • Frequent Contributor
  • **
  • Posts: 373
  • Country: us
Re: Why is my circuit oscillating?
« Reply #16 on: April 23, 2023, 01:37:35 am »
Adding a 1k resistor between the transistor side of the collector transformer winding and ground appears to mostly or entirely kill the oscillations.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22383
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Why is my circuit oscillating?
« Reply #17 on: April 23, 2023, 02:45:25 am »
Adding a 1k resistor between the transistor side of the collector transformer winding and ground appears to mostly or entirely kill the oscillations.

Equivalent to a 250 ohm in parallel with the output, although also reducing collector voltage very slightly.  Oh... reducing collector current too, by the bias servo.  That could be relevant as well.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf