π§ Under Development
This tutorial is actively being updated. Check back for more content and refinements.
Introduction
Model Reference Adaptive Control (MRAC) is a powerful technique for controlling systems with unknown or slowly varying parameters. Instead of designing a controller for a fixed plant model, MRAC designs a controller that adapts its own parameters in real time so the closed-loop plant behaves like a desired reference model.
This tutorial covers two approaches:
- Lyapunov-based Gradient β Guaranteed stability, simpler to implement
- MIT Rule β Gradient-based, historically significant
Try the interactive MRAC Demo while reading this tutorial β adjust plant parameters mid-simulation and watch the controller adapt.
The Problem Setup
Plant (Unknown Parameters)
We have a first-order SISO plant with unknown parameters a and b:
yΛβ=βaβ
y+bβ
u
| Symbol | Meaning |
|---|
| y | Plant output |
| u | Control input |
| a | Unknown pole location (stable if a>0) |
| b | Unknown input gain |
Reference Model (Desired Behavior)
We want the plant to behave like this reference model with known parameters amβ and bmβ:
yΛβmβ=βamββ
ymβ+bmββ
r
| Symbol | Meaning |
|---|
| ymβ | Reference model output |
| r | Reference command input |
| amβ | Desired pole location |
| bmβ | Desired DC gain |
Control Law Structure
The adaptive controller has the structure:
u=ΞΈ1ββ
r+ΞΈ2ββ
y
where ΞΈ1β and ΞΈ2β are adaptive parameters that will be updated in real time.
Derivation: Lyapunov-Based Approach
Step 1: Define the Error
The tracking error is the difference between the plant output and the reference model output:
e=ymββy
We want eβ0 as tββ.
Step 2: Find the Ideal Parameters
If the plant parameters a and b were known, we could choose ΞΈ1β and ΞΈ2β so that the closed-loop dynamics match the reference model exactly.
Substitute the control law u=ΞΈ1ββ
r+ΞΈ2ββ
y into the plant:
yΛβ=βaβ
y+bβ
(ΞΈ1ββ
r+ΞΈ2ββ
y)=β(aβbΞΈ2β)β
y+bΞΈ1ββ
r
To match yΛβmβ=βamββ
ymβ+bmββ
r, we need:
aβbΞΈ2ββ=amββΞΈ2ββ=baβamββ
bΞΈ1ββ=bmββΞΈ1ββ=bbmββ
These ΞΈ1ββ and ΞΈ2ββ are the ideal parameters that would give perfect tracking if the plant were known.
Step 3: Error Dynamics with Adaptive Parameters
Since a and b are unknown, the ideal parameters ΞΈ1ββ and ΞΈ2ββ cannot be computed. Instead, we use the adaptive parameters ΞΈ1β and ΞΈ2β from the control law and define the parameter errors as the gap between the current adaptive values and their ideal counterparts:
ΞΈ~1β=ΞΈ1ββΞΈ1ββandΞΈ~2β=ΞΈ2ββΞΈ2ββ
Differentiate the tracking error:
eΛ=yΛβmββyΛβ=(βamβymβ+bmβr)β(βay+bu)
Substitute the control law u=ΞΈ1βr+ΞΈ2βy:
eΛ=βamβymβ+bmβr+ayβb(ΞΈ1βr+ΞΈ2βy)
Rearrange:
eΛ=βamβ(ymββy)+(bmββbΞΈ1β)r+(aβbΞΈ2β)y
Now substitute ΞΈ1β=ΞΈ~1β+ΞΈ1ββ and ΞΈ2β=ΞΈ~2β+ΞΈ2ββ, using the ideal parameter relationships:
bmββbΞΈ1β=bmββb(ΞΈ~1β+ΞΈ1ββ)=βbΞΈ~1β
aβbΞΈ2β=aβb(ΞΈ~2β+ΞΈ2ββ)=amββbΞΈ~2β
So:
eΛ=βamβeβbΞΈ~1βr+(amββbΞΈ~2β)yβamβy
Simplify the y terms:
eΛ=βamβeβbΞΈ~1βrβbΞΈ~2βy
This is the error dynamics in terms of the parameter errors:
eΛ=βamβeβb(ΞΈ~1βr+ΞΈ~2βy)β
Step 4: Choose a Lyapunov Function
To guarantee stability, we choose a Lyapunov function that includes both the tracking error and the parameter errors:
V=21βe2+2Ξ³1βbβΞΈ~12β+2Ξ³2βbβΞΈ~22β
where Ξ³1β,Ξ³2β>0 are adaptation gains that control how fast the parameters adapt.
Step 5: Compute VΛ and Choose Adaptation Laws
Differentiate V:
VΛ=eβ
eΛ+Ξ³1βbβΞΈ~1ββ
ΞΈ~Λ1β+Ξ³2βbβΞΈ~2ββ
ΞΈ~Λ2β
Since ΞΈ1ββ and ΞΈ2ββ are constant, ΞΈ~Λ1β=ΞΈΛ1β and ΞΈ~Λ2β=ΞΈΛ2β.
Substitute eΛ=βamβeβb(ΞΈ~1βr+ΞΈ~2βy):
VΛ=eβ
[βamβeβb(ΞΈ~1βr+ΞΈ~2βy)]+Ξ³1βbβΞΈ~1ββ
ΞΈΛ1β+Ξ³2βbβΞΈ~2ββ
ΞΈΛ2β
Expand:
VΛ=βamβe2βbΞΈ~1βerβbΞΈ~2βey+Ξ³1βbβΞΈ~1βΞΈΛ1β+Ξ³2βbβΞΈ~2βΞΈΛ2β
Group the ΞΈ~1β and ΞΈ~2β terms:
VΛ=βamβe2+ΞΈ~1β(Ξ³1βbβΞΈΛ1ββber)+ΞΈ~2β(Ξ³2βbβΞΈΛ2ββbey)
Step 6: Choose Adaptation Laws to Make VΛβ€0
To ensure stability, we want VΛβ€0. The first term βamβe2 is already negative semi-definite (since amβ>0). We can make the remaining terms zero by choosing:
Ξ³1βbβΞΈΛ1ββber=0βΞΈΛ1β=Ξ³1βerβ
Ξ³2βbβΞΈΛ2ββbey=0βΞΈΛ2β=Ξ³2βeyβ
With these adaptation laws:
VΛ=βamβe2β€0
This proves that:
- The tracking error e converges to zero
- The parameter errors ΞΈ~1β, ΞΈ~2β remain bounded
- The adaptive system is globally stable
Complete Lyapunov-Based MRAC Algorithm
Initialize: y(0)=0, ymβ(0)=0, ΞΈ1β(0)=0, ΞΈ2β(0)=0
At each time step t:
-
Read reference: r(t)
-
Compute control:
u=ΞΈ1ββ
r+ΞΈ2ββ
y
-
Integrate plant and reference model:
yΛβ=βaβ
y+bβ
u(unknownΒ trueΒ plant)
yΛβmβ=βamββ
ymβ+bmββ
r
-
Compute error:
e=ymββy
-
Update adaptive parameters:
ΞΈΛ1β=Ξ³1ββ
eβ
r
ΞΈΛ2β=Ξ³2ββ
eβ
y
Tuning the Adaptation Gains Ξ³
| Gain | Effect | Typical Value |
|---|
| Ξ³1β | Speed of ΞΈ1β adaptation | 0.5β2.0 |
| Ξ³2β | Speed of ΞΈ2β adaptation | 0.5β2.0 |
Too low (Ξ³βͺ0.1): Adaptation is sluggish; error decays slowly.
Too high (Ξ³β«5): Parameters oscillate; may cause instability with large r or y.
Best practice: Start with Ξ³1β=Ξ³2β=1.0 and adjust based on response.
MIT Rule: Derivation and Comparison
The MIT rule is the original approach to model-reference adaptive control, developed at the Instrumentation Laboratory at MIT. It is based on gradient descent on the squared error.
The MIT Rule
Let e be the error between the output of the closed-loop system and the output of the reference model. One possibility is to adjust parameters in such a way that the loss function
J(ΞΈ)=21βe2
is minimized. The gradient method gives
ΞΈΛ=βΞ³βΞΈβJβ=βΞ³eβΞΈβeββ
The partial derivative βΞΈβeβ, which is called the sensitivity derivative of the system, tells how the error is influenced by the adjustable parameter. If it is assumed that the parameter changes are slower than the other variables in the system, then the derivative βΞΈβeβ can be evaluated under the assumption that ΞΈ is constant.
MIT Rule for First-Order Systems (Example 5.2)
Consider the first-order plant:
yΛβ=βay+bu
where u is the control variable and y is the measured output. Assume that we want to obtain a closed-loop system described by
yΛβmβ=βamβymβ+bmβr
Let the controller be given by
u=ΞΈ1βrβΞΈ2βy
The controller has two parameters. If they are chosen to be
ΞΈ1ββ=bbmββ,ΞΈ2ββ=baβamββ
the input-output relations of the system and the model are the same. This is called perfect model-following.
To apply the MIT rule, introduce the error
e=yβymβ
where y denotes the output of the closed-loop system. It follows from the plant and controller equations that
y=p+a+bΞΈ2βbββ
ucβ
where p=d/dt is the differential operator. The sensitivity derivatives are obtained by taking partial derivatives with respect to the controller parameters ΞΈ1β and ΞΈ2β:
βΞΈ1ββeβ=p+a+bΞΈ2βbββ
r
βΞΈ2ββeβ=βp+a+bΞΈ2βbββ
y
These formulas cannot be used directly because the process parameters a and b are not known. Approximations are therefore required. One possible approximation is based on the observation that p+a+bΞΈ2ββp+amβ when the parameters give perfect model-following. We will therefore use the approximation
p+a+bΞΈ2ββp+amβ
which will be reasonable when parameters are close to their correct values. With this approximation we get the following equations for updating the controller parameters:
ΞΈΛ1β=Ξ³β
eβ
p+amβamβββ
rβ
ΞΈΛ2β=βΞ³β
eβ
p+amβamβββ
yβ
In these equations we have combined the parameters Ξ³β² (the raw adaptation gain from the MIT rule) and amβ with the adaptation gain Ξ³, since they appear as the product Ξ³β²b/amβ. The sign of parameter b must be known to have the correct sign of Ξ³. Notice that the filter has also been normalized so that its steady-state gain is unity.
(This follows Example 5.2 in Γ
strΓΆm & Wittenmark, 2008, p. 190β191.)
Filter Implementation
The operator p+amβamββ represents a first-order filter with unity steady-state gain. In state-space form:
xΛ1β=βamβx1β+amβr
xΛ2β=βamβx2β+amβy
The adaptation laws become:
ΞΈΛ1β=βΞ³β
eβ
x1β
ΞΈΛ2β=Ξ³β
eβ
x2β
Complete MIT Rule Algorithm
Initialize: y(0)=0, ymβ(0)=0, ΞΈ1β(0)=0, ΞΈ2β(0)=0, x1β(0)=0, x2β(0)=0
At each time step t:
-
Read reference: r(t)
-
Compute control:
u=ΞΈ1ββ
rβΞΈ2ββ
y
-
Integrate plant and reference model:
yΛβ=βaβ
y+bβ
u
yΛβmβ=βamββ
ymβ+bmββ
r
-
Update filters:
xΛ1β=βamβx1β+amβr
xΛ2β=βamβx2β+amβy
-
Compute error:
e=yβymβ
-
Update adaptive parameters:
ΞΈΛ1β=βΞ³β
eβ
x1β
ΞΈΛ2β=Ξ³β
eβ
x2β
Why the Lyapunov Approach is Preferred
The MIT rule is less robust than the Lyapunov approach because:
- Stability not guaranteed: For arbitrary adaptation gains Ξ³, the MIT rule can become unstable
- Approximation dependency: The filter approximation p+a+bΞΈ2ββp+amβ is only valid near convergence
- Parameter drift: Can occur with persistent excitation (mitigated by Ο-modification or leakage)
- Sign requirement: The sign of b must be known to choose the correct sign of Ξ³
The Lyapunov approach replaces the sensitivity derivative approximation with a stability proof, giving guaranteed convergence without requiring knowledge of the sign of b.
Comparison: MIT Rule vs. Lyapunov
| Aspect | MIT Rule | Lyapunov-based |
|---|
| Stability guarantee | β No | β
Yes |
| Extra dynamics | 2 first-order filters | None |
| Tuning | Ξ³ must be small | Ξ³ can be larger |
| Derivation | Gradient descent | Lyapunov stability theory |
| Sign of b | Must be known | Not required |
| Approximation | p+a+bΞΈ2ββp+amβ | Exact |
| Historical note | MIT Instrumentation Lab (1950s) | Russian school (1960s) |
Try It Yourself
Open the interactive MRAC Demo and experiment with:
-
Changing plant parameters mid-simulation β drag the a and b sliders while the simulation is running. Watch ΞΈ1β and ΞΈ2β adapt to the new plant dynamics.
-
Different reference signals β switch between square wave, sine wave, and step inputs.
-
Adaptation gain tuning β increase Ξ³ for faster adaptation (but watch for oscillations).
References
Primary Source
-
Γ
strΓΆm, K. J., & Wittenmark, B. (2008). Adaptive Control, 2nd ed. Dover. ISBN: 978-0-486-46278-3.
The standard graduate-level text on adaptive control. Example 5.2 (pp. 190β191) in Chapter 5 (Model Reference Adaptive Control) derives the MIT rule for first-order systems using filtered sensitivity signals β the formulation used in this tutorial. The Lyapunov-based approach presented here draws on the stability framework developed in Chapter 4 (Lyapunov Stability).