A Python-based simulation project implementing a PID (Proportional–Integral–Derivative) controller for dynamic system stabilization and response visualization.
- 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
- Python
- NumPy
- Matplotlib
src/
├── main.py
├── pid.py
└── system.py
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.
Clone the repository:
git clone https://github.com/YOUR_USERNAME/pid-control-simulator.git
cd pid-control-simulatorCreate virtual environment:
python -m venv venvActivate environment:
Linux/macOS:
source venv/bin/activateWindows:
venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtpython src/main.pyThe simulation visualizes:
- system response
- stabilization behavior
- overshoot
- convergence to setpoint
- Real-time animation
- Advanced system models
- PID auto-tuning
- Interactive dashboard
- Disturbance simulation
- Unit testing
MIT License
