Motivation of this project is absolutely nothing else than learning & for fun. Some years ago I bought a cheap amateur RC plane just to try the hobby and soon realized that I have drawers full of Arduinos, Raspberry Pies and other nerdy stuff I'd love to fly to the moon. So here we go!
!!! WORK IN PROGRESS !!!
Agenda: ~1,5m wingspan hobby-grade RC plane with on-board Raspberry Pi flight computer running custom firmware.
Arduino Pro Mini reads PWM signals of the on-board RC receiver and re-routes the signals to PWM Driver (PCA9685) as I2C master device. The PWM Driver controls the engine and all servos.
RPi sends its display using the analog TV out with FPV transmitter (TX5258). The display will have live camera feed and overlay with available flight data. When the RPi boots up and has its custom firmware running, it will notify Arduino with a continues ping that Arduino should switch to I2C slave mode, and RPi will become I2C master.
When RPi is I2C master, it will first query PWM values from Arduino and then send them to Servo driver. Since RPi can also query orientation from MPU9250 and position from GPS, it is possible to write autoleveling, autopilot and such routines.
The radio has 6 channels and 2 of them (knobs) will be utilized to access flight menu of the custom OSD software.
- An RC Plane (6CH): Hobbyking Bix3 /w Flaps
- Hobbyking radio + 6CH receiver
- ESC with 5v BEC
- FPV Transmitter: Eachine TX5258: Power from battery's balanced connector
- FPV Receiver: Eachine VR D2 Pro
- Arduino Pro Mini 5v: Power from ESC BEC
- Raspberry Pi 0w + Camera: According to this page, current draw when recording video is around 230mA. In addition Beitian BN-880 GPS draws 50mA@5V, but it will be run at 3v3. Eachine TX5258 can supply 300mA so... not much playroom there :)
- Beitian BN-880 GPS: Power from RPi (3v3)
- GY-91 (MPU9250+BMP280) 10-DOF sensor: Power from RPi (3v3)
Note: Picure is not up-to-date. GY-91 (MPU9250+BMP280) 10-DOF sensor is actually connected to 3v3 side of the I2C bus and gets powered by RPi's 3v3 line.
git clone https://github.com/sirsipe/TheUAVProject
cd TheUAVProject
git submodule init
git submodule update
cd RaspberryPi/buildroot
make BR2_EXTERNAL=../buildroot-externals rpi0w-uav_defconfig
make menuconfig
Now at buildroot configuration, navigate down to External options
and choose cam-on-start
, osd
and osd-on-start
. You can also selected rpi-wifi
, navigate inside it and configure the RPi for headless SSH access. Exit and save.
make
The resulting image can be found from output/images/sdcard.img
.
-
Custom Linux with Buildroot for RPi 0w
- Raspivid working
- GPS via UART working
- Raylib working (for custom OSD)
- OSD software base
- PWM from Arduino to servos
- Menu navigation using CH5/6
- Subsystem control (record/stop, flaps, auto-level, set home, return to home...)
- Menu navigation using CH5/6
- GPS altitude & speed
- GPS flight path
- Pitch, yaw, roll
- PWM from Arduino to servos
- Master Ping -line
- I2C
- GY-91 communication
- Power from Trasmitter
-
6CH PWM signals from RC receiver for Arduino Pro Mini
- Re-route received signals to servo driver
- Power from ESC
- I2C slave mode