S parameters and stability analysis - Page 1
Forum section: electronics / rf-microwave

author: OwO
author_rank: Super Contributor
timestamp: December 15, 2019, 05:25:45 pm
content: Usually when assessing whether a two port network is stable you look at K factor or stability circles, which tell you what range of impedances when presented to a port will cause the other port to have a reflection coefficient > 1. This is fine for e.g. looking at whether an amplifier or transistor is "unconditionally stable" (stable for all passive impedances presented to ports), but when modelling a more complicated circuit it is sometimes insufficient.I had just run into a circuit that oscillates in LTSpice in transient analysis but doing AC analysis, extracting S parameters and looking at K factor showed the amplifier to be unconditionally stable, so I decided to investigate further. Many MMIC amplifiers do not have spice models and being able to assess stability in e.g. RFSim99 is essential. In theory, as long as there is any signal pathway from the ports to the oscillating region, applying a small signal excitation to the linearized circuit at the trouble frequency should show all nodes "blowing up", but AC analysis showed that the peak near the oscillating frequency was no more than 5dB above the baseline gain, so what is up?In small signal (AC) analysis the simulator does what is equivalent to building a signal flow graph and solving for all nodes using linear algebra. Any loops in the signal flow graph could point to feedback mechanisms that lead to oscillation, but the solution will only "blow up" if the loop gain is exactly equal to 1. If the loop gain is >1, we get a "solution" but one that is unphysical. The explanation is that AC analysis operates with basis functions that are pure sinusoids and thus assumes a steady state excitation and a steady state response, and the onset of oscillation isnota steady state phenomenon. However it *is* a linear phenomenon (imagine a negative resistor connected to a LC tank) and doesn't require nonlinearities to explain.The fix for this is something we were all taught in second year university which is s-domain (laplace) analysis. The basis functions of a Laplace transform consists of not just complex sinusoids, but also decaying and growing complex sinusoids (i.e. e^jwt * e^at). The stability criterion is then simply that the response does not blow up at all frequencies that are decaying (no poles on the right hand side of the s-plane). Additionally the decay factor at the pole location actually tells you how fast the oscillation grows.All circuit elements can be modeled in the s-domain just as well as the frequency domain, so my question then is: why do none of the popular circuit simulators (LTSpice, RFSim99) implement this? This is a problem because there is otherwise NO way to decisively tell if a circuit design is stable when the circuit elements only have S parameter data and no spice model. Taking this further, how do you deal with devices with S parameter data that is always only supplied in the frequency domain? (I have partly the answer for this one which I will post in a reply).

author: rfeecs
author_rank: Frequent Contributor
timestamp: December 15, 2019, 07:37:52 pm
content: Quote from: OwO on December 15, 2019, 05:25:45 pmThat sums it up.S-parameter data represents a small signal linear steady state condition.Instability leading to oscillation is typically a large signal condition with a transient start up.K factor and stability circles give a small amount of information. Not nearly enough to assure the circuit is stable under normal operating conditions including turn on transient, thermal transients, noise transients...

author: RoGeorge
author_rank: Super Contributor
timestamp: December 15, 2019, 08:17:23 pm
content: Quote from: OwO on December 15, 2019, 05:25:45 pmIf that's the reason, than just forget about it.You will waste time based on the false assumption that a simulation is trustworthy. Not at all. It's a very lame numerical representation of a real circuit (especially when it came to oscillations and stability). Usually good enough as a guideline, or for didactic use at most, but don't bet your life on it. It's not even a real simulation, it's more like a toy model, or an analogy: It works upto some point, but from there it breaks, and completely diverge from reality.There is a reason for why Bob Pease was saying "My favorite programming language is soldering". Also, he didn't like much SPICE exactly because of reasons like the one you encountered.(random google link for Bob Pease simulations)https://e2e.ti.com/blogs_/archives/b/thesignal/archive/2012/08/21/spice-it-up-but-does-bob-pease-say-no-august-22-2012I liked SPICE, too, at the beginning. I still use it sometimes, but I wouldn't trust it for serious work. Also, simulation is very time consuming. Problems that will take 10-30 minutes to test in hardware could easily take 4 hours or 4 days to sort out in simulation.TL;DRNot a big fan of simulations because they are not always trustworthy.No simulation is always better than a misleading simulation.

author: m3vuv
author_rank: Super Contributor
timestamp: December 15, 2019, 09:32:43 pm
content: reminds me of doing a repair on some car electrics with a cheap dmm,sent me down rabbit holes,then realised the battery was at about 6 v not 9,gave whacky readings,would of been better off without it.

