This example shows how to use PID Tuner to import measured response data for plant estimation.
If you have System Identification Toolbox™ software, you can use PID Tuner to estimate the parameters of a linear plant model based on time-domain response data. PID Tuner then tunes a PID controller for the resulting estimated model. The response data can be either measured from your real-world system, or obtained by simulating your Simulink® model. Plant estimation is especially useful when your Simulink model cannot be linearized or linearizes to zero.
When you import response data, PID Tuner assumes that your measured data
represents a plant connected to the PID controller in a negative-feedback loop. In other
words, PID Tuner assumes the following structure for your system. PID
Tuner assumes that you injected an input signal at
measured the system response at
y, as shown.
In PID Tuner, in the PID Tuner tab, in the
Plant menu, select
In the Plant Identification tab, click Get I/O data. Select the type of measured response data you have. For example, if you measured the response of your plant to a step input, select Step Response. To import the response of your system to an arbitrary stimulus, select Arbitrary I/O Data.
In the Import Response dialog box, enter information about your response data. For
example, for step-response data stored in a variable
sampled every 0.1s:
Click Import. The Plant Identification tab opens, displaying the response data and the response of an initial estimated plant.
Depending on the quality and features of your response data, you might want to perform some preprocessing on the data to improve the estimated plant results. The Preprocess menu gives you several options for preprocessing response data, such as removing offsets, filtering, or extracting on a subset of the data. In particular, when the response data has an offset, it is important for good identification results to remove the offset.
In the Plant Identification tab, click Preprocess and select the preprocessing option you want to use. A tab opens with a figure that displays the original and preprocessed data. Use the options in the tab to specify preprocessing parameters.
(For more information about preprocessing options, see Preprocess Data.)
When you are satisfied with the preprocessed signal, click Update to save the change to the signal. Click to return to the Plant Identification tab.
PID Tuner automatically adjusts the plant parameters to create a new initial guess for the plant based on the preprocessed response signal.
You can now adjust the structure and parameters of the estimated plant to obtain the estimated linear plant model for PID Tuning. See Interactively Estimate Plant from Measured or Simulated Response Data for more information.