Documentation Center

  • Trial Software
  • Product Updates

Design and Analysis of Control Systems

Compensator Design Process Overview

Compensator design in the Control and Estimation Tools Manager involves the following steps:

  1. Selecting Blocks to Tune

  2. Selecting Closed-Loop Responses to Design

  3. Selecting an Operating Point

  4. Creating a SISO Design Task

  5. Completing the Design

Beginning a Compensator Design Task

Before you begin this compensator design example, close the Control and Estimation Tools Manager.

To begin a new compensator design task for the scdmagball_freeform model:

  1. Enter scdmagball_freeform at the MATLAB® command line to open the scdmagball_freeform model.

  2. Select Analysis > Control Design > Control System Designer from the scdmagball_freeform window.

    The Control and Estimation Tools Manager opens and creates a new compensator design task, as shown in the following figure.

The project tree in the left pane of the Control and Estimation Tools Manager now shows a Simulink Compensator Design Task node as part of Project - scdmagball_freeform in addition to the Operating Points node. You can select a node within the tree to display its contents in the right pane.

Selecting Blocks to Tune

How to Select Blocks to Tune

This section continues the scdmagball_freeform example from Beginning a Compensator Design Task. At this stage in the example, you have already created a compensator design task.

In this step of the compensator design, you select the blocks in your model to tune from a list of tunable blocks in your model. Tunable blocks are blocks that you can tune using the SISO Design Tool to achieve the desired response of your system. Typically, these blocks serve as the compensators in your model.

In this example, you tune the compensator block called Controller inside the Controller subsystem of the scdmagball_freeform model. To select this block as the block to tune:

  1. Select the Simulink Compensator Design Task node.

  2. In the Tunable Blocks pane, click Select Blocks. The Select Blocks to Tune dialog box opens.

  3. Select the Controller subsystem in the left pane to display that subsystem's tunable blocks within the center pane. Within the center pane, select the check box next to the Controller block's name.

  4. Click OK to apply your selections and close the dialog box.

What Blocks Are Tunable?

You can tune parameters in the blocks shown in the following table using Simulink® Control Design™ software. The block input and output signals for tunable blocks must have scalar, double-precision values.

Tunable Blocks Simulink Library

Gain

Math Operations

LTI System

Control System Toolbox

Discrete Filter

Discrete

PID Controller (one-degree-of-freedom only)

  • Continuous

  • Discrete

  • Simulink Extras Additional Linear

State-space blocks

  • Continuous

  • Discrete

  • Simulink Extras Additional Linear

Zero-pole blocks

  • Continuous

  • Discrete

  • Simulink Extras Additional Linear

Transfer function blocks

  • Continuous

  • Discrete

  • Simulink Extras Additional Linear

You can also tune the following versions of the blocks listed in the table:

  • Blocks with custom configuration functions associated with a masked subsystem

  • Blocks discretized using the Simulink Model Discretizer

    Note:   If your model contains Model blocks with normal-mode model references to other models, you can select tunable blocks in the referenced models for compensator design.

Creating Custom Configuration Functions

When you have masked subsystems that you want to tune in your model, they will not automatically appear in the list of tunable blocks. For them to appear in the list, you need to create a custom configuration function for the masked subsystem. The custom configuration function serves the following functions:

  • It informs the Simulink Control Design software that you want this block to be available for tuning.

  • It determines how you want the SISO Design Task to treat the block; it describes the relationship between the block mask parameters and the poles and zeros of the transfer function.

To learn how to create a custom configuration function, see Tuning Custom Masked SubsystemsTuning Custom Masked Subsystems.

Selecting Closed-Loop Responses to Design

This section continues the scdmagball_freeform example from Selecting Blocks to Tune. At this stage in the example a compensator design task has been created, and tunable blocks have been selected.

In this step of the compensator design task, you will select the closed loops whose responses you want to design in your model. A closed-loop system is defined by an input point, such as a reference or disturbance signal, and an output point, such as a measured output or actuator signal.

In this example you will design the response of the closed-loop system from the reference signal to the output of the plant model. To set up linear analysis points to define this closed-loop system, perform the following steps:

  1. On the scdmagball_freeform model diagram, position the mouse on the Reference signal between the Desired Height block and the Sum block. Right-click and select Linear Analysis Points > Input Perturbation from the menu to add an input point.

  2. Position the mouse on the signal line at the output of the Magnetic Ball Plant block. Right-click and select Linear Analysis Points > Output Measurement from the menu to add an output measurement point.

