getBlockRateConversion

Get rate conversion settings for tuned block in slTuner interface

Syntax

  • method = getBlockRateConversion(st,blk) example
  • [method,pwf] = getBlockRateConversion(st,blk)

Description

example

method = getBlockRateConversion(st,blk) returns the rate conversion method associated with the tuned block, blk.

Tuning is performed at the sampling rate specified by the Ts property of the slTuner interface. When you use writeBlockValue to write tuned parameters back to the Simulink® model, each tuned block value is automatically converted from the sample, Ts, to the sample time of the Simulink block. The rate conversion method associated with each tuned block specifies how this resampling operation should be performed.

[method,pwf] = getBlockRateConversion(st,blk) also returns the prewarp frequency. When method is not 'tustin', the prewarp frequency is always 0.

Examples

expand all

Get Rate Conversion Settings of Tuned Block

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

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

[method,pwf] = getBlockRateConversion(st,'C1')
method =

tustin


pwf =

     0

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

method — Rate conversion method'zoh' | 'tustin'

Rate conversion method associated with blk, returned as one of the following strings:

  • 'zoh' — Zero-order hold method

  • 'tustin' — Tustin method

pwf — Prewarp frequency for Tustin methodpositive scalar

Prewarp frequency for the Tustin method, returned as a positive scalar.

If the rate conversion method associated with blk is zero-order hold or Tustin without prewarp, then pwf is 0.

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?