Geometric Control of Quadrotor on SE(3)¶
This page is under construction
Nonlinear dynamics naturally evolve on non-flat spaces, and controlling them using flat-space representations often introduces singularities and global instability. For systems like quadcopters, whose dynamics lie on the manifold \(SE(3)\), geometric control offers a framework to design controllers that intrinsically respect the manifold’s structure.
Euler angle-based controllers exhibit singularities (gimbal lock) when representing complex rotational maneuvers. Quaternion-based controllers can avoid singularities, but they represent attitude by double-covering the configuration of special orthogonal group \(SO(3)\). Geometric control, based on Lie theory, avoids complexities, discontinuities, and ambiguities [1].
Although quadcopters are underactuated systems with four inputs and six degrees of freedom, geometric control achieves asymptotic tracking of a subset of outputs, such as position or attitude, while maintaining stability in other degrees of freedom [1].
Info
This page focuses on derivation of the error equations from [1] and providing some intuition behind them. We don't explain the dynamics of quadcopters here; for that, you can refer to Quadcopter Dynamics for details on quadcopter equations of motion.
Quadcopters equations of motion in short,
where :
- \(m \in \mathbb{R}\) is the total mass
- \(J \in \mathbb{R}^{3 \times 3}\) is the inertia matrix with respect to the body-fixed frame
- \(R \in SO(3)\) is the rotation matrix from the body frame to the inertial frame
- \(\dot{x}\) is the position derivative (velocity) in the inertial frame
- \(\dot{v}\) is the acceleration in the inertial frame
- \(\hat{\Omega}\) is the skew-symmetric matrix of angular velocity \(\Omega\)
- \(f\) is the total thrust force
- \(M\) is the moment vector applied to the body-fixed frame
- \(z_W\) is z-axis in inertial reference frame
- \(z_B\) is z-axis in body frame
Lie Algebra \(\mathfrak{g}\) \(\leftrightharpoons\) Euclidean Space \(\mathbb{R}\)
- Hat map \((\hat{\cdot}) : \mathbb{R}^3 \rightarrow \mathfrak{so}(3)\) for mapping vector in \(\mathbb{R}^3\) to lie algebra of \(SO(3)\).
- Vee map \(({\cdot}^\vee) : \mathfrak{so}(3) \rightarrow \mathbb{R}^3\) is the inverse of hat map.
Lie Theory for robotics explain more here.
The Error Functions¶
Lee, et. al use multiple controller to achieve asymptotic output tracking of both attitude and position; attitude control, position control, and velocity control. Complex flight maneuver can be defined by specifying a concatenation of flight modes together with conditions for switching between them.
Attitude Error¶
This type of control mode requires desired attitude \(R_d(t) \in SO(3)\) and current attitude \(R(t) \in SO(3)\) are function of time, where represented as \(R_d\) and \(R\) for simplified the derivation. Then, they choose the error function on \(SO(3) \times SO(3)\) as follows :
\(R_d^TR\) is relative attitude that transforms a vector from the current frame to the desired frame. If current attitude \(R\) align to \(R_d\) it makes \(R_d^TR\) equals the identity matrix \(I\), and the error function \(\Gamma(R, R_d)\) becomes zero.
How \(R_d^TR=I\)?
This follows from the fundamental axiom of groups, which states that the product of an element and its inverse is the identity element:
For \(R \in SO(3)\), where \(R^{-1}=R^T\) because of rotation matrices are orthogonal. Therefore, the product of a rotation matrix and its inverse is:
So, if \(R_d=R\) it will leads to identity.
Analyze Eq. (5),
where \(\theta\) is angle of rotation. The function \(\Gamma\) is locally positive definite \((\Gamma \ge 0)\) when relative angle less than \(180^\circ\).
- The \(\cos(\theta) \in [−1, 1]\) for \(\theta \in [0, \pi]\).
- \(\Gamma(R, R_d)=0\), if \(\theta=0^\circ\).
- \(\Gamma(R, R_d) > 0\), for \(0^\circ < \theta < 180^\circ\).
Why exclude \(\theta = 180^\circ\)?
Based on [2] (Chapter 11), we can take attitude error \(e_R\) by take derivative of error function \(\Gamma \in SO(3) \times SO(3)\) with variation of rotation matrix expressed as \(\partial R = R\hat{\omega}\) for \(\omega \in \mathbb{R}^3\). Then, the variational derivative when dealing with variation of rotation expressed as follows :
By using \(\frac{\partial}{\partial X} \mathrm{tr}(XA) = A^T\) [3]
Then, apply Frobenius inner product for both \(D_R \Gamma\) and \(\partial R\) , \(\left< A, B \right> = \mathrm{tr}(A^TB)\)
Use property of hat map, \(-\frac{1}{2}\mathrm{tr}\left(\hat{x}\hat{y}\right) = x^Ty = x\cdot y\), where \((\cdot)\) is a vector dot product. To construct the skew-symmetric, we can use \(\hat{a} = \frac{1}{2}(A-A^T)\) for \(A \in G\) where \(G\) is Lie groups,
Then, rotation error \(e_R \in \mathbb{R}^3\) expressed as follows :
Related to geodesic distance on \(SO(3)\)
Geodesic distance in the special orthogonal group \(SO(3)\) [4] is given by:
Where logarithm of \(R \in SO(3)\) is defined as:
with \(\theta = \cos^{-1} \left( \frac{\mathrm{tr}(R) - 1}{2} \right)\).
Starting from Eq.(20), we derive the geodesic distance, where \(||\cdot||_F\) is Frobenius norm.
Subtitute Eq.(22) to Eq.(20), where \(||A||_F = \sqrt{\left< A, A\right>} = \sqrt{\mathrm{tr}(A^TA)}\)
Since the Frobenius norm is always non-negative, the minus sign \(\mathrm{tr}[\hat{x}\hat{y}] = -2x \cdot y\) is irrelevant. Frobenious norm take \(\sqrt{\|\cdot \|^2}\) [5] for rotation matrix makes minus sign irrelevant.
From dynamics of quadrotor we can get \(\dot{R} = R\hat{\Omega}\) and \(\dot{R}_d = R_d\hat{\Omega}_d\). To compare angular velocity we have to calculate in same tangent space either \(\mathsf{T}_RSO(3)\) or \(\mathsf{T}_{R_d}SO(3)\). Thus, the different of time derivative of rotation \(R\) and \(R\) equivalent to \(R\hat{e}_\Omega\).
Where \(RR^T=I\). Then, re-arrange Eq. (29) to match with \(R\hat{e}_\Omega\).
Thus, we can get \(\hat{e}_\Omega\)
In vector space \(e_\Omega \in \mathbb{R}^3\),
Angular Velocity Error \(e_\Omega\) from Lie Groups Adjoint Action
Since tangent \(\dot{R}\in \mathsf{T}_RSO(3)\) and \(\dot{R}_d \mathsf{T}_{R_d}SO(3)\) are "live" on different tangent spaces, so we need "transform" one of them. Thanks to adjoint action, a distinguished operator on the Lie algebra, this transformation can be achieved.
We have to "transform" \(\dot{R}_d\) to \(\mathsf{T}_RSO(3)\). The relative rotation \(R_{rel}\) of it expressed as \(R^TR_d\) to rotate the vector from \(R_d\)-frame to \(R\)-frame. Where \(R_{rel}\) is an element of \(SO(3)\), then
So, we can applied directly to tangent vector, where \(\hat{\Omega}, \hat{\Omega}_d \in \mathfrak{so}(3)\) and \(\Omega, \Omega_d \in \mathbb{R}^3\)
Thus,
Position and Velocity Errors¶
Error on position control \(e_p\) pretty straightforward, we need desired position \(p_d \in \mathbb{R}^3\), current position \(p_d \in \mathbb{R}^3\), desired linear velocity \(\dot{p}_d \in \mathbb{R}^3\), and current velocity \(v \in \mathbb{R}^3\).
Control Law¶
Three different types of control modes derive different control law. We derived thrust \(f\) and total moment \(M\) control law by using Eq. (2) and Eq. (4), respectively. To recall those,
Attitude Control¶
In this mode, it is possible to neglected translation equation of motion Eq. (2). Then, we need to define gain \(k_R \in \mathbb{R}^{3}_+\) for rotation and \(k_\Omega \in \mathbb{R}^3_+\) for angular velocity. Chosen \(f\) and \(M\) input control :
Subtitute Eq. (38) to Eq. (4),
Take derivative of time of angular velocity error \(\dot{e}_\Omega\) to analyze moments for quadcopter \(M\).
Note that \(\hat{\Omega}^T=-\hat{\Omega}\), \(\dot{R}=R\hat{\Omega}\) and \(\hat{x}x = 0\). Subtitute Eq. (40) to Eq. (44). It leads to,
To find error attitude dynamics of \(\Gamma, e_R, e_\Omega\). We take time derivative of error configuration \(\Gamma\).
Terms \(R_d^TR\) is the function in time.
Where \(\dot{R} = R\hat{\Omega}\), \(\dot{R}_d = R_d\hat{\Omega}_d\), and \(-\hat{A}=\hat{A}^T\). Simplified Eq. (53) as follows :
Then, take the time derivative of \(\Gamma\),
Applied hat map property \(\mathrm{tr}\left[ A\hat{x}\right] = -x^T\left(A-A^T\right)^\vee\) to Eq. 57. Thus, error attitude dynamics of \(\Gamma(R_d, R)\) donated by :
Then, we need to find error attitude dynamics of \(e_R\). Given rotation error \(e_R\),
The derivative of \(e_R\) as follows :
Subtitute Eq. (55) to Eq. (60). Note that \(RR_d^T = \left(\frac{d}{dt}\left(R_d^TR\right)\right)^T\).
Applied \(\hat{x}A + A^T \hat{x} = ([\mathrm{tr}[A]I-A]x)^\wedge\) to Eq. [62], and the hat map \((\cdot)^\wedge\) dissapear due to \((\hat{A})^\vee = A\) where \(A \in \mathbb{R}^n\).
Assume \(R^TR_d = \exp{\hat{x}} \in SO(3)\) by using Rodrigues formuka for \(x \in \mathbb{R}^3\). Then, \(\|C(R^TR)\|_2 \leq 1\) it occurs from eigenvalues of \(\left(C(\exp{\hat{x}})\right)^T C(\exp{\hat{x}})\). It eigenvalues is \(\cos^2(\|x\|), \frac{1}{2}(1+\cos(\|x\|))\), and \(\frac{1}{2}(1+\cos(\|x\|))\) [1], which the three of them are less or equal to 1.
How are the eigenvalues like that?
I’m not entirely sure how they compute the eigenvalues of \(\left(C(\exp{\hat{x}})\right)^T C(\exp{\hat{x}})\). So, it still a open question for me.
Position Control¶
Velocity Control¶
References¶
[1] Control of Complex Maneuvers for a Quadrotor UAV using Geometric Methods on SE(3) (v4)
[2] Geometric control of mechanical systems
[5] Learning with 3D rotations, a hitchhiker’s guide to SO(3)
[6] A micro Lie theory for state estimation in robotics
[7] Minimum snap trajectory generation and control for quadrotors
[8] Control of Complex Maneuvers for a Quadrotor UAV using Geometric Methods on SE(3) (v3)