Skip to content

Instantly share code, notes, and snippets.

@jadonk
Last active October 6, 2023 10:23
Show Gist options
  • Save jadonk/6080ca92d6e225eb89d33ad7744e1775 to your computer and use it in GitHub Desktop.
Save jadonk/6080ca92d6e225eb89d33ad7744e1775 to your computer and use it in GitHub Desktop.

Shopping List

Mechanical assembly

Motor positions

The motors should be configured as "Quad X" where BeagleBone Blue's USB connector is forward-facing. ArduCopter QuadX and QuadPlus configs

Wiring

ESC connection from BeagleBone Blue

  1. yellow
  2. orange
  3. green/black
  4. blue

Software setup and test

#!/bin/bash
cd /opt/scripts/tools
git pull
sudo ./update_kernel.sh --ti-rt-channel --lts-4_4
yes | sudo developers/update_bootloader.sh
# Be sure to not try to run "apt-get upgrade" from within Cloud9. "dpkg --configure -a" to fix.
sudo apt-get upgrade -y
sudo apt-get install -y ardupilot-copter-blue
sudo sed -i 's/GOVERNOR="ondemand"/GOVERNOR="performance"/g' /etc/init.d/cpufrequtils
echo "uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo" | sudo tee -a /boot/uEnv.txt
echo "enable_uboot_overlays=1" | sudo tee -a /boot/uEnv.txt
sudo mkdir -p /var/APM/logs
sudo mv /etc/rc.local /etc/rc.local.bak.$RANDOM
cat <<EOX | sudo tee /etc/rc.local
#!/bin/sh
echo pruecapin_pu > /sys/devices/platform/ocp/ocp\:P8_15_pinmux/state
sleep 10
echo 4a334000.pru0 > /sys/bus/platform/drivers/pru-rproc/unbind
echo 4a338000.pru1 > /sys/bus/platform/drivers/pru-rproc/unbind
/usr/bin/ardupilot/blue-arducopter -A udp:10.0.0.10:14550 -l /var/APM/logs 2>&1 > /var/APM/logs/blue-arducopter.log &
exit 0
EOX
sudo chmod +x /etc/rc.local
sudo xxd -r -a - /var/APM/ArduCopter.stg <<EOF
0000000: 5041 0600 0002 0000 7800 0602 f303 0f00 PA......x.......
0000010: 0601 0415 000b 4401 0000 0000 000b 8400 ......D.........
0000020: 00bd 7a76 442a 0200 0000 0003 c500 006c ..zvD*.........l
0000030: 095f bc4e c2a7 3c02 2463 bd03 8307 0011 ._.N..<.$c......
0000040: 6824 0003 c501 0000 0000 0000 0000 0000 h$..............
0000050: 0000 0003 c307 0000 0000 0003 8502 0000 ................
0000060: 0000 0000 0000 0000 0000 0003 0308 0000 ................
0000070: 0000 0006 0313 0000 0000 0006 0323 0094 .............#..
0000080: 5604 0006 0333 00ea 74ea 0249 c100 0001 V....3..t..I....
0000090: 7102 0000 fc00 06c1 0300 0195 0100 0001 q...............
00000a0: 9345 0000 0000 6fc3 0000 bcc2 0080 c643 .E....o........C
00000b0: 93c3 0300 110c 0400 0345 0300 3ea1 b53d .........E..>..=
00000c0: 71d4 8e3d 6b17 6bbf 0305 0300 c606 803f q..=k.k........?
00000d0: 6ca3 7f3f bccb 7f3f 0343 0800 1168 1600 l..?...?.C...h..
00000e0: 0383 0800 0000 0000 03c5 0300 0000 0000 ................
00000f0: 0000 0000 0000 0000 0385 0300 0000 0000 ................
0000100: 0000 0000 0000 0000 03c3 0800 0000 0000 ................
0000110: 0345 0400 0000 0000 0000 0000 0000 0000 .E..............
0000120: 0305 0400 0000 0000 0000 0000 0000 0000 ................
0000130: 9f05 0200 9bd7 133b d2d9 043c 0000 0000 .......;...<....
0000140: 0642 1408 db05 ffff 3f00 0000 0000 0000 .B......?.......
0000150: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0000600: ae65 0000 0000 0000 0000 0000 0000 0000 .e..............
0000610: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0003ff0: 0000 0000 0000 0000 0000 0000 0000 0000 ................
EOF
@silver2row
Copy link

