Monday, 17 November 2014

Building a Robotic Arm

Building a Robotic Arm

Following the fun I had with Project Splendabot (http://goo.gl/pZrTXB). I decided to get into a more meaty robotics project. I want to create a robotic system that is capable of moving steel balls on a track from one place to another. Servo powered arms had always been attractive to me but were always just too expensive. I found that cheap 9g servos that are available to be shipped from china, coupled with a cheap electromagnet it should be able to move steel balls provided all goes well. I found a 3D printable frame for a 9g servo robotic arm on Thingiverse (http://goo.gl/B4tocR) it looked promising but the 3D printers we have at school are unable to produce this kind of mechanical accuracy. I got in touch with 3DPrintMan 3D printing solutions they agreed to print the product. The accuracy and the finish is fantastic! After a touch up with a rotary tool I was ready to test out the arm. 





I found the design had stability issues, so using meccano I modified some of the weak areas and it's now mechanically sound. 
Electronics 
The electromagnet is rated at 9V which which is not available from the arduino so instead the arduino will be switching a transistor on which will allow current to flow from a nine volt battery. After watching this video I started to understand how it would be arranged. 
I need a way for the arm to know when a ball is ready to be picked up, for this I will be using an LDR, the resistance of an LDR increases as the light level decreases. If I couple this with a variable resistor in a voltage divider circuit then I can change the value of the variable resistor to calibrate the background light level. When the LDR is covered the logic level should change which can be harnessed in arduino code. 
The next problem I encountered was power requirements.  As you may have guessed a little arduino didn't have quite enough juice to drive four servos and a switching circuit for the electromagnet and power the voltage divider. I had to modify an old 5V 2A DC charger to get the right amount of power.
Code
My plan for the arduino code is to use a hardware interrupt (great video on those here) to tell the servos to move to a specified location (using the servo.h library) once the arm is lined up the electromagnet circuit will turn on, the ball will be picked up and moved to another predesignated position. The position the ball will be moved to will not be changeable on-the-fly and the arm will have no idea of knowing if it has picked up a ball or not.
I have made a start on the coding for this and hope to have it finished by next week. Its easily the most complex arduino program I have written to date.




This will be a multi-part project but I hope to have another update out as soon as possible. Its been great to learn about the different areas vital to robotic design and I look forward to making the code work how I want it to. If you live in the UK and are looking tor a 3D printing service to give you an accurate product at reasonable prices I would encourage you to check out 3DPrintMan. 
http://www.3dprintman.co.uk/
Thanks and until next time.