Discrete-time PID-based model reference adaptive control

• Library:
• 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

`${u}_{pid}\left(k\right)=\left[{K}_{p}+{K}_{i}\frac{{T}_{s}z}{z-1}+{K}_{d}\frac{z-1}{{T}_{s}z}\right]\text{e}\left(\text{k}\right),$`

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

`${G}_{m}\left(z\right)=\frac{B\left(z\right)}{A\left(z\right)}.$`

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

`$\theta =\left(y-{y}_{m}\right){y}_{m}\frac{-\gamma {T}_{s}z}{z-1},$`

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\left(k\right)={u}_{pid}\left(k\right)\theta \left(k\right).$`

## 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

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? (Simulink) and Specify Sample Time (Simulink).

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.