Unit 5 - Notes

ECE305 11 min read

Unit 5: Design of Compensators

Bode Plot and Stability Determination

The Bode plot is a frequency response analysis tool consisting of two plots:

  1. Magnitude Plot: Logarithm of the magnitude of the transfer function, 20 log |G(jω)|, versus frequency ω (on a log scale). The unit is decibels (dB).
  2. Phase Plot: Phase angle of the transfer function, ∠G(jω), versus frequency ω (on a log scale). The unit is degrees.

These plots are used to determine the stability of a closed-loop system from its open-loop transfer function G(s)H(s).

Key Stability Metrics

  1. Gain Crossover Frequency (ω_gc):

    • The frequency at which the magnitude of the open-loop transfer function is unity, or 0 dB.
    • |G(jω_gc)H(jω_gc)| = 1 or 20 log |G(jω_gc)H(jω_gc)| = 0 dB.
  2. Phase Crossover Frequency (ω_pc):

    • The frequency at which the phase angle of the open-loop transfer function is -180°.
    • ∠G(jω_pc)H(jω_pc) = -180°.
  3. Gain Margin (GM):

    • The amount of gain (in dB) that can be added to the system before the closed-loop system becomes unstable. It is a measure of the system's robustness to gain variations.
    • It is calculated at the phase crossover frequency ω_pc.
    • Formula: GM = -20 log |G(jω_pc)H(jω_pc)| dB.
    • A positive GM (in dB) indicates that the system is stable. A typical desired value is GM > 6 dB.
  4. Phase Margin (PM):

    • The amount of additional phase lag required to bring the system to the verge of instability. It is a measure of the system's relative stability and damping characteristics.
    • It is calculated at the gain crossover frequency ω_gc.
    • Formula: PM = 180° + ∠G(jω_gc)H(jω_gc).
    • A positive PM indicates that the system is stable. A typical desired value is 30° < PM < 60°.

Stability Criterion from Bode Plot

For a minimum-phase system, the closed-loop system is stable if and only if:

  • Gain Margin (GM) > 0 dB
  • Phase Margin (PM) > 0°

This implies that at the phase crossover frequency ω_pc, the gain must be less than 0 dB, and at the gain crossover frequency ω_gc, the phase must be above -180°.

Relationship between Phase Margin and Transient Response

The Phase Margin is directly related to the damping ratio (ζ) of the system, which governs the transient response characteristics like overshoot.

  • Low PM (e.g., < 30°): Corresponds to low damping (ζ < 0.3). The system will be oscillatory with high overshoot.
  • High PM (e.g., > 60°): Corresponds to high damping (ζ > 0.6). The system will be slow and overly damped.
  • Approximation: For a standard second-order system, a useful rule of thumb is PM ≈ 100 * ζ.
Phase Margin (PM) Damping Ratio (ζ) Percent Overshoot (%OS)
20° ~0.17 ~59%
30° ~0.26 ~43%
45° ~0.42 ~23%
60° ~0.59 ~10%

Lead Compensation

Purpose

  • To improve the transient response of a system (e.g., faster rise time, reduced overshoot).
  • To increase the phase margin, thereby improving relative stability.
  • To increase the system's bandwidth.

Transfer Function

The transfer function of a lead compensator is given by:
Gc(s) = Kc * (s + z_c) / (s + p_c) where p_c > z_c.

A more common form for design is:
Gc(s) = K_c * (Ts + 1) / (αTs + 1)
where:

  • α = z_c / p_c < 1
  • T = 1 / z_c
  • The pole is at s = -1/(αT) and the zero is at s = -1/T. The zero is closer to the origin than the pole.

Bode Plot Characteristics

  • Magnitude: Provides a gain that increases with frequency from 20log(K_c) to 20log(K_c/α).
  • Phase: Introduces a positive phase shift (phase lead) over a range of frequencies. The maximum phase lead φ_m occurs at the geometric mean of the corner frequencies.

The maximum phase lead φ_m is given by:
sin(φ_m) = (1 - α) / (1 + α)

The frequency ω_m at which φ_m occurs is:
ω_m = 1 / (T√α)

Effects on the System

  • Adds phase lead: Increases the phase margin.
  • Increases gain crossover frequency: Leads to a faster response time.
  • Increases bandwidth: The system can respond to faster input changes.
  • Can amplify high-frequency noise due to its high-frequency gain.

Design of Lead Compensator using Bode Plot

Goal: Achieve a desired Phase Margin (PM).

