Covers: Lesson 07 Difficulty: Hard
You’re designing a cascade controller for a robot wheel drive: - Motor electrical time constant: $\tau_e = 1.5$ ms - Motor mechanical time constant: $\tau_m = 40$ ms - Position loop required bandwidth: 5 Hz
a) What bandwidth should the current loop have? (Use the 10:1 rule.)
b) What bandwidth should the speed loop have?
c) What sample rates would you choose for each loop?
d) If the current loop bandwidth is limited to 2 kHz by the PWM frequency, what is the maximum achievable position loop bandwidth?
The motor’s electrical model is: $V = L_a \frac{di}{dt} + R_a i + V_{emf}$
With $L_a = 0.5$ mH, $R_a = 0.5 \Omega$, PWM voltage range: 0–24V, max current: 10A.
a) Design a PI current controller using the pole cancellation method: - Set $K_p / K_i = L_a / R_a$ (cancels the electrical pole) - Choose $K_p$ for a bandwidth of 2 kHz
b) What is the closed-loop current step response?
c) Add current saturation at ±10A. What anti-windup method would you use?
The current loop from Problem 2 is now your “inner actuator” for the speed loop.
Model it as: $G_{current}(s) \approx \frac{1}{\tau_{cl}s + 1}$ where $\tau_{cl}$ is the closed-loop current bandwidth.
Plant: $\frac{\omega(s)}{T(s)} = \frac{1}{Js + B}$ with $J = 0.001$ kg·m², $B = 0.005$ N·m·s/rad.
a) What is the combined plant from current setpoint to speed?
b) Design a PI speed controller for 200 Hz bandwidth.
c) Simulate a speed step from 0 to 10 rad/s. What does the current setpoint look like during the transient?
You have a cascade system with current, speed, and position loops. The plant parameters are uncertain — you only know rough estimates.
Describe the step-by-step tuning procedure: a) Which loop do you tune first? b) How do you validate each loop before moving to the next? c) What tests do you perform? d) What should you look for in the frequency response?
The speed loop commands 3A from the current loop. The current loop is saturated at 10A due to a load disturbance.
a) What happens to the speed loop’s integral term?
b) How does cross-loop anti-windup work? Write pseudocode.
c) Without cross-loop anti-windup, the speed overshoots by 40% when the disturbance clears. With it, overshoot drops to 8%. Explain why.
# In speed loop:
speed_error = speed_ref - speed_actual
speed_integral += speed_error * dt
# Compute ideal current command
i_cmd = Kp_speed * speed_error + Ki_speed * speed_integral
# Apply current limit
i_cmd_sat = clamp(i_cmd, -I_MAX, I_MAX)
# Cross-loop anti-windup: if current loop is saturated,
# back-calculate the speed integral
if i_cmd != i_cmd_sat:
speed_integral -= (i_cmd - i_cmd_sat) / Ki_speed