This example shows how to use Compensator Editor dialog box to tune Simulink blocks.
This example uses a model of speed control system for a sparking ignition engine. The initial compensator has been designed in a fashion similar to the example entitled "Single Loop Feedback/Prefilter Design". Take a few moments to explore the model.
Open the engine speed control model.
This example uses the Compensator Editor to tune Simulink blocks. When tuning a block in Simulink using the Control System Designer, you can use one of compensator parameter representations. These representations are the block parameters and the pole/zero/gain representations. For example, in the speed control example there is a PID controller with filtered derivative
This block implements the traditional PID with filtered derivative as:
In this block
N are the parameters that are available for tuning. Another approach is to reformulate the block transfer function to use zero-pole-gain format:
This formulation of poles, zeros, and gains allows for direct graphical tuning on design plots such as Bode, root locus, and Nichols plots. Additionally, the Control System Designer allows for both representations to be tuned using the compensator editor. The tuning of both representations is available for all supported blocks in Simulink Control Design. For more information, see "What Blocks Are Tunable?"
In this example, to tune the compensators in this feedback system, open a pre-configured Control System Designer session by double-clicking the subsystem in the lower left hand corner of the model.
You can view the representations of the PID compensator using the Compensator Editor dialog box. To open the Compensator Editor, in the Data Browser, in the Controllers and Fixed Blocks area, double-click
scdspeedctrl_PID_Controller. In the Compensator Editor dialog box, in the Compensator section, you can view and edit any of the compensators in your system.
On the Pole/Zero tab, you can add, delete, and edit compensator poles and zeros. Since the PID with filtered derivative is fixed in structure, the number of poles and zeros is limited to having up to two zeros, one pole, and an integrator at
s = 0.
On the Parameter tab, you can independently tune the
Enter new parameters values in the Value column. To interactively tune the parameters, use the sliders. You can change the slider limits using the Min Value and Max Value columns.
When you change parameter values, any associated editor and analysis plots automatically update.
The design requirements in the example "Single Loop Feedback/Prefilter Design" can be met with the following controller parameters:
P = 0.0012191
I = 0.0030038
Numerator = 10;
Denominator = [1 10];
In the Compensator Editor dialog box, specify these parameters. The responses of the closed-loop system are shown below:
To write the compensator parameters back to the Simulink model, click Update Blocks. You can then test your design on the nonlinear model.