Controllers
Khaled Wahba
November 22, 2024
Any questions or issues?
More in-lab hours next week needed?
Role of github copilot (or similar) for development?
Multirotor Control History
Geometric Control
1D, 2D, 3D Multirotor Control
Controller Stability
\(f = \frac{m}{\cos(\theta)} + \mathbf{g} +
k_p e_p + k_d e_d\)
\(\boldsymbol{\tau_z} = k_{\theta}(\theta_d -
\theta) + k_{\omega}(\dot{\theta_d} - \dot{\theta})\)
More details in (Mellinger 2012) to see the
problems when using
Euler angles representations
Why “Geometric”?
recall: quadrotors are underactuated systems!
\(e_p = z_d - z\), \(e_d = \dot{z}_d - \dot{z}\)
\(f_1 = m(\ddot{z}_d + k_pe_p + k_de_d + g)\), \(\quad\forall k_p, k_d > 0\)
2D Multirotor
3D Multirotor
Control Structure
\(\mathbf{F}_d = m(\ddot{\mathbf{p}}_d + \mathbf{K}_p \mathbf{e}_p + \mathbf{K}_v \mathbf{e}_v + \mathbf{g})\)
\(f = \mathbf{F}_d \cdot \mathbf{R}e_3\)
where \(\mathbf{K}_p, \mathbf{K}_v \in \mathbb R^{3\times 3}\) are positive definite diagonal gain matrices
We need to define a desired rotation \(\mathbf{R}_d\) that
can align \(z_b\) with \(\mathbf{F}_d\)
\(\mathbf{R}_d = [x_{b_d}\quad y_{b_d}\quad
z_{b_d}]\)
Define \(\mathbf{x}_{b_d} = [\cos(\psi) \quad \sin(\psi) \quad 0]^T\) (e.g., \(\psi = 0\))
\(\mathbf{z}_{b_d} =
\text{normalize}(\mathbf{F}_d)\)
\(\mathbf{y}_{b_d} = \frac{\mathbf{z}_{b_d} \times \mathbf{x}_{b_d}}{\|\mathbf{z}_{b_d} \times \mathbf{x}_{b_d}\|}\)
\(\mathbf{R}_d = \begin{bmatrix} \mathbf{y}_{b_d} \times \mathbf{z}_{b_d} & \mathbf{y}_{b_d} & \mathbf{z}_{b_d} \end{bmatrix} \in SO(3)\)
\(\mathbf{\tau}_u = -\mathbf{K}_R \mathbf{e}_R - \mathbf{K}_\omega \mathbf{e}_\omega + \omega \times \mathbf{J} \omega - \mathbf{J} (\hat{\omega} \mathbf{R}^T \mathbf{R}_d \omega_d - \mathbf{R}^T \mathbf{R}_d \dot{\omega}_d)\)
\(\Psi(\mathbf{R}, \mathbf{R}_d) = \frac{1}{2} \text{tr}(\mathbf{I} - \mathbf{R}^T \mathbf{R}_d)\)
\(\mathbf{e}_R = \frac{1}{2} \left( \mathbf{R}^T_d \mathbf{R} - \mathbf{R}^T \mathbf{R}_d \right)^\vee\), \((\cdot)^\vee\): \(SO(3) \rightarrow \mathbb R^3\)
\(\mathbf{e}_\omega = \omega - \mathbf{R}^T \mathbf{R}_d \omega_d\)
\(f = m(\ddot{\mathbf{p}}_d + \mathbf{K}_p \mathbf{e}_p + \mathbf{K}_v \mathbf{e}_v + \mathbf{g}) \cdot \mathbf{R} \mathbf{e}_3\)
\(\mathbf{\tau}_u = -\mathbf{K}_R \mathbf{e}_R - \mathbf{K}_\omega \mathbf{e}_\omega + \omega \times \mathbf{J} \omega - \mathbf{J} (\hat{\omega} \mathbf{R}^T \mathbf{R}_d \omega_d - \mathbf{R}^T \mathbf{R}_d \dot{\omega}_d)\)
\(\mathbf{h}_\omega = \frac{m}{f} (\dddot{\mathbf{p}_d} - (\mathbf{z}_{b_d} \cdot \dddot{\mathbf{p}_d})\mathbf{z}_{b_d})\), \(\quad \mathbf{e}_3 = [0,0,1]^T\)
\(\omega_{x_d} = -\mathbf{h}_\omega \cdot \mathbf{y}_{b_d}, \quad \omega_{y_d} = \mathbf{h}_\omega \cdot \mathbf{x}_{b_d}, \quad \omega_{z_d} = \dot{\psi}\mathbf{e}_{3}\cdot\mathbf{z}_{b_d}\)
Lyapunov stability analysis
Proof is in the appendix (Lee, Leok, and McClamroch 2010b)
The dynamics are exponentially stable, when the initial conditions satisfy two conditions:
\(\Psi (\mathbf{R}, \mathbf{R}_d) < 2\)
\(\|\mathbf{e}_\omega\|^2 < \frac{2}{\lambda_{\text{max}}(\mathbf J)} k_R (2 - \Psi (\mathbf{R}, \mathbf{R}_d))\),
\[ \begin{aligned} \arg\min_{\mathbf u} \|\mathbf x_N - \mathbf x_{N_d}\| + \sum_{k=0}^{N-1} \left( \|\mathbf x_k - \mathbf x_{k_d}\| + \|\mathbf u_k - \mathbf u_{k_d}\| \right) s.t.\newline \mathbf x_0 = \text{current state}\\ \mathbf x_{k+1} = \text{step}(\mathbf x_{k}, \mathbf u_{k})\\ \text{actuation and state bounds} \end{aligned} \]
3 Crazyflies transporting a triangular payload with cables
Hierarchical control structure multiple UAVs transporting a
payload
Implement the Lee geometric controller for the Bitcraze Crazyflie 2.1 robot. Test and tune in your simulator (Assignment 1). Execute physical test flights with your controller and report the tracking errors.
Testing steps:
Steps:
f32
and switch from std to coreNext 3.75 Weeks
?