Tune at Different Operating Point
By default, PID Tuner linearizes your plant and designs a controller at the operating point specified by the initial conditions in your Simulink® model. Sometimes, this operating point differs from the operating point for which you want to design a controller. For example, you want to design a controller for your system at steady-state. However, the Simulink model is not generally at steady-state at the initial condition. In this case, change the operating point that PID Tuner uses for linearizing your plant and designing a controller.
To set a new operating point for PID Tuner, use one of the following methods. The method you choose depends upon the information you have about your desired operating point.
Manually specify operating condition in the model using known state values.
Relinearize the model at a specific simulation time.
Import a previously computed operating point or linear model.
After PID Tuner generates a new initial controller design based on the updated operating point, you can analyze the controller design. For more information, see Analyze Design in PID Tuner.
Manually Specify Operating Condition in Model
If you know the model states that produce the desired steady-state operating condition, you can specify them directly in the model.
Close PID Tuner.
Set the initial conditions of the components of your model to the values that yield the desired operating conditions.
Click Tune in the PID controller dialog box to open PID Tuner. PID Tuner linearizes the plant using the new default operating point and designs a new initial controller for the new linear plant model.
Relinearize Model at Simulation Snapshot Time
If your model reaches the desired in a finite time, you can relinearize the model at a particular simulation time.
On the PID Tuner tab, in the Plant menu, select Re-linearize Closed Loop.
On the Closed Loop Re-Linearization tab, click Run Simulation to simulate the model for the time specified in the Simulation Time text box.
PID Tuner plots the error signal as a function of time. You can use this plot to identify a time at which the model is in steady-state. Slide the vertical bar to a snapshot time at which you want to linearize the model.
Click Linearize to linearize the model at the selected snapshot time. PID Tuner computes a new linearized plant and saves it to the PID Tuner workspace. PID Tuner automatically designs a controller for the new plant, and displays a response plot for the new closed-loop system. PID Tuner returns you PID Tuner tab, where the Plant menu reflects that the new plant is selected for the current controller design.
Note
For models with Trigger-Based Operating Point Snapshot blocks, the software captures an operating point at events that trigger before the simulation reaches the snapshot time.
Import Operating Point or Linear Model
If you previously computed an operating point using Steady State
Manager, Model Linearizer, or findop
, you can import the operating point into PID Tuner from the
MATLAB® workspace. Alternatively, you can import a previously computed linear
model.
On the PID Tuner tab, in the Plant menu, select Import.
In the Obtain plant model dialog box, select Importing an LTI system or linearizing at an operating point defined in MATLAB workspace.
The table lists the operating points and LTI models available in the MATLAB workspace.
Select the desired operating point or LTI model in the table.
Tip
To refresh the list of operating points and LTI models in the MATLAB workspace, click Refresh.
If you are importing an
frd
model or a state-space model with internal delays, specify the number of open-loop unstable poles (if any) in the text box. Incorrect values might result in PID controllers that fail to stabilize the real plant. Unstable poles are poles located at:Re(s) > 0, for continuous-time plants
|z| > 1, for discrete-time plants
A pure integrator in the plant (s = 0) or (|z| > 1) does not count as an unstable pole in this case. If your plant is an
frd
model of a plant with a pure integrator, for best results, ensure that your frequency response data covers a low enough frequency to capture the integrator slope.Click Import.
PID Tuner computes a new linearized plant at the imported operating point or imports the specified LTI model. The app automatically designs a controller for the new plant and displays a response plot for the new closed-loop system. The app returns you PID Tuner tab, where the Plant menu reflects that the new plant is selected for the current controller design.
Linearize at Model Initial Conditions
By default, when you open the PID Tuner, the model is linearized at the operating point defined by the model initial conditions. After you linearize the model at a different operating point, you might want to return to the default linearization. To do so:
In the Obtain plant model dialog box, click Linearizing the Simulink model at the default operating point.
Click Import. PID Tuner computes a new linearized plant, automatically designs a controller for the new plant, and displays a response plot for the new closed-loop system. The app returns you PID Tuner tab, where the Plant menu reflects that the new plant is selected for the current controller design.