MATLAB scripts for Control Systems laboratory exercises covering transfer function analysis, step response characterization, frequency-domain techniques, root locus design, and PID controller tuning.
- 📐 Transfer Function Analysis — Define, manipulate, and analyze system TFs
- 📈 Step Response — Time-domain performance metrics (rise time, overshoot, settling time)
- 📊 Bode Plots — Frequency response: magnitude and phase diagrams
- 🎯 Root Locus — Pole trajectory analysis for gain variation
- 🔄 Nyquist Plots — Stability assessment via Nyquist criterion
- 🎛️ PID Controller Design — Proportional-Integral-Derivative tuning
- ➗ Laplace Transforms — Symbolic inverse Laplace and ODE solutions
- 📍 Pole-Zero Maps — System stability visualization
control-systems-lab-matlab/
├── README.md
├── .gitignore
├── lab1_transfer_functions.m # TF analysis, partial fractions, Laplace, ODE
└── labs_comprehensive.m # Labs 1–5: step response, Bode, root locus, PID, Nyquist
- MATLAB R2020a or later
- Control System Toolbox
- Symbolic Math Toolbox
- Clone this repository:
git clone https://github.com/q-ms8/control-systems-lab-matlab.git
- Open MATLAB and run:
>> lab1_transfer_functions >> labs_comprehensive
| Script | Topics Covered | Key MATLAB Functions |
|---|---|---|
lab1_transfer_functions.m |
Partial fraction decomposition, transfer function step response, pole-zero mapping, inverse Laplace transforms, ODE solutions | residue(), tf(), step(), pzmap(), ilaplace(), syms |
labs_comprehensive.m |
Lab 1: System modeling with TFs Lab 2: Step response & performance specs Lab 3: Bode plot analysis Lab 4: Root locus design Lab 5: PID controller design & Nyquist plots | tf(), step(), stepinfo(), bode(), rlocus(), nyquist(), pid() |
A system's input-output relationship in the s-domain:
G(s) = Y(s) / X(s) = (bmsm + ... + b1s + b0) / (ansn + ... + a1s + a0)
| Metric | Description |
|---|---|
| Rise Time (tr) | Time to go from 10% to 90% of final value |
| Overshoot (Mp) | Peak value above steady-state (%) |
| Settling Time (ts) | Time to stay within ±2% of final value |
| Steady-State Error (ess) | Final offset from desired value |
- Bode: Gain margin > 0 dB and phase margin > 0° at crossover frequencies
- Nyquist: Number of encirclements of (−1, 0) determines closed-loop stability
- Root Locus: All closed-loop poles must be in the left-half s-plane
- 📈 Step response curves with annotated rise time, overshoot, and settling time
- 📊 Bode magnitude and phase plots with stability margins
- 🌀 Root locus diagrams showing pole migration with gain
- 🔄 Nyquist contour plots for stability analysis
- 📍 Pole-zero maps for system characterization
This project is licensed under the MIT License — see the LICENSE file for details.