author: OwO
author_rank: Super Contributor
timestamp: December 16, 2019, 04:16:48 am
content: So there are oscillation phenomena that depend on large signal behavior and nonlinearity (e.g. relaxation oscillators), but the point here is that the current tools fail to predict ordinary, small signal instability, ones that can be easily seen in an s-plane plot if you work out the transfer function by hand. Suppose you have a feedback loop somewhere in your circuit that at a particular frequency has a loop gain of 2, in other words Vout = Vin + 2*Vout. The solver will find that for Vin = 1, Vout = -1, and completely miss the instability. Why is this? When the circuit was linearized at a particular frequency, an assumption was made which is that the circuit is already in steady state (its internal state and excitations set up in such a way that the output is a steady sinusoid). Since this assumption is broken, everything that follows is rubbish. In the s-domain it's as if you excite the circuit with a impulse and then take the dot product of the response with various decaying and growing sinusoids, which will catch the oscillation when the decay factor is close to the oscillation growth factor.In spice all circuits are built from basic elements (passives and dependent sources) which all have trivial s-domain transfer functions. Even a transmission line's S parameters are easily calculated in the s-domain instead of frequency domain (e.g. instead of S21 being e**(jwL) it would be e**sL). In a linear simulator like RFSim99 it's the same idea, basic elements and transmission lines, except for device models that are specified by S parameter files.How do you derive s-domain S parameters from frequency domain measurements? First observation is that as long as the individual circuit element (transistor or MMIC) itself isn't oscillating, it can be completely described by its S parameters as long as there are enough frequency points that go down to near DC. A linear two port network is nothing more than a LTI system with 2 inputs and 2 outputs. The S parameters simply describe the transfer function of each combination of (input, output). If you transform the S parameters to the time domain, what you get is the impulse response of the system for each pair of (input, output), or in other words time domain S parameters. Given the impulse response it's easy to just use the Laplace transform to get s-domain S parameters for any arbitrary s. (btw "s" should be thought of as a combination of frequency and decay/growth factor.)It's still possible with S parameters that don't go down to near DC. If you think about what the Laplace transform for one particular s is, it's the dot product between a decaying complex sinusoid and the impulse response of the system. A dot product can be taken in the frequency domain as well as time. However, the Fourier transform of the decaying/growing sinusoid doesn't exist, so we have to assume the device is causal, and truncate the decaying sinusoid to only the positive t part. For s with growth rather than decay you can assume a finite length of impulse response for the DUT. In the end what we get is a "convolution" between a kernel and the DUT's frequency domain S parameters, in other wordsby looking at neighboring frequencies you can obtain the s-domain S parameters at a particular s.Put all this together and it should be possible to develop a replacement for RFSim99 that can plot in the s-domain.

author: Odysseus
author_rank: Regular Contributor
timestamp: December 16, 2019, 05:45:08 am
content: OwO, your experience seems to contradict my expectation. If an AC simulation indicates stability, then a transient simulation starting from the same initial conditions will not oscillate, even if perturbed slightly. You are absolutely correct about stability of a an LTI system being dependent on the absence of poles in the right hand plane. The pole locations for a system of arbitrary complexity can be found by calculating the eigenvalues of the KCL matrix. Some commercial spice simulators provide this as an analysis option, such as Cadence's "pz" analysis within the "spectre" simulator.It is not necessary to evaluate the response of a system at frequencies off the j*w axis to determine stability. Right-hand plane poles affect the steady-state sinusoidal frequency response in a way that reveal their existence. This is how gain and phase margin work in the classic bode stability analysis of negative feedback systems.My contention is that you are not correctly assessing the stability from the AC simulation results. K factor should be reliable. Keep in mind that |delta| must also be less than unity to ensure unconditional stability.

author: OwO
author_rank: Super Contributor
timestamp: December 16, 2019, 06:41:29 am
content: "Right-hand plane poles affect the steady-state sinusoidal frequency response in a way that reveal their existence. This is how gain and phase margin work in the classic bode stability analysis of negative feedback systems."Can you elaborate more on how right hand plane poles can be detected from the response on the jw axis (without breaking the feedback loops)? I'm doing AC and transient analysis on the same circuit in LTSpice, and the AC response only shows a slight peaking at the trouble frequency. The excitation is on the input port and I see the same result probing any node. In transient analysis it oscillates, and you can see the slow buildup of the oscillation that indicates the circuit is unstable at the original operating point (the DC operating point solved by spice that is also used for AC analysis). I just went and tried the same with an oscillator circuit, putting an AC excitation on the resonator path and saw the same thing (finite gain on all nodes, small peaking). If you think about the small-signal circuit as a LTI system the frequency response shouldn't even exist, since a finite energy input will give an output with unbounded energy. The impulse response of the system is unbounded and doesn't have a Fourier transform, so what is the AC analysis really showing?In traditional negative feedback systems you have to break the loop to look at loop gain and phase, but this is easy to do only when you know where all the loops are. If you look at e.g. a BJT amplifier with emitter inductance, there are feedback paths that are not immediately visible. I guess you could look at the simplified signal flow graph and look for loops (with suitable software support).

author: OwO
author_rank: Super Contributor
timestamp: December 16, 2019, 02:43:47 pm
content: A bus trip later and I finally realize what this frequency domain "solution" of the response of an unstable system is. It's the solution where the system is already oscillating but the input excitation has just the right *opposing* phase and magnitude as to *suppress* the growth of the oscillation and keep it constant. As such, it is a real solution and a physical one, but not a very meaningful one. It's the only solution that exists in the frequency domain, so that's what the solver finds. There are outcomes where the response blows up, but they do not exist in the frequency domain, only the s-domain. That said, I now know what to look for, which is quick phase inversions in the frequency response. I went to LTSpice and looked at the phase response for various stable and unstable circuits and so far it seems instability is always correlated with an increasing phase (negative group delay). I'll think about this further and see if I can derive some usable stability criteria.