The model should now appear as follows:

Within the Control and Estimation Tools Manager, click the Closed-Loop Signals tab of the Simulink Compensator Design Task node to view the input and output points in the model.

Within this pane you can view the input and output signals in the model and use the Active column to select the ones you want to use to define closed-loop systems for compensator design.

Selecting an Operating Point

This section continues the scdmagball_freeform example from Selecting Closed-Loop Responses to Design. At this stage in the example, a compensator design task has been created, tunable blocks have been selected, and closed-loop signals have been selected.

In this step of the compensator design task, you will select the operating point that you want to use in the compensator design. The Simulink Control Design software uses the operating point when it linearizes the model before creating a SISO Design Task.

    Note:   A compensator designed for the linearized model is likely to control the behavior of the nonlinear model only in a small region around the operating point that the model was linearized at. Therefore it is important that the linearization of the model is accurate and the selection of the operating point about which the system is linearized is an important step in the compensator design process.

To import an operating point for compensator design, perform the following steps:

  1. Select the Operating Points node in the Control and Estimation Tools Manager.

  2. Click the Import button, in the bottom-right corner of the Control and Estimation Tools Manager.

  3. In the Operating Point Import dialog box, select MAT-file as the location to import from.

  4. Click Browse and locate the file scdmagball_freeform_operating_point.mat that you previously saved. If you did not previously save an operating point, browse to matlabroot/toolbox/slcontrol/slctrldemos/scdmagball_freeform_operating_point.mat.

  5. Click Open to return to the Operating Point Import dialog box.

    The Operating Point Import dialog box now shows all the operating points available within the selected MAT-file. In this case just a single operating point is contained in the MAT-file.

  6. Select this operating point and click Import to import it into the Control and Estimation Tools Manager.

Click the Operating Points tab in the Simulink Compensator Design Task node to select an operating point for the compensator design. For this example, you should use the operating point that you just imported, called Operating_Point. To specify this operating point, first select the Linearize at one of the following operating points option. Then select Operating_Point in the list, as shown in the following figure.

Creating a SISO Design Task

What is a SISO Design Task?

This section continues the scdmagball_freeform example from Selecting an Operating Point. At this stage in the example, a compensator design task has been created, and tunable blocks, closed-loop signals, and an operating point have been selected.

In this step of the compensator design task, you will create and configure a SISO Design Task in the Control and Estimation Tools Manager. The SISO Design Task includes several tools for tuning the response of SISO systems:

  • A graphical editing environment in the SISO Design Tool window that contains design plots such as root-locus, and Bode diagrams

  • An LTI Viewer window where you can view time and frequency analysis plots of the system

  • A compensator editor where you can directly edit the block mask parameters or the poles and zeros of compensators in your system

  • A tool that automatically generates compensators using PID, internal model control (IMC), or linear-quadratic-Gaussian (LQG) methods (uses the Control System Toolbox™ software)

  • Optimization-based tuning methods that automatically tunes the system to satisfy design requirements (available when you have the Simulink Design Optimization™ product)

The Design Configuration Wizard guides you through the selection of the open- and closed-loop systems you want to design and the configuration of the design and analysis plots you want to use in the SISO Design Task. To launch the wizard, click Tune Blocks in the Simulink Compensator Design Task node. The wizard opens in a separate window.

The first page of the wizard provides an overview of the design configuration process and lists some issues to consider when selecting design and analysis plots. Click Next to continue to step 1 of the design configuration process on the second page of the wizard.

Configuring Design Plots

In step 1, select the open- and closed-loop systems that you want to design in your model, and up to six corresponding design plots you want to use.

Open-loop design allows you to design the response of a closed feedback loop in your model by artificially opening the loop and designing the response of this open-loop system. The open-loop design plots use rules of linear control theory to determine the dynamics of the closed-loop system from those of the open-loop system. Open-loop design is typically used to tune compensators that lie inside feedback loops.

