Skip to Main Content Skip to Search
Product Documentation

slTunable class -

Interface for control system tuning of Simulink models using looptune or hinfstruct

Description

slTunable provides an interface between a Simulink model and tuning commands such as slTunable.looptune. (Using slTunable.looptune requires Robust Control Toolbox software). slTunable allows you to:

Because tuning commands such as looptune operate on linear models, the slTunable interface automatically computes and stores a linearization of your Simulink model. (For more information about linearization, see linearize). slTunable also parametrizes the tunable portion of your control system. You can use slTunable and its methods for tuning and analyzing the control system.

Commands that query the linearization stored in the slTunable interface automatically relinearize the Simulink model if you have changed any properties of the slTunable interface since the last linearization. Such commands include slTunable.looptune, slTunable.getIOTransfer, and slTunable.getLoopTransfer.

Construction

ST = slTunable(mdl,tunedblocks) creates an slTunable interface ST for tuning the blocks tunedblocks of the Simulink model mdl. Creating ST automatically parametrizes the blocks specified by tunedblocks. The interface ST also stores a linearization of mdl, computed at the operating point and linearization I/O points specified in the model.

ST = slTunable(mdl,tunedblocks,io) further specifies a vector io of linearization I/O points for analysis and tuning of the control system.

ST = slTunable(mdl,tunedblocks,io,op) also specifies an operating point op for linearizing the model.

ST = slTunable(...,options) specifies additional options for linearizing mdl.

ST = slTunable(...,Name,Value) sets the additional properties of ST specified by one or more Name,Value pair arguments. Name is a property name, and Value is the corresponding value. Name must appear inside single quotes (''). You can specify several name-value pair arguments in any order as Name1,Value1,...,NameN,ValueN. Specifying properties of ST in this way saves repeated linearization by ensuring that the interface is fully configured before linearizing the model.

Input Arguments

mdl

String specifying name of Simulink model.

tunedblocks

String or cell array of strings specifying the Simulink block or blocks to tune. You can specify an abbreviated block name provided that the string matches the end of the full block path and unambiguously identifies the block to tune.

slTunable automatically parametrizes the blocks listed in tunedblocks. To override the default parametrization, use slTunable.setBlockParam.

io

Vector of I/O points for linearization, tuning, and analysis of the control system. (For more information about I/O points, see linio.) These I/O points specify which signals are model inputs, outputs, and loop opening locations. Only signals specified in io or added with slTunable.addIO are available in the interface ST for tuning and analysis.

op

Operating point specification for linearizing mdl. For more information about operating point specifications, see operpoint and findop.

options

Option set specifying additional options for the linearization of mdl. Use linoptions to create options. For information about available options, see the linoptions reference page.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'Controls'

Cell array of strings specifying the controller outputs that drive the actuators in the control system. These strings correspond to signal names in mdl.

The Controls and Measurements properties of ST define the boundary between the plant and controller in mdl for tuning with slTunable.looptune.

Use slTunable.addControl to specify additional control signals in the Controls property of an existing slTunable interface.

Default: 0-by-1 cell array

'IOs'

Cell array of strings specifying the input and output signals available for analysis and tuning. Each signal is characterized by:

  • Full path in the model, either:

    BlockPath/PortNumber[SignalName]

    or

    BlockPath/PortNumber[BusElement1.BusElement2]
  • Linearization I/O type 'in', 'out', 'inout', or 'outin'.

ST.IOs automatically includes all the linearization I/O points specified in the model. To remove a linearization I/O from ST.IOs, delete a row from the cell array. For example, the following command deletes the second I/O from ST.IOs.

ST.IOs(2,:) = [];

To add a linearization I/O to ST, use slTunable.addIO.

For more information about linearization I/O points, see linio.

Default: 0-by-2 cell array

'LinearizeOptions'

Options set for linearizing mdl. Use linoptions to create the options set. Use slTunable.linearize to relinearize mdl and update the slTunable interface after changing LinearizeOptions.

'Measurements'

Cell array of strings specifying the sensor outputs that feed the controller in the control system. These strings correspond to signal names in mdl. The Controls and Measurements properties of ST define the boundary between the plant and controller in mdl for tuning with slTunable.looptune.

Use slTunable.addMeasurement to specify additional measurement signals in the Measurement property of an existing slTunable interface.

Default: 0-by-1 cell array

'ModelName'

String specifying the name of the model being analyzed or tuned. ModelName is set by the input argument mdl.

'Notes'

User notes. This property can store any text as a string or cell array of strings. For example:

ST.Notes = 'This model was created on Jan. 1st, 2011.';

Default: {}

'Openings'

