Smith's Predictor¶
This example develops a control system for an object with a large time delay. To control objects with a delay, the Smith predictor is often used, which can predict what signal should appear at the output of the object before it actually appears there [1].
Pkg.add(["ControlSystems", "ControlSystemsBase"])
using ControlSystemsBase, Plots
using ControlSystems # Библиотека для моделирования системы задержек
The control object is given by Eq: $P = P_0e^{-sτ}$, where $P_0 = {1 \over s+1}$.
P0 = ss(-1, 1, 1, 0) # Объект управления без задержки
By varying the delay τ , we can see how the system will behave at different delays.
τ = 8 # Величина задержки
P = delay(τ) * P0 # Объект управления с задержкой
The structural diagram of the control system with Smith predictor is shown in the figure below. It contains an additional internal feedback loop that contains a model of the control object $P_0$. The additional loop generates a signal identical to that which will eventually appear at the output of the system and feeds it to the input of the controller $C_0$ until a signal from the main feedback loop appears. [2]
We use a PI controller as a regulator $C_0$.
ω0 = 2
ζ = 0.7
C0, _ = placePI(P0, ω0, ζ) # ПИ-регулятор
Smith's Predictor $C$:
C = feedback(C0, (1.0 - delay(τ))*P0) # Формирование внутренней обратной связи
Let us construct the transient process.
The transfer function of the perturbing influence f:
${Y \over F} = {P \over (1+PC)}$ = feedback(P, C)
.
Transfer function of a closed-loop system :
${Y \over R} ={PC \over (1+PC)}$ = feedback(P*C, 1)
G = [feedback(P*C, 1) feedback(P, C)] # Эталонный шаг при t = 0 и шаг возмущения нагрузки при t = 15
fig_timeresp = plot(lsim(G,(_,t) -> [1; t >= 15], 0:0.1:40), title="τ = $τ")
Let us construct the logarithmic amplitude-phase frequency response of the predictor and compare it with the frequency response of the negative delay $e^{sτ}$, which would be an ideal controller (usually such a controller cannot be realised in practice).
C_pred = feedback(1, C0*(ss(1.0) - delay(τ))*P0)
fig_bode = bodeplot([C_pred, delay(-τ)], exp10.(-1:0.002:0.4), ls=[:solid :solid :dash :dash], title="", lab=["Предиктор Смита" "" "Идеальный контроллер" ""])
plot!(yticks=[0.1, 1, 10], sp=1)
plot!(yticks=0:180:1080, sp=2)
Let us construct the Nyquist hodograph.
fig_nyquist = nyquistplot(C * P, exp10.(-1:1e-4:2), title="τ = $τ")
You can repeat the script by changing the delay value τ
in line 4. Note that the hodograph describes -1 when τ > 2.99.
Conclusion¶
In this case study, we have learnt methods for designing time delayed object control systems using Smith's predictor. We have also looked at various methods of analysing such systems and visualising them.