A simulation framework for Brushless DC Motor (BLDC) control strategies with a Graphical User Interface (GUI).
This project implements PID-based, Lyapunov-based, and Field-Oriented Control (FOC) algorithms on a dynamic BLDC motor model.
.
├── main.py # Entry point for running the simulator
├── runSimulator.sh # Helper script to launch the simulator
├── requirements.txt # Python dependencies
├── resources/ # Images, styles, and screenshots
├── src/ # Source code (control, models, gui)
└── tests/ # Unit tests + venv
Clone the repo and install dependencies:
git clone https://github.com/your-username/BLDC_sim.git
cd BLDC_sim
# (Optional) Create a virtual environment
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
# Install required packages
pip install -r requirements.txtYou can run directly with:
python main.pyOr use the provided script:
./runSimulator.shBelow are screenshots of the Field-Oriented Control (FOC) algorithm (Control V3) running on the BLDC dynamic model:
| Control V3 – Example 1 | Control V3 – Example 2 |
|---|---|
![]() |
![]() |
| Control V3 – Example 3 | Control V3 – Example 4 |
|---|---|
![]() |
![]() |
- Control V1 → Basic PID speed control (Trapezoidal conmutation)
- Control V2 → PID with Lyapunov-based torque regulation
- Control V3 (FOC) → Field-Oriented Control with virtual speed loop



