Course materials · Control Engineering I

Week 13 · Comparing Steady-State Error with P and PI

English translation

Before practice

01 Persistent error

It stops approaching the reference at a slightly lower value. Could this persistent difference be used to adjust the input?

Description
  • Error accumulated over time
  • PI uses the current and accumulated error. Closed-loop stability is a prerequisite for evaluating its effect.

02 Tracking a moving target

Are maintaining a fixed velocity and tracking a continuously increasing target velocity the same problem? What changes when comparing control methods?

Description
  • Step and ramp are different tracking problems
  • Assess steady-state error using both the reference signal and system type

Practice

1. Calculate steady-state error

  • Use CPI(s)=10+5sC_{\mathrm{PI}}(s)=10+\frac5s and G(s)=10.5s+1G(s)=\frac1{0.5s+1} in the “3. Step tracking with P and PI” code in the practice Live Script.
  • Before execution, write by hand the characteristic polynomials obtained from L(s)=CPI(s)G(s)L(s)=C_{\mathrm{PI}}(s)G(s) and 1+L=01+L=0.
  • Check stability using the criterion that if all three coefficients of a 2nd-order polynomial are positive, both poles have negative real parts.

Here, Kp=lim⁡s→0L(s)K_p=\lim_{s\to0}L(s) is the position error constant. Distinguish it from the proportional gain labeled KpK_p in the controller equation below.

  • Determine the system type from the number of poles at the origin in L, and calculate Kp=lim⁡s→0L(s)K_p=\lim_{s\to0}L(s) and Kv=lim⁡s→0sL(s)K_v=\lim_{s\to0}sL(s).
  • After checking stability, calculate the unit-step error 11+Kp\frac1{1+K_p} and unit-ramp error 1Kv\frac1{K_v}, and compare with the execution results.
  • Use this calculation as the baseline record for KiK_i=5.

2. Compare pole locations

The models in the “2. Compare pole locations” code in the practice Live Script are T1=tf(10,[1 2 10]) and T2=tf(100,[1 10 100]).

  1. Match each denominator to s2+2ζωns+ωn2s^2+2\zeta\omega_n s+\omega_n^2 to find ωn,ζ\omega_n,\zeta, and record the results in two rows.
  2. Keep ζ\zeta of T1, and create a model by changing only ωn\omega_n to the value in T2. Set the numerator to ωn2\omega_n^2 to preserve DC gain.
  3. On the same time axis, overlay the step responses of T1 and the new model, and tabulate the stepinfo rise time, settling time, and overshoot. Unlike the original T1 and T2 comparison, state which coefficient you held fixed this time.

3. Step tracking with P and PI

  1. Keep the baseline plant G=1/(0.5*s+1) and create the closed loop with P gain Kp=20K_p=20. Record the theoretical unit step error 1/(1+Kp)1/(1+K_p) beside 1-dcgain(Tp).
  2. Keep the PI controller's Kp=10K_p=10 and apply each Ki∈{2,5,10}K_i\in\{2,5,10\}. Plot the three unit-step curves on the same time axis and label KiK_i in the legend.
  3. For each KiK_i, record 1-dcgain(Tpi) and the settling time and overshoot returned by stepinfo(Tpi). Compare the final error separately from the transient response metrics.

4. Ramp tracking

  1. Build the loop L(s)=(10+10/s)G(s)L(s)=(10+10/s)G(s) in the “4. Ramp tracking” code in the practice Live Script and determine the system type from the number of denominator poles at the origin. G(s)G(s) is the same as in the preceding activity.
  2. Find Kv=lim⁡s→0sL(s)K_v=\lim_{s\to0}sL(s) and calculate the unit ramp error 1/Kv1/K_v.
  3. Keep the same time vector and ramp input. Change the code’s integral gain from 5 to the value 10 given in this activity, and rebuild the PI model using the same time axis and ramp input, and use lsim to find output yy. Write the last sample's r−yr-y beside the calculated 1/Kv1/K_v and record their absolute difference.

Submission and saving

Include code, actual outputs and plots, and your own interpretation. Submit through KLAS; check the semester schedule and latest announcements for the deadline.

Filename: Name_StudentID_Week13.mlx.

Restart the runtime, run all code from the top, then save.

Optional practice

Example: using a constant for the integral term in a PI controller

  1. In a copy of the “3. Step tracking with P and PI” code in the practice Live Script, replace PI=10+5/s with PI=10+5, then rebuild feedback(PI*G,1).
  2. Record 1-dcgain(Tpi) before and after the change, and compare whether there is a pole at the origin. Change only the controller definition line to 10+5/s.