Skip to content

Commit ee71b4d

Browse files
committed
Added PID
1 parent c16d5e3 commit ee71b4d

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

BlockB/SysReg_crashcourse_FreqDomain_BlockB_05_ControlSynthesis.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,25 @@
169169
# %% [markdown]
170170
# <div style="text-align:center;background-color:tomato;">End of lecture "Frequency Domain Design I & II"</div>
171171
#
172+
# # I promised PID
173+
# **Note: PID is a regulator, not a tracker, apply it to the error signal.**
174+
#
175+
# So in the slides there is some info on time-domain tuning of PID, mostly [Ziegler-Nichols](https://en.wikipedia.org/wiki/Ziegler%E2%80%93Nichols_method) methods. Generally they're okay, not very impressive
176+
# though and almost never optimal. I'm here to show you that PID has loop shaping equivalents. Starting with the standard ideal PID controller:
177+
# $$ C(s) = K_p + \frac{K_i}{s} + sK_d. $$
178+
# Rewriting gives
179+
# $$ C(s) = K_p\frac{s}{s} + \frac{K_i}{s} + sK_d\frac{s}{s} = \frac{K_d s^2 + K_p s + K_i}{s} = K_d \frac{s^2 + \frac{K_p}{K_d} s + \frac{K_i}{K_d}}{s}. $$
180+
# Now we recognise a zero pair and integrator, and control gain $K_d$. Retrieving the damping ratio and natural frequency of this zeros pair gives
181+
# $$\left.\begin{aligned} &2\zeta\omega_0 = \frac{K_p}{K_d} \\ &\omega_0^2 = \frac{K_i}{K_d} \end{aligned} \right\}\therefore (\omega_0, \zeta) = \left(\sqrt{\frac{K_i}{K_d}},
182+
# \frac{K_p\sqrt{\frac{K_i}{K_d}}}{2K_i}\right).$$
183+
# And there you have the equivalence between loop shaping and PID tuning. We have
184+
# | Controller | Tools |
185+
# | ---------- | ----- |
186+
# | PID | Gain, zero pair, integrator |
187+
# | PI | Gain, one zero, integrator |
188+
# | PD | Gain, one zero |
189+
#
190+
# So PID is just a limited version of loopshaping.
191+
#
172192
# # Closing remark
173193
# I'm so sorry, but everything we've done is, technically speaking, bachelor level control engineering.

0 commit comments

Comments
 (0)