From-scratch, zero-dependency C implementations of classical frequency-domain control theory — Bode, Nyquist, Nichols, and robustness analysis
| Sub-Module | Topics | Key Courses |
|---|---|---|
| mini-bandwidth-design | Bandwidth allocation in multiloop/cascade control, bandwidth separation rules (ω_B_inner ≥ 3~5·ω_B_outer), RGA pairing, bandwidth budgeting (Stein 2003) | MIT 6.302, Stanford ENGR105 |
| mini-bode-plot | Bode magnitude (dB) and phase plots, asymptotic approximation (straight-line), Bode stability criterion, frequency response computation via Horner's method | MIT 6.302, Stanford ENGR105, Caltech CDS 110 |
| mini-frequency-compensation | Lead/lag/lead-lag compensator design, PID frequency-domain interpretation, notch filter, phase margin improvement, steady-state error reduction | MIT 6.302, Stanford ENGR105 |
| mini-gain-phase-margin | Gain margin (GM), phase margin (PM), delay margin (DM), vector margin (modulus margin), disk margin, crossover frequency detection | MIT 6.302, Stanford ENGR105, Berkeley ME132 |
| mini-loop-shaping | Loop transfer L(s)=G(s)C(s) design via pole-zero placement, QFT methodology, performance/robustness/noise tradeoffs, sensitivity analysis | MIT 6.302, Cambridge 3F2, Stanford ENGR105 |
| mini-nichols-chart | Nichols chart (open-loop dB vs. phase), M-circles (constant closed-loop magnitude), N-circles (constant closed-loop phase), closed-loop performance from open-loop | MIT 6.302, Stanford ENGR105, Berkeley ME132 |
| mini-nyquist-criterion | Nyquist stability criterion (N=Z-P), contour mapping, Cauchy argument principle, encirclements of −1+j0, stability for non-minimum-phase and delayed systems | MIT 6.302, Stanford ENGR105, Caltech CDS 110, Cambridge 3F2 |
| mini-robustness-freq | Robustness metrics, S/T sensitivity functions, Bode sensitivity integral (waterbed effect), small gain theorem, multiplicative/additive uncertainty models | MIT 6.302, Stanford ENGR210B, ETH 151-0563 |
-
From-Scratch Core — Every module in this repository implements control algorithms and data structures from first principles in pure C, with zero external dependencies beyond the C standard library.
-
Nine-Level Knowledge Coverage — Each sub-module spans L1 (definitions/data structures) through L6 (complete implementations) with partial coverage of L7–L9 (advanced theory, research frontiers, cross-domain applications).
-
Lecture-Auditable Code — The source code is structured to be readable alongside classical control textbooks (Ogata, Franklin, Åström, Skogestad), with header-file comments that map directly to lecture topics from MIT, Stanford, Caltech, and Cambridge.
-
Minimal, Portable C — Every sub-module compiles with
gcc -std=c11 -Wall -Wextra -pedanticon Linux/macOS/Windows (MSYS2). Each sub-module provides its ownMakefiletargetinglib<name>.a.
# Build the first sub-module (example)
cd mini-bode-plot
make
# Run tests
make test
# Build all sub-modules
for d in mini-*/; do cd "$d" && make && cd ..; donemini-frequency-domain/
├── mini-bandwidth-design/ # Bandwidth allocation, cascade loop bandwidth, RGA, bandwidth budgeting
├── mini-bode-plot/ # Bode magnitude/phase, asymptotic plots, stability criterion, frequency sweep
├── mini-frequency-compensation/ # Lead/lag/lead-lag compensator, PID frequency-domain, notch filter
├── mini-gain-phase-margin/ # Gain/phase margin, delay margin, vector margin, crossover detection
├── mini-loop-shaping/ # Loop transfer design via pole-zero placement, QFT, sensitivity tradeoffs
├── mini-nichols-chart/ # Nichols chart (open-loop dB vs phase), M/N-circles, closed-loop analysis
├── mini-nyquist-criterion/ # Nyquist stability N=Z-P, encirclements, non-minimum-phase & delay systems
├── mini-robustness-freq/ # Robustness margins, S/T sensitivity, Bode integral, small gain, uncertainty
├── .gitignore # Build artifacts, IDE files, OS files
├── README.md # This file (English)
└── README-CN.md # Chinese version
MIT License — see individual sub-module directories for details.