Documentation Center

  • Trial Software
  • Product Updates

writeBlockValue

Update block values in Simulink model

Syntax

  • writeBlockValue(st) example
  • writeBlockValue(st,m)

Description

example

writeBlockValue(st) writes tuned parameter values from the slTuner interface, st, to the Simulink® model that st describes. Use this command, for example, to validate parameters of a control system that you tuned using systune or looptune.

writeBlockValue skips blocks that cannot represent their tuned value in a straightforward and lossless manner. For example, suppose you tune an user defined Subsystem or S-Function block. writeBlockValue will skip this block because there is no clear way to map the tuned value to a Subsystem or S-Function block. Similarly, if you parameterize a Gain block as a second-order transfer function, writeBlockValue will skip this block, unless the transfer function value is a static gain.

writeBlockValue(st,m) writes tuned parameter values from a generalized model, m, to the Simulink model described by the slTuner interface, st.

Examples

expand all

Update Simulink Model with All Tuned Parameters

Create an slTuner interface for the scdcascade model, and tune the parameters of its controller blocks. Write the tuned parameter values from the slTuner interface to the Simulink model.

Create an slTuner interface.

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

Specify the tuning goals and necessary analysis points.

tg1 = TuningGoal.StepResp('r','y1m',5);

addPoint(st,{'r','y1m'});

tg2 = TuningGoal.Poles();
tg2.MaxFrequency = 10;

Tune the controller.

[sttuned,fSoft] = systune(st,[tg1 tg2]);

After validating the tuning results, update the model to use the tuned controller values.

writeBlockValue(sttuned);

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.

m — Tuned control systemgeneralized state-space

Tuned control system, specified as a generalized state-space model (genss).

Typically, m is the output of a tuning function like systune, looptune, or hinfstruct. The model m must have some tunable parameters in common with st. For example, m can be a generalized model that you obtained by linearizing your Simulink model, and then tuned to meet some design requirements.

See Also

| | |

Was this topic helpful?