getBlockParam

Get parameterization of tuned block in slTuner interface

Syntax

  • blk_param = getBlockParam(st,blk) example
  • [blk_param1,...,blk_paramN] = getBlockParam(st,blk1,...,blkN)
  • [blk_param1,...,blk_paramN] = getBlockParam(st)

Description

example

blk_param = getBlockParam(st,blk) returns the parameterization used to tune the Simulink® block, blk.

The slTuner interface automatically associates a parametric model with each Simulink block in the list of tuned blocks. This parametrization models each tuned block as a Control Design Block or a tunable genss model. The parameterization specifies which parameters are tuned by commands such as systune or looptune. Use getBlockParam to access this parameterization.

Use setBlockParam to override the default parameterization for a given block, and setBlockValue to initialize or modify the tuned parameter values in blk_param.

[blk_param1,...,blk_paramN] = getBlockParam(st,blk1,...,blkN) returns the parameterizations of one or more blocks.

[blk_param1,...,blk_paramN] = getBlockParam(st) returns the parameterizations of all the tuned blocks of st (in their order of appearance in st.TunedBlocks).

Examples

expand all

Get Parameterization of Tuned Block

Create an slTuner interface for the Simulink model, scdcascade, and examine the block parameterization of one of the tuned blocks.

open_system('scdcascade');
st = slTuner('scdcascade',{'C1','C2'});

blk_param = getBlockParam(st,'C1')
blk_param =

  Parametric continuous-time PID controller "C1" with formula:

             1 
  Kp + Ki * ---
             s 

  and tunable parameters Kp, Ki.

Type "pid(blk_param)" to see the current value and "get(blk_param)" to see all properties.

The block C1 is a PID Controller block. Therefore, its parameterization in st is a ltiblock.pid (a Control Design Block).

Input Arguments

expand all

st — Interface for tuning control systems modeled in SimulinkslTuner interface

Interface for tuning control systems modeled in Simulink, specified as an slTuner interface.

blk — Blockstring

Block in the list of tuned blocks for st, specified as a string.

You can specify the full block path or any portion of the block path that uniquely identifies the block among the other tuned blocks of st.

For example, blk = 'scdcascade/C1' or blk = 'C1'.

Output Arguments

expand all

blk_param — Parameterization of tuned blockcontrol design block | generalized state-space model | []

Parameterization of the specified tuned block, returned as one of the following:

More About

expand all

Tuned Blocks

Tuned blocks, used by the slTuner interface, identify blocks in a Simulink model whose parameters are to be tuned to satisfy tuning goals. You can tune most Simulink blocks that represent linear elements such as gains, transfer functions, or state-space models. (For the complete list of blocks that support tuning, see How Tuned Simulink Blocks Are Parameterized.) You can also tune more complex blocks such as SubSystem or S-Function blocks by specifying an equivalent tunable linear model.

Use commands such as systune and looptune to tune the parameters of tuned blocks.

You must specify tuned blocks (for example, C1 and C2) when you create an slTuner interface:

st = slTuner('scdcascade',{'C1','C2'})

You can modify the list of tuned blocks using addBlock and removeBlock. Use commands such as setBlockParam, getBlockValue, and writeBlockValue to interact with and manipulate tuned blocks.

Was this topic helpful?