A set of default open-loop systems is created for your model, shown in the lower half of the wizard. To create these open-loop systems, the software artificially opens the feedback loop at the output signal of each tunable block (at the X in the following figure) and unwraps the closed-loop system to create the corresponding open-loop system.

The unwrapped open-loop system, which is -CPH, is shown in the following figure. The open-loop design plots show the negative of the unwrapped open-loop, which is CPH. This configuration allows you to design controllers using a negative feedback architecture.

Note that elements that are outside the feedback loop, such as the prefilter F, are not seen in the open-loop system.

In this example, you will tune the response of Open Loop 1 which is defined by a loop opening at the output of the Controller block. This open-loop system contains the plant model and the controller. To design this system, select Open Loop 1 from the menu next to Plot 1 in the wizard.

Next, select a design plot to use for this open-loop system. Design plots are interactive plots within the SISO Design Tool. You can use them to graphically tune parameters and manually move, add, or remove poles and zeros of the tunable blocks to tune and design the dynamics of open- and closed-loop systems in your model. The following table shows the design plots, along with their uses, available in the SISO Design Tool.

Type of Design PlotAvailable Plots in the SISO Design ToolUse to tune blocks that act as
Open-loopRoot Locus, Nichols, Open-loop bodeFeedback elements
Closed-loopClosed-loop bodeFeedforward or prefilter elements

You can also use the design plots to specify requirements for stability, performance, or both to use in using optimization-based automated tuning.

For this example, select Root Locus from the menu next to Plot 1 to use this plot type as the design plot for Open Loop 1. Step 1 of the wizard should now look similar to the following figure.

Click Next to proceed to step 2 of the wizard.

Configuring Analysis Plots

In this step, select the closed-loop responses that you want to view while designing your model, and the corresponding analysis plots you want to use to view them.

Analysis plots are plots that show the responses or dynamics of a closed or open loop systems or tunable blocks in your model. Although you cannot directly edit the analysis plots by graphically moving gains, poles, zeros, etc., changes that you make in the design plots, compensator editor, or automated design tools will affect the responses in the analysis plots. Possible analysis plots include

  • Step response

  • Impulse response

  • Bode and Bode magnitude

  • Nyquist

  • Nichols

  • Pole/Zero

You can use analysis plots to

  • Analyze closed-loop, open-loop, and tuned block responses in your control system.

  • Define stability and performance requirements for optimization-based automated tuning.

For this example, select Step from the menu for Plot 1 to create a step response analysis plot.

Next, select the closed-loop system that you want to display in this plot. A closed-loop system is a system that has not had any feedback loops opened for open-loop design. It typically defines the system whose response you want to control and it lies between the input and output signals of interest, for example between a reference signal and the plant output signal.

Linearization input and output points placed on signal lines in your model define closed-loop systems. The closed-loop system includes all blocks in the path between the input and the output.

The software automatically displays a list of up to four closed-loop systems in your model, based on the input and output points on the signal lines. In this example, only one closed-loop system appears in the wizard, the closed-loop from the Desired Height signal to the output of the Magnetic Ball Plant Model, because the system only has one input and one output point. You can add additional closed-loop responses, as well as open-loop and tunable block responses. To add a new response, click the Add Responses button and complete the Select a New Response to Analyze dialog box.

To display the current closed-loop system in the step response plot of Plot 1, select the check box under Plot 1 to the left of the closed-loop system. Step 2 of the wizard should now look similar to the following figure.

Click Finish to complete the wizard and create the SISO Design Task underneath the Simulink Compensator Design Task node within the Control and Estimation Tools Manager, as shown in the following figure.

The SISO Design Task also includes the design plots you configured in the Design Configuration Wizard. They appear within the SISO Design Tool window, as shown in the following figure.

In addition, the SISO Design Task also includes the analysis plots you configured in the Design Configuration Wizard. They appear within the LTI Viewer window, as shown in the following figure.

Control Design Linearization Options

To modify or adjust the settings used to linearize a model when creating a SISO Design Task, click the Simulink Compensator Design Task node, and then select Tools > Options. The Options dialog box opens.

Specify the linearization sample time and rate conversion method. If, for the Rate conversion method parameter, you specify Tustin W/Prewarping, you must also specify a pre-warp frequency.

Designing Compensators for Plants with Time Delays

