Tale of the Bode Plot Failure

By Mike Jones |
It is not too often that a tool fails me. Most of the time I have made some mistake, so when a Bode Plot failed to predict an unstable system, I came down with a bad case of myopia. I spent so much time chasing my tail, I thought I better write about the experience so others can learn from it.I was trying to port an analog instrument with two control loops to a different platform. I thought the port was all software. A few days of code hacking and I'd be done. But, I ran into an oscillation in a precision DC control system shown in this scope shot:Osc1.jpgLet's take a look at the design, and then I'll walk you though my analysis, failure, and final success.Block1.jpgTheir are three loops in the design. VDAC controls voltage, and +/-IDAC control current. When the current loop is in control, the voltage loop is pushed aside. It is the current loop that oscillates. Kp, Hn, and Kg are all op-amps with single poles at 100Hz, and a second pole at 1Mhz. This means the two poles from Kp/Kg or Kn/Kg give 180 degrees of phase shift, and you would expect oscillation.Bode1.jpgAfter building a rather complex MATLAB loop gain transfer function, I created this Bode Plot. 40dB/Decade roll off and 180 deg phase shift from 100Hz to 100Khz. The scope shot shows oscillations in this range, and my intuition immediately said, gain > 1 and 180 deg equals oscillator.However, a friend pointed out that phase margin only applies when gain = 1. So with some playing around you can move the phase and get some margin like this plot:Bode2.jpgIn this case, we have over 45 deg margin. But, the system still oscillated. My intuition would not let go of the phase from 100Hz to 100Khz, so my friend pointed out the Barkhausen Criteria. The Wikipedia entry says:bq). ...if [tex] A [/tex], is the gain of the amplifying element in the circuit and [tex]\beta(j\omega)[/tex], is the transfer function of the feedback path, so [tex]\beta A[/tex] is the loop gain around the feedback loop of the circuit, the circuit will sustain steady-state oscillations only at frequencies for which:bq). # The loop gain is equal to unity in absolute magnitude, that is, [tex] |\beta A| = 1\[/tex]; # There must be a positive feedback i.e., the phase shift around the loop is zero or an integer multiple of [tex]2 \pi: \angle \beta A = 2 \pi n, n \in 0, 1, 2,\dots [/tex].Reality and theory still did not agree. By some luck, I ran into a compensation article on EE Times. There was a similar Bode Plot:EETimes1.jpgThe phase margin is defined at gain = 1, not where the phase approaches 180 deg. This seemed to agree with the Barkhausen Criteria. I posted a question in the comments and got confirmation and a link to a discussion about stability. Deep into the discussion was a comment by Frank Wiedmann:bq). In case of doubt (if there is more than one crossing of 180 degrees or 0 dB), you should always apply the Nyquist stability criterion (see http://en.wikipedia.org/wiki/Stability_criterion). In the case presented here, by applying this criterion, you will find that the circuit is in fact stable (if the gain remains below 0 dB for higher frequencies).bq). When phase margin is specified for a system, it is usually assumed that the loop gain has two significant poles and no zeros. In this case, you can derive from the phase margin the shape of the closed-loop response of the system (damping of the step response etc.). The loop gain in the example presented here does not satisfy this condition, so giving a phase margin does not make very much sense.Reusing my MATLAB model to produce a Nyquist Plot:Nyquist1.jpgThere she is! We are wrapped around -1 and the system is unstable, even though the phase/gain margin is ok!By tweaking Hp and Kn, I was able to get a Nyquist Plot like this one:Nyquist2.jpgThis should be stable. Now I recheck my margins:Bode3.jpgAll good. Might want a little more margin, but it should be stable.The change only required adding a 1500pF capacitor in the lead network of Hp and Kn. With a little soldering, I rechecked the instrument and all the oscillations were gone.The lesson was quite clear: Know your tools and how to use them. If a tool depends on an assumption, you must know it's assumptions, or know someone else who does :-)

Join the Conversation!

User must log-in to comment.

Add Comment

You must log-in to comment.