Documentation

Design Controller Using Identified Model with Noise Channel

This example shows how to design a model predictive controller using an identified plant model with a nontrivial noise component.

This example requires a System Identification Toolbox™ license.

Load the input/output data for identification.

load dryer2
Ts = 0.08;

Create an iddata object from the input

dry_data = iddata(y2,u2,Ts);
dry_data_detrended = detrend(dry_data);

Estimate a linear state-space plant model.

plant_idss = ssest(dry_data_detrended,3);

plant_idss is a third-order, identified state-space model that contains one measured input and one unmeasured noise component.

Design a model predictive controller for the identified plant model.

controller = mpc(plant_idss,Ts);
-->Converting "idmodel" object to state-space.
-->The "PredictionHorizon" property of "mpc" object is empty. Trying PredictionHorizon = 10.
-->The "ControlHorizon" property of the "mpc" object is empty. Assuming 2.
-->The "Weights.ManipulatedVariables" property of "mpc" object is empty. Assuming default 0.00000.
-->The "Weights.ManipulatedVariablesRate" property of "mpc" object is empty. Assuming default 0.10000.
-->The "Weights.OutputVariables" property of "mpc" object is empty. Assuming default 1.00000.

controller is an mpc object in which:

  • The measured input of plant_idss is a manipulated variable.

  • The noise component of plant_idss is an unmeasured disturbance.

  • The output of plant_idss is a measured output.

To view the structure of the model predictive controller, at the MATLAB® command prompt, type controller.

You can change the treatment of plant input signals in one of two ways:

  • Programmatic - Use the setmpcsignals command to set the signal types.

  • MPC Designer - Specify the signal types when defining the MPC structure using an imported plant.

You can also design a model predictive controller using:

plant_ss = ss(plant_idss,'augmented');
controller2 = mpc(plant_ss,Ts);
-->All input signals are labeled as "Measured" or "Noise". The model was probably converted from the System Identification Toolbox.
   All "Measured" inputs will be treated as manipulated variables, all "Noise" inputs as unmeasured disturbances.
   Type "help setmpcsignals" for more information.
-->The "PredictionHorizon" property of "mpc" object is empty. Trying PredictionHorizon = 10.
-->The "ControlHorizon" property of the "mpc" object is empty. Assuming 2.
-->The "Weights.ManipulatedVariables" property of "mpc" object is empty. Assuming default 0.00000.
-->The "Weights.ManipulatedVariablesRate" property of "mpc" object is empty. Assuming default 0.10000.
-->The "Weights.OutputVariables" property of "mpc" object is empty. Assuming default 1.00000.

When you use the 'augmented' input argument, ss creates two input groups, Measured and Noise, for the measured and noise inputs of plant_idss. mpc handles the measured and noise components of plant_ss and plant_idss identically.

See Also

Related Examples

More About

Was this topic helpful?