getPIDLoopResponse
Closed-loop and open-loop responses of systems with PID controllers
Description
returns a response of the control loop formed by the PID controller response
= getPIDLoopResponse(C
,G
,looptype
)C
and the plant G
. The function returns the closed-loop, open-loop,
controller action, or disturbance response that you specify with the
looptype
argument. The function assumes the following control
architecture.
When
C
is apid
orpidstd
controller object (1-DOF controller):When
C
is apid2
orpidstd2
controller object (2-DOF controller):
Examples
Validate Controller Performance by Examining Closed-Loop Responses
Design a PI controller for a SISO plant and examine its performance in reference tracking and disturbance rejection. For reference tracking, use the "closed-loop"
response. For rejection of a load disturbance, use "input-disturbance"
.
G = tf(1,[1 1 1]); C = pidtune(G,'PI'); Tref = getPIDLoopResponse(C,G,"closed-loop"); Tdist = getPIDLoopResponse(C,G,"input-disturbance"); step(Tref,Tdist) legend("Reference Tracking","Disturbance Rejection")
Validate the tuned controller by comparing the extracted responses to your design requirements for settling time and overshoot.
Responses of System with 2-DOF PID Controller
Design a two-degree-of-freedom (2-DOF) PID controller for a plant and examine its performance in reference tracking and disturbance rejection. For reference tracking, use the "closed-loop"
response. For rejection of a load disturbance, use "input-disturbance"
.
G = tf(1,[1 0.5 0.1]); w0 = 1.5; C = pidtune(G,'PID2',w0); Tref = getPIDLoopResponse(C,G,"closed-loop"); Tdist = getPIDLoopResponse(C,G,"input-disturbance"); step(Tref,Tdist) legend("Reference Tracking","Disturbance Rejection")
Input Arguments
G
— Plant
dynamic system model
Plant, specified as a SISO dynamic system model, such as a tf
,
ss
, zpk
, or frd
model object. If
G
is a model with tunable or uncertain elements (such as a
genss
or uss
model), then the function uses the
current or nominal value of the model.
looptype
— Loop response to return
string | character vector
Loop response to return, specified as a string or character vector. The available loop responses are given in the following table.
Response | 1-DOF Controller | 2-DOF Controller | Description |
---|---|---|---|
"open-loop" | GC | –GCy | Response of the open-loop controller-plant system. Use for frequency-domain
design. Use when your design specifications include robustness criteria such as open-loop gain margin and phase margin. |
"closed-loop" | (from r to y) | (from r to y) | Closed-loop system response to a step change in setpoint. Use when your design specifications include setpoint tracking. |
"controller-effort" | (from r to u) | (from r to u) | Closed-loop controller output response to a step change in setpoint. Use when your design is limited by practical constraints, such as controller saturation. |
"input-disturbance" | (from d1 to y) | (from d1 to y) | Closed-loop system response to load disturbance (a step disturbance at the plant input). Use when your design specifications include input disturbance rejection. |
"output-disturbance" | (from d2 to y) | (from d2 to y) | Closed-loop system response to a step disturbance at plant output. Use when you want to analyze sensitivity to modeling errors. |
Output Arguments
response
— Selected loop response
ss
model | frd
model
Selected loop response, returned as a state-space (ss
) or
frequency-response data (frd
) model. If G
is an
frd
model, then response
is also an
frd
model with the same frequencies as G
.
Otherwise, response
is an ss
model.
Version History
Introduced in R2019a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)