MATLAB simulation of a closed-loop analog control system with transport delays, sensor dynamics, and actuator saturation.
The controlled plant consists of:
- Integrating element —
1 / (s·Tᵢ) - First-order inertia —
Kₚ / (1 + s·Tₚ) - Second-order oscillatory element —
1 / (1 + s·a₁ + s²·a₂) - Transport delay —
e^(−s·T₀)
The full open-loop plant transfer function:
Kₚ · e^(−s·T₀)
G(s) = ——————————————————————————————————————————
s·Tᵢ · (1 + s·Tₚ) · (1 + s·a₁ + s²·a₂)
| Folder / File | Method |
|---|---|
szukanie_Kp.m |
Proportional gain sweep (overshoot & settling time) |
LEAD/ |
Lead compensator via root-locus |
LAG/ |
Lag compensator (Bode design) |
LEAD-LAG/ |
Combined Lead-Lag compensator |
STATE FEEDBACK/ |
Full state-feedback with Luenberger observer |
tuning_z_n.m |
Ziegler-Nichols PID tuning |
pid_optim.m + pid_cost.m |
PID optimization (ITAE criterion, fminsearch) |
main.m |
Unified simulation — compares selected controller vs. baseline |
- Time-domain simulation using trapezoidal (Heun) integration
- Actuator saturation at ±5 V
- Step and ramp reference inputs
- Comparison plots of designed controller vs. proportional baseline
- MATLAB R2020a or later
- Control System Toolbox
% Run the main simulation (default: Lead-Lag + State Feedback comparison)
main
% Sweep proportional gain to find optimal Kp
szukanie_Kp
% Optimize PID parameters
pid_optim