Expand description
Control theory and systems: PID, state-space, transfer functions, Bode analysis, LQR, Kalman filter, MPC, adaptive control, fuzzy control, and neural controller.
Structs§
- Adaptive
Controller - Model Reference Adaptive System (MRAS) controller using the MIT rule for parameter adaptation.
- Bode
Analysis - Bode frequency response analysis for a SISO transfer function.
- Fuzzy
Controller - Mamdani fuzzy controller with triangular MFs and centroid defuzzification.
- Fuzzy
Rule - Fuzzy rule: (input_mf_index) → (output_mf_index).
- Kalman
Filter - Full linear Kalman filter with predict and update steps.
- LqrController
- Linear Quadratic Regulator (LQR): computes optimal gain matrix K via Discrete Algebraic Riccati Equation (DARE).
- Model
Predictive Control - Simple linear MPC with prediction horizon N, tracking and input penalties.
- Neural
Controller - Simple multi-layer perceptron (MLP) neural network controller.
- Pid
- Proportional-integral-derivative (PID) controller with anti-windup and derivative filter.
- Replay
Buffer - Simple experience replay buffer for neural controller training.
- State
Space Model - Continuous or discrete linear state-space model: ẋ = Ax + Bu, y = Cx + Du.
- Transfer
Function - SISO transfer function defined by numerator and denominator polynomials (descending powers).
- Triangle
Mf - Triangular membership function: zero outside [a, c], peak at b.
Constants§
- TWO_PI
- Constant π exported for convenience.
Functions§
- controllability_
matrix - Compute controllability matrix: [B, AB, A²B, …, A^(n-1)B].
- pole_
placement - Pole placement: compute state feedback gain K such that eigenvalues of (A - B*K) match desired poles (Ackermann’s formula, SISO only).
- riccati_
solve_ dare - Solve the Discrete Algebraic Riccati Equation (DARE) iteratively. Returns gain matrix K = (R + BᵀPB)⁻¹ * BᵀPA.
- zoh_
discretize - Zero-order hold (ZOH) discretization of continuous-time A matrix. Uses Padé approximation: e^(Adt) ≈ I + Adt + (A*dt)²/2 + …