Hello Again,

Thank you for taking time out to accompany my minor issue. I will test things out and get back to this Gist and the #beagle Freenode thing.

Seth

P.S. If you have time to review this gist again, I will stay up-to-date and test more images and kernels.

@silver2row
Copy link

silver2row commented Apr 4, 2018

Sir,

If you have time to understand, please let me know from your perspective why rc.local is not showing for line 13 when /etc/rc.local is already a directory and I get this error: mv: cannot stat '/etc/rc.local': No such file or directory.

I will look it up while you are busy doing whatever. I will reply to me, myself, and I until I hear from another person.

Seth

P.S. I think the /etc/rc.local directory was added by me and was not present on the system beforehand. I will check that out, too.

@silver2row
Copy link

Hello Sir,

Forget about it...the .sh script works and I am just going to ignore the error as an error until I set up everything to see if things work. I will reply.

Seth

@silver2row
Copy link

Hello,

Well...here goes it. Once I rebooted after running the .sh script w/ sudo sh ardupilot_setup.sh, I have the second LED to the USB port blinking red while the rest still blink blue. I erased the file, the .sh script file, and then I rebooted.

Only after the reboot, and this is ongoing now, did I come across the blinking LEDs in different colors and patterns.

So,

I guess I will start from scratch and get back to this board. I am finding that some people still use, in opensource, ardupilot/arducopter and I can learn a lot from this post/gist and their development.

Seth

P.S. I will stay "attached" for the time being, i.e. at least until you get tired of this specific gist. Good times and dollars!

@silver2row
Copy link

Hello...

https://github.com/mirkix/BBBMINI/blob/master/doc/software/software.md is what I found that may work. If you are still planning on working w/ the BBBlue and ArduPilot/Copter, this person put some stuff together and did well (I think).

Seth

@silver2row
Copy link

Hello Again Sir,

I got connected to MavLink and Mission Planner from the BBBlue. I think this is a big step. My parts will come in one day and until then, I will find tune things.

Seth

@jadonk
Copy link
Author

jadonk commented Apr 12, 2018

@silver2row: how did it go?

@fatdollar
Copy link

Any way you could be a little more detailed on the wiring? I don't fully understand how the battery is connected to the system.

Thanks.

@fatdollar
Copy link

I am having problems with the PRU I've run your setup.sh file and didn't have any errors. I can't find any clear cut documentation on how to enable the PRU. The one step by step post i found bricked my bone and i had to rebuild the SD card.

I'm extremely frustrated with the lack of documentation on the Beagle Bone Blue and that there seems to be no central source for help.

Any advice? The error message i'm getting is posted as well.
image

@silver2row
Copy link

silver2row commented Jul 14, 2018

@jadonk and @fatdollar...

I was having some issues. I stopped for a while, took a break, and forgot my notes. I am up a creek right now w/ things. I am trying to follow along w/ https://github.com/imfatant/test. I will keep you updated.

Seth

P.S. I will try your script again w/ the BBBlue. I will let you know what I find.

@silver2row
Copy link

@jadonk

Hello...Do I plug the ESCs into the two-pin motor connectors on the BBBlue? I am asking b/c the darn thing does not work well w/ a power board.

Seth

P.S. I think I need to make the connections to the BBBlue directly.

@silver2row
Copy link

silver2row commented Sep 11, 2018

@jadonk

Okay. I think I got it now. "I should have not added two new leads to my ESCs to attach them to my BBBlue." I can use the servo connectors to add the ESCs directly to the BBBlue by way of the Servo Rail. I just need to power the Servo Rail at boot. Got it!

Seth

P.S. I will test this in a few days or so. Reporting back here should be exciting w/ my new knowledge on this idea: Motor -> ESC -> Servo connector -> BBBlue Servo Rail!

@crazyquark
Copy link

