| Contents | Index |
Interface for control system tuning of Simulink models using looptune or hinfstruct
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:
Specify the control architecture.
Extract information about the control system, such as linearized open-loop and closed-loop responses.
Designate and parametrize blocks to be tuned.
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.
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.
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. |
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:
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
|
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:
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
|
| addBlock | Add block to list of tuned blocks |
| addControl | Add control signal to list of control signals in slTunable interface |
| addIO | Add I/O points list of linearization I/Os in slTunable interface |
| addMeasurement | Add measurement signal to list of measurement signals in slTunable interface |
| addOpening | Add new opening location to list of loop openings in slTunable interface |
| addSwitch | Add switch location to list of loop opening switches in slTunable interface |
| getBlockParam | Get parametrization of a particular tuned block in slTunable interface |
| getBlockValue | Current value of a particular tuned block in slTunable interface |
| getIOTransfer | Tunable model of closed-loop transfer function between specified linearization I/Os |
| getLoopTransfer | Tunable model of open-loop transfer function at specified location |
| linearize | Relinearize Simulink model to update slTunable interface |
| looptune | Tune MIMO control systems in Simulink |
| loopview | Graphically analyze results of control system tuning |
| readBlockValue | Update tuned block values from Simulink model |
| setBlockParam | Specify parametrization for specified tuned block |
| setBlockValue | Set current value of parametrization for specified block |
| showBlockValue | Display current value of block parametrizations |
| writeBlockValue | Update block values in Simulink model |
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.
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.
slTunable linearizes your Simulink model using the algorithms described in Exact Linearization Algorithm.
TuningGoal.LoopShape | TuningGoal.MaxGain | TuningGoal.Tracking

Learn more about resources for designing, testing, and implementing control systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |