Main Content

Model Reference Adaptive Control

Compute control actions to make a controlled system track a reference model

  • Library:
  • Simulink Control Design

  • Model Reference Adaptive Control block

Description

The Model Reference Adaptive Control block computes control actions to make the states of an uncertain controlled system track the states of an ideal reference model.

The MRAC controller computes control actions using:

  • A model of the external disturbances and uncertainty in the system being controlled.

  • Feedback gains that relate the state of the controlled system to the control signal.

  • Feedforward gains that relate the reference signal to the control signal.

Based on the tracking error, the controller can adapt the parameters of the disturbance model and gains in real time.

For more information, see Model Reference Adaptive Control.

Ports

Input

expand all

Provide the reference signal for the controlled system to follow.

Provide the current state vector from the controlled system.

You can provide custom disturbance model features using the phi input port.

Dependencies

To enable this input port, set the Feature type parameter to Use External Source for Feature.

Output

expand all

Connect the control input signal to the input of the controlled system. The control input is a vector signal with length equal to the number of control inputs in the controlled system.

The disturbance and uncertainty estimate is the product of the of the disturbance model features and the disturbance model weight vector. You can use this signal to compare the estimated disturbance model with the actual disturbances in your system.

Dependencies

To enable this output port, select the Output disturbance/uncertainty estimate parameter.

Parameters

expand all

System

Specify nominal and reference model dynamics.

Specify the state matrix for the nominal model as an N-by-N matrix, where N is the number of states in the controlled system.

Programmatic Use

Block Parameter: 'A'
Type: character vector
Values: square matrix
Default: '0'

Specify the control effective matrix of the nominal model as a nonzero N-by-M matrix, where N is the number of states in the controlled system and M is the number of control inputs in the controlled system.

Programmatic Use

Block Parameter: 'B'
Type: character vector
Values: vector | matrix
Default: '1'

Specify the state matrix for the reference model a matrix with the same dimensions as parameter A. For a stable reference model, Am must be a Hurwitz matrix for which every eigenvalue must have a strictly negative real part.

Programmatic Use

Block Parameter: 'Am'
Type: character vector
Values: square matrix
Default: '-1'

Specify the control effective matrix of the reference model as a nonzero matrix with same dimensions as parameter B.

Programmatic Use

Block Parameter: 'Bm'
Type: character vector
Values: vector | matrix
Default: '[0;4]'

Control Gains

Define initial feedback and feedforward gains for model matching. You can configure the block to update these control gains and adjust the corresponding learning rates.

Initial feedback gain values. If you do not select the Adapt feedback gains parameter, then the controller holds the specified feedback gains at these initial values.

Programmatic Use

Block Parameter: 'kx'
Type: character vector
Values: finite scalar | matrix of finite values
Default: '0'

When you select this parameter, the controller adapts the feedback gains based on the difference between the states of the controlled system and the reference model.

Programmatic Use

Block Parameter: 'FBLrEnable'
Type: character vector
Values: 'on' | 'off'
Default: 'on'

Use this parameter to control the rate at which the controller adapts the feedback gains. A larger value increases the size of the gain updates.

Programmatic Use

Block Parameter: 'gamma_kx'
Type: character vector
Values: finite positive scalar
Default: '2'

To add robustness at higher gains, select this option to add a momentum term to the feedback gain updates. Configure the learning modification on the Learning Modification tab.

Programmatic Use

Block Parameter: 'FBLrEnableMod'
Type: character vector
Values: 'on' | 'off'
Default: 'on'

Initial feedforward gain values. If you do not select the Adapt feedforward gains parameter, then the controller holds the specified feedforward gains at these initial values.

Programmatic Use

Block Parameter: 'kr'
Type: character vector
Values: finite scalar | matrix of finite values
Default: '0'

When you select this parameter, the controller adapts the feedforward gains based on the difference between the states of the controlled system and the reference model.

Programmatic Use

Block Parameter: 'FFLrEnable'
Type: character vector
Values: 'on' | 'off'
Default: 'on'

Use this parameter to control the rate at which the controller adapts the feedforward gains. A larger value increases the size of the gain updates.

Programmatic Use

Block Parameter: 'gamma_kr'
Type: character vector
Values: finite positive scalar
Default: '2'

To add robustness at higher gains, select this option to add a momentum term to the feedforward gain updates. Configure the learning modification on the Learning Modification tab.

Programmatic Use

Block Parameter: 'FFLrEnableMod'
Type: character vector
Values: 'on' | 'off'
Default: 'on'

Disturbance Model

Configure the disturbance and uncertainty model used by the block. During operation, the block adapts the disturbance model parameters.

When you select this parameter, the controller uses a disturbance model to estimate the uncertainty and external disturbances in the controlled system. The controller adapts the parameters of the disturbance model based on the error between the states of the controlled system and reference model.

The disturbance model has the form wTϕ(x).

  • ϕ(x) is the disturbance model feature vector. To configure the feature vector, use the Feature type parameter.

  • wT is a weighting matrix that contains disturbance model parameters. The controller adjusts its disturbance and uncertainty model by adapting these parameters.

Programmatic Use