Cell array of strings specifying signal locations in mdl where feedback loops are broken. The loop openings are enforced in all tuning and validation commands such as slTunable.looptune and slTunable.loopview.

Loop opening locations are stored in the Openings property as the full path name of the corresponding signal in mdl, either:

BlockPath/PortNumber[SignalName]

or

BlockPath/PortNumber[BusElement1.BusElement2]

Use slTunable.addOpening to add additional loop openings to the Opening property of an existing slTunable interface. To remove a loop opening location, delete a row from the cell array. For example, the following command deletes the second I/O from ST.Openings.

ST.Openings(2,:) = [];

Default: 0-by-1 cell array

'OperatingPoint'

Operating point specification for linearizing mdl. Use slTunable.linearize to relinearize mdl and update the slTunable interface after changing OperatingPoint.

For more information about operating point specifications, see operpoint and findop.

'Ts'

Working sampling time for analysis and tuning. mdl is linearized at this sampling time.

Default: 0

'Switches'

Cell array specifying signal locations in mdl where feedback loops may be broken for analysis or tuning purposes. Switches differs from Openings in that the loop openings specified in Openings are always enforced in tuning and analysis. In contrast, locations specified in Switches are closed by default unless you explicitly specify them open. You can specify switch locations as openings in commands such as slTunable.getIOTransfer, slTunable.getLoopTransfer, or TuningGoal.LoopShape.

Switch locations are stored in the Switches property as the full path name of the corresponding signal in mdl, either:

BlockPath/PortNumber[SignalName]

or

BlockPath/PortNumber[BusElement1.BusElement2]

Use slTunable.addSwitch to add additional loop openings to the Switches property of an existing slTunable interface. To remove a loop opening location, delete a row from the cell array. For example, the following command deletes the second I/O from ST.Switches.

ST.Switchess(2,:) = [];

Default: 0-by-1 cell array

'TunedBlocks'

Cell array of strings specifying full paths to the tuned blocks in mdl.

When you create an slTunable interface, the TunedBlocks property is automatically populated with the blocks you specify in the tunedblocks input. To specify additional tunable blocks in an existing an existing slTunable interface, use slTunable.addBlock

Properties

Controls

Cell array of strings specifying the controller outputs that drive the actuators in the control system. These strings correspond to signal names in mdl.

The Controls and Measurements properties of ST define the boundary between the plant and controller in mdl for tuning with slTunable.looptune.

Use slTunable.addControl to specify additional control signals in the Controls property of an existing slTunable interface.

Default: 0-by-1 cell array

IOs

Cell array of strings specifying the input and output signals available for analysis and tuning. Each signal is characterized by:

  • Full path in the model, either:

    BlockPath/PortNumber[SignalName]

    or

    BlockPath/PortNumber[BusElement1.BusElement2]
  • Linearization I/O type 'in', 'out', 'inout', or 'outin'.

ST.IOs automatically includes all the linearization I/O points specified in the model. To remove a linearization I/O from ST.IOs, delete a row from the cell array. For example, the following command deletes the second I/O from ST.IOs.

ST.IOs(2,:) = [];

To add a linearization I/O to ST, use slTunable.addIO.

For more information about linearization I/O points, see linio.

Default: 0-by-2 cell array

LinearizeOptions

Options set for linearizing mdl. Use linoptions to create the options set. Use slTunable.linearize to relinearize mdl and update the slTunable interface after changing LinearizeOptions.

Measurements

Cell array of strings specifying the sensor outputs that feed the controller in the control system. These strings correspond to signal names in mdl. The Controls and Measurements properties of ST define the boundary between the plant and controller in mdl for tuning with slTunable.looptune.

Use slTunable.addMeasurement to specify additional measurement signals in the Measurement property of an existing slTunable interface.

Default: 0-by-1 cell array

ModelName

String specifying the name of the model being analyzed or tuned. ModelName is set by the input argument mdl.

Notes

User notes. This property can store any text as a string or cell array of strings. For example:

ST.Notes = 'This model was created on Jan. 1st, 2011.';

Default: {}

Openings

Cell array of strings specifying signal locations in mdl where feedback loops are broken. The loop openings are enforced in all tuning and validation commands such as slTunable.looptune and slTunable.loopview.

Loop opening locations are stored in the Openings property as the full path name of the corresponding signal in mdl, either:

BlockPath/PortNumber[SignalName]

or

BlockPath/PortNumber[BusElement1.BusElement2]

Use slTunable.addOpening to add additional loop openings to the Opening property of an existing slTunable interface. To remove a loop opening location, delete a row from the cell array. For example, the following command deletes the second I/O from ST.Openings.

ST.Openings(2,:) = [];

