This repository serves as a centralized compendium of control algorithms, mathematical models, and simulation environments for various electric machine topologies. The primary objective is to bridge the gap between theoretical control systems—specifically State-Space representation and Classical PID methodologies—and their practical implementation in discrete-time software environments.
The project adopts a Model-Based Design (MBD) approach, where physical plant dynamics are derived from first principles, discretized for digital simulation, and subjected to rigorous testing against linear and non-linear control strategies.
The repository is structured by motor topology. The current development focus is on Direct Current (DC) motor systems, with future expansions planned for synchronous and asynchronous AC machines.
| Machine Topology | Control Strategy | Dynamic Modeling | Implementation Status |
|---|---|---|---|
| DC Brushed Motor | Cascaded PID (Position/Current) | Continuous State-Space | Completed |
| Stepper Motor | Microstepping / Open-Loop | Hybrid Automata | Planned |
| BLDC | Six-Step Commutation / Trapezoidal | Back-EMF Sensing | Planned |
| PMSM | Field Oriented Control (FOC) | dq0 Transformation | Planned |
| Induction Motor | V/f Control & Vector Control | T-Equivalent Circuit | Planned |
.
├── DC_motor/ # DC Motor Control Implementation
│ ├── main.py # Source code (Python/C++)
│ ├── README.md # Mathematical documentation
└── README.md # Root documentation
This repository emphasizes a rigorous academic approach to control system design:
- Mathematical Modeling: All systems begin with the derivation of differential equations governing the electrical (Kirchhoff’s laws) and mechanical (Newton-Euler) dynamics.
-
Discretization: Continuous-time models (
$\dot{x} = Ax + Bu$ ) are converted to discrete-time equivalents ($x_{k+1} = Ad \cdot x_k + Bd \cdot u_k$ ) using Euler or Runge-Kutta integration methods to simulate digital controller behavior. - Control Architecture: Implementation of hierarchical control structures, typically separating high-bandwidth inner loops (Torque/Current) from lower-bandwidth outer loops (Velocity/Position).
- Disturbance Rejection: Analysis of system performance under stochastic or deterministic external loads.
The active module located in /DC_motor demonstrates a complete Cascaded PID control system for a DC motor.
Key Features:
- Physics Engine: A 2kHz real-time simulation of motor dynamics including inertia, viscous friction, and inductance.
- Control Logic: A dual-loop architecture utilizing anti-windup mechanisms for integral saturation.
- Visualization: Real-time telemetry plotting of angular position tracking and current consumption via PyQt5.
The simulation environments typically require the following computational stack:
- Language: Python 3.8+ (Prototyping), C++17 (Target Implementation)
- Scientific Computing: NumPy, SciPy
- Visualization: Matplotlib, PyQt5
- Concurrency: Python Multiprocessing (for decoupling physics and rendering)
If utilizing models or code from this repository for academic or research purposes, please verify the specific machine parameters in the source code, as they are idealized for simulation stability.
This project is open-source and available under the MIT License. See the LICENSE file for details.