TP1 Commande MAC - MPC 2024
TP1 Commande MAC - MPC 2024
The objective of this practical session is to implement and understand Model Reference Adaptive Control (MRAC)
using MATLAB. The task is to control a system (plant) so that its behavior follows a desired reference model by
dynamically adjusting the controller's parameters in real-time. By the end of the session, the aim is to simulate the step
responses of both the plant and the reference model, apply adaptive control to minimize the error between them, and
analyze the system's performance using MATLAB.
• Theoretical Reminder:
1. Adaptive Control:
Adaptive control allows the controller to adjust in real-time to handle system uncertainties. Unlike traditional
fixed-gain controllers, adaptive controllers continuously adjust their parameters to ensure optimal performance.
2. MRAC (Model Reference Adaptive Control):
MRAC is a specific approach where the goal is to make the plant's behavior match that of a reference model.
The reference model represents the desired response of the system. MRAC continuously adjusts the controller
parameters based on the error between the plant output and the reference model output.
3. Control Law:
In MRAC, the control signal is generally of the form:
𝑢(𝑡) = 𝜃(𝑡) ∗ 𝑢𝑟𝑒𝑓(𝑡)
where u(t) is the control signal applied to the plant, θ(t) is the adaptive gain that evolves over time, and 𝑢𝑟𝑒𝑓(𝑡)
is the reference input.
4. Adaptation Law:
The control parameter θ(t) is adjusted using an adaptation law based on the error between the reference model
output and the plant output:
𝜃(𝑡 + 1) = 𝜃(𝑡) + 𝛾 ∗ 𝑒(𝑡) ∗ 𝑢𝑟𝑒𝑓(𝑡)
where γ is the adaptation gain, and e(t) is the error between the reference model and the plant outputs.
• Manipulations:
In this manipulation, we will simulate the behavior of MRAC using MATLAB. Follow the steps below to implement
and test the system:
✓ Step 1: Define the reference model and plant in MATLAB.
Define a reference model that your plant should follow. This could be a second-order system like:
𝜔𝑛2
𝐺𝑟𝑒𝑓(𝑠) =
𝑠 2 +2𝜁𝜔𝑛𝑠+𝜔𝑛2
where 𝜔𝑛 is the natural frequency and ζ is the damping ratio. So code in MATLAB will be:
1
Plant Dynamics:
Define the dynamics of the plant you are controlling. For instance, a simple first-order or second-order system.
Question 1: Plot the figure between y-ref and y_plant_init, make a small discussion about it.
✓ Step 3: Plot the results.
Plot the curves to compare the reference model output with the plant output: