Introduction: Raspberry Pi As Robotic Arm Controller With Flick Hat
This guide will allow you to control a Robotic Arm to pick up and move objects without having to touch anything! We will be using a Flick Board combined with a Pi to command a Motorised Robotic Arm. This should work with any Pi and Flick combo if the Flick board is compatible with the Pi, likewise the OS is not limited so any Linux OS that has a Terminal or console will work.
This guide was originally published here.
So now to get into setting up the project.
Step 1: Putting Everything Together
This project requires no soldering or electronic construction. The only mildly difficult part is the build of the Robotic Arm for which there is a guide that comes with the Arm and there is various tips and guides online.
Parts for this project:
- Raspberry Pi A+,B+ and above
- An SD card with your choice of OS (I am using Raspbian Jessie Full)
- Maplin Robotic Arm Buy Here
- Flick Board compatible with you Pi
For initial preparation
- Monitor
- Keyboard
- Mouse
- Ethernet cable
Use these diagrams to wire up the kit taking extra care with fitting the Flick Board onto the GPIO pins.
Step 2: Preparing the Pi
I suggest setting up SSH on your Pi for convenience by running
sudo raspi-config
Choose interfacing options then SSH and enable SSH Server.
Next we need to go through the basic updates and installations:
sudo apt-get update
sudo apt-get install git
sudo apt-get install subversion
Run each of those and let them install.
Run each of those and let them install. Then we need to get the Flick Board software via
curl -sSL https://pisupp.ly/flickcode | sudo bash
And to finish the installing section we need the various programs and software which allow the Pi to talk to the Arm. I would suggest, if possible, copy and pasting each of block of code rather than typing out each line separately.
Install PyUsb:
git clone https://github.com/walac/pyusb.git
cd pyusb
sudo python setup.py install
cd ~
This will install a library that allows the Pi to communicate to the Arm via USB. Install RobotArmControl program:
svn co http://projects.mattdyson.org/projects/robotarm/armcontrol
sudo cp ~/armcontrol/RobotArm.py* /usr/local/bin/
Step 3: The Testing Stage
Running this line should make the Arm test every motor and then return to its starting position.
sudo python ~/armcontrol/testRobotArm.py
Now to test the Flick Board fun the demo program
flick-demo
When this program is running you should be able to see inputs and values as you move your hand over the Flick.
Now the program which allows control of the Arm
sudo flick-armcontrol
We need to use sudo with the armcontrol because of the RobotArm library which requires direct access to the serial interface.