Current value of Control Design Block in Generalized Model
val = getBlockValue(M,blockname)
[val1,val2,...] = getBlockValue(M,blockname1,blockname2,...)
S = getBlockValue(M)
returns the current value of the Control Design
Block
val
= getBlockValue(M
,blockname
)blockname
in the Generalized Model
M
. (For uncertain blocks, the “current value” is the
nominal value of the block.)
[
returns the values of the specified Control Design Blocks.val
1,val2,...] = getBlockValue(M
,blockname
1,blockname2,...)
returns the values of all Control Design Blocks of the generalized model in a structure.
This syntax lets you transfer the block values from one generalized model to another
model that uses the same Control Design Blocks, as follows:
S
= getBlockValue(M
)
S = getBlockValue(M1); setBlockValue(M2,S);
|
Generalized LTI ( |
|
Name of the Control
Design Block in the model To get a list of the Control Design Blocks in |
|
Numerical LTI model or numerical value, equal to the current value of the
Control Design Block |
|
Current values of all Control Design Blocks in |
Create a tunable genss
model, and evaluate the
current value of the Control Design Blocks of the model.
Typically, you use getBlockValue
to retrieve the tuned values
of control design blocks after tuning the genss
model using a
tuning command such as systune
. For this example, create the
model and retrieve the initial block values.
G = zpk([],[-1,-1],1); C = tunablePID('C','PID'); a = realp('a',10); F = tf(a,[1 a]); T = feedback(G*C,1)*F; Cval = getBlockValue(T,'C')
Continuous-time I-only controller: 1 Ki * --- s With Ki = 0.001
Cval
is a numeric pid
controller object.
aval = getBlockValue(T,'a')
aval = 10
aval
is a numeric scalar, because a
is a
real scalar parameter.
Using the genss
model of the previous
example, get the current values of all blocks in the model.
G = zpk([],[-1,-1],1); C = tunablePID('C','PID'); a = realp('a',10); F = tf(a,[1 a]); T = feedback(G*C,1)*F; S = getBlockValue(T)
S = C: [1x1 pid] a: 10