Root Locus Analysis
The root locus is a graphical method for analyzing how the poles of a closed-loop system change as a system parameter (usually the gain) varies.
Understanding Root Locus
The root locus shows the paths that the poles of the closed-loop system follow as the gain K varies from 0 to ∞. For a system with forward transfer function G(s) and unity feedback:
Basic Rules for Sketching Root Locus
- The root locus starts at the open-loop poles (K = 0)
- The root locus ends at the open-loop zeros (K = ∞)
- The number of branches equals the number of open-loop poles
- Branches approach asymptotes at high gains
- The root locus is symmetric about the real axis
Example 1: Simple Second-Order System
import control
import numpy as np
import matplotlib.pyplot as plt
# Create transfer function G(s) = 1/(s(s + 2))
num = [1]
den = [1, 2, 0] # s^2 + 2s
G = control.TransferFunction(num, den)
# Generate root locus
plt.figure(figsize=(10, 8))
rlist, klist = control.root_locus(G, plot=True)
plt.title('Root Locus: G(s) = 1/s(s + 2)')
plt.grid(True)
plt.show()
Output:
Transfer Function G(s) = 1/s(s + 2)
Open-Loop Poles: [-2.+0.j 0.+0.j]
Critical Gain (K) at Imaginary Axis: 0.00
Example 2: System with Multiple Poles
# Create transfer function G(s) = 1/((s+1)(s+2)(s+3))
G = control.TransferFunction([1], [1, 6, 11, 6])
# Generate root locus
plt.figure(figsize=(10, 8))
rlist, klist = control.root_locus(G, plot=True)
plt.title('Root Locus: G(s) = 1/((s+1)(s+2)(s+3))')
plt.grid(True)
plt.show()
Output:
Analyzing Root Locus Features
Break-Away Points
Points where branches of the root locus depart from the real axis.
For our simple second-order system: - Break-away point occurs at s = -1 (where the branches split from the real axis) - This happens at a gain value of K = 1
Crossing Points
Points where the root locus crosses the imaginary axis, indicating stability boundaries.
For our simple second-order system: - The root locus crosses the imaginary axis at approximately ±j1.4 - This occurs at a gain value of K ≈ 4.0
Design Example: Lead Compensator
# Design a lead compensator
alpha = 10
T = 1
num_c = [T, 1]
den_c = [T/alpha, 1]
C = control.TransferFunction(num_c, den_c)
# Combined system
GC = control.series(G, C)
# Plot root locus of compensated system
plt.figure(figsize=(10, 8))
control.root_locus(GC)
plt.title('Root Locus with Lead Compensator')
plt.grid(True)
plt.show()
Stability Analysis Using Root Locus
Gain Selection
The root locus helps in selecting appropriate gain values for stability:
# Find gain for specific closed-loop poles
desired_poles = [-1 + 1j, -1 - 1j]
K = control.root_locus_plot(G, plot=False)
Stability Margins
Analyzing stability margins from root locus:
# Calculate gain and phase margins
gm, pm, _, _ = control.margin(G)
print(f"Gain Margin: {gm} dB")
print(f"Phase Margin: {pm} degrees")
Exercises
- Plot the root locus for a system with transfer function G(s) = K/(s² + 2s + 2).
- Find the range of K for which the system is stable.
- Design a compensator to achieve specific closed-loop pole locations.
- Analyze how zeros affect the root locus shape and system stability.