You can design compensators for plants with time delays using the tools in the SISO Design Task. These tools automatically create a linear model of your plant. Within this model, you can represent time delays in two ways—using Padé approximation or exact delay.

To represent time delays in the linear plant model using...You must...
Padé approximation representations

Specify the Padé order in the Block Parameters window for each Simulink blocks with delays.

Exact delay representations

Open the Simulink Compensator Design Task, and select Tools > Options. Then, in the Options dialog box, select Enable design of linearized control systems with exact delay(s).

    Note:   Some tools do not support exact time delays and automatically compute a Padé approximation for delays. In this case, you receive a notification. The software uses the Padé order specified in SISO Tool Preferences and ignores the Padé order specified in your block. For more information, see Time Delays Pane.

For more information on the linearizing models with time delays, see Models with Time Delays. For more information on the tools available for compensator design, see Tools for Compensator Design.

Completing the Design

Tools for Compensator Design

This section continues the scdmagball_freeform example from Creating a SISO Design Task. At this stage in the example, a compensator design task has been created, tunable blocks, closed-loop signals, and an operating point have been selected, design and analysis plots have been created, and a SISO Design Task node has been created in the Control and Estimation Tools Manager.

In this step of the compensator design task, you will complete the design of the compensator in the scdmagball_freeform model, using the SISO Design Task node. For a more detailed discussion of the SISO Design Task node, refer to the Control System Toolbox documentation.

The SISO Design Task node contains five panes with various tools for designing the compensators in your system.

  • Architecture:

    • Configure loops for multi-loop design by opening signals to remove the effects of other feedback loops.

    • Import compensators into your system.

    • Convert the sample time of the system or switch between different sample times to design different compensators.

  • Compensator Editor:

    • Directly edit the poles, zeros, and gains of the compensator.

    • Add or remove poles and zeros to the compensators.

  • Graphical Tuning:

    • Configure design plots in the SISO Design Tool.

    • Use design plots to graphically manipulate the response of the system.

  • Analysis Plots:

    • Configure analysis plots in the LTI Viewer.

    • Use analysis plots to view the response of open- or closed-loop systems.

  • Automated Tuning: Design compensators using one of several automated methods.

    • Automatically generate compensators using PID, internal model control (IMC), or linear-quadratic-Gaussian (LQG) methods (uses Control System Toolbox software).

    • Use optimization-based methods that automatically tune the system to satisfy design requirements (available when you have the Simulink Design Optimization product).

You can use any of these design methods, or a combination of methods, to design the compensators for your system. A suitable final design for the Controller of the scdmagball_freeform model is:

  • Gain: -16000

  • Integrator at the origin

  • Complex zeros at -10±10i

  • Real pole at -1000

You can use the Compensator Editor in the SISO Design Task node to specify these settings. The initial design contains an integrator at the origin. Specify the remaining settings as follows:

  • Gain — Enter -16000 in the text box to the right of the equal sign in the Compensator area.

  • Complex zeros — In the Dynamics table, right-click and then select Add Pole/Zero > Complex Zero. Select the new complex zero in the Dynamics table. In the Edit Selected Dynamics table:

    • Enter -10 in the Real Part field.

    • Enter 10 in the Imaginary Part field.

  • Real pole — In the Dynamics table, right-click and then select Add Pole/Zero > Real Pole. Select the new real pole in the Dynamics table. In the Edit Selected Dynamics table:

    • Enter -1000 in the Location field.

The Control and Estimation Tools Manager should now appear similar to the following:

With these settings, the root-locus diagram and step-response plot should look similar to the following figures.

Storing and Retrieving Designs

When you design a compensator within a Simulink Compensator Design Task, you can store the current design. You can retrieve the stored design at any time. This storage and retrieval capability lets you continue designing and still be able to return to a previously saved version of the design.

This section continues the example from Completing the Design. At this stage in the example, a compensator has been designed to control the system. To store the design within the SISO Design Task node, perform the following steps:

  1. Select the SISO Design Task node in the Control and Estimation Tools Manager.

  2. Underneath the SISO Design Task panes, click the Store Design button.

    Clicking this button adds the current design to the Design History node as shown in the following figure. The default name for the design is Design.

