Auto-Aiming Pan/Tilt Turret
A real-time computer vision tracking platform using YOLO, a Kalman filter, PID control, a Teensy, and motorized pan-and-tilt hardware.
Role
Sole designer
Team
Individual
Status
Completed
Timeline
Feb 2026 – Mar 2026
- ▹Approximately 60 FPS tracking
- ▹Less than 50 ms detection latency
- ▹Less than 10 ms motor-command latency
- ▹Predictive target tracking with Kalman filtering
- ▹Manual and automatic control modes
- ▹Custom control dashboard
Problem Statement
Building a responsive electromechanical tracker requires closing the loop between perception latency and actuator bandwidth. Detection delay, network/serial latency, and mechanical lag all compound into pointing error.
Design Goals
- Sustain ~60 FPS object tracking
- Keep detection latency under 50 ms
- Keep motor command latency under 10 ms
- Support predictive tracking and manual override
- Expose live PID tuning through a dashboard
System Architecture
Pipeline:
- Camera capture → YOLOv8 detection
- Bounding-box centroid extraction
- Kalman filter prediction of target motion
- PID computation of pan/tilt setpoints
- Serial commands to Teensy 4.1 actuators
A Flask dashboard provides mode selection, live PID gains, and system monitoring.
Hardware Design
Two-axis pan/tilt mechanics driven by motors controlled from a Teensy 4.1. Homing and motion-stabilization routines keep the platform calibrated for closed-loop tracking.
Software Design
- Vision process runs detection and filtering
- Control process issues low-latency actuator commands
- Dashboard process exposes telemetry and tuning controls
- Manual and automatic modes share the same command path
Engineering Decisions
- Kalman filtering to bridge detection gaps and reduce jitter
- Embedded PID on Teensy for deterministic actuator timing
- Flask dashboard for rapid experiment iteration
Testing and Validation
Validated tracking frame rate, detection latency, and command latency during live target motion. Homing and stabilization routines were exercised before closed-loop runs.
Results
Achieved approximately 60 FPS object tracking with less than 50 ms detection latency and less than 10 ms motor-command latency on the Teensy actuator path.
Challenges
- Balancing model accuracy against latency
- Mechanical backlash and axis coupling
- Keeping serial command streams non-blocking
Lessons Learned
End-to-end latency budgeting matters more than peak FPS. Predictive filtering significantly improved smoothness when detections momentarily dropped.
Future Improvements
- Multi-target selection
- On-device inference optimization
- Improved mechanical stiffness and encoder feedback
Questions about this project? Email Caleb.