Resources
Everything in one place
Source code, wiring, costs, checklists and a glossary. Pages print cleanly, so you can save any of them as a PDF.
Source code
The firmware, transmitter, telemetry and dashboard code are all on GitHub under the MIT License. Vendor libraries in the repository keep their own licences.
| Folder | Contents |
|---|---|
Aeronexus firmware/ | STM32 flight controller |
AMD24 mini transmitter/ | ESP32 transmitter |
Aeronexus telemetry/ | ESP32 Wi-Fi bridge |
Aeronexus dashboard/ | Node.js ground station |
pid_tuning_guide.md | PID tuning reference |
Wiring and pins
Flight controller (STM32H743)
| Peripheral | Pins | Connected to | Settings |
|---|---|---|---|
| SPI1 | PA5 SCK, PA6 MISO, PA7 MOSI, PA4 CSN, PC4 CE | nRF24L01+ | 250 kbps, channel 76 |
| SPI2 | PB10 SCK, PC2 MISO, PC1 MOSI, PB12 CS IMU, PB11 CS baro | MPU6500, BMP280 | 500°/s, ±8 g |
| I2C1 | PB6 SCL, PB7 SDA | Magnetometer | Auto-detected |
| USART2 | PA2, PA3 | ESP32 telemetry | 115200 baud |
| USART3 | PD9 TX, PD2 RX | GPS | 115200 baud |
| TIM3 | PC6, PC7, PC8, PB1 | ESCs M1 to M4 | 1100 to 2000 µs |
| TIM4 | Internal | Control loop timer | 250 Hz |
| GPIO | PE3, PE4 | Arm/disarm and spare buttons | 500 ms debounce |
| GPIO | PA1 | Status LED | Solid when armed, fast blink on failsafe |
| USB FS | USB | Virtual COM port | Telemetry and commands |
Motor outputs
| Motor | Position | Spin | Timer | Pin |
|---|---|---|---|---|
| M1 | Rear left | CCW | TIM3 CH1 | PC6 |
| M2 | Rear right | CW | TIM3 CH2 | PC7 |
| M3 | Front left | CW | TIM3 CH3 | PC8 |
| M4 | Front right | CCW | TIM3 CH4 | PB1 |
Transmitter (ESP32)
| Part | ESP32 pins | Notes |
|---|---|---|
| ADS1115 | SDA 21, SCL 22 | A0 yaw, A1 throttle, A2 roll, A3 pitch |
| OLED SSD1306 | SDA 21, SCL 22 | Address 0x3C |
| nRF24L01+ | SCK 18, MISO 19, MOSI 23, CE 4, CSN 5 | Address 00001, channel 76, 250 kbps, 8-byte payload |
Telemetry bridge (ESP32)
| Link | ESP32 pins | Notes |
|---|---|---|
| UART2 to STM32 USART2 | GPIO 17 RX, GPIO 5 TX | 115200 baud, 8N1. Cross TX to RX |
| Status LEDs | GPIO 18 | 8 addressable LEDs |
Schematics
Select an image to enlarge it.
Build notes
The project changed as it went, so some documents describe earlier versions. This site follows the code in the repository where the sources differ. Check your own board too.
| Topic | This site uses | Older references |
|---|---|---|
| IMU | MPU6500 driver | Some documents and the cost list say MPU9250 |
| Joystick converter | ADS1115 at 860 samples/s | Some documents say ADS1015 |
| Barometer bus | SPI2 | Some documents say I2C |
| Motor spin | M1 and M4 CCW, M2 and M3 CW, from the firmware mixer | Some documents say M1 and M3 CCW |
| Telemetry UART on ESP32 | GPIO 17 RX, GPIO 5 TX | Some documents say D17 and D18. GPIO 18 now drives the LEDs |
| Control loop | 250 Hz | Some documents mention much higher rates |
| Telemetry rate | 5 Hz | Some documents say 50 Hz |
The tuning guide in the repository says that when you tilt right, the left motors should speed up. A correcting drone must speed up the low side. Use the test in stage 10.
Cost breakdown
All prices are in Sri Lankan rupees, from our project records. Yours will vary.
| Item | Price (Rs) |
|---|---|
| Airframe and propulsion | 45,680 |
| F450 drone frame | 4,290 |
| Hobbywing Skywalker ESC 30A | 19,200 |
| EMAX XA2212 980 KV brushless motors | 12,000 |
| LiPo 3S 5200 mAh 60C battery | 9,490 |
| ABS 1045 propellers | 700 |
| Avionics | 38,490 |
| STM32H7xx | 5,100 |
| MPU9250 IMU unit (listed in the report) | 750 |
| BMP280 barometer unit | 200 |
| u-blox NEO-M8N GPS module | 3,630 |
| QMC5883L magnetometer | 900 |
| ESP32-WROOM-32 | 1,820 |
| nRF24L01+PA+LNA transceiver | 700 |
| Headers and connectors | 1,200 |
| LED decorations | 2,500 |
| PCB manufacturing | 18,000 |
| 3D printing for the UAV | 2,490 |
| Wiring and cable | 1,200 |
| Transmitter | 7,730 |
| ESP32 Devkit | 1,250 |
| Joysticks | 280 |
| OLED display | 600 |
| ADC module | 600 |
| nRF24L01+PA+LNA transceiver | 700 |
| 18650 battery | 1,200 |
| Power wiring and connectors | 1,500 |
| 3D printing for the transmitter | 1,600 |
| Product total | 91,900 |
| Whole project | Approx. (Rs) |
|---|---|
| Product budget | 91,900 |
| Prototyping | 16,100 |
| Tools | 15,000 |
| Hardware attrition and testing loss | 27,000 |
| Total (approx.) | 150,000 |
Plan for breakage. Over a sixth of our total went on parts lost during testing. The list has no separate lines for a LiPo charger, buck converters, capacitors or a power distribution board, so budget for those too.
Pre-flight checklist
Go through this before every flight. Ticks are saved only in this browser.
Troubleshooting
| Problem | Likely cause | What to do |
|---|---|---|
| Drone flips on takeoff | Motor order wrong, or propellers on the wrong motors | Recheck stage 3 and stage 10's direction test, props off |
| Motors speed up on the wrong side | Motor order or mixing wrong | Stop. Do not fit propellers until fixed |
| Fast buzzing, hot motors | P or D too high | Lower P, or lower D if the motors run hot |
| Slow rocking at 1 to 2 Hz | I too high | Lower I |
| Bouncing after a correction | D too low | Raise D |
| Drifts with sticks centred | I too low, CG off or unequal motors | Check CG, compare motor RPM, then raise I |
| Oscillation only at high throttle | TPA not lowering gains enough | Adjust TPA in firmware |
| Altitude bounces in altitude hold | Altitude P too high or D too low | Lower P or raise D, and check the barometer's foam cover |
| I2C freezes during spin-up | Power rail noise | Add capacitors, separate wiring and check the buck converter |
| Compass heading wanders | Motor or power cable interference | Raise the mast, twist wires and recalibrate |
| Gains lost after power cycle | Not saved to flash | Send the save command while disarmed |
| Telemetry not reaching dashboard | Wrong Wi-Fi settings or server IP | Rerun the Aeronexus-Setup step and check your firewall allows TCP port 5000 |
| Dashboard always shows 13.2 V | The firmware's battery value is hardcoded | Expected in current code. See the battery warning in stage 4 |
Test log template
Print this and fill one in for every powered test. Good records find problems faster.
| Date / time | Test (stage) | Battery start / end (V) | Gains P / I / D | Result | Notes |
|---|---|---|---|---|---|
Drone rules
Rules on registration, permitted areas and height change over time and differ by country. Before any outdoor flight, check the current rules from your national civil aviation authority. In Sri Lanka, that is the Civil Aviation Authority of Sri Lanka. Stay clear of people, roads, airports and private property without permission.
Glossary
| AHRS | Attitude and Heading Reference System: works out the drone's orientation from its sensors. |
|---|---|
| AirMode | Keeps motors above idle so the PID loop can still steer at low throttle. |
| BLDC | Brushless DC motor. |
| Buck converter | An efficient circuit that steps voltage down. |
| CG | Centre of gravity. |
| CW / CCW | Clockwise and counter-clockwise. |
| Decoupling capacitor | A small energy store near a chip that smooths its power supply. |
| ESC | Electronic Speed Controller: drives a brushless motor from a control signal. |
| Feedforward | A PID add-on that reacts directly to stick movement. |
| Geofence | A distance limit that triggers a safety response. |
| Hard-iron distortion | A constant magnetic offset caused by the drone's own parts. |
| Hall-effect gimbal | A joystick that senses position with magnets, with no sliding contacts. |
| HDOP | A GPS quality number. Lower is better. |
| IMU | Inertial Measurement Unit: a gyroscope plus an accelerometer. |
| KV | Motor speed in RPM per volt, with no load. |
| LiPo | Lithium polymer battery. Powerful, and needs careful handling. |
| Mahony filter | The sensor fusion method used to combine gyro and accelerometer data. |
| PID | Proportional, Integral, Derivative: the core feedback control method. |
| PIO | Pilot-induced oscillation: over-corrections by the pilot that make motion worse. |
| PWM | Pulse Width Modulation: here, a 1000 to 2000 µs pulse that sets ESC speed. |
| Quaternion | A four-number way to represent rotation without gimbal lock. |
| RTL | Return to launch. |
| TPA | Throttle PID Attenuation: lowers P and D at high throttle to prevent oscillation. |
| Windup | When the I term grows too large while the output is at its limit. |
