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
Copy file name to clipboardExpand all lines: class01/class01_intro.jl
+275-7Lines changed: 275 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,8 @@ begin
64
64
[^ArmManip]: Guechi, E.H., Bouzoualegh, S., Zennir, Y. and Blažič, S., 2018. [MPC control and LQ optimal control of a two-link robot arm: A comparative study](https://www.mdpi.com/2075-1702/6/3/37). Machines, 6(3), p.37.
65
65
66
66
[^ZachMIT]: Zachary Manchester talk at MIT - [MIT Robotics - Zac Manchester - Composable Optimization for Robotic Motion Planning and Control](https://www.youtube.com/watch?v=eSleutHuc0w&ab_channel=MITRobotics).
67
+
68
+
[^Hespanha]: Hespanha, J.P., 2018. Linear systems theory. Princeton university press.
**Attention!** The linearization describes perturbations around the reference $(x_e,u_e)$; it is valid only while $\|\delta x\|$ and $\|\delta u\|$ remain small.
819
871
820
872
""")
821
873
@@ -829,14 +881,19 @@ The problem becomes convex!!
829
881
# ╔═╡ 2936c97e-a407-4e56-952f-0a2dfb7acf83
830
882
md"""## Equilibria
831
883
832
-
A point at which the system is and will remain at "rest":
884
+
A **Equilibrium** point $(x_{\mathrm{eq}},u_{\mathrm{eq}})$ is one at which the system is and will remain at "rest":
833
885
834
886
```math
835
-
\dot{x} = f(x,u) = 0
887
+
\dot{x} = f(x_{\mathrm{eq}},u_{\mathrm{eq}}) = 0
836
888
```
837
889
838
890
The root of the dynamic equations!
839
891
892
+
In this case,
893
+
894
+
```math
895
+
x(t) = x_{\mathrm{eq}}, \; u(t) = u_{\mathrm{eq}} \;\forall t
896
+
```
840
897
"""
841
898
842
899
# ╔═╡ 1a154d04-2b33-43b6-9cb6-accd935de7b7
@@ -1081,6 +1138,208 @@ But the $2^{\text{nd}}$ case is still not asymptotically stable!
1081
1138
# ╔═╡ da8a1e40-7e7c-472a-933a-c585754270bd
1082
1139
question_box(md"Can we add a continuous controler to make it asymptotically stable?")
1083
1140
1141
+
# ╔═╡ 211f75ed-8acb-4261-bf97-8fc70be2a79b
1142
+
Columns(md"""
1143
+
### Example Unicycle Model
1144
+
1145
+
Consider a unicycle moving in a plane, described by the continuous-time dynamics
1146
+
1147
+
```math
1148
+
\dot p_x = v\cos\theta,\qquad
1149
+
\dot p_y = v\sin\theta,\qquad
1150
+
\dot\theta = \omega ,
1151
+
```
1152
+
1153
+
where the control input is given by
1154
+
$u = [v,\,\omega]^\top$ and $(p_x, p_y)$ are the Cartesian coordinates of the wheel and $\theta$ its orientation.
1155
+
1156
+
#### Coordinate transformation
1157
+
1158
+
Introduce the new coordinates
1159
+
1160
+
```math
1161
+
x = \begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix}
1162
+
:=
1163
+
\begin{bmatrix}
1164
+
p_x\cos\theta + (p_y-1)\sin\theta \\[4pt]
1165
+
-\,p_x\sin\theta + (p_y-1)\cos\theta \\[4pt]
1166
+
\theta
1167
+
\end{bmatrix}
1168
+
```
1169
+
1170
+
This transformation can be viewed as a rotation of the position vector about $\theta$.
Foldable(md"#### Linearization around the equilibrium ($x^{\ast} = 0, \; u^{\ast} = 0$)",
1210
+
md"""
1211
+
Define perturbations $\delta x = x - x^{\ast}, \;\delta u = u - u^{\ast}$.
1212
+
The linearized dynamics are obtained from the Jacobians
1213
+
1214
+
```math
1215
+
A = \left.\frac{\partial f}{\partial x}\right|_{(x^{\ast},u^{\ast})},
1216
+
\quad
1217
+
B = \left.\frac{\partial f}{\partial u}\right|_{(x^{\ast},u^{\ast})}.
1218
+
```
1219
+
1220
+
Evaluating,
1221
+
1222
+
```math
1223
+
A = 0_{3\times 3},
1224
+
\qquad
1225
+
B =
1226
+
\begin{bmatrix}
1227
+
1 & 0 \\
1228
+
0 & 0 \\
1229
+
0 & 1
1230
+
\end{bmatrix}.
1231
+
```
1232
+
1233
+
"""
1234
+
)
1235
+
1236
+
# ╔═╡ db1c0c1e-9f3b-44b6-8974-6d5ab5e5e8b7
1237
+
md"""
1238
+
## Local Linearizations around Trajectories
1239
+
1240
+
Often it is convenient to consider perturbations around an arbitrary (feasible) reference trajectory (*ref*) ($x_{ref}(t)$, $u_{ref}(t)$) instead of an equilibrium point.
1241
+
1242
+
Now, assuming an input perturbed by a small signal $\delta u(t)$:
1243
+
```math
1244
+
u(t) = u_{ref}(t) + \delta u(t), \quad t \ge 0
1245
+
```
1246
+
and a deviation from the reference initial condition:
1247
+
```math
1248
+
x(0) = x_{ref}(0) + \delta x(0)
1249
+
```
1250
+
We can define the deviation from the reference state as:
1251
+
```math
1252
+
\delta x(t) = x(t) - x_{ref}(t), \quad t \ge 0
1253
+
```
1254
+
To determine the evolution of $\delta x(t)$, we can expand the dynamics around the reference point using a Taylor expansion:
> In general, local linearizations around trajectories lead to LTV systems because the partial derivatives need to be computed along the trajectory. However, for some nonlinear systems there are trajectories for which local linearizations actually lead to LTI systems. For models of vehicles (cars, airplanes, helicopters, hovercraft, submarines, etc.) trajectories that lead to LTI local linearizations are called trimming trajectories. They often correspond to motion along straight lines, circumferences, or helices. [^Hespanha]
1268
+
1269
+
"""
1270
+
1271
+
# ╔═╡ 04b6560f-aee2-41fd-86fa-d075f0b3d738
1272
+
md"""
1273
+
### Example Unicycle Model
1274
+
1275
+
Consider the Reference motion
1276
+
```math
1277
+
\omega(t)=1,\qquad v(t)=1,\qquad
1278
+
p_x(t)=\sin t,\qquad
1279
+
p_y(t)=1-\cos t,\qquad
1280
+
\theta(t)=t,\quad t\ge 0 .
1281
+
```
1282
+
Then
1283
+
```math
1284
+
\dot p_x(t)=\cos t = v\cos\theta,\qquad
1285
+
\dot p_y(t)=\sin t = v\sin\theta,\qquad
1286
+
\dot\theta(t)=1=\omega,
1287
+
```
1288
+
so this is indeed a solution of the system.
1289
+
1290
+
In the rotated coordinates,
1291
+
```math
1292
+
\begin{align}
1293
+
x_1 &= p_x\cos\theta + (p_y-1)\sin\theta \\
1294
+
&= \sin t\cos t + (-\cos t)\sin t = 0, \\
1295
+
x_2 &= -p_x\sin\theta + (p_y-1)\cos\theta \\
1296
+
&= -\sin^2 t - \cos^2 t = -1, \\
1297
+
x_3 &=\theta=t.
1298
+
\end{align}
1299
+
```
1300
+
1301
+
Hence the reference trajectory in $x$--coordinates is
0 commit comments