Skip to content

BLDC_sim is a Python simulator for BLDC motors featuring FOC and Lyapunov-based PID control. Visualize motor dynamics, phase voltages, and speed control with an interactive GUI. Ideal for learning, testing control strategies, and experimenting with disturbance observers.

License

Notifications You must be signed in to change notification settings

Ineso1/bldc_control_simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ BLDC_sim

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.


📂 Project Structure

.
├── 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

🚀 Installation

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.txt

▶️ Running the Simulator

You can run directly with:

python main.py

Or use the provided script:

./runSimulator.sh

🖼️ GUI – FOC Algorithm in Action

Below 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 1 Control v3 2
Control V3 – Example 3 Control V3 – Example 4
Control v3 3 Control v3 4

🛠️ Control Strategies Implemented

  • 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

About

BLDC_sim is a Python simulator for BLDC motors featuring FOC and Lyapunov-based PID control. Visualize motor dynamics, phase voltages, and speed control with an interactive GUI. Ideal for learning, testing control strategies, and experimenting with disturbance observers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published