PX4 BeagleBone® Blue-based quadcopter
This article shows how to build a PX4 BeagleBone® Blue-based quadcopter
Hardware
Radiomaster Pocket Radio Controller (M2)
Radiomaster RP3 V2 ExpressLRS 2.4ghz Nano Receiver
Radiomaster Ranger Nano 2.4GHZ ELRS Module
Matek Systems GNSS & Compass, M10Q-5883
BeagleBone® Blue
4x BLHeli Series 12A ESC
2x MT2205II 2300KV Brushless Motor CW
2x MT2205II 2300KV Brushless Motor CCW
FT VersaCopter v2.0
Software
Express LRS Configurator (https://github.com/ExpressLRS/ExpressLRS-Configurator/releases)
balenaEtcher (https://etcher.balena.io/)
Windows Subsystem for Linux (WSL)
PX4 v1.15.0 compiled under WSL using the Arm GNU Toolchain
BeagleBone software image (bone-debian-10.3-console-armhf-2020-04-06-1gb.img.xz)
Arm GNU Toolchain (gcc-arm-8.3-2019.02-x86_64-arm-linux-gnueabihf.tar.xz)
Configuration
TX, RX, and backpack
The Radiomaster Pocket Radio Controller (M2) and RP3 V2 ExpressLRS 2.4ghz Nano Receiver must be updated to ExpressLRS 3.5.2 TX/RX firmware (the latest at the time of writing this article). Similarly, the Ranger Nano 2.4GHZ ELRS module must be updated to ExpressLRS 1.5.0 backpack firmware (the latest at the time of writing this article).
Hardware -> Internal RF -> Type - CSRF -> Baudrate - 400k Hardware -> ADC filter - Off Tools -> 01 Express LRS -> Packet Rate - D250 -> Telem Ratio - 1:2 (19921bps) -> Switch Mode - Hybrid -> Link Mode - MAVLink -> Mode Match - Off Tools -> 01 Express LRS -> Backpack -> Backpack - On -> DVR Rec - Off -> DVR Srt Dly - 0s -> DVR Stp Dly - 0s -> HT Enable - Off -> HT Start Chan - AUX 1 -> Telemetry - WiFi In the model setup, set Internal RF -> Mode - Off and set External RF -> Mode - CRSF. Note that the receiver's serial protocol must be set to MAVLink.
BeagleBone® Blue
Balena Etcher must be used to flash the bone-Debian-10.3-console-armhf-2020-04-06-1gb.img.xz to a microSD card.
The microSD card must be inserted into the microSD card slot of the BeagleBone Blue board
The microSD card button must be pressed while the BeagleBone Blue board is powered. The button should be released 1-2 seconds after powering on the board. This will instruct the BeagleBone Blue board to boot from the microSD card.
After the board boots from the microSD card use a SSH client (e.g. PuTTY) to connect to the board. Note that the default username is debian and the default password is temppwd.
Once connected to the board the /boot/uEnv.txt file must be modified by uncommenting the last line in the file (invoking a generic flasher).
Power cycle the BeagleBone blue board.
Wait until the flashing is complete (the microSD card contents will be flashed onto the EMMC.
PX4
Using Windows Subsystem for Linux (WSL), the latest stable PX4 release must be cloned (v1.15.0 at the time of writing this article). Before compiling, the default.px4board file in boards/beaglebone/blue folder must be modified to include the following lines:
In addition, two CPP files must be modified - the CrsfRc.cpp file in src/drivers/rc/crsf_rc folder and the board_pwm_out.cpp in the boards/beaglebone/blue/src folder.
The #define CRSF_BAUDRATE
in CrsfRc.cpp must be changed from 420000
to 460800
. If left unchanged, the csrf_rc driver would not start properly.
The CRSF driver is not used in this example. MAVLink is used both for telemetry and command and control. However, the above change is required if CRSF is to be used for command and control instead of MAVLink.
In board_pwm_out.cpp in the BBBlueRcPWMOut::send_output_pwm
function an additional line must be added before the return statement:
This makes the PWM signal frequency approximately 50 Hz so the BLHeli Series 12A ESCs accept it.
Once the above changes are made, PX4 can be compiled for the BeageBone Blue board with the following command:
For more information on how to upload the compiled PX4 binaries to the BeagleBone Blue board using the rsync command please refer to:
Building and running PX4 Autopilot on BeagleBone® BlueBelow is the px4.config file for PX4:
Wiring
Below is a wiring diagram showing the UART and I2C connections to the M10Q-5883 GNSS & Compass and the UART connection to the Radiomaster RP3 V2 ExpressLRS 2.4ghz Nano receiver. The BLHeli Series 12A ESCs are connected to the BeagleBone Blue board via servo 1 to 4 outputs. Only the signal and ground wires are connected to the servo outputs, as the 12V DC power connector powers the board.
Completed build
Last updated