Chapter 29: Industrial and Mechatronic Case Studies in Linear Control
Lesson 1: DC Motor Speed and Position Control
This lesson develops a rigorous, transfer-function-based model of a brushed DC motor and uses it to design classical linear controllers for speed and position. We derive the motor dynamics from first principles, obtain speed and position transfer functions, and design PI/P cascaded loops that satisfy time-domain performance specifications. Implementation-oriented examples are given in Python, C++, Java, MATLAB/Simulink, and Wolfram Mathematica.
1. Physical Overview and Dynamic Modeling
A brushed DC motor converts electrical energy at the armature into mechanical rotational motion. The key variables are:
- \( v_a(t) \): armature voltage [V]
- \( i_a(t) \): armature current [A]
- \( \omega(t) \): angular speed [rad/s]
- \( \theta(t) \): angular position [rad]
- \( T_L(t) \): load torque [N·m]
The motor is characterized by electrical and mechanical parameters:
- \( R \): armature resistance [\(\Omega\)]
- \( L \): armature inductance [H]
- \( J \): rotor and load inertia [kg·m\(^2\)]
- \( b \): viscous friction coefficient [N·m·s/rad]
- \( K_t \): torque constant [N·m/A]
- \( K_e \): back-EMF constant [V·s/rad]
Applying Kirchhoff's voltage law to the armature circuit yields the electrical equation:
\[ v_a(t) = L \frac{d i_a(t)}{dt} + R\, i_a(t) + K_e \, \omega(t). \]
The mechanical equation (sum of torques about the shaft) is
\[ J \frac{d \omega(t)}{dt} + b\, \omega(t) = K_t \, i_a(t) - T_L(t). \]
Finally, the kinematic relation between position and speed is
\[ \frac{d \theta(t)}{dt} = \omega(t). \]
These three equations form a linear time-invariant (LTI) model suitable for transfer-function-based control design.
flowchart TD
V["Armature voltage v_a(t)"] --> E["Electrical dynamics (R, L, K_e)"]
E --> I["Armature current i_a(t)"]
I --> T["Electromagnetic torque K_t * i_a(t)"]
T --> M["Mechanical dynamics (J, b, T_L)"]
M --> W["Angular speed omega(t)"]
W --> TH["Position theta(t)"]
2. Laplace-Domain Model and Transfer Functions
Taking the Laplace transform (zero initial conditions) and denoting \( V_a(s), I_a(s), \Omega(s), \Theta(s), T_L(s) \) as the Laplace transforms of the corresponding time-domain variables:
\[ V_a(s) = (L s + R)\, I_a(s) + K_e \, \Omega(s), \]
\[ (J s + b)\, \Omega(s) = K_t \, I_a(s) - T_L(s), \]
\[ s \Theta(s) = \Omega(s). \]
2.1 Speed transfer function \( \Omega(s)/V_a(s) \)
Set the load torque input to zero, \( T_L(s) = 0 \), to derive the speed response to the armature voltage. From the mechanical equation:
\[ I_a(s) = \frac{(J s + b)\,\Omega(s)}{K_t}. \]
Substitute into the electrical equation:
\[ \begin{aligned} V_a(s) &= (L s + R)\, \frac{(J s + b)\,\Omega(s)}{K_t} + K_e \,\Omega(s) \\ &= \left[ \frac{(L s + R)(J s + b)}{K_t} + K_e \right] \Omega(s). \end{aligned} \]
Thus the open-loop speed transfer function (load torque neglected) is
\[ G_\omega(s) \equiv \frac{\Omega(s)}{V_a(s)} = \frac{K_t}{(L s + R)(J s + b) + K_t K_e }. \]
2.2 Position transfer function \( \Theta(s)/V_a(s) \)
Since \( s \Theta(s) = \Omega(s) \), the position transfer function follows as
\[ G_\theta(s) \equiv \frac{\Theta(s)}{V_a(s)} = \frac{\Theta(s)}{\Omega(s)}\frac{\Omega(s)}{V_a(s)} = \frac{1}{s} G_\omega(s) = \frac{K_t}{s\left[(L s + R)(J s + b) + K_t K_e \right]}. \]
This is a third-order transfer function. In many practical motor drives, the electrical dynamics are much faster than the mechanical dynamics. When \( L \) is small so that \( L s \ll R \) over the bandwidth of interest, we may approximate \( L s + R \approx R \), obtaining a first-order speed model.
\[ G_\omega(s) \approx \frac{K_t}{R(J s + b) + K_t K_e} = \frac{K_m}{T_m s + 1}, \]
where the effective static gain and time constant are
\[ K_m = \frac{K_t}{b R + K_t K_e}, \quad T_m = \frac{J R}{b R + K_t K_e}. \]
The corresponding position transfer function is then
\[ G_\theta(s) \approx \frac{K_m}{s(T_m s + 1)}, \]
which is a canonical second-order form (one pole at the origin, one real pole at \( s = -1/T_m \)).
3. Closed-Loop Speed Control with PI Controller
We consider a standard single-loop speed control structure with a PI controller. The reference input is the desired speed \( \omega_r(t) \), measured speed is \( \omega(t) \), and the control signal is the armature voltage \( v_a(t) \).
Using the first-order motor approximation \( G_\omega(s) = K_m/(T_m s + 1) \), the PI controller is
\[ C_\text{PI}(s) = K_p + \frac{K_i}{s} = \frac{K_p s + K_i}{s}. \]
3.1 Closed-loop transfer function
The open-loop transfer function from speed error \( \omega_r - \omega \) to speed is
\[ L(s) = C_\text{PI}(s) G_\omega(s) = \frac{K_p s + K_i}{s} \cdot \frac{K_m}{T_m s + 1}. \]
The closed-loop transfer function from reference speed \( \Omega_r(s) \) to actual speed \( \Omega(s) \) is
\[ \frac{\Omega(s)}{\Omega_r(s)} = \frac{L(s)}{1 + L(s)} = \frac{\dfrac{K_m(K_p s + K_i)}{s(T_m s + 1)}} {1 + \dfrac{K_m(K_p s + K_i)}{s(T_m s + 1)}}. \]
Multiply numerator and denominator by \( s(T_m s + 1) \) to obtain a polynomial denominator:
\[ \frac{\Omega(s)}{\Omega_r(s)} = \frac{K_m(K_p s + K_i)} {T_m s^2 + s + K_m(K_p s + K_i)}. \]
Thus the characteristic polynomial is
\[ \varphi(s) = T_m s^2 + (1 + K_m K_p) s + K_m K_i. \]
3.2 Matching desired second-order dynamics
Suppose we want the closed-loop dynamics to match a standard second-order model with natural frequency \( \omega_n \) and damping ratio \( \zeta \),
\[ \varphi_\text{des}(s) = T_m \left(s^2 + 2 \zeta \omega_n s + \omega_n^2\right). \]
Equating coefficients of \( s^2, s, 1 \) between \( \varphi(s) \) and \( \varphi_\text{des}(s) \) gives
\[ \begin{aligned} T_m &: \quad T_m = T_m \quad (\text{always satisfied}), \\ s &: \quad 1 + K_m K_p = 2 \zeta \omega_n T_m, \\ 1 &: \quad K_m K_i = T_m \omega_n^2. \end{aligned} \]
Hence the PI gains are
\[ K_p = \frac{2 \zeta \omega_n T_m - 1}{K_m}, \quad K_i = \frac{T_m \omega_n^2}{K_m}. \]
3.3 Steady-state error properties (speed loop)
With a PI controller, the open-loop transfer function \( L(s) \) contains an integrator (factor \( 1/s \)), so the closed-loop speed system is of type 1 (one net integrator in the loop). From Chapter 8, type 1 systems track step references with zero steady-state error.
Define the steady-state speed error for a unit-step reference \( \omega_r(t) = u(t) \) as
\[ e_\infty = \lim_{t \to \infty} \left( \omega_r(t) - \omega(t) \right). \]
For a type 1 system, the position error constant \( K_v \) (defined as in Chapter 8) is finite and the step error is zero. Therefore, the PI speed controller guarantees zero steady-state error for step speed commands if the closed-loop system is stable.
4. Position Control via Cascaded Loops
High-performance servo drives usually employ a cascaded structure: an inner speed loop and an outer position loop. The inner loop makes the motor behave like a first-order actuator in speed, while the outer loop regulates position.
flowchart TD
RTH["Position reference theta_r"] --> SUMTH["\"Position error\""]
SUMTH --> CP["Outer controller (P/PI on position)"]
CP --> WR["Speed reference omega_r"]
WR --> SUMW["\"Speed error\""]
SUMW --> CW["Inner PI speed controller"]
CW --> PWR["Motor + drive (G_omega(s))"]
PWR --> WM["Measured speed omega"]
WM --> INT["Integration to theta"]
INT --> TH["Measured position theta"]
TH --> SUMTH
4.1 Inner loop approximation
If the inner speed loop is designed with sufficiently large bandwidth, its closed-loop response can be approximated by a first-order transfer function
\[ \frac{\Omega(s)}{\Omega_r(s)} \approx \frac{1}{\tau_v s + 1}, \]
where \( \tau_v \) is the effective time constant of the closed-loop speed dynamics. Integrating speed to position yields the inner-loop effective plant for the outer position controller:
\[ G_\text{pos,eff}(s) = \frac{\Theta(s)}{\Omega_r(s)} = \frac{1}{s} \cdot \frac{1}{\tau_v s + 1}. \]
4.2 P position controller design
Consider an outer-loop proportional controller \( C_p(s) = K_p^\theta \). The open-loop transfer function of the outer loop is
\[ L_\theta(s) = C_p(s)\,G_\text{pos,eff}(s) = \frac{K_p^\theta}{s(\tau_v s + 1)}. \]
The closed-loop position transfer function \( \Theta(s)/\Theta_r(s) = L_\theta(s) / (1 + L_\theta(s)) \) has the characteristic polynomial
\[ \varphi_\theta(s) = \tau_v s^2 + s + K_p^\theta. \]
This is again a second-order polynomial. To obtain specified \( \omega_n^\theta \) and \( \zeta_\theta \), we match
\[ \varphi_\theta(s) = \tau_v\left( s^2 + 2 \zeta_\theta \omega_n^\theta s + (\omega_n^\theta)^2 \right). \]
Equating coefficients gives
\[ \begin{aligned} \tau_v &: \quad \tau_v = \tau_v, \\ s &: \quad 1 = 2 \zeta_\theta \omega_n^\theta \tau_v, \\ 1 &: \quad K_p^\theta = \tau_v(\omega_n^\theta)^2. \end{aligned} \]
Thus, a chosen pair \( (\omega_n^\theta, \zeta_\theta) \) determines the proportional gain:
\[ K_p^\theta = \tau_v (\omega_n^\theta)^2, \quad \text{with } \zeta_\theta = \frac{1}{2 \omega_n^\theta \tau_v}. \]
The coupling between inner and outer bandwidths must respect the classical rule of thumb: the speed loop bandwidth should be significantly higher (typically by a factor of 4 to 10) than the position loop bandwidth to ensure good separation of time scales.
5. Time- and Frequency-Domain Characteristics
With suitably chosen gains, both speed and position loops can be analyzed using standard second-order formulas from previous chapters. For example, for the closed-loop speed system with characteristic polynomial \( s^2 + 2 \zeta \omega_n s + \omega_n^2 \), the key transient metrics are:
- Rise time (approximate): \( t_r \approx \frac{1.8}{\omega_n} \)
- Settling time (2% criterion): \( t_s \approx \frac{4}{\zeta \omega_n} \)
- Percent overshoot: \( M_p \approx 100 \exp\!\left(-\frac{\pi \zeta}{\sqrt{1-\zeta^2}}\right)\,\% \)
Frequency-domain characteristics are obtained from the loop transfer function \( L(j\omega) \). The bandwidth of the speed loop can be read from the magnitude response of the closed-loop transfer function \( \Omega(s)/\Omega_r(s) \). The position loop bandwidth must be chosen lower to avoid exciting the inner loop.
From Chapter 18, the sensitivity and complementary sensitivity functions for the speed loop are
\[ S_\omega(s) = \frac{1}{1 + L(s)}, \quad T_\omega(s) = \frac{L(s)}{1 + L(s)}. \]
The trade-off between disturbance rejection (small \( |S_\omega(j\omega)| \) at low frequencies) and noise attenuation (small \( |T_\omega(j\omega)| \) at high frequencies) directly shapes the achievable speed and position performance for the DC motor system.
6. Python Implementation (Using python-control)
We illustrate a complete speed and position control design using the
python-control library. Assume the following motor
parameters:
- \( R = 2 \,\Omega \), \( L = 0.5 \,\text{H} \)
- \( J = 0.02 \,\text{kg·m}^2 \), \( b = 0.002 \,\text{N·m·s/rad} \)
- \( K_t = 0.1 \,\text{N·m/A} \), \( K_e = 0.1 \,\text{V·s/rad} \)
Using the approximations from Section 2:
\[ K_m = \frac{K_t}{b R + K_t K_e}, \quad T_m = \frac{J R}{b R + K_t K_e}. \]
import numpy as np
import control as ctl
import matplotlib.pyplot as plt
# Motor parameters
R = 2.0
L = 0.5
J = 0.02
b = 0.002
Kt = 0.1
Ke = 0.1
# Effective first-order speed model parameters
Km = Kt / (b * R + Kt * Ke)
Tm = J * R / (b * R + Kt * Ke)
print("Km =", Km, "Tm =", Tm)
# First-order speed plant G_omega(s) = Km / (Tm s + 1)
G_omega = ctl.tf([Km], [Tm, 1.0])
# Desired closed-loop specs for speed
zeta = 0.8
omega_n = 20.0 # rad/s
Kp = (2 * zeta * omega_n * Tm - 1.0) / Km
Ki = (Tm * omega_n**2) / Km
print("Kp =", Kp, "Ki =", Ki)
# PI controller C(s) = Kp + Ki / s
C_speed = ctl.tf([Kp, Ki], [1.0, 0.0])
# Closed-loop speed from speed reference to speed
T_speed = ctl.feedback(C_speed * G_omega, 1)
# Position loop: integrate speed
G_pos_eff = ctl.series(ctl.tf([1.0], [1.0, 0.0]), T_speed)
# Choose outer loop natural frequency lower than inner
omega_n_theta = 5.0
zeta_theta = 0.9
tau_v = 1.0 / omega_n # approximate from inner loop bandwidth
Kp_theta = tau_v * omega_n_theta**2
C_pos = ctl.tf([Kp_theta], [1.0])
T_pos = ctl.feedback(C_pos * G_pos_eff, 1)
# Time vector and responses
t_speed, y_speed = ctl.step_response(T_speed, T=np.linspace(0, 1.0, 1000))
t_pos, y_pos = ctl.step_response(T_pos, T=np.linspace(0, 2.0, 1000))
plt.figure()
plt.plot(t_speed, y_speed)
plt.xlabel("Time [s]")
plt.ylabel("Speed [rad/s]")
plt.title("Closed-loop speed response (unit step)")
plt.grid(True)
plt.figure()
plt.plot(t_pos, y_pos)
plt.xlabel("Time [s]")
plt.ylabel("Position [rad]")
plt.title("Closed-loop position response (unit step)")
plt.grid(True)
plt.show()
The control library automates transfer-function operations,
feedback interconnections, and step-response computation, providing a
flexible environment for classical linear control design.
7. C++ Implementation (Numerical Simulation)
In C++, we can implement a simple discrete-time simulation of the DC
motor with PI speed control using Euler integration of the full
electrical and mechanical equations. The code below uses no external
control libraries, but in more advanced projects one may use
Eigen for matrix operations and state-space formulations.
#include <iostream>
#include <fstream>
int main() {
// Motor parameters
double R = 2.0;
double L = 0.5;
double J = 0.02;
double b = 0.002;
double Kt = 0.1;
double Ke = 0.1;
// PI speed controller gains (use values designed in Python, for example)
double Kp = 1.5;
double Ki = 50.0;
// Simulation settings
double dt = 0.0005;
double t_end = 1.0;
int steps = static_cast<int>(t_end / dt);
// State variables
double ia = 0.0; // armature current
double omega = 0.0; // speed
double theta = 0.0; // position
double integ_e = 0.0; // integrator state for PI
double TL = 0.0; // load torque
std::ofstream fout("dc_motor_pi_speed.csv");
fout << "t,omega,theta,ia\n";
for (int k = 0; k <= steps; ++k) {
double t = k * dt;
// Reference speed: unit step
double omega_ref = (t >= 0.0) ? 1.0 : 0.0;
// Speed error
double e = omega_ref - omega;
// PI controller
integ_e += e * dt;
double va = Kp * e + Ki * integ_e;
// Electrical dynamics: L dia/dt = va - R ia - Ke omega
double dia = (va - R * ia - Ke * omega) / L;
// Mechanical dynamics: J domega/dt = Kt ia - b omega - TL
double domega = (Kt * ia - b * omega - TL) / J;
// Integrate states
ia += dia * dt;
omega += domega * dt;
theta += omega * dt;
fout << t << "," << omega << "," << theta << "," << ia << "\n";
}
fout.close();
std::cout << "Simulation complete. Data written to dc_motor_pi_speed.csv\n";
return 0;
}
The output file can be plotted with any external tool (MATLAB, Python, or gnuplot) to analyze the closed-loop speed and position responses.
8. Java Implementation (Object-Oriented Simulation)
The following Java example encapsulates the DC motor dynamics and PI speed controller in separate classes. For more advanced matrix-based models, one may use libraries such as Apache Commons Math.
public class DCMotor {
double R = 2.0;
double L = 0.5;
double J = 0.02;
double b = 0.002;
double Kt = 0.1;
double Ke = 0.1;
double ia = 0.0;
double omega = 0.0;
double theta = 0.0;
public void step(double va, double TL, double dt) {
double dia = (va - R * ia - Ke * omega) / L;
double domega = (Kt * ia - b * omega - TL) / J;
ia += dia * dt;
omega += domega * dt;
theta += omega * dt;
}
}
class PIController {
double Kp;
double Ki;
double integ;
public PIController(double Kp, double Ki) {
this.Kp = Kp;
this.Ki = Ki;
this.integ = 0.0;
}
public double control(double ref, double meas, double dt) {
double e = ref - meas;
integ += e * dt;
return Kp * e + Ki * integ;
}
}
public class DCMotorSimulation {
public static void main(String[] args) {
DCMotor motor = new DCMotor();
PIController pi = new PIController(1.5, 50.0);
double dt = 0.0005;
double tEnd = 1.0;
int steps = (int) (tEnd / dt);
double TL = 0.0;
System.out.println("t,omega,theta");
for (int k = 0; k <= steps; k++) {
double t = k * dt;
double omegaRef = (t >= 0.0) ? 1.0 : 0.0;
double va = pi.control(omegaRef, motor.omega, dt);
motor.step(va, TL, dt);
if (k % 50 == 0) {
System.out.println(t + "," + motor.omega + "," + motor.theta);
}
}
}
}
This structure closely mirrors the block-diagram representation: the controller object generates the voltage command, and the motor object propagates the state dynamics.
9. MATLAB/Simulink Implementation
MATLAB and Simulink provide built-in support for transfer functions and block diagrams, making them widely used in industrial motor-control applications. The script below constructs the speed and position loops using transfer functions.
% Motor parameters
R = 2.0;
L = 0.5;
J = 0.02;
b = 0.002;
Kt = 0.1;
Ke = 0.1;
Km = Kt / (b * R + Kt * Ke);
Tm = J * R / (b * R + Kt * Ke);
s = tf('s');
% Speed plant
G_omega = Km / (Tm * s + 1);
% Speed PI controller design
zeta = 0.8;
omega_n = 20;
Kp = (2 * zeta * omega_n * Tm - 1) / Km;
Ki = (Tm * omega_n^2) / Km;
C_speed = Kp + Ki / s;
T_speed = feedback(C_speed * G_omega, 1);
% Position loop: integrate speed
G_pos_eff = (1 / s) * T_speed;
omega_n_theta = 5;
tau_v = 1 / omega_n;
Kp_theta = tau_v * omega_n_theta^2;
C_pos = Kp_theta;
T_pos = feedback(C_pos * G_pos_eff, 1);
figure;
step(T_speed);
title('Closed-loop speed response');
figure;
step(T_pos);
title('Closed-loop position response');
grid on;
In Simulink, one would implement equivalent block diagrams using Transfer Fcn, Gain, Sum, and Integrator blocks, or use the PID Controller block for the inner speed loop and outer position loop.
10. Wolfram Mathematica Implementation
Mathematica's ControlSystems functionality supports
transfer functions and feedback interconnections. The code snippet below
mirrors the MATLAB implementation.
(* Motor parameters *)
R = 2.0;
L = 0.5;
J = 0.02;
b = 0.002;
Kt = 0.1;
Ke = 0.1;
Km = Kt/(b*R + Kt*Ke);
Tm = J*R/(b*R + Kt*Ke);
s = LaplaceTransformVariable;
Gomega = TransferFunctionModel[Km/(Tm*s + 1), s];
zeta = 0.8;
omegan = 20.0;
Kp = (2*zeta*omegan*Tm - 1)/Km;
Ki = (Tm*omegan^2)/Km;
Cspeed = TransferFunctionModel[(Kp*s + Ki)/s, s];
Tspeed = FeedbackConnect[SeriesConnect[Cspeed, Gomega], 1];
GposEff = SeriesConnect[
TransferFunctionModel[1/s, s],
Tspeed
];
omeganTheta = 5.0;
tauv = 1.0/omegan;
KpTheta = tauv*omeganTheta^2;
Cpos = TransferFunctionModel[KpTheta, s];
Tpos = FeedbackConnect[SeriesConnect[Cpos, GposEff], 1];
(* Plot step responses *)
speedResp = StepResponse[Tspeed, {t, 0, 1}];
posResp = StepResponse[Tpos, {t, 0, 2}];
speedRespPlot = Plot[Evaluate[speedResp[[1]]], {t, 0, 1},
AxesLabel -> {"t", "omega"},
PlotLabel -> "Closed-loop speed response"];
posRespPlot = Plot[Evaluate[posResp[[1]]], {t, 0, 2},
AxesLabel -> {"t", "theta"},
PlotLabel -> "Closed-loop position response"];
Show[speedRespPlot]
Show[posRespPlot]
Symbolic capabilities in Mathematica can also be used to derive closed-loop transfer functions analytically, verify pole locations, and perform parameter sensitivity analysis for the motor and controller gains.
11. Problems and Solutions
Problem 1 (Derivation of Speed Transfer Function): Starting from the DC motor equations
\[ v_a(t) = L \frac{d i_a(t)}{dt} + R\, i_a(t) + K_e \omega(t), \quad J \frac{d \omega(t)}{dt} + b\, \omega(t) = K_t i_a(t) - T_L(t), \]
derive the transfer function \( \Omega(s)/V_a(s) \) under the assumptions \( T_L(t) = 0 \) and zero initial conditions.
Solution:
Taking Laplace transforms:
\[ V_a(s) = (L s + R) I_a(s) + K_e \Omega(s), \quad (J s + b)\Omega(s) = K_t I_a(s). \]
Solve the mechanical equation for \( I_a(s) \):
\[ I_a(s) = \frac{(J s + b)\Omega(s)}{K_t}. \]
Substitute into the electrical equation:
\[ \begin{aligned} V_a(s) &= (L s + R)\frac{(J s + b)\Omega(s)}{K_t} + K_e \Omega(s) \\ &= \left[ \frac{(L s + R)(J s + b)}{K_t} + K_e \right]\Omega(s). \end{aligned} \]
Therefore,
\[ \frac{\Omega(s)}{V_a(s)} = \frac{1}{\dfrac{(L s + R)(J s + b)}{K_t} + K_e} = \frac{K_t}{(L s + R)(J s + b) + K_t K_e}. \]
This matches the expression obtained in Section 2 and completes the derivation.
Problem 2 (PI Speed Controller Design): For the first-order speed model
\[ G_\omega(s) = \frac{K_m}{T_m s + 1} \]
and PI controller \( C(s) = K_p + K_i/s \), show that the closed-loop characteristic polynomial is
\[ \varphi(s) = T_m s^2 + (1 + K_m K_p) s + K_m K_i. \]
Solution:
The open-loop transfer function is
\[ L(s) = C(s) G_\omega(s) = \left(K_p + \frac{K_i}{s}\right)\frac{K_m}{T_m s + 1} = \frac{K_m(K_p s + K_i)}{s(T_m s + 1)}. \]
The closed-loop transfer function is
\[ \frac{\Omega(s)}{\Omega_r(s)} = \frac{L(s)}{1 + L(s)}. \]
Multiply numerator and denominator by \( s(T_m s + 1) \):
\[ \frac{\Omega(s)}{\Omega_r(s)} = \frac{K_m(K_p s + K_i)} {s(T_m s + 1) + K_m(K_p s + K_i)}. \]
Expand the denominator:
\[ s(T_m s + 1) + K_m(K_p s + K_i) = T_m s^2 + s + K_m K_p s + K_m K_i = T_m s^2 + (1 + K_m K_p) s + K_m K_i. \]
Hence, the characteristic polynomial is indeed \( \varphi(s) = T_m s^2 + (1 + K_m K_p) s + K_m K_i \).
Problem 3 (Zero Steady-State Error for Speed): Using the speed loop with PI controller, show that the steady-state error for a step speed reference is zero, assuming the closed-loop system is asymptotically stable.
Solution:
In Chapter 8, a system with open-loop transfer function \( L(s) \) and one integrator (i.e., \( L(s) \) has a factor \( 1/s \)) is a type 1 system. The steady-state error for a unit-step input is
\[ e_\infty = \lim_{t \to \infty} e(t) = \lim_{s \to 0} s E(s). \]
For unity feedback, \( E(s) = \dfrac{1}{1 + L(s)} \Omega_r(s) \). For a unit-step, \( \Omega_r(s) = 1/s \), so
\[ E(s) = \frac{1}{1 + L(s)} \cdot \frac{1}{s}. \]
Then
\[ e_\infty = \lim_{s \to 0} s E(s) = \lim_{s \to 0} \frac{1}{1 + L(s)}. \]
Since \( L(s) \) contains \( 1/s \) (due to the integral term of the PI), we have \( L(s) \to \infty \) as \( s \to 0 \), provided the controller gains are positive and the closed-loop system remains stable. Thus,
\[ e_\infty = \lim_{s \to 0} \frac{1}{1 + L(s)} = 0. \]
Therefore, the PI speed controller yields zero steady-state error for a step speed reference.
Problem 4 (Outer Loop Gain for Position): The effective plant for the outer position loop is
\[ G_\text{pos,eff}(s) = \frac{1}{s(\tau_v s + 1)}, \]
and the outer controller is \( C_p(s) = K_p^\theta \). Show that the closed-loop characteristic polynomial is \( \varphi_\theta(s) = \tau_v s^2 + s + K_p^\theta \) and compute \( K_p^\theta \) to achieve a desired natural frequency \( \omega_n^\theta \).
Solution:
The open-loop transfer function is
\[ L_\theta(s) = C_p(s) G_\text{pos,eff}(s) = \frac{K_p^\theta}{s(\tau_v s + 1)}. \]
The closed-loop transfer function from \( \Theta_r(s) \) to \( \Theta(s) \) is
\[ \frac{\Theta(s)}{\Theta_r(s)} = \frac{L_\theta(s)}{1 + L_\theta(s)} = \frac{K_p^\theta}{s(\tau_v s + 1) + K_p^\theta}. \]
The denominator is
\[ s(\tau_v s + 1) + K_p^\theta = \tau_v s^2 + s + K_p^\theta, \]
so \( \varphi_\theta(s) = \tau_v s^2 + s + K_p^\theta \). To match a standard second-order polynomial
\[ \varphi_\theta^\text{des}(s) = \tau_v\left( s^2 + 2 \zeta_\theta \omega_n^\theta s + (\omega_n^\theta)^2 \right), \]
equate constant terms:
\[ K_p^\theta = \tau_v (\omega_n^\theta)^2. \]
Thus, once \( \tau_v \) is known from the speed loop and \( \omega_n^\theta \) is specified, the outer-loop proportional gain is uniquely determined by \( K_p^\theta = \tau_v (\omega_n^\theta)^2 \).
12. Summary
In this lesson we developed a first-principles model of a DC motor, obtained Laplace-domain transfer functions for speed and position, and showed how electrical and mechanical parameters combine into effective gain and time constant parameters. We then designed a PI speed controller using pole placement to match desired second-order dynamics and extended the framework to cascaded position control via an outer loop.
The analysis used tools built in earlier chapters: Laplace transforms, transfer functions, steady-state error constants, and second-order time- domain metrics. Implementation examples in Python, C++, Java, MATLAB/Simulink, and Wolfram Mathematica demonstrate how linear models of DC motors can be simulated and controlled in software, anticipating more complex industrial mechatronic case studies in subsequent lessons.
13. References
- Pontryagin, L.S. (1962). Ordinary Differential Equations. Addison–Wesley. (Foundational theory for linear system dynamics.)
- Kalman, R.E. (1960). Contributions to the theory of optimal control. Boletín de la Sociedad Matemática Mexicana, 5(2), 102–119.
- Zames, G. (1966). On the input–output stability of time-varying nonlinear feedback systems. Part I: Conditions derived using concepts of loop gain, conicity, and positivity. IEEE Transactions on Automatic Control, 11(2), 228–238.
- Åström, K.J., & Hägglund, T. (1984). Automatic tuning of simple regulators with specification on phase and amplitude margins. Automatica, 20(5), 645–651.
- Middleton, R.H., & Goodwin, G.C. (1986). Adaptive control of time-varying linear systems. IEEE Transactions on Automatic Control, 31(10), 911–918.
- Ioannou, P.A., & Sun, J. (1996). Robust Adaptive Control. Prentice Hall. (Includes rigorous treatment of motor-type plants.)
- Ortega, R., Loria, A., Nicklasson, P.J., & Sira-Ramírez, H. (1998). Passivity-Based Control of Euler–Lagrange Systems. Springer. (Theoretical framework applicable to electromechanical drives.)
- Bement, M.T., & Paden, B. (1990). A frequency domain approach for tracking and disturbance rejection in servo systems. International Journal of Control, 52(4), 803–824.
- Slotine, J.-J.E., & Li, W. (1991). Applied Nonlinear Control. Prentice Hall. (Chapters on motor drives and servo systems with rigorous linearization arguments.)
- Lurie, B.J., & Enright, P.J. (2000). Classical feedback control with modern applications. Proceedings of the IEEE, 88(4), 615–641.