Interactively Estimate Plant from Measured or Simulated Response Data
If you have System Identification Toolbox™ software, PID Tuner lets you 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. For plant identification, you must specify a finite value for the Simulink model stop time.
PID Tuner gives you several techniques to graphically, manually, or automatically adjust the estimated model to match your response data. This topic illustrates some of those techniques.
Obtain Response Data for Identification
In PID Tuner, in the PID Tuner tab, in the
Plant menu, select
In the Plant Identification tab, click Get I/O data. This menu allows you to obtain system response data in one of two ways:
Simulate Data. Obtain system response data by simulating the response of your Simulink model to an input signal. For more information, see Design PID Controller Using Simulated I/O Data.
Import I/O Data. Import measured system response data as described in Import Measured Response Data for Plant Estimation.
Once you have imported or simulated data, the Plant Identification plot displays the response data and the response of an initial estimated plant. You can now select the plant structure and adjust the estimated plant parameters until the response of the estimated plant is a good fit to the response data.
Depending on the quality and features of your imported or simulated data, you might want to perform some preprocessing on the data to improve the estimated plant results. PID Tuner provides several options for preprocessing response data, such as removing offsets, filtering, or extracting a subset of the data. For information, see Preprocess Data.
Adjust Plant Structure and Parameters
PID Tuner allows you to specify a plant structure, such as One Pole, Two Real Poles, or State-Space Model. In the Structure menu, choose the plant structure that best matches your response. You can also add a transport delay, a zero, or an integrator to your plant.
In the following sample plot, the one-pole structure gives the qualitatively correct response. You can make further adjustments to the plant structure and parameter values to make the response of the estimated system a better match to the measured response data.
PID Tuner gives you several ways to adjust the plant parameters:
Graphically adjust the response of the estimated system by dragging the adjustors on the plot. In this example, drag the red
xto adjust the estimated plant time constant. PID Tuner recalculates system parameters as you do so. As you change the estimated system’s response, it becomes apparent that there is some time delay between the application of the step input at
t= 5 s, and the response of the system to that step input.
To add a transport delay to the estimated plant model, in the Plant Structure section, check Delay. A vertical line appears on the plot, indicating the current value of the delay. Drag the line left or right to change the delay, and make further adjustments to the system response by dragging the red
Adjust the numerical values of system parameters such as gains, time constants, and time delays. To numerically adjust the values of system parameters, click Edit Parameters.
Suppose that you know from an independent measurement that the transport delay in your system is 1.5 seconds. In the Plant Parameters dialog box, enter 1.5 for τ. Check Fix to fix the parameter value. When you check Fix for a parameter, neither graphical nor automatic adjustments to the estimated plant model affect that parameter value.
Automatically optimize the system parameters to match the measured response data. Click Auto Estimate to update the estimated system parameters using the current values as an initial guess.
You can continue to iterate using any of these methods to adjust plant structure and parameter values until the estimated system response adequately matches the measured response.
Save Plant and Tune PID Controller
When you are satisfied with the fit, click
Save Plant. Doing so saves the estimated plant,
Plant1, to PID Tuner workspace. Doing so also selects the
Step Plot: Reference Tracking figure and returns you to the
PID Tuner tab. PID Tuner automatically designs a PI
Plant1, and displays a response plot for the new
closed-loop system. The Plant menu reflects that
Plant1 is selected for the current controller design.
To examine variables stored in the PID Tuner workspace, use the Plant List area.
You can now use the PID Tuner tools to refine the controller design for the estimated plant and examine tuned system responses.
You can also export the identified plant from the PID Tuner workspace to
the MATLAB® workspace for further analysis. In the PID Tuner tab,
Export. Check the plant model you want to export to the MATLAB workspace. For this example, export
Plant1, the plant you
identified from response data. You can also export the tuned PID controller. Click
OK. The models you selected are saved to the MATLAB workspace.
Alternatively, right-click a plant in the Plant List to select it for tuning or export it to the MATLAB workspace.