You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# | Low | High gain ensures unscaled tracking | Low gain ensures disturbance rejection |
944
944
# | Cross-over | Ensure good GM and PM | Ensure good SM |
945
945
# | High | Low gain ensures measurement noise rejection | - |
946
946
#
947
+
# That unscaled tracking cell confused me slightly, so briefly why: the transfer function $G_{yr} = TF = \frac{L}{1+L}F$. Ignoring $F$ for a second, $\lim_{|L|\rightarrow\infty}\frac{L}{1+L} = 1$, meaning there
948
+
# is unitary gain for constant input, i.e. unscaled reference tracking.
949
+
#
947
950
# ## Easier said...
948
-
# So lets run an example and you'll understand better (I hope). We start with a unitary feedback controller and see how we're doing and what plant we have.
951
+
# So lets run an example and you'll understand better (I hope). This will be very much a Plato-style of explanation (coincidentally my favourite style). We start with a unitary
952
+
# feedback controller and see what plant we're dealing with.
# What should you get from this plot? Well, lets start with the crossover frequencies: they're around 30 or 300 rad/s. The loop transfers below and above have a low gain. Our margins are looking good however
989
+
# and we can gain some performance for sure. Lets work low to high frequencies. For the lower frequencies our sensitivity needs low gains, so our loop needs high gains, also ensuring good tracking.
990
+
# It doesn't, so lets add an integrator:
991
+
992
+
# %%
993
+
SYS.Cpoles= [0]
994
+
SYS.OM=np.logspace(-5, 5, 1000)
979
995
996
+
[a.cla() forainax]
980
997
SYS.plot_LS(ax)
981
998
display(fig)
982
999
1000
+
# %% [markdown]
1001
+
# We need a bit more downslope around 1E-3 rad/s, i.e. more poles:
1002
+
1003
+
# %%
1004
+
SYS.Cpoles= [0, -1e-3]
1005
+
1006
+
[a.cla() forainax]
1007
+
SYS.plot_LS(ax)
1008
+
display(fig)
1009
+
1010
+
# %% [markdown]
1011
+
# Okaayyy, lower frequencies looking good. Zooming in on the crossover frequency next:
1012
+
1013
+
# %%
1014
+
[a.set_xlim([1e-2, 1e2]) forainax[:3]]
1015
+
ax[0].set_ylim([1e-3, 5e1])
1016
+
display(fig)
1017
+
1018
+
# %% [markdown]
1019
+
# Notes: our PM is very large, as well as our GM. In this case we can decrease both of these with the gain. Lets aim for $35^\circ$ PM, looking at the phase plot that happens at 50 or so rad/s, the
1020
+
# magnitude there now is $5E-4$. *Therefore*, our gain can be $2E3$:
1021
+
1022
+
# %%
1023
+
SYS.Cgain=2e2
1024
+
1025
+
[a.cla() forainax]
1026
+
SYS.plot_LS(ax)
1027
+
display(fig, np.pi/3)
1028
+
1029
+
# %% [markdown]
1030
+
# Honestly I suck at loop shaping.
1031
+
#
1032
+
# ## Feedforward control
1033
+
# We've been ignoring the feedforward block up to now, but really it's very powerful when you can measure the output noise.
1034
+
# Consider when there's no input noise $d$, which is often the case, and we add an extra feedforward control $u_\text{ff}$
1035
+
# such that $u = Ce + u_\text{ff}$. Now append/recall $y = TFr + PSu_\text{ff} + Sn$
1036
+
# Then with the measurement of the output noise $n$, define $u_\text{ff} = P^{-1}Fr - P^{-1}n$
1037
+
# $$ y = (1- S)Fr + PSu_\text{ff} + Sn = Fr - SFr + PS(P^{-1}Fr - P^{-1}) + Sn = Fr - SFr + PSP^{-1}Fr - PSP^{-1}n + Sn $$
1038
+
# $$ = Fr - SFr + SFr - Sn + Sn = Fr.$$
1039
+
# This means you have perfect tracking. However, inverting the plant might not always be possible (non minimum phase systems for example).
1040
+
# There are more tricks like this when you have knowledge of your disturbances.
983
1041
984
1042
# %% [markdown]
985
1043
# # Fundamental Limitations
986
-
# I'm so sorry, but everything we've done is technically speaking bachelor level control engineering. Now that we're nearing the end of the course content, we run into problems that we ignored before.
1044
+
# ## Waterbed effect
1045
+
# The funny thing about control is, the most important proofs are the proofs that say that something
1046
+
# is **impossible**. These are the bounds you cannot circumvent. Bode's integral formula, otherwise known as the waterbed effedct,
1047
+
# is one of these. It is defined as: assume L has relative degree $geq$ 2 and $N_p$ RHP-poles $p_i$, then
# This is somewhat reminiscent of the Nyquist plot. This integral is basically the integral of the vector going from -1 to the Nyquist plot.
1050
+
# Iff this integral makes a half ellips on the onesided Nyquist contour, there is an encirclement, there is a RHP-pole.
1051
+
#
1052
+
# What it's also saying is: you can never change the value of that integral (assuming you don't add RHP poles). Therefore, if you change C
1053
+
# to take some magnitude in S away, it has to come back at other frequencies.
1054
+
#
1055
+
# ## Time delays
1056
+
# Time delays are annoying, because they put a hard limit on your bandwidth. Why? Well, a time delay $e^{-\theta s}$, has an idealized $T(s)=e^{-\theta s}$.
1057
+
# The bandwidth is defined as $|T(i\omega_\text{B})| = \frac{1}{\sqrt2}$. Also
0 commit comments