Compensator Design

English translation

Execution setup

The Python option uses python-control. If the module is missing, run %pip install control==0.10.2 in a Colab or Jupyter code cell.

Learning objectives

Decide whether to adjust lead or lag compensation when speed, damping, and steady-state error must be met together.

Baseline plant and lead design point

Starting conditions

G(s)=40s(s+2)G(s)=\frac{40}{s(s+2)}. Targets: ζ=.4\zeta=.4, ωn=10\omega_n=10 rad/s.

Procedure

  1. Calculate the real and imaginary parts of the target complex poles and mark them on the root locus.
  2. Choose the lead compensator's zero and pole, calculate its gain using the angle and magnitude conditions at the target point, and write the compensator expression.
  3. Calculate the distance between the selected point and the actual closed-loop pole.

Results to retain

import numpy as np
import matplotlib.pyplot as plt
import control as ctl
s = ctl.tf('s')
G=40/(s*(s+2));zeta=.4;wn=10.
p_desired=-zeta*wn+1j*wn*np.sqrt(1-zeta*zeta)
print('desired pole',p_desired)
# TODO: Apply the angle condition and gain selection from the original.

Record results and self-check

Design item:

Target value:

Calculated or selected value:

Difference:

Points to check

Checking design objectives with metrics

Starting conditions

Apply a unit step and unit ramp to baseline G and the compensated model from Activity 1. Use 0~5 s and 0~20 s, respectively.

Procedure

  1. Apply the same unit step and unit ramp to the compensator from Activity 1 and the uncompensated model. Use 0–5 s for the step and 0–20 s for the ramp.
  2. Find step overshoot and settling time. For the ramp, plot e(t)=r(t)−y(t)e(t)=r(t)-y(t), obtained by subtracting the output from r(t)=tr(t)=t. Record the final-sample error for each model.
  3. Find Kv=lim⁡s→0sL(s)K_v=\lim_{s\to0}sL(s) from the loop transfer function to calculate 1/Kv1/K_v, and record its absolute difference from the final ramp error above. Using the table values, explain which aspects of response speed and final error improved or worsened after compensation.

Results to retain

import numpy as np
import matplotlib.pyplot as plt
import control as ctl
s = ctl.tf('s')
G=40/(s*(s+2))
t=np.linspace(0,20,4001);r=t.copy()
# TODO: Insert C from Activity 1 and calculate the ramp response of feedback(C*G,1).

Record results and self-check

Model:

Overshoot [%]:

Settling Time [s]:

Kv:

Late ramp error:

Points to check

Repeating the design for a different target

Starting conditions

For the same G, change the target to (ζ,ωn)=(.5,8), or follow the procedure in the first ‘Phase-lag compensator using root locus’ section of W12_CompensatorDesign.ipynb (conditions Kv>20K_v>20, ζ=0.4\zeta=0.4, starting code Kv_desired=20) to target Kv=20K_v=20. Choose either option.

Procedure

  1. First state the changed target and the fixed plant.
  2. Create a new compensator and performance table in the same format.
  3. Summarize the metrics achieved and those sacrificed in no more than 5 sentences.

Results to retain

import numpy as np
import matplotlib.pyplot as plt
import control as ctl
s = ctl.tf('s')
G=40/(s*(s+2))
# TODO: Define the selected new target as variables and repeat the design.

Record results and self-check

Design:

Objective:

Compensator expression:

Achieved value:

Metrics that changed together:

Points to check