This page provides an essential summary of the robust MRAC (model reference adaptive control) techniques coded in the simulator https://github.com/andrealaffly/UAV_Sim_PyChrono/wiki to enforce user-defined constraints on the trajectory tracking error.
It is worthwhile noting that the continuous convex projection operator allows imposing explicit constraints on the adaptive gains. For details, see the notes on classical and robust MRAC.
Assume that the plant model (i.e., the system to be controlled) is in the form
\[ \dot{x}(t) = A x(t) + B \Lambda [u(t) + \Theta^{\rm T} \Phi(t,x(t))], \quad x(t_0) = x_0, \quad t \geq t_0, \]
where
A goal of constrained MRAC systems is to steer the plant state toward the trajectory of the refence model
\[ \dot{x}_{\rm ref}(t) = A_{\rm ref}x_{\rm ref}(t) + B_{\rm ref}r_{\rm cmd}(t),\quad x_{\rm ref}(t_0) = x_{\rm ref,0}, \quad{} t \geq t_0, \]
where
Another goal of constrained MRAC systems is to guarantee that
\[ e(t) \in \overline{\mathcal{E}} \triangleq \left\{ e \in \mathbb{R}^n : e_{\max} - e^{\rm T} M e \geq 0 \right\}, \quad t \geq t_0, \]
where
\(e(t) \triangleq x(t) - x_{\rm ref}(t)\) denotes the trajectory tracking error
\(M \in \mathbb{R}^{n \times n}\) is user-defined, symmetric, and positive-definite
\[ A_{\rm ref}^{\rm T} M + M A_{\rm ref} \prec - Q_M \]
\(Q_M \succ 0_{n \times n}\) is user-defined
\(\mathring{\mathcal{E}} \supset \overline{\mathcal{B}}_{\overline{\epsilon}_0}(0_n)\)
\[ \begin{aligned} \mathring{\mathcal{E}} &\triangleq \left \{ e \in \mathbb{R}^n : h(e^{\rm T} M e) > 0\right\} \\ \overline{\mathcal{B}}_{\overline{\epsilon}_0}(0_n) &\triangleq \Bigg\{ e \in \mathbb{R}^n : \Vert e \Vert \leq \overline{\epsilon} \triangleq 2 \frac{ \left( \lambda_{\max}(P) + \lambda_{\max}(M) \right)}{\lambda_{\min}(Q)} \overline{\xi} \Bigg \}. \end{aligned} \]
To meet these goals, constrained MRAC systems set \[ u(t) = \phi(\hat{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 ramp}(e(t_0),\overline{\epsilon}_0) \Gamma \pi(t) e^{\rm T}(t) \tilde{P}(e(t)) B \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) &\triangleq \begin{bmatrix} x(t) \\ r(t) \\ - \Phi(t,x(t)) \end{bmatrix}, \end{aligned} \]
\[ \tilde{P}(e) \triangleq h^{-1}(e^{\rm T} M e) \left[ P - V_e(e) \left. \frac{\partial h(\alpha)}{\partial \alpha} \right \vert_{\alpha = e^{\rm T} M e} M \right], \quad e \in \mathring{\mathcal{E}}, \]
\[ A_{\rm ref}^{\rm T} P + P A_{\rm ref} = - Q \]
\[ V_e(e) \triangleq \frac{e^{\rm T} P e}{h(e^{\rm T} M e)}, \quad{} e \in \mathring{\mathcal{E}} \]
\[ \mu_{\rm ramp}(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 \]
Assume that there exist \(K_x \in \mathbb{R}^{n \times m}\) and \(K_r \in \mathbb{R}^{m \times m}\) such that the matching conditions
\[ \begin{aligned} A_{\rm ref} &= A + B \Lambda K_x^{\rm T}, \\ B_{\rm ref} &= B \Lambda K_r^{\rm T} \end{aligned} \]
are verified and \(e(t_0) \in \mathring{\mathcal{E}}\)
Constrained MRAC guarantees
\(e(t) \in \mathring{\mathcal{E}}\) for all \(t \geq t_0\)
uniform boundedness of \(\hat{K}(t)\) for all \(t \geq t_0\)
that \(e(t) \to \overline{\mathcal{B}}_{\overline{\epsilon}_0}(0_n)\) for all \(t \geq T\) and some \(T \geq t_0\)
It is impossible to solve the matching conditions since \(A\) and \(\Lambda\) are unknown. However, the structure of \(A\) (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.
MRAC systems can enforce time-varying constraints captured by
\[ \overline{\mathcal{E}}_t \triangleq \left \{e \in \mathbb{R}^n : H(t,e) \geq 0\right\}, \quad{} t \geq t_0, \]
where
\[ H(t,e) \triangleq \eta_{\max} - \eta^2(t) - e^{\rm T} M e, \quad{} (t,e) \in [t_0,\infty) \times \mathbb{R}^n. \]
This constraint set is called funnel since, ideally, it would reduce its diameter \(\eta_{\max} - \eta^2(t)\) over \([t_0,\infty)\).
The diameter of the constraint set can not be reduced arbitrarily fast.
For this reason, the diameter of funnel must be regulated to reflect the closed-loop system's capabilities.
To ensure compatibility of constraints with the closed-loop plant dynamics, the funnel diameter can be regulated by
\[ \begin{align} \dot{\eta}(t) &= \min\left\{ 0,- \varepsilon^{\rm T}(t) M \dot{\varepsilon}(t) / \eta(t) \right\}, \nonumber \\ &\quad \text{if } \|\varepsilon(t)\| > e_{\rm min} \text{ and } H(t,\varepsilon(t)) = \delta_2 \text{ and } \nonumber \\ &\quad \eta(t) \in \left( \sqrt{\delta_1}, \sqrt{\eta_{\rm max} - \delta_3} \right), \\ \dot{\eta}(t) &= \sigma_{\rm nom}(t), \quad \text{if } \|\varepsilon(t)\| > e_{\rm min} \text{ and } H(t,\varepsilon(t)) > \delta_2 \text{ and } \nonumber \\ &\quad \eta(t) \in \left(\sqrt{\delta_1}, \sqrt{\eta_{\rm max} - \delta_3} \right), \\ \dot{\eta}(t) &= \max\left\{ 0, \sigma_{\rm nom}(t) \right\}, \quad \text{if } \|\varepsilon(t)\| > e_{\rm min} \text{ and } \nonumber \\ &\quad \eta(t) = \sqrt{\delta_1}, \\ \dot{\eta}(t) &= \min\left\{ 0, \sigma_{\rm nom}(t) \right\}, \quad \text{if } \|\varepsilon(t)\| > e_{\rm min} \text{ and } \nonumber \\ &\quad \eta(t) = \sqrt{\eta_{\rm max} - \delta_3}, \\ \dot{\eta}(t) &= 0, \quad \text{if } \|\varepsilon(t)\| \leq e_{\rm min}, \end{align} \]
where
\(\nu \in \left[ \max \left\{0, \lambda_{\min}(Q)- \frac{\lambda_{\max}(P)\lambda_{\min}(Q_M)}{\lambda_{\max}(M)}\right\}, \lambda_{\min}(Q) \right)\) is user-defined
\(H_{\max} > \dfrac{4\overline{\xi}^2 \lambda_{\min}(P)\lambda_{\max}^2(M)} {3 (\lambda_{\min}(Q)-\nu)\lambda_{\min}(Q_M)}\) is user-defined
\(\delta_1 \in (0,H_{\max})\) is user-defined
\(\eta_{\max} \triangleq H_{\max} - \delta_1\)
\(z_1 \triangleq s_1 + s_2 - a_2/3\)
\(s_1 \triangleq \sqrt[3]{- q/2 + \sqrt{\Delta}}\)
\(s_2 \triangleq \sqrt[3]{- q/2 - \sqrt{\Delta}}\)
\(\Delta \triangleq p^3/27 + q^2/4\)
\(a_2 \triangleq - 2 \overline{\xi} \lambda_{\max}(M) / \lambda_{\min}(Q_M)\)
\(p \triangleq \dfrac{(\lambda_{\min}(Q) - \nu)H_{\max}}{\lambda_{\min}(P)\lambda_{\min}(Q_M)} - \dfrac{4 \overline{\xi}^2\lambda_{\max}^2(M)}{3\lambda_{\min}^2(Q_M)}\)
\[ q \triangleq \frac{2\overline{\xi} \lambda_{\max}(M)(\lambda_{\min}(Q) - \nu)H_{\max}}{3 \lambda_{\min}(P)\lambda_{\min}^2(Q_M)} - \frac{2H_{\max}\overline{\xi} \lambda_{\max}(P)}{\lambda_{\min}(P)\lambda_{\min}(Q_M)} - \frac{16 \overline{\xi} ^3 \lambda_{\max}^3(M)}{27\lambda_{\min}^3(Q_M)} \]
\(\delta_3 \in (z_1,H_{\max})\) is user-defined
\(\delta_2 \in (0, \delta_3)\) is user-defined
\(e_{\min} \in (0, \delta_3)\) is user-defined
To enforce these time-varying constraints, set \[ u(t) = \phi(\hat{K}(t),\pi(t)), \quad t \geq t_0, \]
where
\[ \begin{aligned} \dot{\hat{K}}(t) &= {\rm Proj}\left(\hat{K}(t), - \mu_{\rm ramp}(e(t_0),\overline{\epsilon}_0) \Gamma \pi(t) e^{\rm T}(t) \tilde{P}(t,e(t)) B \right), \nonumber \\ &\quad \hat{K}(t_0) = \hat{K}_0, \quad t \geq t_0, \\ \tilde{P}(t,e) &\triangleq H^{-1}(t,e^{\rm T} M e) \left[ P + V_e(t,e) M \right], \quad e \in \mathring{\mathcal{E}}_t, \\ V_e(t,e) &\triangleq \frac{e^{\rm T} P e}{H(t,e^{\rm T} M e)}, \quad{} e \in \mathring{\mathcal{E}}_t. \end{aligned} \]
Assume that there exist \(K_x \in \mathbb{R}^{n \times m}\) and \(K_r \in \mathbb{R}^{m \times m}\) such that the matching conditions
\[ \begin{aligned} A_{\rm ref} &= A + B \Lambda K_x^{\rm T}, \\ B_{\rm ref} &= B \Lambda K_r^{\rm T} \end{aligned} \]
are verified and \(e(t_0) \in \mathring{\mathcal{E}}_{t_0}\)
Constrained MRAC guarantees
For additional information, see
funnel_mrac.pyfunnel_two_layer_mrac.py