Skip to content

MrShirini/pid-control-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PID Control System Simulator

A Python-based simulation project implementing a PID (Proportional–Integral–Derivative) controller for dynamic system stabilization and response visualization.

Simulation Preview

PID Simulation

Features

  • PID controller implementation
  • Dynamic first-order system simulation
  • Real-time response animation
  • GIF export for visualization
  • Adjustable PID tuning parameters
  • Unit testing with pytest
  • Modular Python codebase

Technologies

  • Python
  • NumPy
  • Matplotlib

Project Structure

src/
├── main.py
├── pid.py
└── system.py

Theory

A PID controller continuously calculates an error value:

error = setpoint - measured_value

and applies corrective control using:

  • Proportional term (P)
  • Integral term (I)
  • Derivative term (D)

The controller attempts to stabilize the system output at the desired target value.

Installation

Clone the repository:

git clone https://github.com/YOUR_USERNAME/pid-control-simulator.git
cd pid-control-simulator

Create virtual environment:

python -m venv venv

Activate environment:

Linux/macOS:

source venv/bin/activate

Windows:

venv\Scripts\activate

Install dependencies:

pip install -r requirements.txt

Run Simulation

python src/main.py

Example Output

The simulation visualizes:

  • system response
  • stabilization behavior
  • overshoot
  • convergence to setpoint

Future Improvements

  • Real-time animation
  • Advanced system models
  • PID auto-tuning
  • Interactive dashboard
  • Disturbance simulation
  • Unit testing

License

MIT License

About

PID-based control system simulation built in Python using NumPy and Matplotlib. The project models a first-order dynamic system and implements a configurable PID controller with real-time response visualization.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages