Closed-Loop Analysis
The Closed-Loop Analysis computes and visualizes the frequency- and time-domain properties of a feedback system by linearizing the model around an operating point. This analysis is useful for assessing stability, robustness, and performance of the closed-loop system.
Method Overview
The analysis considers the standard feedback interconnection:
d
┌─────┐ │ ┌─────┐
r e │ │u ▼ │ │ y
──+─►│ C ├──+─►│ P ├─┬─►
▲ │ │ │ │ │
-│ └─────┘ └─────┘ │
│ │
└──────────────────────┘
where C
is the controller, P
is the plant, r
is the reference, d
is an input disturbance, y
is the measured output, and u
is the control input.
The analysis linearizes the model and computes:
Closed-loop transfer functions:
Sensitivity:
. For MIMO systems, the output sensitivity is computed. Complementary sensitivity:
Controller sensitivity:
Plant sensitivity:
Robustness margins:
Disk margin (combined gain and phase margin). For MIMO systems, the simultaneous margin at the output is computed.
Classical gain and phase margins
Step responses to reference and disturbance inputs
Example Definition
This example is a continuation of the DC Motor Control tutorial. We will analyze the closed-loop properties of the transfer function from load disturbance (entering at the plant input u
) to output y
.
analysis DCMotorClosedLoopAnalysis
extends DyadControlSystems.ClosedLoopAnalysis(
measurement = ["y"],
control_input = ["u"],
loop_openings = ["r"],
wl = 1,
wu = 1e4,
num_frequencies = 300,
pos_feedback = true,
duration = 2.0
)
model = DyadExampleComponents.TestDCMotorLoadControlled()
end
using DyadInterface: artifacts
asol = DCMotorClosedLoopAnalysis()
ClosedLoopAnalysisSolution
Phase margin (disk based): 34.9°
Gain margin (disk based): ["0.5", "1.9"]
using Plots
plot!(artifacts(asol, :all); size=(1200,1200))
Analysis Arguments
The following arguments define a ClosedLoopAnalysis:
Required Arguments
model
: The model to be analyzed.measurement::Vector{String}
: Name of the measurement signal analysis points (plant outputs).control_input::Vector{String}
: Name of the control input signal analysis points.
Optional Arguments
wl::Real = -1
: Lower frequency bound for analysis (set to -1 for automatic selection).wu::Real = -1
: Upper frequency bound for analysis (set to -1 for automatic selection).num_frequencies::Int = 300
: Number of frequency points.pos_feedback::Bool = true
: Whether the feedback is positive (default is true; negative feedback is often built into the model).duration::Real = -1.0
: Duration of the step-response simulation (set to -1 for automatic selection).
Artifacts
A ClosedLoopAnalysis returns the following artifacts:
Standard Plots
all
: Combined plot showing:Bode plots of
, , , Disk margin and classical margins
Step responses to reference and disturbance steps
Further Reading
Notes about MIMO Systems
When MIMO systems are analyzed, some sensitivity functions are drawn as Sigma plots rather than Bode plots. The disk margin is in this case computed for the output loop-transfer function