Get list of loop opening sites in generalized model of control system
Build a closed-loop model of a cascaded feedback loop system, and get a list of loop-opening sites in the model.
Create a model of the following cascaded feedback loop. C1 and C2 are tunable controllers. X1 and X2 are loop-opening sites.
G1 = tf(10,[1 10]); G2 = tf([1 2],[1 0.2 10]); C1 = ltiblock.pid('C','pi'); C2 = ltiblock.gain('G',1); X1 = loopswitch('X1'); X2 = loopswitch('X2'); T = feedback(G1*feedback(G2*C2,X2)*C1,X1);
T is a genss model whose Control Design Blocks include the tunable controllers and the switches X1 and X2.
Get a list of the loop-opening sites in T.
Locations = getSwitches(T)
Locations = 'X1' 'X2'
getSwitches returns a cell array listing loop-opening sites in the model.
For more complicated closed-loop models, you can use getSwitches to keep track of a larger number of loop-opening sites. You can use these loop-opening sites to specify an open-loop response to compute. For instance, the following command computes the open-loop response of the inner loop, with the outer loop open.
L = getLoopTransfer(T,'X2',-1,'X1');
Loop-opening sites in the control system model, returned as a cell array of strings. The strings contain the loop channel names. These loop channel names are the contents of the Location property of each loopswitch block in the control system model.