This page provides an essential summary of the MRAC (model reference adaptive control) techniques coded in the simulator
https://github.com/andrealaffly/UAV_Sim_PyChrono/wiki
for hybrid plant models (plants with discontinuities in the trajectory and the dynamical model)
Hybrid plant models, that is, models captured by a combination of ordinary differential equations and difference equations and whose continuous-time dynamics may vary instantaneously, pose a challenge to classical adaptive control systems. Indeed, these systems do not meet the canonical assumptions of continuity in time and Lipschitz continuity in the state vector required by most adaptive systems.
The MRAC systems coded in this simulator allow accounting for discontinuities in the plant model and trajectory.
If the UAV transports some payload free to move in its
casing, impact between the payload and the casing produces
instantaneous changes in the UAV's velocity.
If the UAV drops or picks up some payload,
the UAV's dynamical model changes instantaneously.
Assume that the plant model (i.e., the system to be controlled) is in the form
\[ \begin{aligned} \begin{bmatrix} \dot{x}(t) \\ \dot{\sigma}(t) \end{bmatrix} &= \begin{bmatrix} A_{\sigma(t)} x(t) + B_{\sigma(t)} \Lambda \left[u(t) + \Theta_{\sigma(t)}^{\rm T} \Phi_{\sigma(t)}(t,x(t)) \right] \\ 0 \end{bmatrix} \nonumber \\ &\hspace{1.0em} + \begin{bmatrix} \xi_{\sigma(t)}(t) \\ 0 \end{bmatrix}, \quad \begin{bmatrix} x(t_0) \\ \sigma(t_0) \end{bmatrix} = \begin{bmatrix} x_0 \\ \sigma_0 \end{bmatrix}, \quad (t,x(t)) \notin \mathcal{D}_{\sigma(t)}, \\ \begin{bmatrix} x(t^+) \\ \sigma(t^+) \end{bmatrix} &= g_{{\rm d},\sigma(t)}(t,x(t)), \quad (t,x(t)) \in \mathcal{D}_{\sigma(t)}, \end{aligned} \]
where
The primary goal of hybrid MRAC systems is to steer the plant state toward the trajectory of the refence model
\[ \begin{aligned} \begin{bmatrix} \dot{x}_{\rm ref}(t) \\ \dot{\sigma}(t) \end{bmatrix} &= \begin{bmatrix} A_{\rm ref,\sigma(t)} x_{\rm ref}(t) + B_{\rm ref,\sigma(t)} r(t) \\ 0 \end{bmatrix}, \nonumber \\ &\hspace{0.5em} \begin{bmatrix} x_{\rm ref}(t_0) \\ \sigma(t_0) \end{bmatrix} = \begin{bmatrix} x_{{\rm ref},0} \\ \sigma_0 \end{bmatrix}, \,\,\, (t,x_{\rm ref}(t)) \notin \mathcal{D}_{{\rm ref},\sigma(t)}, \\ \begin{bmatrix} x_{\rm ref}(t^+) \\ \sigma(t^+) \end{bmatrix} &= g_{{\rm d, ref}, \sigma(t)}(t,x_{\rm ref}(t)), \,\,\, (t,x_{\rm ref}(t)) \in \mathcal{D}_{{\rm ref},\sigma(t)}, \end{aligned} \]
where
\[ \mathcal{D}_{{\rm ref},\sigma_{i_w}} \triangleq \left\{ t_{{\rm ref},i_w} \right\} \times \mathbb{R}^n, \qquad{} (i,w) \in \mathbb{N} \times \mathbb{N} \]
To apply an MRAC system, the plant model must not be integrated. It suffices to assume that \(x(t)\) is known for all \(t \geq t_0\).
To this goal, hybrid MRAC systems set \[ u(t) = \phi(K(t),\pi(t)), \quad t \geq t_0, \]
where
\[ \phi(\hat{K},\pi) \triangleq \hat{K}^{\rm T} \pi, \quad (\hat{K},\pi) \in \mathbb{R}^{(n+m+N) \times m} \times \mathbb{R}^{(n+m+N)}, \]
\[ \begin{aligned} \dot{\hat{K}}(t) &= {\rm Proj}\left(\hat{K}(t), - \mu_{\rm step}(e(t),\epsilon_0) \Gamma \pi(t) e^{\rm T}(t) P_{\sigma(t)} B_{\sigma(t)} \right), \\ &\quad \hat{K}(t_0) = \hat{K}_0, \quad t \geq t_0, \end{aligned} \]
\(\Gamma \succ 0_{(n+m+N) \times (n+m+N)}\) denotes the adaptive rate matrix, which is user-defined
the augmented regressor vector is defined as
\[ \begin{aligned} {\pi}(t) &= \begin{bmatrix} x(t) \\ r(t) \\ - \Phi_{\sigma(t)}(t,x(t)) \end{bmatrix}, \end{aligned} \]
\(e(t) \triangleq x(t) - x_{\rm ref}(t)\) denotes the trajectory tracking error
\(P_{\sigma} \succ 0_{n \times n}\) denotes the solution of the algebraic Lyapunov equation
\[ A_{\rm ref, \sigma}^{\rm T} P_{\sigma} + P_{\sigma} A_{\rm ref,\sigma} = - Q_{\sigma} \]
\[ \mu_{\rm step}(e,\epsilon_0) \triangleq \begin{cases} 1, & \text{if } \lVert e \rVert \geq \epsilon_0, \\[6pt] \dfrac{\lVert e \rVert - \delta \epsilon_0}{(1 - \delta)\epsilon_0}, & \text{if } \lVert e \rVert \in [\delta \epsilon_0, \epsilon_0], \\[6pt] 0, & \text{if } \lVert e \rVert \leq \delta \epsilon_0, \end{cases} \quad e \in \mathbb{R}^n \]
\(\epsilon_0 \triangleq 2 \max_{\sigma \in \Sigma} \dfrac{\lambda_{\max}(P_{\sigma})}{\lambda_{\max}(Q_{\sigma})}\)
\(\delta \in (0,1)\) is user-defined
\(\lambda_{\max}(\cdot)\) denotes the eigenvalue of its matrix argument with largest real part
\(\lambda_{\min}(\cdot)\) denotes the eigenvalue of its matrix argument with smallest real part
\(\overline{\xi} \geq \max_{\sigma \in \Sigma} \Vert \xi_{\sigma}(t) \Vert\) denotes an upper bound on the unmatched uncertainty for all \(t \geq t_0\), which is user-defined
and resets the reference model at
\[ \begin{aligned} &t_{{\rm ref},i_w} \triangleq \inf \Bigg\{t > \max\{t_{{\rm plant},i}, t_{{\rm ref},i_w - 1}\} : \int_{t_0}^t W(e(\tau)) {\rm d} \tau \nonumber \\ &\hspace{4.0em} \geq \sum_{j = 1}^{k - 1} \left[ e^{\rm T}(t_j^+) P_\sigma e(t_j^+) - e^{\rm T}(t_j) P_\sigma e(t_j) \right] \Bigg\} \end{aligned} \]
with
\[ g_{{\rm d, ref}, \sigma}(t_{{\rm ref},i_w},x_{\rm ref}(t_{{\rm ref},i_w})) \triangleq \begin{bmatrix} x_{\rm ref}(t_{{\rm ref},i_w}^+) \\ 0_n \end{bmatrix} \]
where
\[ \begin{aligned} x_{\rm ref}(t_{{\rm ref},i_w}^+) &= x(t_{{\rm ref},i_w}) \nonumber \\ &\quad{} - \sqrt{\frac{e^{\rm T}(t_{{\rm ref},i_w}) P_{\sigma(t_{{\rm ref},i_w})} e(t_{{\rm ref},i_w}) - z_{{\rm ref},i_w}} {e^{\rm T} (t_{{\rm ref},i_w}) P_{\sigma(t_{{\rm ref},i_w})} e(t_{{\rm ref},i_w})}} \nonumber \\ &\quad\quad \cdot P_{\sigma(t_{{\rm ref},i_w}^+)}^{-\frac{1}{2}} P_{\sigma(t_{{\rm ref},i_w})}^{\frac{1}{2}} e(t_{{\rm ref},i_w}), \quad{} (i,w) \in \mathbb{N} \times \mathbb{N}. \end{aligned} \]
The control law for hybrid MRAC is the same as the control law for classical MRAC.
The adaptive law for hybrid MRAC is the same as the control law for classical MRAC.
To counter the destabilizing effect of resetting events in the plant model, the reference trajectory is reset at \(t_{{\rm ref},i_w}\).
Assume that there exist \(K_{x,\sigma} \in \mathbb{R}^{n \times m}\), \(K_{r,\sigma} \in \mathbb{R}^{m \times m}\) such that the matching conditions
\[ \begin{aligned} A_{\rm ref,\sigma} &= A_{\sigma} + B_{\sigma} \Lambda K_{x,\sigma}^{\rm T}, \\ B_{\rm ref,\sigma} &= B_{\sigma} \Lambda K_{r,\sigma}^{\rm T}, \end{aligned} \]
are verified.
Hybrid MRAC guarantees
It is impossible to solve the matching conditions since \(\{A_{\sigma}\}_{\sigma \in \Sigma}\) and \(\Lambda\) are unknown. However, the structure of each \(A_{\sigma}\) (i.e., the location of its zeros) is usually known and we know that \(\Lambda\) is diagonal and positive-definite. Thus, the existence of solutions to the matching conditions can usually be safely assumed.
The matching conditions are needed to verify compatibility between the plant model and the reference model. Here is a simple exmple, if the plant model captures the dynamics of a car and the reference model captures the dynamics of an airplane, the matching conditions can not be verified because a car is unable to take off.
For additional information, see
hybrid_mrac.py