logo

한국어

BBBMini (BeagleBone ArduPilot DIY Cape)

관리자 2017.01.15 11:10 조회 수 : 229

■홈페이지 : https://github.com/mirkix/BBBMINI

■구매처 : http://www.shenzhen2u.com/BBBMINI.html

■비글본그린에 구현 : https://www.hackster.io/mirkix/flying-beaglebone-green-448b60



Software

How to prepare your BeagleBone to use as BBBmini.

  • Debian 8.6 jessie
  • GCC 4.9
  • Kernel 4.4 PREEMPT RT
  • BBBmini devicetree loaded at startup.

Prepare microSD with your Linux host computer

  1. Download Debian image https://rcn-ee.net/rootfs/bb.org/testing/2016-10-02/console/BBB-blank-debian-8.6-console-armhf-2016-10-02-2gb.img.xz
  2. Decompress image: unxz BBB-blank-debian-8.6-console-armhf-2016-10-02-2gb.img.xz
  3. Copy image to microSDcard (>= 2GB): sudo dd bs=4M if=./BBB-blank-debian-8.6-console-armhf-2016-09-21-2gb.img of=/dev/sdX /dev/sdX should point to your microSD, be careful here!!! Use lsblk to figure out, which is your mircroSD. The process can take 15-30 minutes depending on the speed of your microSD card.
  4. sync and remove mircroSD

Install Debian to your BeagleBone eMMC

  1. Plug prepared microSD into BeagleBone
  2. While holding down the boot button, apply power to the board. If there is a newer Debian installed, holding down the boot button is not necessary.
  3. Wait some minutes until Debian is installed (all four LEDs turned on).
  4. Remove power.
  5. Remove microSD.
  6. Apply power again.
  7. Connect to the BeagleBone ssh debian@beaglebone
  8. Password temppwd
  9. Update software: sudo apt update && sudo apt upgrade -y
  10. Install software: sudo apt install -y cpufrequtils g++ liblttng-ust-dev pkg-config gawk git make device-tree-compiler screen python python-dev python-lxml python-pip
  11. Install Python library: sudo pip install future
  12. Set link to pkg-config: sudo ln -s pkg-config /usr/bin/arm-linux-gnueabihf-pkg-config
  13. Update scripts: cd /opt/scripts && sudo git pull
  14. Expend partition: sudo /opt/scripts/tools/grow_partition.sh
  15. Install RT Kernel: sudo /opt/scripts/tools/update_kernel.sh --bone-rt-kernel --lts-4_4
  16. Add BBBmini DTB: sudo sed -i 's/#dtb=$/dtb=am335x-boneblack-bbbmini.dtb/' /boot/uEnv.txt
  17. Set clock to fixed 1GHz sudo sed -i 's/GOVERNOR="ondemand"/GOVERNOR="performance"/g' /etc/init.d/cpufrequtils
  18. Reboot system: sudo reboot
  19. Login again: ssh debian@beaglebone
  20. Clone overlays: git clone https://github.com/beagleboard/bb.org-overlays
  21. Build and install overlays: cd ./bb.org-overlays && ./install.sh
  22. Add ADC DTBO: sudo sed -i 's/#cape_enable=bone_capemgr.enable_partno=/cape_enable=bone_capemgr.enable_partno=BB-ADC/g' /boot/uEnv.txt
  23. Reboot system: sudo reboot
  24. Login again: ssh debian@beaglebone
  25. Clone ArduPilot code: git clone https://github.com/ArduPilot/ardupilot.git
  26. Change dir: cd ardupilot/Tools/Linux_HAL_Essentials/pru/rangefinderpru
  27. Install Rangefinder firmware: sudo make install
  28. Your BeagleBone is now ready to use.