crazyquark commented Oct 9, 2018

Hi @jadonk,

Sorry for being a total n00b but I can't figure out how the 4in1 ESC should be powered(ok, so the signal wires go to PWM pins/servo on the board) but then the LiPo connects to the ESC or the board?

A diagram would help me tremendously. As far as I can tell you are supposed to use that Balance/charge connector on the lipo only for charging not powering the project so power must come from some other connector, right?

@silver2row
Copy link

silver2row commented Jul 14, 2020

Hello...

@crazyquark

Are you still using the BBBlue and Mission Planner on Win 10? Anyway, I am making some headway from two years ago.

...

I can help you w/ the wiring set up and connections if you still need support. There is a room online for the BBBlue and ArduCopter: https://gitter.im/mirkix/BBBMINI?utm_source=share-link&utm_medium=link&utm_campaign=share-link.

Seth

P.S. The only thing that is not working are these two objectives on my side of things:

  • GPS

  • Accel Calibration

@Antonstr
Copy link

Antonstr commented Jun 3, 2022

Good day

I have limited knowledge of Linux and robotics
I have a BeagleBone Blue with Ardupilot, Ardurover 4.1 compiled on it using the procedure as described here https://beaglebluevoyager.com/configuring-beagle-bone-blue-as-flight-controller-unit/
I am building an Autonomous Rover with skid steer that will be navigated by a low cost precise navigation device to 8 precisely surveyed and post processed points. The rover is equipped with a Raspberry Pi 3 fitted with a camera. The camera is down looking and the lens centre is aligned with the center of the GPS antenna. The down looking camera will record the track of the Rover, this video will be synchronised to a video recording of the whole operation. The Rover will also pause at each point and record a couple of images. The purpose of this is to determine the accuracy of navigation by measuring the distance from the photo center to the pin center as captured.
Everything went smoothly and Ardupilot compiled successfully and everything worked being able to test the 6V DC motors and encoders using Robot Control Library command rc_test _motors –s 0.5 however Ardupilot does not seem to support these ports or dc motors with quadrature encoders. I then decided to use the PWM rail for the motors. It turns out that the inclusion of the overlay “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 the /boot/uEnv.txt file prevents the PRU and RPROC drivers to be loaded preventing you from using the PWM rail

Disabling the overlay in the /boot/uEnv.txt file loads the drivers but bring problems of its own
The navigation device only has a USB port and worked perfectly connected to ttyACM0 before disabling the overlay

But after disabling the overlay the GPS is no longer seen by Mission Planner

I then purchased a LN298 Dual H-Bridge to drive 2 brushed 12V DC Motors to be controlled by the PWM rail.

The motors were setup as per Ardupilot instructions for skid steer.
https://ardupilot.org/rover/docs/rover-motor-and-servo-configuration.html?highlight=skid%20steer
SERVO1_FUNCTION = 73 (Throttle Left)
SERVO3_FUNCTION = 74 (Throttle Right)

When I run rc_test_servos –p 1 the motors both rotate in the same direction. I cannot test the motors in Mission Planner

Mission planner connected via USB to 192.168.7.2. All the calibrations were done sensor wise, accelerometers, compass etc.
I also have a Spektrum SR315 reciever installed on the UART for DSM. I also connected the RC receiver signal to connector E4 pin 4 of the BeagleBone Blue
In both cases rc_test_dsm and rc_calibrate_dsm failed
There is no frame type for a skid steer Rover. This does not allow you to configure a 2 motor skid steer system
I also purchased an APM Battery monitor, wired it as per instructions but could not configure such to work with mission planner
I will greatly appreciate any assistance in getting the problems I am experiencing resolved

Thanking you in advance

Sincerely

Anton Strydom

@jadonk
Copy link
Author

jadonk commented Jun 6, 2022

Can you bring this discussion over to https://forum.beagleboard.org? Please feel free add a link to that discussion here or e-mail me directly with a link to that discussion. The best thing for me is to reply on the forum.

@Antonstr
Copy link

Antonstr commented Jun 8, 2022 via email

@Antonstr
Copy link

Antonstr commented Jun 8, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment