So, what's been happening? Well a lot really, the new school year is already in full swing and as a result I am a very busy man. This years project? A Robot Arm! The servo's are still in there, but in a different application, it adds interest to the project and means I get to learn about Servo Control that isn't manual. The little brain that heads up the coordination is a PIC Microcontroller, to be precise the PICAXE 20M2. This little bad boy packs eight inputs and outputs, some of which can be serial, digital or analogue. It has EPPROM (Electrically Erasable Programmable Read-Only Memory) so that servo positions can be saved and then used at a later date - although that is not something I will be delving into. The most important thing is that it supports wave frequency modulation, so Servo Control is a walk in the park for this little IC. So, shall we get down to business and talk about what the plan really is?
The 20M2 Board:
There's not much to say here, its a relatively simple board. Anyone who has remotely touched electronics before in their life will have seen something more complicated than this. It literally consists of the 20M2 Chip in the middle; lots of inputs with their Diode's or Pull Down resistors on one side of the chip and the links to the output header pins on the other. Nothing too complicated at all!
Programming:
Now I am not the worlds biggest authority or programming in Basic, or programming in general for that matter. As of now I only know a bit of Python and how to graphically program a PIC with Basic. But I have enough knowledge to work my way round robot arm control with a PIC. For those of you only wishing to delve into "automatic" control of the Robot Arm, there is not a lot of work ahead of you. Automatic is in quotation marks because it's not really automatic, but rather fooling you into thinking that's the case. There's no camera with object recognition, no infrared sensor, not even an LED and Light Dependant Resistor. The "Automatic" Program is merely a cleverly times sequence designed to fit with most people's needs. For example the Robot arm will pick an object up, rotate 90 Degrees and then put it down again. However it is not rationally understanding when there is something in the claw, it is simply following a set of preprogrammed instructions. Open Claw, Wait One Second, Close Claw, Wait One Second, Rotate 90 Degrees, etc. Its like a Microwave. It doesn't know when the food is cooked, it merely stops microwaving the food when the timer is done.
No Manual control is where it's really at in my opinion, this is the section that really takes some knowledge. Automatic Control only really requires you to understand the Servo and Wait Command. Nothing else is really required. But Manual Control Requires Procedures, Variables, Servo Commands, Decisions, Comparators, Interrupts, etc. There is no limit to what you may need to know when programming for Manual Control, it depends on the task your trying to manually tell the Robot to do. Manual Control is harder because you have to account for every possibility of input the user might give. You can never know exactly what is going through their head, what plan they have. So you have to account for everything. The easiest way to do this is to allow manual control of each axis of rotation or pivot point (of each servo). This way they can do whatever they want, as they have full control of the robot.
My program uses Variables, Comparators, Increment and Decrement Commands and Decisions to allow the user to manually select the position of the servo. Down to single increments. Manual is definitely more time consumer, but a lot more rewarding when the task is complete.
The Main Structure:
This is probably the most complicated bit, and so I won't go into hyper amounts of detail. Unless you have an hour?
The Main Structure is much like any Robot Arm you will have seen on the Internet, TV or in a Book. It tries to emulate the functions of a real human arm as much as possible. The problem is that we can't really properly emulate the function of the ball and socket joints of the human body without spending lots of money. So we have to split the functions up. There are six main functions on the arm. The Base Rotation, Shoulder, Elbow, Wrist Y, Wrist X and Claw. They all do separate functions that try and emulate the parts of the human arm. The Base Rotation is like the rotation you get in the shoulder, the shoulder is like you raising up your arm from the shoulder onwards. The elbow is the same as the shoulder except from the elbow onwards, as is the wrist Y but from the wrist onwards. Wrist X is a rotary motion, like when you are twisting an object. And finally the claw is like the fingers, grabbing an object. These Pivot points are attached together using sections of wood (In this case 4mm Laser Ply), these sections have to fit together perfectly, so that the gaps between them have to be exact so that the other section will fit around it. The sections cannot be too long, as this would create an overly large maximum reach, causing the material to snap due to the increased relative weight of the load as it gets further out from the base.
It seems very simple, granted I thought it was too when I started. And to a certain extent it is. It is all very logical and intuitive, nothing occurs that seems to be totally against the grain. However, everything needs to be so extremely accurate, there is no room for error. Because if one hole is out, then this has a rippling effect through the rest of the arm, causing a huge discrepancy at the other end if it isn't account for.
It takes some time to do, with no small amount of maths, and engineering. But it's incredibly rewarding once you get it right! And once the design is correct, the thing just fits together like a slightly complicated jigsaw puzzle when it's all cut out!
To Conclude...
You've got to know your interested, because it will take up a lot of your time if your going to build one from scratch. If your not sure you could by a kit online, that will save you the time of designing the parts, all you have to do is put the thing together. It would be less rewarding as an experience though. Still, its all great fun!
Phew, that was a long one. Time to give my hands a rest....