A browser-based PID controller simulator built to assist with tuning my custom STM32 flight controller. Simulates step response for drone altitude, pitch, and roll axes with real-time metrics and response analysis.
- Simulates a physical drone model (mass, drag, velocity, position) with a PID feedback loop
- Displays live step response graph as you adjust Kp, Ki, Kd
- Computes rise time, overshoot, settle time, and steady-state error
- Classifies the response as optimal, underdamped, overdamped, or steady-state error
- Gives a tuning recommendation based on the result
- Supports three axes: Altitude, Pitch, Roll (each with different physics parameters)
- Adds configurable sensor noise to simulate real IMU data
Tuning PID controllers by trial and error on real hardware is slow and can damage components. This tool lets me understand the effect of each gain before flashing firmware to the flight controller. Built as a companion to my custom STM32-based FC project.
- HTML / CSS / JavaScript (no framework, single file)
- Chart.js for the response graph
- Physics simulation written from scratch (Euler integration)
No install needed. Just open the file in a browser:
git clone https://github.com/Akshay-s-raikar/pid-visualizer.git
cd pid-visualizer
# open index.html in any browserOr open pid_visualizer.html directly — it works completely offline.
| Parameter | Description | Default |
|---|---|---|
| Kp | Proportional gain | 1.20 |
| Ki | Integral gain | 0.30 |
| Kd | Derivative gain | 0.10 |
| Setpoint | Target value | 1.0 |
| Duration | Simulation length (s) | 10 |
| Time step | Integration step (ms) | 50 |
| Sensor noise | Random noise added to position | 0.01 |
| Preset | Kp | Ki | Kd | Behaviour |
|---|---|---|---|---|
| Optimal | 1.20 | 0.30 | 0.10 | Fast response, low overshoot |
| Underdamped | 3.00 | 0.10 | 0.02 | Fast but oscillates |
| Overdamped | 0.40 | 0.05 | 0.50 | Slow, no overshoot |
| Aggressive | 4.50 | 0.80 | 0.01 | Very fast, high overshoot |
This tool is part of a larger custom flight controller project:
- Custom FC firmware — STM32-based flight controller with PID, IMU integration, MAVLink
- Arena Mission Stack — Full autonomous drone system using ROS 2 and ArduPilot (IRoC-U 2026)
- Precision Landing — ArUco marker detection with MAVROS
- Rock Detection Pipeline — YOLOv8 + DINOv2 + LightGlue on Jetson Orin NX
Akshay Shailesh Raikar
CSE Student, Jain College of Engineering and Research, Belagavi
LinkedIn · GitHub