Project 03 · 2026
Ground Control Station: LoRa Controller and Receiver Design
Desktop ground control software for UAVs: decodes telemetry from a serial link, draws flight instruments and uploads missions from a map.
03.1Summary
During a flight the operator needs to see the vehicle's state on one screen and be able to change the route on the fly. Off-the-shelf ground stations (Mission Planner, QGroundControl) are tied to MAVLink, whereas my boards use a smaller binary protocol I defined myself.
So I wrote a ground control station that runs on Electron. It decodes packets from the serial port, draws a primary flight display (PFD) with an artificial horizon and speed/altitude tapes, and sends a mission built on the map to the vehicle with a checksum.
03.2Block diagram
03.3Telemetry packet
Every packet from the vehicle is 34 bytes. The parser syncs on the 0xAA 0xBB header; fields are little-endian scaled integers.
| Offset | Type | Field | Scale |
|---|---|---|---|
| 0–1 | u8 ×2 | header | 0xAA 0xBB |
| 2 | int16 | roll | /100 → ° |
| 4 | int16 | pitch | /100 → ° |
| 6 | int16 | yaw | /100 → ° |
| 8 | int16 | altitude | /10 → m |
| 10 | int16 | speed | /100 → m/s |
| 12 | uint8 | battery | /10 → V |
| 13 | uint8 | satellites | — |
| 14 | uint8 | GPS fix | — |
| 15 | uint8 | flight mode | — |
| 16 | int32 | latitude | /10⁷ → ° |
| 20 | int32 | longitude | /10⁷ → ° |
When a mission is uploaded, each waypoint is packed into 11 bytes: latitude and longitude as float32, altitude as int16, command as uint8 (16 waypoint, 20 RTL, 21 land, 22 takeoff). The packet ends with a two-byte Fletcher-16 checksum.
03.4Features
| PFD | Artificial horizon, speed and altitude tapes, circular gauges |
|---|---|
| Map | Live position with Leaflet, route drawing, drag-and-drop waypoint editing |
| Safety | Ground elevation is fetched for each waypoint; those below the minimum safe altitude raise a warning |
| Performance | UI refresh rate is throttled; incoming data is buffered |
| Persistence | Theme, units, baud rate and audio alert settings persist; missions save/load as JSON |
| Setup | Frame type selection, motor test and direction, servo min/max/trim limits (UI) |
03.5Status
- Serial port management and binary protocol parser
- PFD, map and telemetry panels
- Waypoint upload and in-flight re-routing
- Reading the mission back from the vehicle (waypoint download)
- RC override with a USB gamepad
- Writing Setup screen settings to the vehicle