Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

PID Visualizer — Drone Flight Controller Tuning Tool

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.


What it does

  • 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

Why I built this

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.


Tech stack

  • HTML / CSS / JavaScript (no framework, single file)
  • Chart.js for the response graph
  • Physics simulation written from scratch (Euler integration)

How to run

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 browser

Or open pid_visualizer.html directly — it works completely offline.


Simulation parameters

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

Presets

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

Related projects

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

Author

Akshay Shailesh Raikar
CSE Student, Jain College of Engineering and Research, Belagavi
LinkedIn · GitHub

About

Browser-based PID controller simulator for tuning drone flight controller gains. Simulates altitude, pitch, and roll step response with real-time metrics.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages