I had no experience building quadcopters before, but I built one all the same, just to show them. It crashed horribly. So I built a second one. That one crashed horribly. So I built a third. That burned down, fell over, then crashed horribly. But the fourth one stayed up after take off. And that's what you're going to get, Lad, the strongest quadcopter in all of … well, let’s say it doesn’t crash that much anymore!
Hello and welcome to my channel, Hardware.ai! This is going to be the first of two videos about building a quadcopter with Raspberry Pi as companion computer and Google Coral USB accelerator. In fact in the first video I’m mostly going to be talking about my experience building a drone with companion computer as a person who has a Software Engineering background and little to none experience with flying machines. To freshen up things a little bit, the video is going to be in “anti-tutorial” format, which means you want to do EXACTLY the opposite of what I say. I’m even going to put a warning red box before I start, right here. Here you go! Read it. Serious business. Okay, let’s begin.
1)You have a companion computer onboard? Don’t buy a receiver and remote! Save some money. I mean that thing is smart, it practically flies itself. You flew DJI drones, surely your DIY drone is going to be even more stable than that, so it will wait patiently hovering solid like a rock in one spot while you go through controls on your laptop.
2)Go for a cheapest flight controller there is. I mean surely you can spend a few hundred bucks on NAVIO, which just works. But you’re in here for learning, right? So get the most basic one, ideally a nameless Chinese brand. So you can figure out the communication protocols and write the driver for it yourself (and learn some Chinese in process as a bonus)! I would suggest even building a flight controller yourself. Better yet, don’t use any of the available microcontrollers, design and implement your own design.
3)When writing a code for your companion computer, especially the communication protocols with FC, don’t test too much! Exception handling is for wussies. Real engineers test their code by just executing it and checking what happens. Even if the code is controlling the motors on DJI Flamewheel frame with 10 inch props, which is standing about 1 meter from you in your apartment at 1 o’clock in the night. I mean, what’s the worst thing that could happen?
4)Altitude Hold mode? Surely it works indoors. You shouldn’t just take the word of people writing documentation for your flight controller as ground truth. Maybe it doesn’t work for them, but it will definitely work for you, so you drone will not crash horribly into the ceiling after sudden air pressure change indoors. No, sir, no.
5)Speaking of safety. It’s for wussies again. If you haven’t been ignoring it yet, now it is time to start, because those things are smart and practically fly themselves. For your testing choose an open place with no people around. Maybe something like a roof of your 11 floor office building. Your drone has GPS, how far can it fly anyway? And what is this thing called “fly away” that everyone in documentation keeps mentioning about?
Okay, the anti-tutorial part is over now. Here is the warning red box again. You’re welcome. As of now I have two drones, Flamewheel f450 frame with Pixhawk 2.4.8 flight controller and smaller, racing quad frame QAV250 with APM 2.8 flight controller. Originally I was experimenting with Flamewheel f450, but after it … you guessed it, crashed horribly, and I was fixing it, in order to continue experiments I bought another smaller frame and parts.
I got object detection and drone control to work together in simulation, using Dronekit SITL. The next step for me is to get the video stream from OpenCV with bounding boxes to the QGroundControl station on my android phone. All this will be running on f450 frame drone.
For the smaller one, I decided to leave it as simple FPV drone. If you’re interested in making one with Raspberry Pi Zero, the process is pretty straightforward. Download the APStreamline image for Raspberry Pi, flash it on SD card. If you’re using USB port for communication with flight controller, you’ll need to change the port in the mavproxy start script. Also add the command to start streaming from the camera on wlan0 interface to rc.local file.
Overall this setup works stable. The only really necessary improvement is to attach external antenna to Raspberry Pi, because with all the interference coming from the motors, Raspberry Pi Zero internal antenna is not really suitable for anything but testing. To reduce the number of wires, you can power Raspberry Pi using GPIO pins through 5V DC-DC converter. If you want to have companion computer and flight controller communicating using UART, for Raspberry Pi Zero you need to have an adapter to convert the voltage levels between the those two. (Pixhawk 2.4.8 and APM 2.8 both have 5V on telemetry port, if you don’t use the adapter you will burn Pi’s UART!).
Hope this video and article were helpful for you building your own FPV drone for the first time. Stay tuned for the updates and the second part of the video, which will be specifically about using Raspberry Pi 3B with Google Coral USB Accelerator as a companion computer. Share, like and subscribe! And the most importantly, stay safe building your drone, red box warning.
Till the next time!