Procedure:

  1. Determine System Gain (K): Choose a gain K for the uncompensated system G(s) = K * G_p(s) to meet steady-state error specifications (e.g., for K_v, K_p, K_a).
  2. Analyze Uncompensated System: Plot the Bode plot for G(s). Determine the existing phase margin PM_u.
  3. Calculate Required Phase Lead: Determine the required phase margin PM_d from the design specifications. The required phase lead from the compensator is φ_m = PM_d - PM_u + (5° to 12°), where the extra degrees form a safety margin to account for the shift in the gain crossover frequency.
  4. Calculate α: From the required φ_m, calculate α using α = (1 - sin(φ_m)) / (1 + sin(φ_m)).
  5. Find New Gain Crossover Frequency (ω'_gc): The maximum phase lead φ_m should be centered at the new gain crossover frequency ω'_gc. This frequency is found by locating where the magnitude of the uncompensated system G(jω) is equal to -10 log(1/α) dB or -20 log(1/√α) dB.
    • Set ω_m = ω'_gc.
  6. Calculate Compensator Parameters (T): Use the relation ω_m = 1 / (T√α) to find T. Now you have α and T.
  7. Determine Compensator Gain (K_c): Often K_c is set to 1 if the gain K was already set for steady-state error. If the specification is on the final compensated gain, adjust K_c accordingly.
  8. Write Final Compensator: Gc(s) = (Ts + 1) / (αTs + 1).
  9. Verification: Plot the Bode plot of the compensated system Gc(s)G(s) and verify that all design specifications (PM, GM, K_v) are met.

Lag Compensation

Purpose

  • To improve the steady-state accuracy of a system (i.e., reduce steady-state error).
  • This is achieved by increasing the low-frequency gain without significantly affecting the phase margin and transient response at higher frequencies.

Transfer Function

The transfer function of a lag compensator is given by:
Gc(s) = Kc * (s + z_c) / (s + p_c) where z_c > p_c.

A more common form for design is:
Gc(s) = (Ts + 1) / (βTs + 1)
where:

  • β = z_c / p_c > 1
  • T = 1 / z_c
  • The pole is at s = -1/(βT) and the zero is at s = -1/T. The pole is closer to the origin than the zero.
  • Note: The DC gain is 1, but it provides a high-frequency attenuation of 20 log(1/β).

Bode Plot Characteristics

  • Magnitude: The gain is 0 dB at low frequencies and attenuates to -20log(β) dB at high frequencies. This attenuation helps lower the gain crossover frequency.
  • Phase: Introduces a negative phase shift (phase lag). The design goal is to place this lag at frequencies low enough that it does not significantly affect the phase margin at the new gain crossover frequency.

Effects on the System

  • Increases low-frequency gain: By adjusting the system gain K first, it improves the static error constant (K_p, K_v).
  • Reduces bandwidth: The system becomes slower.
  • Reduces the gain crossover frequency.
  • Maintains or slightly improves phase margin: The attenuation from the lag compensator lowers the entire magnitude curve, effectively moving the gain crossover frequency to a lower point where the phase margin is naturally higher.

Design of Lag Compensator using Bode Plot

Goal: Improve steady-state error while maintaining a desired Phase Margin (PM).

Procedure:

  1. Determine System Gain (K): Set the gain K of the uncompensated system G(s) to meet the new, desired steady-state error requirement.
  2. Analyze Uncompensated System: Plot the Bode plot for this high-gain system G(s). This system will likely have a poor (or negative) phase margin.
  3. Find New Gain Crossover Frequency (ω'_gc): Find the frequency where the phase of G(jω) provides the desired phase margin PM_d. Let this frequency be ω'_gc.
    • ∠G(jω'_gc) = -180° + PM_d + (5° to 12°), where the extra degrees compensate for the small phase lag from the compensator at this frequency.
  4. Determine Required Attenuation (β): At this frequency ω'_gc, the magnitude of G(jω'_gc) is likely greater than 0 dB. The lag compensator must provide enough attenuation to make ω'_gc the new gain crossover frequency. The required attenuation is equal to the magnitude of G(jω) at ω'_gc.
    • 20 log(β) = |G(jω'_gc)| dB. Solve for β.
  5. Calculate Compensator Parameters (T): To ensure the compensator's phase lag does not significantly affect the new phase margin, place the compensator's zero (1/T) well below the new gain crossover frequency ω'_gc. A common rule is to place it one decade below.
    • z_c = 1/T = ω'_gc / 10.
  6. Write Final Compensator: Gc(s) = (Ts + 1) / (βTs + 1).
  7. Verification: Combine the compensator with the high-gain system Gc(s)G(s) and check the Bode plot to ensure K_v and PM_d are met.

Lag-Lead Compensation

Purpose

  • To combine the advantages of both lag and lead compensation.
  • Used when a system requires improvement in both steady-state response (e.g., reduce steady-state error) and transient response (e.g., increase speed and phase margin).

Transfer Function

A lag-lead compensator is a cascade of a lag and a lead section.
Gc(s) = Gc_lead(s) * Gc_lag(s) = [ (T₁s + 1) / (αT₁s + 1) ] * [ (T₂s + 1) / (βT₂s + 1) ]
where:

  • α < 1 (Lead section)
  • β > 1 (Lag section)
  • T₁ and T₂ are the respective time constants.

Often, the design is simplified by setting α = 1/β.

Effects on the System

  • Lag Section: Provides high gain at low frequencies to improve steady-state accuracy.
  • Lead Section: Provides phase lead at higher frequencies to improve phase margin and bandwidth.
  • Essentially, it reshapes the Bode plot at both low and high frequencies to meet multiple conflicting design objectives.

Design of Lag-Lead Compensator using Bode Plot

The design process involves designing the lead and lag parts separately.

  1. Lead Compensator Design: First, design the lead part to achieve the desired phase margin and transient response, following the lead design procedure. This will fix α and T₁.
  2. Lag Compensator Design: Next, design the lag part to provide the necessary low-frequency gain to meet the steady-state error specification. This will fix β and T₂.
  3. The overall system gain K is adjusted to satisfy all requirements simultaneously. The design can be iterative.

PID Control

A Proportional-Integral-Derivative (PID) controller is a powerful and widely used feedback control mechanism. Its output u(t) is a sum of three terms based on the error signal e(t) = r(t) - y(t).

u(t) = Kp * e(t) + Ki * ∫e(t)dt + Kd * de(t)/dt

In the Laplace domain, the controller's transfer function is:
Gc(s) = Kp + Ki/s + Kd*s = Kp(1 + 1/(Ti*s) + Td*s)
where Ti = Kp/Ki is the integral time and Td = Kd/Kp is the derivative time.

Individual Control Actions

  1. Proportional (P) Control: Gc(s) = Kp

    • Action: Output is proportional to the current error.
    • Effect: Increases the overall loop gain. Reduces rise time and steady-state error, but does not eliminate it. High Kp can lead to instability and increased overshoot.
  2. Integral (I) Control: Gc(s) = Ki/s

    • Action: Output is proportional to the integral of past errors.
    • Effect: The integrator (1/s term) drives the steady-state error to zero for step inputs (increases the system type by one). However, it adds a -90° phase lag, which degrades transient response and can reduce stability.
  3. Derivative (D) Control: Gc(s) = Kd*s

    • Action: Output is proportional to the rate of change of the error. It is predictive.
    • Effect: Adds damping to the system by anticipating future error. It provides a +90° phase lead, which increases stability and reduces overshoot and settling time. It is highly sensitive to high-frequency noise.

Combined Controllers

  1. Proportional-Integral (PI) Controller: Gc(s) = Kp + Ki/s

    • Purpose: Combines the fast response of P-control with the zero steady-state error of I-control.
    • Analogy: Behaves similarly to a Lag Compensator.
  2. Proportional-Derivative (PD) Controller: Gc(s) = Kp + Kd*s

    • Purpose: Combines the fast response of P-control with the stability and damping improvements of D-control.
    • Analogy: Behaves similarly to a Lead Compensator.
  3. Proportional-Integral-Derivative (PID) Controller: Gc(s) = Kp + Ki/s + Kd*s

    • Purpose: The complete controller, combining the advantages of all three actions. It can achieve fast response, good stability, low overshoot, and zero steady-state error.
    • Analogy: Behaves similarly to a Lag-Lead Compensator.

Summary of Effects

Controller Rise Time Overshoot Settling Time S-S Error Stability
P Decrease Increase Small change Decrease Degrade
I Decrease Increase Increase Eliminate Degrade
D Minor change Decrease Decrease Minor change Improve
PI Decrease Increase Increase Eliminate Degrade
PD Decrease Decrease Decrease Minor change Improve
PID Decrease Decrease Decrease Eliminate Can be improved

PID Tuning

The process of selecting the optimal controller parameters Kp, Ki, and Kd to meet performance specifications is called tuning. Common methods include manual tuning and algorithmic approaches like the Ziegler-Nichols method.