Antenna rotator controller that automatically points a dish to track satellites. Uses a BNO085 IMU (9-axis inertial measurement unit) for absolute orientation sensing combined with PID control to drive stepper and servo motors.
ESP32 antenna controller that tracks satellites using BNO085 IMU + PID control. Accepts positioning commands via Easycomm II protocol (rotctld compatible).
- Microcontroller: ESP32
- Sensor: Adafruit BNO085 (I2C)
- Azimuth: Stepper motor (GPIO 18/19)
- Elevation: Servo motor (GPIO 16)
- Link: Serial over USB at 115200 baud
- BNO085 measures antenna orientation (quaternion → Euler angles)
- Manual north offset set via
SETNORTHcommand - PID controller compares desired vs. actual angles
- Motors adjust antenna to target position
Manually set north reference when powered up:
SETNORTH - Set current direction as north (0°)
SETNORTH 45.5 - Set north offset to specific angle
RESETNORTH - Reset offset to 0°
Point antenna at true north (compass/sun position) and send SETNORTH.
Query current position:
AZ → returns "AZ123.5"
EL → returns "EL45.2"
Command new position:
AZ180.0 EL45.0
Start rotctld on your antenna controller:
.\rotctld.exe -m 204 -r COM1 -s 115200 -T 127.0.0.1 -t 4533
Then use rotctl or compatible software (Satdump) to connect:
rotctl -m 204 -r TCP:127.0.0.1:4533
PID gains are configured in main.cpp:
// Azimuth control
float azKp = 8, azKi = 1, azKd = 0;
// Elevation control
float elKp = 0.5, elKi = 0, elKd = 0;Tuning tips:
- Kp (Proportional): Larger = faster response, too large causes oscillation
- Ki (Integral): Helps eliminate steady-state error
- Kd (Derivative): Dampens oscillations, reduces overshoot
The BNO085 provides multiple orientation estimates:
- Rotation Vector (SH2_ROTATION_VECTOR): Most accurate, uses all sensors
- Geomagnetic RV: Lower power, mag + accel only (no gyro drift correction)
- Game RV: Gyro + accel only (no magnetic field reference)
Currently uses Rotation Vector for best accuracy in satellite tracking applications.
- Add magnetic declination correction for true north
- Calibration status LED indicators
- Data logging of tracking accuracy
- Support for multiple antenna types (parabolic, Yagi, etc.)
- BNO085 Datasheet
- Adafruit BNO08x Library
- QuickPID Library
- [Easycomm II Protocol Specification](http://www.dk1tb.de/rotor/easycomm.html and https://github.com/Hamlib/Hamlib/blob/master/rotators/easycomm/easycomm.c)