Loop Shaping

Introduction

Sorry, your browser does not support SVG.

  • Nyquist Stability Criterion tells us the stability of the closed-loop system depends on the open-loop transfer function \(C(s)G(s)\).

Introduction

  • Loop shaping means to choose a compensator(controller) \(C(s)\) to give the open-loop transfer function \(C(s)G(s)\) a desired shape.
  • Commonly used controller includes PID controller, lag/lead compensator, and combined lag-lead compensator.

Desirable Shape: Low Frequency

  • In the low frequency, the gain should be high to have good steady state accuracy.
    • For type-0 system, the position error constant is \(G(0)\).
    • For type-1 system, the position error constant is \(0\) and the velocity error constant is \(\lim_{s\rightarrow 0} sG(s)\).
    • For type-2 system, the position and velocity error constant is \(0\) and the acceleration error constant is \(\lim_{s\rightarrow 0} s^2G(s)\).

Desirable Shape: Mid Frequency

  • Bode's Relation For a minimum phase system, if the magnitude plot is a straight line with slope \(20N\), then the phase will be \(90N^\circ\).
  • Around the gain crossover frequency, the slope of the magnitude plot should be about \(-20\) and extend over a sufficient range of frequency
  • The phase will then be \(\approx -90^\circ\) with a phase margin \(\approx 90^\circ\)

Desirable Shape: High Frequency

  • In the high frequency, the magnitude must be small in order to have good noise attenuation and robustness against model uncertainty.
  • The choice of gain crossover frequency is a compromise among steady-state error, rejection of noise and robustness.

Desirable Shape: Implications in the Time Domain

Freq. Domain Time Domain
Phase margin\(\uparrow\) damping ratio\(\uparrow\) overshot\(\downarrow\)
Gain crossover frequency\(\uparrow\) rise time\(\downarrow\) settling time\(\downarrow\)
Low frequency gain\(\uparrow\) steady state error\(\downarrow\)

Desirable Shape: Example

Consider the following open-loop transfer function \[G(s) = \frac{10(s+1)}{s^2\left[(s/100)^2+2(s/100)+1\right]}.\]

Sorry, your browser does not support SVG.

Desirable Shape: Step Response

The closed-loop transfer function is \[\frac{G(s)}{1+G(s)} = \frac{10(s+1)}{10^{-4}s^4+2\times 10^{-2}s^3+s^2+10s+10}.\]

Sorry, your browser does not support SVG.

Lead Compensator

Lead Compensator

  • The transfer function of a lead compensator is \[C(s) = K\frac{Ts+1}{\alpha Ts+1},\,0<\alpha<1.\]

Sorry, your browser does not support SVG.

Observations

  • The low frequency gain is changed by \(20\log K\).
    • \(K\) can be chosen to satisfy specification on steady-state error.
  • The phase is always positive, which is why it is called a lead compensator
    • The phase margin will be increased
    • Smaller overshot
  • The system's gain crossover frequency will also be increased, resulting in faster response (but the system will be more susceptible to noise)

Analysis

  • The phase response of the lead compensator is given by \[\angle C(j\omega) = \tan^{-1}(\omega T) - \tan^{-1}(\alpha\omega T).\]
  • The maximum phase lead occurs when \[ \frac{d\angle C(j\omega)}{d\omega} = \frac{T}{1+\omega^2T^2}-\frac{\alpha T}{1+\alpha^2\omega^2T^2} = 0,\]which implies that \(\omega = 1/\sqrt{\alpha}T\).
  • The maximum lead is \[\tan^{-1}\left(1/\sqrt{\alpha} \right)- \tan^{-1}\sqrt{\alpha} = \sin^{-1}\frac{1-\alpha}{1+\alpha}.\]

Analysis

  • Therefore, to achieve \(\phi\) maximum phase lead, we need to choose \[\alpha = \frac{1-\sin \phi}{1+\sin\phi}.\]
  • The corresponding magnitude increase at $\omega=1/\sqrt{\alpha}T$ is \begin{align*} K\left|\frac{jT\omega+1}{j\alpha T\omega + 1}\right| &= K\frac{\sqrt{1+1/\alpha}}{\sqrt{1+\alpha}} = K\alpha^{-1/2} \\ &= 20\log K-10\log \alpha (\text{dB}). \end{align*}

Sorry, your browser does not support SVG.

Design Procedure

  • Determine the gain \(K\) to satisfy the steady state error requirement. For example, for type-0 system: \[e_{ss} = \frac{1}{1+K_p},\text{ and }K_p = \lim_{s\rightarrow 0} C(s)G(s) = KG(0).\]
  • Draw the Bode plots of \(KG(s)\), derive the phase margin \(\phi_0\).
  • From \(\phi_0\) and the required phase margin \(PM\), determine the phase lead \(\phi\): \[\phi = PM - \phi_0 + 5^\circ\sim 10^\circ.\]
  • Derive \[\alpha = \frac{1-\sin \phi}{1+\sin \phi}.\]

Design Procedure

  • To achieve the maximum phase lead, place the gain crossover frequency \(\omega_g\) at \(1/\sqrt{\alpha}T\). Therefore, \[20\log|G(j\omega_g)| + 20\log K = 10\log \alpha,\] and we can derive \(\omega_g\).
  • Choose \[T = \frac{1}{\sqrt{\alpha}\omega_g}.\]
  • Verify the result using Matlab.

Example

In a solar tracking system, the control objective is to drive the solar panel which is attached to motor shaft in order to track the light source. The transfer function of the system is given by \[G(s) = \frac{10}{s(s+1)}.\] Design a lead compensator such that \[K_v \geq 100,\,\phi_m \geq 40^\circ,\, K_g \geq 10\text{dB}.\]

Determine \(K\)

  • The lead compensator is of the form \[C(s) = K\frac{Ts+1}{\alpha Ts+1}.\]
  • The velocity error constant is defined as \[K_v = \lim_{s\rightarrow 0}sC(s)G(s) = 10K = 100.\]
  • Hence, we should choose \(K = 10\).

Sketch the Bode Plots of \(KG(s)\)

We will use the straight line approximation:

Sorry, your browser does not support SVG.

Determine \(\alpha\)

  • From the straight line approximation, the phase margin is \(\approx 0^\circ\).
  • In order to achieve \(40^\circ\) phase margin, we will choose the maximum phase lead of the compensator to be \[\phi = 40^\circ - 0^\circ + 5^\circ = 45^\circ.\]
  • The corresponding \[\alpha = \frac{1-\sin 45^\circ}{1+\sin 45^\circ} = 0.1716.\]

Determine \(T\)

  • Using the straight line approximation, we know that \[20\log|KG(j\omega)|\approx 40-40\log(\omega).\]
  • The gain crossover frequency \(\omega_g\) of \(C(s)G(s)\) satisfies \[40-40\log(\omega_g) -10\log(\alpha) = 0.\]
  • Therefore, \(\omega_g \approx 15.54\) and \[T = \frac{1}{\sqrt{\alpha}\omega_g} = 0.1554.\]
  • The compensator is obtained as \[C(s) = 10\frac{0.1554s+1}{0.0267s+1}.\]

Verification

  • The phase margin is \(48.7^\circ\) and the gain margin is \(\infty\).

Sorry, your browser does not support SVG.

Step Response

  • After the compensation, the system responses faster and has less overshoot.

Sorry, your browser does not support SVG.

Remarks

  • The lead compensator improves the phase margin and thus the transient performance (overshoot) of the system.
  • The gain crossover frequency is increased. Thus, the speed of the system response is improved.
  • However, the lead compensator increases the high frequency gain of the system. This makes the system more susceptible to noise signals.