AMD Labs

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.

FolderContents
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.mdPID tuning reference
Open repository
QR code to the AMD24 GitHub repository

Wiring and pins

Flight controller (STM32H743)

PeripheralPinsConnected toSettings
SPI1PA5 SCK, PA6 MISO, PA7 MOSI, PA4 CSN, PC4 CEnRF24L01+250 kbps, channel 76
SPI2PB10 SCK, PC2 MISO, PC1 MOSI, PB12 CS IMU, PB11 CS baroMPU6500, BMP280500°/s, ±8 g
I2C1PB6 SCL, PB7 SDAMagnetometerAuto-detected
USART2PA2, PA3ESP32 telemetry115200 baud
USART3PD9 TX, PD2 RXGPS115200 baud
TIM3PC6, PC7, PC8, PB1ESCs M1 to M41100 to 2000 µs
TIM4InternalControl loop timer250 Hz
GPIOPE3, PE4Arm/disarm and spare buttons500 ms debounce
GPIOPA1Status LEDSolid when armed, fast blink on failsafe
USB FSUSBVirtual COM portTelemetry and commands

Motor outputs

MotorPositionSpinTimerPin
M1Rear leftCCWTIM3 CH1PC6
M2Rear rightCWTIM3 CH2PC7
M3Front leftCWTIM3 CH3PC8
M4Front rightCCWTIM3 CH4PB1

Transmitter (ESP32)

PartESP32 pinsNotes
ADS1115SDA 21, SCL 22A0 yaw, A1 throttle, A2 roll, A3 pitch
OLED SSD1306SDA 21, SCL 22Address 0x3C
nRF24L01+SCK 18, MISO 19, MOSI 23, CE 4, CSN 5Address 00001, channel 76, 250 kbps, 8-byte payload

Telemetry bridge (ESP32)

LinkESP32 pinsNotes
UART2 to STM32 USART2GPIO 17 RX, GPIO 5 TX115200 baud, 8N1. Cross TX to RX
Status LEDsGPIO 188 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.

TopicThis site usesOlder references
IMUMPU6500 driverSome documents and the cost list say MPU9250
Joystick converterADS1115 at 860 samples/sSome documents say ADS1015
Barometer busSPI2Some documents say I2C
Motor spinM1 and M4 CCW, M2 and M3 CW, from the firmware mixerSome documents say M1 and M3 CCW
Telemetry UART on ESP32GPIO 17 RX, GPIO 5 TXSome documents say D17 and D18. GPIO 18 now drives the LEDs
Control loop250 HzSome documents mention much higher rates
Telemetry rate5 HzSome documents say 50 Hz
Check the tilt test against physics

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.

Rs 45,680airframe and propulsion
Rs 38,490avionics
Rs 7,730transmitter
ItemPrice (Rs)
Airframe and propulsion45,680
F450 drone frame4,290
Hobbywing Skywalker ESC 30A19,200
EMAX XA2212 980 KV brushless motors12,000
LiPo 3S 5200 mAh 60C battery9,490
ABS 1045 propellers700
Avionics38,490
STM32H7xx5,100
MPU9250 IMU unit (listed in the report)750
BMP280 barometer unit200
u-blox NEO-M8N GPS module3,630
QMC5883L magnetometer900
ESP32-WROOM-321,820
nRF24L01+PA+LNA transceiver700
Headers and connectors1,200
LED decorations2,500
PCB manufacturing18,000
3D printing for the UAV2,490
Wiring and cable1,200
Transmitter7,730
ESP32 Devkit1,250
Joysticks280
OLED display600
ADC module600
nRF24L01+PA+LNA transceiver700
18650 battery1,200
Power wiring and connectors1,500
3D printing for the transmitter1,600
Product total91,900
Whole projectApprox. (Rs)
Product budget91,900
Prototyping16,100
Tools15,000
Hardware attrition and testing loss27,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

ProblemLikely causeWhat to do
Drone flips on takeoffMotor order wrong, or propellers on the wrong motorsRecheck stage 3 and stage 10's direction test, props off
Motors speed up on the wrong sideMotor order or mixing wrongStop. Do not fit propellers until fixed
Fast buzzing, hot motorsP or D too highLower P, or lower D if the motors run hot
Slow rocking at 1 to 2 HzI too highLower I
Bouncing after a correctionD too lowRaise D
Drifts with sticks centredI too low, CG off or unequal motorsCheck CG, compare motor RPM, then raise I
Oscillation only at high throttleTPA not lowering gains enoughAdjust TPA in firmware
Altitude bounces in altitude holdAltitude P too high or D too lowLower P or raise D, and check the barometer's foam cover
I2C freezes during spin-upPower rail noiseAdd capacitors, separate wiring and check the buck converter
Compass heading wandersMotor or power cable interferenceRaise the mast, twist wires and recalibrate
Gains lost after power cycleNot saved to flashSend the save command while disarmed
Telemetry not reaching dashboardWrong Wi-Fi settings or server IPRerun the Aeronexus-Setup step and check your firewall allows TCP port 5000
Dashboard always shows 13.2 VThe firmware's battery value is hardcodedExpected 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 / timeTest (stage)Battery start / end (V)Gains P / I / DResultNotes
 
 
 
 
 
 

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

AHRSAttitude and Heading Reference System: works out the drone's orientation from its sensors.
AirModeKeeps motors above idle so the PID loop can still steer at low throttle.
BLDCBrushless DC motor.
Buck converterAn efficient circuit that steps voltage down.
CGCentre of gravity.
CW / CCWClockwise and counter-clockwise.
Decoupling capacitorA small energy store near a chip that smooths its power supply.
ESCElectronic Speed Controller: drives a brushless motor from a control signal.
FeedforwardA PID add-on that reacts directly to stick movement.
GeofenceA distance limit that triggers a safety response.
Hard-iron distortionA constant magnetic offset caused by the drone's own parts.
Hall-effect gimbalA joystick that senses position with magnets, with no sliding contacts.
HDOPA GPS quality number. Lower is better.
IMUInertial Measurement Unit: a gyroscope plus an accelerometer.
KVMotor speed in RPM per volt, with no load.
LiPoLithium polymer battery. Powerful, and needs careful handling.
Mahony filterThe sensor fusion method used to combine gyro and accelerometer data.
PIDProportional, Integral, Derivative: the core feedback control method.
PIOPilot-induced oscillation: over-corrections by the pilot that make motion worse.
PWMPulse Width Modulation: here, a 1000 to 2000 µs pulse that sets ESC speed.
QuaternionA four-number way to represent rotation without gimbal lock.
RTLReturn to launch.
TPAThrottle PID Attenuation: lowers P and D at high throttle to prevent oscillation.
WindupWhen the I term grows too large while the output is at its limit.

Credits

Built by Team MicroSolutions, AMD Labs. This site uses three.js (MIT License) for the 3D model and the Fira Sans typeface (SIL Open Font License). Licence files are in the site's assets/licenses folder.