Sample Page
Lifestyle BloggerThis is an example page. It’s different from a blog post because it will stay in one place and will
The most important component of any drone is the Flight Controller Unit (FCU). I have dedicated an entire chapter to explaining the configuration of Beagle Bone Blue as Flight Controller. All sensors and drone electrical components revolve mainly around FCU. Beagle Bone Blue (BBB) is an all-in-one Linux-based general purpose robotics computer with small form factor (3.5″ x 2.15″ board) running Octavo OSD3358 microprocessor. It also supports wifi/Bluetooth for networking, inbuilt IMU/barometer, power management and regulation. It has the option of being powered from 9-18 volts DC power source via barrel jack. It requires JST type connectors for interfacing with sensors It has all the commonly-needed buses for additional peripherals in embedded applications. The key aspect for the choice of this board is its fully open source and actively supported by a strong community, the real-time performance, flexible networking, and rich set of robotics-oriented capabilities making it versatile, fast, streamlined, affordable, and fun.
This Beagle Bone Blue will be configured as Flight Controller Unit (FCU). It will run Debian Linux Operating System (OS) and Ardupilot autopilot stack as application. This process has been explained in subsequent sub chapters and paras.
Preparing SD Card We need to format an SD Card preferably 16/32 GB and flash Linux Debian Operating System. Download bone-debian-9.12-console-armhf-2020-04-01-1gb.img and flash it on SD card of 16/32 Gb using Balena Etcher or any other such application. I have used Raspberry Pi imager to do the same.
Insert SD card and boot Beagle Bone Blue Connect Beagle Bone Blue with micro-USB cable to USB port of laptop. Use putty application for ssh access of Beagle Bone Blue. Default ip access to access Beagle Bone Blue is 192.168.7.2
Accessing Beagle Bone Blue on ssh Use below mentioned default credentials to access Beagle Bone Blue-
Default username – Debian
Default password – temppwd
Connecting through wifi for wireless access in future After logging in to Beagle Bone Blue through ssh for the first time, use the below mentioned command to connect it on wifi for internet access. Also the board can also be accessed on wifi.
Step1 We need to allow the debian user to sudo without having to enter the password every (subsequent) time, enter the following commandecho "debian ALL=(ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers.d/debian >/dev/null
Step 2 The Wifi SSID and password be automated and put in a script so that subsequent access can be on Wifi without the need of connecting with micro USB cablesudo -s
Check Beagle Bone Blue detects the wifi, in my case wifi name is YASH1connmanctl services | grep 'YASH1' | grep -Po 'wifi_[^ ]+'
Step3 Add Wifi SSID and passphrase detailscat >/var/lib/connman/wifi.config
[service_<your hash>]
Type = wifi
Security = wpa2
Name = YASH1
Passphrase = 7350604575
Step 4 Ctrl-D and ping www.google.com to check internet and DNS resolution is working successfully.
Step 5 Restart Beagle Bone Blue. Use any IP Scanner application on wifi to detect IP of Beagle Bone Blue over wifi network.
Step 6. Use Putty to access it over that that IP which was scanned and found during step 5 above. Using Putty Application to access ssh over wifi. (No need of any micro-USB cable now). Use same login credentials as above.
Default username – Debian
Default password – temppwd
Configuring OS on Beagle Bone Blue Update and upgrade Debian Linux OS and install requisite tools/applicationssudo apt-get -y update
sudo apt-get -y dist-upgrade
Installing CPU Frequency Scaling Utility Now we need to install CPU Frequency scaling utility which enables Operating systems to scale up or down CPU frequency to save power. It can be scaled up incase of load on CPUsudo apt-get install -y cpufrequtils git
To get pre-built kernels. Real-time kernel is software which manages the time of microprocessor thereby ensuring that time-critical events required as Flight Controller Unit (FCU) can be processed efficiently. It simplifies the design of embedded systems and makes Linux act like Real Time Operating System as it allows the system to be divided into multiple independent elements called tasks. These scheduling of tasks can be done in real-time.cd /opt/scripts && git pull
sudo /opt/scripts/tools/update_kernel.sh --lts-4_19 --bone-rt-channel
Now we need to specify the device tree binary which is to be used at Linux startupsudo sed -i 's/#dtb=/dtb=am335x-boneblue.dtb/g' /boot/uEnv.txt
Now we need to specify the device tree overlayssudo sed -i 's|#dtb_overlay=/lib/firmware/<file8>.dtbo|dtb_overlay=/lib/firmware/BB-I2C1-00A0.dtbo\n#dtb_overlay=/lib/firmware/BB-UART4-00A0.dtbo\n#dtb_overlay=/lib/firmware/BB-ADC-00A0.dtbo|g' /boot/uEnv.txt
Now we need to specify the U-Boot overlaysudo sed -i 's|uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo|#uboot_overlay_pru=/lib/firmware/AM335X-PRU-RPROC-4-14-TI-00A0.dtbo|g' /boot/uEnv.txt
sudo sed -i 's|#uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo|uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo|g' /boot/uEnv.txt
To set clock frequencysudo sed -i 's/GOVERNOR="ondemand"/GOVERNOR="performance"/g' /etc/init.d/cpufrequtils
We can disable Bluetooth as we don’t need it for FCU.sudo systemctl disable bb-wl18xx-bluetooth.service
We can maximize the SD cards existing partition sudo /opt/scripts/tools/grow_partition.sh
sudo reboot
I have always carried out wiping the eMMC boot sector to ensure resolution of RCOutputAioPRU.cpp:SIGBUS error
sudo dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=10
Now we update the bootloader through the scriptsudo /opt/scripts/tools/developers/update_bootloader.sh
Step1 Before we begin the Ardupilot autopilot application stack build up, we need to understand the Ardupilot environment and its configuration file to be created at location /etc/default/ardupilot
. The UARTS map to pin configuration on Beagle Bone Blue side is as below:-
The Ardupilot autopilot application supports upto 8 x UARTs. The mapping done by me for the utilization is as per table below: –
The IP Addresses in this table are of Ground Control Station (GCS) and must be changed as the existing network. This scheme of IP Addresses have been explained in later chapter on concept of MAVlink over VPN. The concept of MAVlink has also been explained in following chapters.
Step2 After getting the table ready as per our requirement, we now need to create ardupilot environment file with the data from table above: –sudo nano /etc/default/ardupilot (later for editing use sudoedit /etc/default/ardupilot)
Add the blow mentioned linesTELEM1="-A udp:192.168.7.1:1194"
GPS="-B /dev/ttyO2"
TELEM2="-C /dev/ttyO1"
TELEM3="-D udp:100.96.1.34:1194"
RANGER="-F /dev/ttyO5"
Ctrl+O
and enter to save configuration followed by and Ctrl+X
to exit
Step 3 Create system file for running Arducopter (version of Ardupilot) as a service at startup
sudo nano /lib/systemd/system/arducopter.service
Add the below mentioned lines[Unit]
Description=ArduCopter Service
After=networking.service
StartLimitIntervalSec=0
Conflicts=arduplane.service ardurover.service antennatracker.service
[Service]
EnvironmentFile=/etc/default/ardupilot
ExecStartPre=/usr/bin/ardupilot/aphw
ExecStart=/usr/bin/ardupilot/arducopter $TELEM1 $TELEM2 $TELEM3 $GPS $RANGER
Restart=on-failure
RestartSec=1
[Install]
WantedBy=multi-user.target
Ctrl+O and Ctrl+X
to save configuration
Step 4 We need to create ardupilot directory where we will build and compile the Ardupilot autopilot stack.sudo mkdir -p /usr/bin/ardupilot
Step 5 We need to create Ardupilot hardware configuration file aphw at location /usr/bin/ardupilot/aphw, which is run by the services prior to running the Ardupilot executables.sudo nano /usr/bin/ardupilot/aphw
Add the below mentioned lines#!/bin/bash
# aphw
# ArduPilot hardware configuration.
#/bin/echo 80 >/sys/class/gpio/export
#/bin/echo out >/sys/class/gpio/gpio80/direction
#/bin/echo 1 >/sys/class/gpio/gpio80/value
/bin/echo pruecapin_pu >/sys/devices/platform/ocp/ocp:P8_15_pinmux/state
The lines 5 to 7 has been commented out by me as I don’t wish to activate or switch on power to the Beagle Bone Blue’s +5V servo rail. I have made a conscious effort to ensure that power of 5V is fed directly from DC-DC convertor to the sensor or peripheral and nothing is powered from Beagle Bone Blue. This ensures that Beagle Bone Blue is protected from any power related issues. However, the option of doing that exists in case we uncomment the lines. In order to draw power from Beagle Bone Blue esp 5V, the recommended input power is 12V-18V through DC Barrel jack. 5V snt available when powering BBB through micro USB cable. I have provided 12V to Beagle Bone Blue through Barrel jack just to ensure enough power. Also, the only module to draw power directly from Beagle Bone Blue is the 4G LTE module connected on the USB 2.0 of Beagle Bone Blue (5V and 500mA)
Ctrl+O and enter to save configuration followed by and Ctrl+X to exit
Step 6 Give permission to the file/folder
sudo chmod 0755 /usr/bin/ardupilot/aphw
sudo chmod 0755 /usr/bin/ardupilot/a*
Step 7 Compiling Ardupilot on Beagle Bone Blue itself. We need to install the requisite packages before:-sudo apt-get install g++ make pkg-config python python-dev python-lxml python-pip
sudo pip install future
git clone https://github.com/ArduPilot/ardupilot
cd ardupilot
git branch -a # <-- See all available branches. Press q to exit.
I have compiled Ardupilot 3.6, 4.0.5, 4.0.7 all being stable versions. Later to support the mm Wave radar which is a 3D radar, I have compiled 4.1.0 (Beta) version. Hence, select the Ardupilot version one wishes to compile.
git checkout Copter-4.0 # <-- Arducopter 4.0 is selected by this command
Git submodule init to initialize our local configuration file, and git submodule is used to update to fetch all the data from Ardupilot github repository
git submodule update --init --recursive
Now we use the waf command which is a build automation tool. It is designed to assist in the automatic compilation and installation of application/computer software. Now we name the compilation folder Blue as its Beagle Bone Blue../waf configure --board=blue # <-- BeagleBone Blue.
The compilation starts from the step below:-./waf
The compilation for Arducopter 3.6 took about 2 hours, while for Arducopter 4.0.5, (stable) Arducopter 4.0.7 (stable) and Arducopter 4.1.0 (Beta) took almost 12 hours !!!! Now we copy the compiled bin file to the execution folder and give permission.
sudo cp ./build/blue/bin/a* /usr/bin/ardupilot
sudo chmod 0755 /usr/bin/ardupilot/a*
Step 8. Now we enable Arducopter service after successfully compiling it on Beagle Bone Blue itself.
sudo systemctl enable arducopter.service
To start Arducopter service, sudo systemctl start arducopter.service
To check arducopter service statussudo systemctl status arducopter.service
To disable and stop arducopter service sudo systemctl disable arducopter.service
sudo systemctl stop arducopter.service
To restart service after making any change will require following command,sudo systemctl daemon-reload
sudo systemctl restart arducopter. service
Hi!
We are currently also working on using the BBBlue as FC for ArduPilot on a plane. Is there a reason not to use the most recent real-time kernel 5.10 but 4.19 instead?
Thanks and Greetings
This is fantastic. I have been wanting to build a quad with BBB but there are gaps in the docs for my skill level, and this is definitely an improvement. Thanks
This is very helpful. Thanks for doing this.
What does this line in aphid do? I don’t think you explain it:
/bin/echo pruecapin_pu >/sys/devices/platform/ocp/ocp:P8_15_pinmux/state
Hello,
Thank you. Has anyone updated this idea to newer kernels on the BBBlue and with Bullseye along with Python3?
I have installed the required binary via rsync and upload but failed to understand how to make the motors move via transmitter/receiver within the MP source. Anyway, I have been working on the ideas revolving around ArduCopter for about three years. I never got past the checks on ArduCopter and MP source. Calibrations are these checks I am discussing.
Anyway, thank you for posting this info. in the forum. I clicked the link and read over the info. you have listed.
If you ever get around to it, please (I beg of you…ha) add how to make the board actually fly. I got as far as transmitter calibrations and then received nothing as output, no error, no issues. But…the calibration failed, i.e. as I could not move my motors via the BBBlue and trans/receiver combo.
Seth
Hi this post seems very helpful, I have BBblue and required omponents to bild quad, I think i will need some help. This is just a test if you are available.
Hoping a reply soon.
This config has been tested on quad and hexa copters.
That’s the best description I’ve ever seen of how to setup a BBB for ArduPilot. Fantastic.
Thanks