A multi-drone collaborative painting system where coordinated UAVs work together to create bit/pixel art on canvases. The system features precise position control and real-time coordination of multiple drones.
This project enables autonomous drones to collaboratively paint pixel art by converting digital images into drone missions with coordinated waypoints. Each drone follows precisely planned trajectories to apply paint at specific canvas locations, creating collaborative bit art through swarm coordination.
Key Features:
- Multi-drone mission planning and coordination
- Image-to-dot conversion for bit/pixel art patterns
- Cascaded PID control system for precise positioning
- Real-time flight data logging and analysis
- OptiTrack motion capture integration
- Betaflight firmware integration for low-level control
Click the image above to watch the demo on YouTube.
pi@192.168.18.109pi@192.168.18.114pi@192.168.18.130
Edit ccodeLINUX.c to tune PID loops as needed, then send to drones:
# Send control code to specific drone
scp ccodeLINUX.c pi@192.168.18.109:/home/pi/onboard/On the Air Traffic Controller (ATC), type sleep and then wake to recompile the C code on the drone.
Send your user flight code (e.g., mission waypoints):
# Send flight code to drone
scp pickplacelo.py pi@192.168.18.114:/home/pi/onboard/codesOn the ATC:
- Type
updateandpickplacelowhen prompted to update current flight code for all drones - Or type
update 14 9to update specific drones' user code (by last digits of IP)
After flight, retrieve the log file:
# Download log from drone to local analyze directory
scp pi@192.168.18.114:/home/pi/onboard/ctrl_logs/2025-02-16_205325.csv ./Analyze with the plotting tool:
# Example: Check velocity tracking and position for Y-axis
python3 analyse.py 2025-02-16_204633.csv -vycomp -y
# Example: Check velocity tracking and position for X-axis
python3 analyse.py 2025-02-16_204633.csv -vxcomp -xaerial-painting/
│
├── tuning/ # Control system and flight infrastructure
│ ├── analyse.py # Flight data analysis tool
│ ├── ccodeLINUX.c # PID controller implementation
│
└── usr_codes/ # User mission files
└── reference/ # Reference implementations
├── hover.py
└── step.py
The analyse.py script is the primary tool for post-flight data analysis and visualization. It reads CSV log files and generates matplotlib plots for various control parameters.
python3 analyse.py <log_file.csv> [flags] [-s start_time] [-d end_time]Flight logs are CSV files with the following key columns:
timestamp, frequency, pos_x, pos_y, pos_z, vel_x, vel_y, vel_z,
setpoint_x, setpoint_y, setpoint_z, control_outputs, PID_terms, errors, ...
-x - Plot X position tracking
- Shows actual position vs. desired setpoint
- Displays average position error
-y - Plot Y position tracking
- Shows actual position vs. desired setpoint
- Displays average position error
-z - Plot Z position tracking
- Shows actual position vs. desired setpoint
- Displays average position error
-px - Position P term (X)
- Shows proportional control contribution
-ix - Position I term (X)
- Shows integral control contribution
-dx - Position D term (X)
- Shows derivative control contribution
-vx - Desired velocity output (X)
- Commanded velocity from position controller
-pix - Position P and I terms (X)
-pdx - Position P and D terms (X)
-idx - Position I and D terms (X)
-pidx - All position PID terms (X)
- Shows P, I, D contributions overlaid
- Prints average magnitude of each term
-py - Position P term (Y)
-iy - Position I term (Y)
-dy - Position D term (Y)
-vy - Desired velocity output (Y)
-piy - Position P and I terms (Y)
-pdy - Position P and D terms (Y)
-idy - Position I and D terms (Y)
-pidy - All position PID terms (Y)
- Shows P, I, D contributions overlaid
- Prints average magnitude of each term
-px2 - Velocity P term (X)
- Inner loop proportional control
-ix2 - Velocity I term (X)
- Inner loop integral control
-dx2 - Velocity D term (X)
- Inner loop derivative control
-pix2 - Velocity P and I terms (X)
-pdx2 - Velocity P and D terms (X)
-idx2 - Velocity I and D terms (X)
-pidx2 - All velocity PID terms (X)
- Complete inner loop visualization
- Prints average magnitude of each term
-ev2 - Velocity errors (X)
- Shows
error_vel_xandd_error_vel_x - Useful for debugging velocity tracking
-py2 - Velocity P term (Y)
-iy2 - Velocity I term (Y)
-dy2 - Velocity D term (Y)
-piy2 - Velocity P and I terms (Y)
-pdy2 - Velocity P and D terms (Y)
-idy2 - Velocity I and D terms (Y)
-pidy2 - All velocity PID terms (Y)
- Complete inner loop visualization
- Prints average magnitude of each term
-ev2y - Velocity errors (Y)
- Shows
error_vel_yandd_error_vel_y
-vxcomp - Desired vs Actual Velocity (X)
- Overlays pure desired velocity with actual measured velocity
- Prints average magnitudes
-vycomp - Desired vs Actual Velocity (Y)
- Overlays pure desired velocity with actual measured velocity
- Prints average magnitudes
Basic flight analysis:
python3 analyse.py flight_log.csv -x -y -zTune velocity controller (X-axis):
python3 analyse.py flight_log.csv -vxcomp -pidx2Tune position controller (Y-axis):
python3 analyse.py flight_log.csv -y -pidy -vycompDebug oscillations:
python3 analyse.py flight_log.csv -pidx -pidx2 -vxcompThe project uses waypoint-based missions where each drone navigates to discrete points to create bit/pixel art:
Example: Star Pattern (star*.py)
- 5 separate mission files, one for each star edge
- Each mission contains ~10 painting dots
- Dots are created with move → descend → paint → ascend sequences
- Canvas size: 0.8m × 0.5m
Special thanks to Drew Curtis, Prof. Matt Elwin, and Prof. Michael Rubenstein for their guidance and support throughout this project.
The swarmOS and drone hardware were developed by Drew Curtis. My main contributions are the gripper designs and the cascaded PID controller.
