Arduino-based guidance and control prototype developed for a University at Buffalo MAE 451 Design Processes and Methods senior design project.
The Sail Balloon project investigated a method of providing directional control to a high-altitude balloon (HAB) using an aerodynamic sail/airfoil and actively controlled surfaces. Conventional high-altitude balloons primarily drift with atmospheric winds, making their trajectories difficult to control. Our project explored whether onboard sensing and aerodynamic control could instead guide a balloon toward a desired destination.
This repository contains the Arduino control and sensor-integration code used during an initial full-system ground test at Kunz Field at the University at Buffalo.
The prototype used an Arduino Mega 2560 as the primary controller and integrated:
- GPS for position and navigation
- MMC5603 magnetometer for vehicle heading
- MPU6050 accelerometer and gyroscope
- Wind vane for relative wind direction
- Anemometer for wind-speed measurements
- Two servo-actuated aerodynamic control surfaces
The guidance logic compares the bearing from the current GPS position to a predefined target coordinate against the vehicle heading measured by the magnetometer. The resulting heading error determines the commanded servo direction.
Conceptually:
GPS Position ────────> Bearing to Target ──┐
│
Magnetometer ────────> Current Heading ────┼─> Heading Error ─> Servo Command
│
Wind Sensors ────────> Environmental Data ─┘
The system simultaneously outputs GPS, magnetometer, IMU, and wind-sensor telemetry over serial for testing and debugging.
flattest.ino represents an early integrated prototype used to evaluate
the guidance and servo-control behavior on the ground before flight
testing.
A target coordinate near the center of Kunz Field was programmed into the controller. The prototype was then moved around the field to simulate changes in vehicle position and orientation.
For each updated GPS position, the software:
- Reads the current latitude and longitude
- Calculates the bearing from the current position to the target
- Measures the current heading using the magnetometer
- Calculates and normalizes the heading error to ±180°
- Determines the required turn direction
- Commands both control-surface servos
- Outputs sensor and navigation telemetry for observation
This test was intended primarily to verify that the integrated sensors, navigation logic, and servos could operate together and that the control surfaces responded appropriately as the system's position relative to the target changed.
The target bearing is calculated from the current and destination GPS coordinates using:
float dLon = radians(lon2 - lon1);
float y = sin(dLon) * cos(radians(lat2));
float x = cos(radians(lat1)) * sin(radians(lat2))
- sin(radians(lat1)) * cos(radians(lat2)) * cos(dLon);
float bearing = atan2(y, x);The controller then compares this bearing with the magnetometer heading:
float headingDiff = headingToTarget - currentHeading;
if (headingDiff > 180) headingDiff -= 360;
if (headingDiff < -180) headingDiff += 360;The sign of the normalized heading error determines the commanded turn direction.
Component Function
Arduino Mega 2560 Main controller GPS Receiver Position and navigation MMC5603 Magnetometer Vehicle heading MPU6050 Acceleration and angular-rate measurements Wind Vane Wind direction Anemometer Wind speed 2× Servos Aerodynamic control-surface actuation
HABcontrolcode/
├── flattest.ino
├── Wind_Sensors.cpp
├── Wind_Sensors.h
├── Wind_Sensors_Constants.h
└── README.md
Main Arduino prototype containing sensor initialization, GPS navigation, heading calculation, servo control, and serial telemetry.
Wind-sensor interface used for wind-vane and anemometer measurements.
Constants and definitions associated with the wind-sensing hardware.
The broader Sail Balloon project explored an alternative to the uncontrolled drift characteristic of conventional high-altitude balloons.
The design evolved into a buoyancy-sail/paraglider concept that used relative airflow generated during balloon ascent and descent across a rigid airfoil. Aerodynamic control surfaces were incorporated to change vehicle orientation, while the airfoil was intended to generate lateral motion.
The complete prototype incorporated mechanical structures, aerodynamic analysis, embedded electronics, sensing, guidance logic, and servo actuation as part of an integrated multidisciplinary design.
My work on the six-person Sail Balloon team focused primarily on the main control loop and component testing. My contributions included:
- GPS and servo-control development
- Integration of navigation and actuator behavior into the main control loop
- Initial HAB assembly modeling
- Hardware/software integration and prototype testing
- Analysis of ground-test results
This repository preserves the control software from the initial integrated ground-testing stage of the project.
Course: MAE 451 --- Design Processes and Methods
Institution: University at Buffalo
Department: Mechanical and Aerospace Engineering
Term: Fall 2024
Project: Sail Balloon