Main Content

Model reference adaptive control (MRAC) is a model-based, real-time adaptive control
algorithm that computes control actions to make an uncertain controlled system track the
behavior of a given reference plant model. Using Simulink^{®}
Control Design™ software, you can implement MRAC using the Model Reference Adaptive
Control block.

The following figure shows the structure of an MRAC controller.

The goal of the controller is to make the states (*x*) of the controlled
system track the states (*x _{m}*) of the reference model
for a given reference signal (

Compute the error

*e*between the states of the controlled system and the states of the reference model.Compute the features

*ϕ(x)*for the internal model of the system disturbances and uncertainty.Update the weight parameters of the disturbance model based on the error

*e*.Update the values of the feedback and feedforward gains based on error

*e*. You can choose to have the controller adapt the feedforward gains, the feedback gains, or both.Apply the updated gains and parameters to the reference signal, plant states, and disturbance model features.

Compute the control action

*u*. For more information, see Control Structure.

The controlled system, which typically exhibits modeling uncertainty and external disturbances, has the following nominal state equation. This model represents the nominal behavior that you expect from the plant.

$$\dot{x}\left(t\right)=Ax\left(t\right)+B\left(u\left(t\right)+f\left(x\right)\right)$$

Here:

*x*(*t*) is the state of the system you want to control.*u*(*t*) is the control input.*A*is a constant state-transition matrix.*B*is a constant control effective matrix.*f*(*x*) is the matched uncertainty in the system.

The reference plant model is the ideal system that characterizes the desired behavior that you want to achieve in practice.

$${\dot{x}}_{m}\left(t\right)={A}_{m}{x}_{m}\left(t\right)+{B}_{m}r\left(t\right)$$

Here:

*r*(*t*) is the external reference signal*x*(_{m}*t*) is the state of the reference plant model. Since*r*(*t*) is known, you can simulate the reference model to get*x*(_{m}*t*).*A*is a constant state matrix. For a stable reference model,_{m}*A*must be a Hurwitz matrix for which every eigenvalue must have a strictly negative real part._{m}*B*is a control effective matrix._{m}

MRAC computes the control input *u*(*t*) using the
following control structure.

$$\begin{array}{l}u\left(t\right)={k}_{x}x\left(t\right)+{k}_{r}r\left(t\right)-{u}_{ad}\\ {u}_{ad}={w}^{T}\varphi \left(x\right)\end{array}$$

Here:

*k*is the feedback gain matrix._{x}*k*is the feedforward gain matrix._{r}*u*is the adaptive control component derived from the disturbance model._{ad}*ϕ*(*x*) contains the disturbance and uncertainty model features. For more information on the model features, see Disturbance and Uncertainty Model Features.*w*is an adaptive control weight vector.

An MRAC controller can learn the values of *k _{x}*,

When you substitute the control structure into the nominal model and simplify the result, you get the following state equation.

$$\dot{x}\left(t\right)=\left(A+B{k}_{x}\right)x\left(t\right)+B{k}_{r}r\left(t\right)+B\left(f\left(x\right)-{w}^{T}\varphi \left(x\right)\right)$$

Using the universal approximation property of neural networks, you can assume that an ideal neural network with unknown ideal weights can parameterize the true uncertainty.

$$f\left(x\right)={w}^{*T}\varphi \left(x\right)+\epsilon $$

Here, *w ^{*}* contains the unknown ideal
weights and

Further, if you define the weight vector error as $$\tilde{w}={w}^{*}-w$$ and substitute it into the control structure, you get the following state equation.

$$\dot{x}\left(t\right)=\left(A+B{k}_{x}\right)x\left(t\right)+B{k}_{r}r\left(t\right)+B\left({\tilde{w}}^{T}\varphi \left(x\right)+\epsilon \right)$$

The goal of the MRAC controller is the asymptotic convergence of the state tracking
error *e*(*t*) to zero.

$$\begin{array}{l}e\left(t\right)=x\left(t\right)-{x}_{m}\left(t\right)\\ \dot{e}\left(t\right)=\dot{x}\left(t\right)-{\dot{x}}_{m}\left(t\right)\end{array}$$

Substitute the control structure and reference model equations to obtain the following equation for the error dynamics.

$$\dot{e}\left(t\right)=\left(A+B{k}_{x}\right)x\left(t\right)+B{k}_{r}r\left(t\right)+B\left({\tilde{w}}^{T}\varphi \left(x\right)+\epsilon \right)-{A}_{m}{x}_{m}\left(t\right)-{B}_{m}r\left(t\right)$$

You can rewrite this equation as follows.

$$\begin{array}{l}\dot{e}\left(t\right)={A}_{m}e\left(t\right)+B{\tilde{k}}_{x}x\left(t\right)+B{\tilde{k}}_{r}r\left(t\right)+B\left({\tilde{w}}^{T}\varphi \left(x\right)+\epsilon \right)\\ {\tilde{k}}_{x}={k}_{x}^{*}-{k}_{x}\\ {\tilde{k}}_{r}={k}_{r}^{*}-{k}_{r}\end{array}$$

Here, $${\tilde{k}}_{x}$$ and $${\tilde{k}}_{r}$$ are feedback and feedforward gain errors, respectively. $${k}_{x}^{*}$$ and $${k}_{r}^{*}$$ are unknown ideal feedback and feedforward gains.

To derive the MRAC parameter update equations, first define the following Lyapunov function based on the error dynamics.

$$V\left(e,{\tilde{k}}_{x},{\tilde{k}}_{r},\tilde{w}\right)={e}^{T}Qe+\frac{{\Gamma}_{x}{\tilde{k}}_{x}^{2}}{2}+\frac{{\Gamma}_{r}{\tilde{k}}_{r}^{2}}{2}+\frac{{\tilde{w}}^{T}{\Gamma}_{w}\tilde{w}}{2}$$

Here, *Γ _{x}*,

To obtain the following parameter update equations, take the Lie derivative of the preceding Lyapunov function along the error dynamics and equate it to zero.

$$\begin{array}{l}{\dot{k}}_{x}={\Gamma}_{x}x\left(t\right){e}^{T}\left(t\right)PB\\ {\dot{k}}_{r}={\Gamma}_{r}x\left(t\right){e}^{T}\left(t\right)PB\\ {\dot{w}}_{x}={\Gamma}_{w}\varphi \left(t\right){e}^{T}\left(t\right)PB\end{array}$$

Here, *P* is the solution to the following Lyapunov function based on
the reference model state matrix.

$${A}_{m}^{T}P+P{A}_{m}+Q=0$$

To add robustness at higher learning rates, you can modify the parameter updates to
include an optional momentum term. You can choose one of two possible learning modification
methods: *sigma modification* and
*e-modification*.

For sigma modification, the momentum term for each parameter update is the product of
the momentum weight parameter *σ* and the current parameter value.

$$\begin{array}{l}{\dot{k}}_{x}={\Gamma}_{x}x\left(t\right){e}^{T}\left(t\right)PB+\sigma {k}_{x}\\ {\dot{k}}_{r}={\Gamma}_{r}x\left(t\right){e}^{T}\left(t\right)PB+\sigma {k}_{x}\\ {\dot{w}}_{x}={\Gamma}_{w}\varphi \left(t\right){e}^{T}\left(t\right)PB+\sigma w\end{array}$$

For e-modification, the controller scales the sigma-modification momentum term by the norm of the error vector.

$$\begin{array}{l}{\dot{k}}_{x}={\Gamma}_{x}x\left(t\right){e}^{T}\left(t\right)PB+\sigma \left|e\left(t\right)\right|{k}_{x}\\ {\dot{k}}_{r}={\Gamma}_{r}x\left(t\right){e}^{T}\left(t\right)PB+\sigma \left|e\left(t\right)\right|{k}_{x}\\ {\dot{w}}_{x}={\Gamma}_{w}\varphi \left(t\right){e}^{T}\left(t\right)PB+\sigma \left|e\left(t\right)\right|w\end{array}$$

To adjust the amount of the learning modification for either method, change the value of
the momentum weight parameter *σ*.

The Model Reference Adaptive Control block maintains an internal model
*u _{ad}* of the disturbance and model uncertainty
in the controlled system.

$${u}_{ad}={w}^{T}\varphi \left(x\right)$$

Here, *ϕ*(*x*) is a vector of model features.
*w* is an adaptive control weight vector that the controller updates in
real time.

To define *ϕ*(*x*), you can use one of the following
feature definitions.

State vector of the controlled plant — This approach can under-represent the uncertainty and perform poorly. Use this option when the disturbance and model uncertainty are linear. Using the state vector can also be a useful starting point when you do not know the complexity of the disturbance and model uncertainty.

Gaussian radial basis functions — Use this option when the disturbance and model uncertainty are nonlinear and structure of the disturbance model is unknown.

External source provided to the controller block — Use this option to define your own custom feature vector. You can use this option when you know the structure of the disturbance and uncertainty model. For example, you can use a custom feature vector to identify specific unknown plant parameters.