getIOTransfer

Closed-loop transfer function from generalized model of control system

Syntax

  • H = getIOTransfer(T,in,out) example
  • H = getIOTransfer(T,in,out,openings) example

Description

example

H = getIOTransfer(T,in,out) returns the transfer function from specified inputs to specified outputs of a control system, computed from a closed-loop generalized model of the control system.

example

H = getIOTransfer(T,in,out,openings) returns the transfer function calculated with one or more loops open.

Examples

expand all

Closed-Loop Responses of Control System Model

Analyze responses of a control system by using getIOTransfer to compute responses between various inputs and outputs of a closed-loop model of the system.

Consider the following control system.

Create a genss model of the system by specifying and connecting the numeric plant models G1 and G2, the tunable controllers C1, and the AnalysisPoint blocks X1 and X2 that mark potential loop-opening or signal injection 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 = AnalysisPoint('X1');
X2 = AnalysisPoint('X2');
T = feedback(G1*feedback(G2*C2,X2)*C1,X1);
T.InputName = 'r';
T.OutputName = 'y';

If you tuned the free parameters of this model (for example, using the Robust Control Toolbox™ tuning command systune), you might want to analyze the tuned system performance by examining various system responses.

For example, examine the response at the output, y, to a disturbance injected at the point d1.

H1 = getIOTransfer(T,'X1','y');

H1 represents the closed-loop response of the control system to a disturbance injected at the implicit input associated with the AnalysisPoint block X1, which is the location of d1:

H1 is a genss model that includes the tunable blocks of T. If you have tuned the free parameters of T, H1 allows you to validate the disturbance response of your tuned system. For example, you can use analysis commands such as bodeplot or stepplot to analyze H1. You can also use getValue to obtain the current value of H1, in which all the tunable blocks are evaluated to their current numeric values.

Similarly, examine the response at the output to a disturbance injected at the point d2.

H2 = getIOTransfer(T,'X2','y');

You can also generate a two-input, one-output model representing the response of the control system to simultaneous disturbances at both d1 and d2. To do so, provide getIOTransfer with a cell array that specifies the multiple input locations.

H = getIOTransfer(T,{'X1','X2'},'y');

Responses with Some Loops Open and Others Closed

Compute the response from r to y of the following cascaded control system, with the inner loop open, and the outer loop closed.

Create a genss model of the system by specifying and connecting the numeric plant models G1 and G2, the tunable controllers C1, and the AnalysisPoint blocks X1 and X2 that mark potential loop-opening or signal injection 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 = AnalysisPoint('X1');
X2 = AnalysisPoint('X2');
T = feedback(G1*feedback(G2*C2,X2)*C1,X1);T.InputName = 'r';
T.OutputName = 'y';

If you tuned the free parameters of this model (for example, using the Robust Control Toolbox tuning command systune), you might want to analyze the tuned system performance by examining various system responses.

For example, compute the response of the system with the inner loop open, and the outer loop closed.

H = getIOTransfer(T,'r','y','X2');

By default, the loops are closed at the analysis points X1 and X2. Specifying 'X2' for the openings argument causes getIOTransfer to open the loop at X2 for the purposes of computing the requested transfer from r to y. The switch at X1 remains closed for this computation.

Input Arguments

expand all

T — Model of control systemgeneralized state-space model

Model of a control system, specified as a Generalized State-Space (genss) Model.

in — Input to extracted transfer functionstring | cell array of strings

Input to extracted transfer function, specified as a string or cell array of strings. To extract a multiple-input transfer function from the control system, use a cell array of strings. Each string in in must match either:

  • An input of the control system model T (in other words, a string contained in T.InputName).

  • An analysis point in T, corresponding to a channel of an AnalysisPoint block in T. Use getpoints(T) to get a full list of available analysis points in T.

    When you specify an analysis point as an input in, getIOTransfer uses the input implicitly associated with the AnalysisPoint channel, arranged as follows.

    This input signal models a disturbance entering at the output of the switch.

If an analysis point has the same name as an input of T, then getIOTransfer uses the input of T.

Example: {'r','X1'}

out — Output of extracted transfer functionstring | cell array of strings

Output of extracted transfer function, specified as a string or cell array of strings. To extract a multiple-output transfer function from the control system, use a cell array of strings. Each string in out must match either:

  • An output of the control system model T (in other words, a string contained in T.OutputName).

  • An analysis point in T, corresponding to a channel of an AnalysisPoint block in T. Use getPoints(T) to get a full list of available analysis points in T.

    When you specify an analysis point as an output out, getIOTransfer uses the output implicitly associated with the AnalysisPoint channel, arranged as follows.

If an analysis point has the same name as an output of T, then getIOTransfer uses the output of T.

Example: {'y','X2'}

openings — Locations for opening feedback loopsstring | cell array of strings

Locations for opening feedback loops for computation of the response from in to out, specified as string or cell array of strings that identify analysis points in T. Analysis points are marked by AnalysisPoint blocks in T. Use getPoints(T) to get a full list of available loop-opening sites in T.

Use openings when you want to compute the response from in to out with some loops in the control system open. For example, in a cascaded loop configuration, you can calculate the response from the system input to the system output with the inner loop open.

Output Arguments

expand all

H — Closed-loop transfer functiongeneralized state-space model

Closed-loop transfer function of the control system T from in to out, returned as a Generalized State-Space (genss) model.

  • If both in and out specify a single signal, then T is a SISO genss model.

  • If in or out identifies multiple signals, then T is a MIMO genss model.

More About

expand all

Tips

  • You can use getIOTransfer to extract various subsystem responses, given a generalized model of the overall control system. This is useful for validating responses of a control system that you tune with the Robust Control Toolbox tuning command systune.

    For example, in addition to evaluating the overall response of a tuned control system from inputs to outputs, you can use getIOTransfer to extract the transfer function from a disturbance input to a system output. Evaluate the responses of that transfer function (such as with step or bode) to confirm that the tuned system meets your disturbance rejection requirements.

  • getIOTransfer is the genss equivalent to the Simulink® Control Design™ getIOTransfer command, which works with the slTuner and slLinearizer interfaces. Use the Simulink Control Design command when your control system is modeled in Simulink.

Was this topic helpful?