Preparing to own a drone - TX/RX
I recently went all in on purchasing cheap drone parts from AliExpress, eBay and Amazon. I have a Betaflight V4S Flight Controller (FC), a 30Ax4 Electronic Speed Controller (ESC), motors and a high end LiPo charger on the way. After that, I just need a huge battery, a frame and some propellers before I have all I need for an autonomous drone. I’ll 3D print everything except the battery when the parts arrive.
The next step is to create my own flight control transmitter. While the logical move here would be to buy an RC transmitter, they’re all 60-100GBP for a base model. When you can purchase the receivers that come with these devices for a price of something like 20GBP per receiver, the discrepancy is noteworthy. This leads me to the natural conclusion - DIY. Make it myself. I’m already planning on leapfrogging an expensive FPV kit by instead using a 5.8ghz USB video system, utilising my existing laptop and desktop screens. The next logical step is an open source transmitter.
Naturally, to make a transmitter, you have to understand the common protocols at play. The transmitter is flexible - it doesn’t exist. The flight controller does exist, and only supports a limited number of protocols. I ended up buying quite a few ESP32 nodes recently. Instead of trying to integrate an external module with an existing Arduino, I’ll reuse the ESP32 point-to-point long range mode. That means one of my nodes is a transmitter, and the other is a receiver. ESP32 LR is approximately 50MB/s UDP, so if I keep a connectionless protocol, I should be able to pump control data along pretty frequently.
It’s interesting that receivers have failsafe modes - since they are responsible for all the controller signals, a flight controller is essentially a stupid but high voltage tolerant gyroscope and low voltage processor. A project that might be useful inspiration is EspCopter32, but I may end up just using the ESP32 as a dumb protocol drone. It looks like this user also made a project for that - is epnow_RC_TX.
Unfortunately, I don’t like this project at all. The documentation is bare to nonexistent, which is how I write most of my code too. It’s difficult when I’m not familiar with the protocols at play, but it turns out that I’m only confused because it’s so simple. IBUS is an example protocol, with a pretty high data rate. If 20 channels are sent every second, it seems like it can manage about 500 updates a second. I think there is some differential data, otherwise there would be a need to communicate quite a bit of data every update.
I could send about 8bits at around 200-350 acked packets per second. There are occasional halts, which drop the rate to 200/s - several packets in a row are not sent, causing 500ms delays! That’s insane! Losing control for a half second is a long period of time and could cause a failsafe to kick in. I introduced a 3ms delay in the send loop and increased the data to 16bits. My packet rate seems to be a stable 270-300. The chips heat up a little bit, so buying some heatsinks might help run the chips cooler and increase the packet rate slightly. Adding extra antenna should help with transmission rate. Unfortunately, this has been a fair bit of bench testing. I don’t know how the data rate changes over time.
I want to try the LR version at some point, but I think that’s only going to become interesting to me when I need to receive telemetry from long range autonomous drones.
Well, that’s my basic RF research done. Time to start programming and reading about the protocols at play.