Unit 5 - Notes
Unit 5: Design of Compensators
Bode Plot and Stability Determination
The Bode plot is a frequency response analysis tool consisting of two plots:
- 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). - 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
-
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)| = 1or20 log |G(jω_gc)H(jω_gc)| = 0 dB.
-
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°.
-
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.
-
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 < 1T = 1 / z_c- The pole is at
s = -1/(αT)and the zero is ats = -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)to20log(K_c/α). - Phase: Introduces a positive phase shift (phase lead) over a range of frequencies. The maximum phase lead
φ_moccurs 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:
- Determine System Gain (K): Choose a gain
Kfor the uncompensated systemG(s) = K * G_p(s)to meet steady-state error specifications (e.g., forK_v,K_p,K_a). - Analyze Uncompensated System: Plot the Bode plot for
G(s). Determine the existing phase marginPM_u. - Calculate Required Phase Lead: Determine the required phase margin
PM_dfrom 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. - Calculate α: From the required
φ_m, calculateαusingα = (1 - sin(φ_m)) / (1 + sin(φ_m)). - Find New Gain Crossover Frequency (ω'_gc): The maximum phase lead
φ_mshould be centered at the new gain crossover frequencyω'_gc. This frequency is found by locating where the magnitude of the uncompensated systemG(jω)is equal to-10 log(1/α) dBor-20 log(1/√α) dB.- Set
ω_m = ω'_gc.
- Set
- Calculate Compensator Parameters (T): Use the relation
ω_m = 1 / (T√α)to findT. Now you haveαandT. - Determine Compensator Gain (K_c): Often
K_cis set to 1 if the gainKwas already set for steady-state error. If the specification is on the final compensated gain, adjustK_caccordingly. - Write Final Compensator:
Gc(s) = (Ts + 1) / (αTs + 1). - 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 > 1T = 1 / z_c- The pole is at
s = -1/(βT)and the zero is ats = -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(β) dBat 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
Kfirst, 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:
- Determine System Gain (K): Set the gain
Kof the uncompensated systemG(s)to meet the new, desired steady-state error requirement. - 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. - Find New Gain Crossover Frequency (ω'_gc): Find the frequency where the phase of
G(jω)provides the desired phase marginPM_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.
- Determine Required Attenuation (β): At this frequency
ω'_gc, the magnitude ofG(jω'_gc)is likely greater than 0 dB. The lag compensator must provide enough attenuation to makeω'_gcthe new gain crossover frequency. The required attenuation is equal to the magnitude ofG(jω)atω'_gc.20 log(β) = |G(jω'_gc)| dB. Solve forβ.
- 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.
- Write Final Compensator:
Gc(s) = (Ts + 1) / (βTs + 1). - Verification: Combine the compensator with the high-gain system
Gc(s)G(s)and check the Bode plot to ensureK_vandPM_dare 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₁andT₂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.
- 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
αandT₁. - 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
βandT₂. - The overall system gain
Kis 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
-
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
Kpcan lead to instability and increased overshoot.
-
Integral (I) Control:
Gc(s) = Ki/s- Action: Output is proportional to the integral of past errors.
- Effect: The integrator (
1/sterm) 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.
-
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
-
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.
-
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.
-
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.