Tip:
Highlight text to annotate it
X
When you don’t know a mathematical model of your plant, but have input-output test data, you can identify plant model from that test data and
use the identified plant model for control design. Starting with release R2014a you can do all of this in the PID Tuner app.
If you have System Identification Toolbox, you can identify a plant right in the PID Tuner app by importing step response, impulse response, or
arbitrary input/output data. In this example we will import step response data. You can specify name of the signal in MATLAB workspace that
contains step response data. You can also specify the amplitude, offset, and when the step happened, as well as a few other parameters
such as sampling time for data. Once the data is imported into the tool, you can preprocess it. For example, you can extract a
range of data, resample the signals, filter the signals, or remove the offset, which is what we will do in this example. After we process the
signal, we can select a structure of the plant we will identify. We can choose from several typical low-order model structures. We can also specify
if our plant has an integrator, zero, and a delay. The formula for the plant structure is updated based on our choices.
We can then estimate model parameters. We can do in several different ways. We can graphically adjust parameter values, such as
pole location, time delay, and system gain, to try to match the measured data as best we can. We can also edit the parameters in the text
dialog, where we can type parameter values in or use sliders. We can also specify if we want to “freeze” or “fix” some parameters. For example,
we might want to fix the value of the time delay once we set it interactively. We can use obtained parameter values for
control design, or we could let the tool try to improve the fit by adjusting parameter values automatically. We can specify whether we want
the tool to use the values we set interactively as the initial guesses or ignore the current values altogether and simply try to find the best fit.
Often times automatic estimation will provide a good fit, but sometimes manual fine-tuning of system gain, for example, may be useful.
Once we have a good fit, we can save the identified plant for control design. This brings us back to PID controller tuning. The tool uses the
identified plant to automatically come up with PID Controller gains. We can try different types of PID controllers – proportional, PI, PD, PID,
and we can fine tune the design by making the response faster or slower, and more robust or more aggressive. We can observe how PID
gains as well as closed loop system characteristics such as rise time, gain, and phase margins change as we tune the controller.
We can setup the tool to have several plots side by side. We can add other system responses. For example, we can add the plot showing the
Bode plot of input disturbance rejection transfer function. Once we are satisfied with the controller design,
we can export both the identified plant and the tuned controller to MATLAB workspace, so we can, for example, create a Simulink model to
investigate nonlinear effects such as output saturation, integrator anti-windup, and perform tasks such as fixed-point scaling and automatic
code generation. This concludes the video.