Block Parameter: 'AdaptEnable'
Type: character vector
Values: 'on' | 'off'
Default: 'on'

Use this parameter to control the rate at which the controller adapts the disturbance model parameters. A larger value increases the size of the parameter updates.

Dependencies

To enable this parameter, select the Enable disturbance adaptation parameter.

Programmatic Use

Block Parameter: 'gamma'
Type: character vector
Values: finite positive scalar
Default: '100'

To add robustness at higher gains, select this option to add a momentum term to the disturbance parameter updates. Configure the learning modification on the Learning Modification tab.

Dependencies

To enable this parameter, select the Enable disturbance adaptation parameter.

Programmatic Use

Block Parameter: 'WLrEnableMod'
Type: character vector
Values: 'on' | 'off'
Default: 'on'

The channel learning rate Q is a weighting matrix for state tracking errors in the Lyapunov function for the error dynamics. The larger the value of Q, the faster the tracking error goes to zero. However, a larger value of Q also creates larger transients and a less robust system.

Dependencies

To enable this parameter, select the Enable disturbance adaptation parameter.

Programmatic Use

Block Parameter: 'Q'
Type: character vector
Values: finite positive scalar
Default: '1'

Select one of the following types for the disturbance model feature vector.

  • State — Use the states from the controlled plant as the disturbance model. This option can under represent the uncertainty and therefore perform poorly.

  • Radial Basis Function — Use Gaussian radial basis functions to create the feature vector.

  • Use External Source for Feature — Add the phi input port to the block. Use this port to provide your own custom feature vector.

For more information on when to use each type of feature vector, see Disturbance and Uncertainty Model Features.

Dependencies

To enable this parameter, select the Enable disturbance adaptation parameter.

Programmatic Use

Block Parameter: 'FeatureTypeOptions'
Type: character vector
Values: Radial Basis Function | State | Use External Source for Feature
Default: Radial Basis Function

Number of radial basis function (RBF) centers to use in the disturbance model. The RBF centers are evenly spaced across the span defined by the Centers min and Centers max parameters.

Dependencies

To enable this parameter, select the Enable disturbance adaptation parameter and set the Feature type parameter to Radial Basis Function.

Programmatic Use

Block Parameter: 'nCen'
Type: character vector
Values: positive integer
Default: '20'

Specify the lower limits for the radial basis function centers. If you specify a scalar value, the same minimum is used for all basis functions. Otherwise, you must specify a vector with length equal to the Number of RBF centers parameter.

The Centers min parameter must be less than the Centers max parameter.

Dependencies

To enable this parameter, select the Enable disturbance adaptation parameter and set the Feature type parameter to Radial Basis Function.

Programmatic Use

Block Parameter: 'cSpanMin
Type: character vector
Values: finite scalar | vector
Default: '-1'

Specify the upper limits for the radial basis function centers. If you specify a scalar value, the same maximum is used for all basis functions. Otherwise, you must specify a vector with length equal to the Number of RBF centers parameter.

The Centers max parameter must be greater than the Centers min parameter.

Dependencies

To enable this parameter, select the Enable disturbance adaptation parameter and set the Feature type parameter to Radial Basis Function.

Programmatic Use

Block Parameter: 'cSpanMax
Type: character vector
Values: finite scalar | vector
Default: '1'

Specify the standard deviation for the Gaussian basis function kernel. If you specify a scalar value, the same standard deviation is used for all basis functions. Otherwise, you must specify a vector with length equal to the Number of RBF centers parameter.

Dependencies

To enable this parameter, select the Enable disturbance adaptation parameter and set the Feature type parameter to Radial Basis Function.

Programmatic Use

Block Parameter: 'cSig'
Type: character vector
Values: positive scalar | vector
Default: '5'

Select this parameter to add the u_ad output port.

Dependencies

To enable this parameter, select the Enable disturbance adaptation parameter and set the Feature type parameter to Radial Basis Function.

Programmatic Use

Block Parameter: 'adaptiveCntrlOutport'
Type: character vector
Values: 'on' | 'off'
Default: 'on'

Learning Modification

To add robustness at higher gains, you can modify the parameter updates to include a momentum term. The equations in the Parameter Update Formula section show the update formulas for the current block configuration.

Select one of the following options for computing the momentum term that is added to the parameter updates.

  • Sigma Modification — The momentum term is the product of the momentum weight parameter σ and the current parameter values.

  • e-Modification — Scale the sigma-modification momentum term by the magnitude of the error value

  • None — Do not use learning modification.

To specify σ, use the Sigma parameter.

Programmatic Use

Block Parameter: 'modChoice'
Type: character vector
Values: 'Sigma Modification' | 'e-Modification' | 'None'
Default: 'Sigma Modification'

Specify the value for the momentum weight term. A larger value increases the size of the parameter updates gain and parameter updates.

Dependencies

To enable this parameter, set the Modification Methods parameter to either Sigma Modification or e-Modification.

Programmatic Use

Block Parameter: 'sigma_val'
Type: character vector
Values: finite positive scalar
Default: '0.1'

Extended Capabilities

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

Introduced in R2021b