Compile ArduPilot native on BeagleBone

  1. cd ardupilot
  2. git checkout Copter-3.4.4 for ArduCopter or git checkout ArduPlane-3.7.1 for ArduPlane or git checkout APMrover2-3.1.0 for ArduRover
  3. git submodule update --init --recursive
  4. alias waf="$PWD/modules/waf/waf-light"
  5. waf configure --board=bbbmini
  6. waf (take about 1h20m)
  7. cp build/bbbmini/bin/* /home/debian/

Cross compile ArduPilot (faster) with Ubuntu computer

Get the source code:

  1. git clone https://github.com/diydrones/ardupilot.git
  2. cd ardupilot
  3. ./Tools/scripts/install-prereqs-ubuntu.sh
  4. git checkout Copter-3.4.4 for ArduCopter or git checkout ArduPlane-3.7.1 for ArduPlane or git checkout APMrover2-3.1.0 for ArduRover
  5. git submodule update --init --recursive
  6. alias waf="$PWD/modules/waf/waf-light"
  7. waf configure --board=bbbmini
  8. waf
  9. scp build/bbbmini/bin/* debian@beaglebone:/home/debian/

Run ArduPilot

Now you can check your hardware here.

ArduCopter: sudo /home/debian/arducopter-quad (plus parameter)

ArduPlane: sudo /home/debian/arduplane (plus parameter)

ArduRover: sudo /home/debian/ardurover (plus parameter)

To connect a MAVLink groundstation with IP 192.168.178.26 add -C udp:192.168.178.26:14550

To use MAVLink via radio connected to UART4 add -C /dev/ttyO4.

If there is a GPS connected to UART5 add -B /dev/ttyO5.

Example: MAVLink groundstation with IP 192.168.178.26 on port 14550 and GPS connected to /dev/ttyO5 UART5.

sudo /home/debian/arducopter-quad -C udp:192.168.178.26:14550 -B /dev/ttyO5

Example: MAVLink groundstation via radio connected to UART4 and GPS connected to /dev/ttyO5 UART5.

sudo /home/debian/arducopter-quad -B /dev/ttyO5 -C /dev/ttyO4

Automatic start ArduPilot after boot

If ArduPilot should start automatically at boot time follow the instructions below:

  1. Connect to your BeagleBone via ssh with ssh debian@beaglebone
  2. Edit /etc/rc.local with sudo nano /etc/rc.local
  3. Modify file to (use your ArduPilot file and parameter):
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

/bin/sleep 10
/home/debian/arducopter-quad -B /dev/ttyO5 -C /dev/ttyO4 > /home/debian/arducopter.log &

exit 0
  1. Save file: Strg + o + Enter
  2. Exit nano: Strg + x
  3. Reboot BegaleBone with sudo reboot


Check hardware

If your board is ready you can check that everything is working as expected.

To build the example code / test code follow the instructions below.

Compile example / test code native on BeagleBone

cd ardupilot
git checkout master
git submodule update --init --recursive
alias waf="$PWD/modules/waf/waf-light"
waf configure --board=bbbmini
waf examples (take some time)
cp build/bbbmini/examples/* /home/debian/


Cross compile example / test code (faster) with Ubuntu computer

cd ardupilot
git checkout master
git submodule update --init --recursive
alias waf="$PWD/modules/waf/waf-light"
waf configure --board=bbbmini
waf examples
scp build/bbbmini/examples/* debian@beaglebone:/home/debian/


Check IMU

sudo /home/debian/INS_generic



Check baro

sudo /home/debian/BARO_generic



Check GPS

sudo /home/debian/GPS_AUTO_test -B /dev/ttyO5



Check rcinput

sudo /home/debian/RCInput




HARDWARE

IMU MPU-9250

Search for GY-9250 or MPU-9250 at aliexpress

Baro MS5611

Search for GY-63 or MS5611 at aliexpress

Rangefinder HC-SR04

Search for HC-SR04, there are a lot of sellers.

Connector

P1 & P2

  • 2.54mm pin header 3 x 12 straight or 90°
  • 12 x RC out 3.3V

P3

  • 2.54 mm pin header 1 x 2 straight
  • Close this jumper to connect 5V BBBMINI power supply to P1 / P2 RC out 5V

P4

  • 2.54 mm pin header 1 x 4 straight
  • RC receiver input.
  • For 5V RCIN signal R4 = 1kOhm and R5 = 2kOhm.
  • For 3.3V RCIN signal R4 = 0Ohm / bridged and R5 = open / not equipped.

P5

  • 2.54mm pin header female 1 x 10 straight
  • MPU-9250 breakout board

P6

  • 2.54mm pin header female 1 x 7 straight
  • MS5611 breakout board

P7

  • 2.54mm pin header 1 x 5 straight
  • UART4 port
  • RX and TV 3.3V signals

P8

  • 2.54mm pin header 2 x 23 straight
  • BeagleBone connector, pin header has to soldered on the back of the BBBMINI-PCB

P9

  • 2.54mm pin header 2 x 23 straight
  • BeagleBone connector, pin header has to soldered on the back of the BBBMINI-PCB

P10

  • 2.54mm pin header 1 x 5 straight
  • UART5 port (GPS)
  • RX and TX 3.3V signals

P11

  • 2.54mm pin header 1 x 2 straight
  • Connector for power supply. Use this connector to power the BeagleBone Black and BBBMIN-PCB. You can also use the BeagleBone Black power plug to power the BeagleBone Black and BBBMINI-PCB.

P12

  • 2.54mm pin header 1 x 7 straight
  • External SPI Bus connector for additional hardware.
  • MOSI, MISO, SCLK and CS 3.3V

P13

  • 2.54mm pin header 1 x 2 straight
  • CAN Bus interface

P14

  • 2.54mm pin header 1 x 2 straight
  • Close this jumper to enable 120Ohm CAN Bus resistor.

P15

  • 2.54mm pin header 1 x 5 straight
  • External I2C Bus connector for additional hardware.
  • SDA and SCL 3.3V

P16

  • 2.54mm pin header 1 x 3 straight
  • Additional RC_1 ESC out connector for X-Quad configuration.
  • RC_1 out 3.3V

P17

  • 2.54mm pin header 1 x 3 straight
  • Additional RC_3 ESC out connector for X-Quad configuration.
  • RC_3 out 3.3V

P18

  • 2.54mm pin header 1 x 3 straight
  • Additional RC_4 ESC out connector for X-Quad configuration.
  • RC_4 out 3.3V

P19

  • 2.54mm pin header 1 x 4 straight
  • Ultrasonic Range Finder connector
  • Connect HC-SR04 Range Finder here.

P20

  • 2.54mm pin header 1 x 5 straight
  • External I2C Bus connector for additional hardware.
  • SDA and SCL 3.3V

P21

  • 2.54mm pin header 1 x 5 straight
  • Current and voltage sensing via Power Module


Assemble BBBmini

Step 1: Solder resistor R4 and R5.

For 3.3V RC input signal use R4 = 0Ω (bridge) and R5 = open (see picture)

For 5V RC input signal use R4 = 1kΩ and R5 = 2kΩ
build_step1.jpg



Step 2:

Solder resistor

R1 = 120Ω

R2 = 1kΩ

R3 = 2kΩ

R6 = 20kΩ 0.1%

R7 = 10kΩ 0.1%

R8 = 20kΩ 0.1%

R9 = 10kΩ 0.1%

to the bottom layer.

build_step2.jpg




Step 3:

Solder CAN transceiver on the top layer

build_step3.jpg




Step 4:

Solder male pin-header on top layer

P1, P2, P3, P4, P7, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21

build_step4.jpg




Step 5:

Solder C1 and C2

build_step5.jpg




Step 6:

Solder female pin-header P5 and P6 on top layer

Solder P5 and P6

build_step6.jpg



Step 7:

Solder male pin-header P8 and P9 to bottom layer

build_step7.jpg




Step 8:

Solder male pin-header to bottom layer of GY-9250 and GY-63

build_step8.jpg




Step 9:

Mount spacer to BBBmini

build_step9.jpg




Step 10:

Mount GY-9250 and GY-63

build_step10.jpg



Finish! BBBmini is ready to use for Copter, Planes or Rover.

build_step11.jpg



Connect BBBmini

Connect motors and ESC
esc.png




Connect power distribution

Connect each ESC to the power distribution board
Connect the 5V power distribution board output to BBBmini P11 power input
Connect the voltage and current sensing power distribution board output to BBBmini P21 voltage and current sensing pins
power.png




Connect RC receiver

rcrx.png




Connect display

display.png




Connect GPS

Connect your GPS to P10.
P10 +3.3V to GPS VCC
P10 GND to GPS GND
P10 RX to GPS TX
P10 TX to GPS RX
gps.png




Connect telemetry

Connect your telemetry radio to P7.
P7 +5V to telemetry radio VCC
P7 GND to telemetry radio GND
P7 RX to telemetry radio TX
P7 TX to telemetry radio RX
telemetry.png




Connect HC-SR04

Connect your HC-SR04 ultrasonic rangefinder
P19 +5V to HC-SR04 VCC
P19 GND to HC-SR04 GND
P19 TRIG to HC-SR04 TRIG
P19 ECHO to ECHO TRIG
hcsr04.png

BBBMini Pin-Out
bbbmini_pinout.png


Beaglebone Green Hardware components:
BeagleBoard.org SeeedStudio BeagleBone Green × 1
BBBMINI PCB
BBBmini cape PCB × 1
GY-9250
MPU-9250 IMU board × 1
GY-63
MS5611 Baro board × 1
Microchip MCP2562 E/P CAN TRXCAN transceiver × 1
SeeedStudio Grove - OLED Display 1.12''
BBBmini status display × 1
HC-SR04 ultrasonic rangefinder
Distance measurement × 1
GPS ublox NEO-M8N
GPS with up to 10Hz update rate× 1
Telemetry radio
Telemetry connection between BBBmini and ground computer × 1
Kemet c320c104k5r5ta imageCapacitor 100 nF × 2
Resistor 10kΩ 0,1% × 2
Resistor 20kΩ 0,1% × 2
Mfr 25frf52 1k sml
Resistor 1k ohm × 2
Resistor 2kΩ × 2
Resistor 120Ω × 1
Pppc081lfbn rc sml
Female Header 8 Position 1 Row (0.1") × 3
Te connectivity   amp 4 103777 0 image 75px
Male Header 80 Position 2 Row (0.1") × 2
Te connectivity 4 103741 0 image 75px
Male Header 40 Position 1 Row (0.1") × 2
M3 x 6mm Polyamid screw
To mount sensor breakout boards × 10
M3 x 10mm hexa Polyamid spacer
To mount sensor breakout boards × 7
Quadcopter frame × 1
ESC and motor set
4 x ESCs 4 x Motors × 1
Lipo pack 2200mAh
Flight Lipo pack × 1
Lipo charger
It is recommended to buy a better one. × 1
Gemfan 5030 Multirotor ABS Propellers Bulk Pack (10 Pairs)Propeller × 1
HK Pilot Power VI Module, Distribution Board And Dual UBEC ALL-In-One (120A and 10s) × 1

■ 배터리 셋팅

bbbmini_battery_monitor.png

battery_monitor_set.png

빨간 부분을 조정하여 Voltage를 맞춘다. (테스트 된 적절 값:10.3)