To rename the design to something more descriptive:

  1. Right-click the Design node underneath the Design History node.

  2. Select Rename from the right-click menu.

  3. Enter a name for your design. For this example, call the design scdmagball_freeform Design.

    The Control and Estimation Tools Manager should now appear as follows:

    Note:   After you store a compensator design, you can continue to refine it. If you make undesired changes, you can retrieve the stored design by selecting it in the Design History node and then clicking the Retrieve Design button.

Writing the Design to the Simulink Model

When designing a compensator within a Simulink Compensator Design Task node, you can write the compensator design to the Simulink model. This is useful when

  • You want to see how the current design performs in the full nonlinear model.

  • You have completed the design and you want to update the model with the newly designed parameters.

When you write the compensator design to your Simulink model:

  • If the block parameters are numerical, the software writes new numerical values to the tuned block.

  • If the block parameters are variables in the base workspace or the model workspace (including Simulink.Parameter objects), the software writes the tuned values to those variables. The block parameters remain the workspace variables.

There are two ways to write the design to your Simulink model:

  • Write the tuned parameters to your model when you have finished your design — Click the Design node of the Control and Estimation Tools Manager and click the Update Simulink Block Parameters button.

  • Automatically update the block parameters as you tune the design — select the Design History node in the Control and Estimation Tools Manager and click the checkbox next to Automatically update block parameters.

For example, continue the example from Storing and Retrieving Designs. At this stage in the example you have designed a compensator to control the system and stored the design within the SISO Design Task node. To write the stored design to the scdmagball_freeform model, perform the following steps:

  1. Select the scdmagball_freeform Design node under the Design History node in the Control and Estimation Tools Manager.

  2. Click the Update Simulink Block Parameters button.

You can now simulate the scdmagball_freeform model containing the newly designed Controller block.

After simulation, the Scope block of the scdmagball_freeform model should look similar to the following figure.

The system is now stable and the height of the magnetic ball settles at the desired height of 0.05 m.

Compare and Contrast the SISO Design Task and Enhanced SISO Design Task

The SISO Design Task is a graphical user interface (GUI) that simplifies the task of designing controllers. This section describes the similarities and differences between the SISO Design Task, which is available in the Control System Toolbox product, and the enhanced SISO Design Task, which is available with the Simulink Control Design product.

The following figure shows the SISO Design Task as it appears in the Control and Estimation Tools Manager.

The following figure shows the enhanced SISO Design Task as it appears under the Simulink Compensator Design Task node in the Control and Estimation Tools Manager.

The following table summarizes the similarities and differences between the SISO Design Task and the enhanced SISO Design Task:

SimilaritiesDifferences
  • Similar layout

  • Graphical Tuning, Analysis Plots, and Automated Tuning panes have the same functionality. For more information about these tabs, see Tools for Compensator Design.

  • Architecture tab — The SISO Tool lets you change the architecture of your system. In contrast, once you create a SISO Design Task you cannot add or delete blocks from your model. Also, the Architecture tab in the SISO Design Task node summarizes the Simulink Blocks to Tune, Closed Loop Input Signals, and Closed Loop Output Signals.

  • Compensator Editor tab — The SISO Design Tool lets you tune the poles and zeros of your system. The enhanced SISO Design Tool lets you tune the poles, zeros, and parameters of your system. For more information, see Tuning Simulink Blocks in the Compensator EditorTuning Simulink Blocks in the Compensator Editor.

  • When you are satisfied with your system's performance, the enhanced SISO Design Tool lets you click Update Simulink Block Parameters to write the parameters back to your Simulink model.

For additional information, see:

Design Operating Point Node

The Design Operating Point node is located inside the Design History node of the Control and Estimation Tools Manager.

The States pane describes the operating point the GUI used to linearize the model. When creating the SISO Design Task node, you can use this pane to import a different operating point and to populate the SISO Design Task node with a linear model evaluated at the new operating point.

SISO Tool Options

To modify the precision of the numbers calculated by SISO Tool, click the SISO Design Task node, and then select Tools > Options. The SISOTool Options dialog box opens.

If you select the Use full precision check box, the SISO Tool uses the full double-precision data type when writing back to the Simulink block dialog box. If you clear this check box, use Custom: n digits of precision to specify the precision you want.

For additional information, see Creating a SISO Design Task.

Was this topic helpful?