Default: 0-by-1 cell array

OperatingPoint

Operating point specification for linearizing mdl. Use slTunable.linearize to relinearize mdl and update the slTunable interface after changing OperatingPoint.

For more information about operating point specifications, see operpoint and findop.

Ts

Working sampling time for analysis and tuning. mdl is linearized at this sampling time.

Default: 0

Switches

Cell array specifying signal locations in mdl where feedback loops may be broken for analysis or tuning purposes. Switches differs from Openings in that the loop openings specified in Openings are always enforced in tuning and analysis. In contrast, locations specified in Switches are closed by default unless you explicitly specify them open. You can specify switch locations as openings in commands such as slTunable.getIOTransfer, slTunable.getLoopTransfer, or TuningGoal.LoopShape.

Switch locations are stored in the Switches property as the full path name of the corresponding signal in mdl, either:

BlockPath/PortNumber[SignalName]

or

BlockPath/PortNumber[BusElement1.BusElement2]

Use slTunable.addSwitch to add additional loop openings to the Switches property of an existing slTunable interface. To remove a loop opening location, delete a row from the cell array. For example, the following command deletes the second I/O from ST.Switches.

ST.Switchess(2,:) = [];

Default: 0-by-1 cell array

TunedBlocks

Cell array of strings specifying full paths to the tuned blocks in mdl.

When you create an slTunable interface, the TunedBlocks property is automatically populated with the blocks you specify in the tunedblocks input. To specify additional tunable blocks in an existing an existing slTunable interface, use slTunable.addBlock

Methods

addBlockAdd block to list of tuned blocks
addControlAdd control signal to list of control signals in slTunable interface
addIOAdd I/O points list of linearization I/Os in slTunable interface
addMeasurementAdd measurement signal to list of measurement signals in slTunable interface
addOpeningAdd new opening location to list of loop openings in slTunable interface
addSwitchAdd switch location to list of loop opening switches in slTunable interface
getBlockParamGet parametrization of a particular tuned block in slTunable interface
getBlockValueCurrent value of a particular tuned block in slTunable interface
getIOTransferTunable model of closed-loop transfer function between specified linearization I/Os
getLoopTransferTunable model of open-loop transfer function at specified location
linearizeRelinearize Simulink model to update slTunable interface
looptuneTune MIMO control systems in Simulink
loopviewGraphically analyze results of control system tuning
readBlockValue Update tuned block values from Simulink model
setBlockParamSpecify parametrization for specified tuned block
setBlockValueSet current value of parametrization for specified block
showBlockValueDisplay current value of block parametrizations
writeBlockValueUpdate block values in Simulink model

Copy Semantics

To make an independently modifiable copy of an slTunable interface, use the copy command. For example:

ST = copy(STO)

creates an slTunable interface ST that initially contains identical values to ST0 for all properties. You can now modify ST without changing ST0.

slTunable a handle class. To learn more about how handle classes affect copy operations, see Copying Objects in the MATLAB Programming Fundamentals documentation.

Examples

Create and Configure slTunable Interface

Create and configure a slTunable interface for tuning the Simulink model rct_cascade using slTunable.looptune.

Open the Simulink model.

open_system('rct_cascade')

Create the slTunable interface for rct_cascade.

tunedblocks = {'C1','C2'};
ST0 = slTunable('rct_cascade',tunedblocks);

The tunable blocks of this model are the PID controllers, C1 and C2. This command the slTunable interface ST0 with those tunable blocks.

Specify the control and measurement signals of the control system.

addControl(ST0,'u2');
addMeasurement(ST0,{'y1','y2m'});

The commands slTunable.addControl and slTunable.addMeasurement add the specified signals to the Controls and Measurements properties of ST0.

Control and measurement signals define the boundary between plant and controller for tuning with slTunable.looptune. In rct_cascade, the actuator signal is u2, the output of the inner-loop controller. The measurement signals are y1 and y2m, each of which feeds into a portion of the cascaded controller.

Specify the signal y1 as a location for an optional loop opening (a switch).

addSwitch(ST0,'y1');

When tuning a cascade control system, it can be useful to impose certain requirements on the inner loop that are enforced with the outer loop open. However, such a control system also has overall requirements are enforced with all loops closed. Therefore, add a switch location, instead of a loop opening location.

You can now use ST0 to tune the control system with slTunable.looptune. See the Robust Control Toolbox demo Tuning of Cascaded PID Loops for more information.

Algorithms

slTunable linearizes your Simulink model using the algorithms described in Exact Linearization Algorithm.

See Also

TuningGoal.LoopShape | TuningGoal.MaxGain | TuningGoal.Tracking

Tutorials

How To

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS