Main Content

Model Reference Adaptive Controller

Discrete-time PID-based model reference adaptive control

  • Model Reference Adaptive Controller block

Libraries:
Simscape / Electrical / Control / General Control

Description

The Model Reference Adaptive Controller block implements discrete-time proportional-integral-derivative (PID) model reference adaptive control (MRAC). The three main components of an MRAC system are the reference model, the adjustment mechanism, and the controller.

Equations

The control equation is

upid(k)=[Kp+KiTszz1+Kdz1Tsz]e(k),

where:

  • upid is the controller output.

  • Kp is the proportional gain.

  • Ki is the integral gain.

  • Kd is the differential gain.

  • Ts is the sample time.

  • e is the error.

The reference model is the transfer function for the closed-loop system. This model captures the desired behavior of the closed-loop system. It is implemented as the discrete-time transfer function

Gm(z)=B(z)A(z).

The adaptation mechanism adjusts the control action based on the error between the plant output and the reference model output as

θ=(yym)ymγTszz1,

where:

  • θ is the adaptation parameter.

  • y is the plant output.

  • ym is the reference model output.

  • γ is the learning rate.

Increasing the value of γ results in faster adaptation to plant changes.

The adjusted control signal, u, is

u(k)=upid(k)θ(k).

Ports

Input

expand all

Plant system reference signal.

Data Types: single | double

Plant system output signal.

Data Types: single | double

External reset signal (rising edge) for the integrator.

Data Types: Boolean

Output

expand all

Adjusted control signal.

Data Types: single | double

Parameters

expand all

Controller Parameters

Proportional gain, Kp, of the controller.

Integral gain, Ki, of the controller.

Derivative gain, Kd, of the controller.

Anti-windup gain of the controller.

Choose whether to use a filter coefficient for the reference signal.

Dependencies

The Filter coefficient parameter is only visible when the Use filtered derivative check box is selected.

Filter coefficient for the reference signal.

Dependencies

This parameter is only visible when the Use filtered derivative check box is selected.

Upper bound for the control signal.

Lower bound for the control signal.

Time, in s, between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.

If this block is inside a triggered subsystem, inherit the sample time by setting this parameter to -1. If this block is in a continuous variable-step model, specify the sample time explicitly using a positive scalar.

Dependencies

If you set Sample time (-1 for inherited) to -1 and, in the Reference Model settings, set Model parameterization to Continuous-time, the Discretization sample time parameter becomes visible in the Reference Model settings.

Reference Model

Mathematical model for the controller.

Dependencies

Choosing:

  • Discrete-time makes the discrete-time parameters visible.

  • Continuous-time makes the continuous-time parameters visible. Also, in the Controller Parameter settings, if Sample time (-1 for inherited) is set to -1, choosing this option makes the Discretization sample time parameter visible in the Reference Model settings.

Numerator for the discrete-time transfer function.

Dependencies

Choosing Discrete-time for Model parameterization makes this parameter visible.

Denominator for the discrete-time transfer function.

Dependencies

Choosing Discrete-time for Model parameterization makes this parameter visible.

Time, in seconds, between consecutive discretizations. If block sample time is inherited, specify the discretization sample time explicitly.

Dependencies

This parameter is only visible when both of these conditions are met:

  • In the Control Parameters settings, Sample time (-1 for inherited) is set to -1.

  • In the Reference Model settings, Model parameterization is set to Continuous-time.

Numerator for the continuous-time transfer function.

Dependencies

Choosing Continuous-time for Model parameterization makes this parameter visible.

Denominator for the continuous-time transfer function.

Dependencies

Choosing Continuous-time for Model parameterization makes this parameter visible.

Adjustment Mechanism

Rate of adjustment to plant changes.

References

[1] Butler, H. Model-Reference Adaptive Control-From Theory to Practice. Upper Saddle River, NJ: Prentice Hall, 1992.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2018a