Arduino controlled robot arm

Hi all, I am new to arduino but I am very interested in this thing :D. I bought the Arduino Mega because I wanted to build a robot arm.
Instead of using standard R/C controllers, I thought that using arduino will be much more precise than human operators. The arm needs to move around and picks up things with a claw and then put the objects into score boxes.
Since my robot arm utilizes three VEX motors, the motor shield doesn't seem to work. Also, I've tried controlling the arm with a joystick, using a servo controller connected to the computer via USB.
So is there a way to make a program, tells the arm where it needs to go and pick up things, given its initial position? Like let motor 1 rotate a certain degree and then operate the claw and then move motor 2 and 3 a certain degree then open the claw. Can I program the board to make the whole thing automated?
Thanks for your help!

James

Arduino is up to the task if you are! I would recommend writing your own motor library, but there are many out there and you may be able to find a servo library that serves your purpose.
The key is to think things through. Draw your diagram of how things will work, and get rid of the black-box components if you know what I mean.
Example: move motor 1 degree. How is motor controlled? PWM? that has a resolution of 512. What is the range of motion of the motor? Divide range of motion by 512 to find motor resolution.
Likewise imagine a program to let you record a series of movements by repeatedly moving the motors to a certain position, pressing a button and storing the coordinates in EEPROM, maybe even add timing information. If you need more memory then you could go to an SD card system (which would require you to implement at FAT16 file to read/write the data from/to)
Use the force, meditate on the various functions and their variables, then you can write the code! The playground has lots of examples of things once you get down to specific questions of hardware and software implementation.
Good luck.

zhengfu23:
So is there a way to make a program, tells the arm where it needs to go and pick up things, given its initial position? Like let motor 1 rotate a certain degree and then operate the claw and then move motor 2 and 3 a certain degree then open the claw. Can I program the board to make the whole thing automated?

There is way more to accurately controlling a robot arm than you think; note that I am not trying to discourage you in any way - but rather trying to guide you on what you will need to look into in order to have a successful project.

You can do as you suggest; in fact - you need to do that initially - so start there. Get your arm working with the Arduino, first, in the manner you describe.

Note that your method is essentially "open loop" control; while the Vex motors know their position, the Arduino actually knows nothing about the motor positions, beyond simply telling the motors "move here", and then assuming the motors went to the proper position. In order for the Arduino to know the position of the motors, it needs positional feedback from them. This is actually pretty important in a real robotic arm, but for the time being, you don't need to implement it, unless you want to. Just know that in the future, it may be something you want to look into.

Once you have your arm working with the Arduino, unless you are doing simple "pick-and-place" operations with your arm; where all positions are "fixed" in location, and nothing changes (this rarely happens outside of a factory floor, btw), you're going to want more precise control. Ultimately, you're going to want to specify a coordinate position within the fixed work envelope of the arm (that is, all positions the arm can possibly reach), and have the arm's end-effector travel to that position, smoothly and efficiently.

The path the arm takes is known as an "arm solution" (look it up on wikipedia); this path (ideally) takes the shortest and most efficient path, while avoiding any and all obstacles in the way of the arm. Unfortunately, solving for the "arm solution" for a given arm is NOT a trivial problem. It involves knowing all joint angles, lengths of arm segments, as well as the environmental conditions around the arm's work envelope (positions and shapes of objects external to the arm, for instance). It may even need more detailed knowledge about the arm itself (thickness or profile contours of the arm segments, for example). Computer vision processing systems may come into play (involving more than one camera, as well). Then there are the mathematics - know anything about "reverse kinimatics"? If you want to solve for an arm solution - you'll need to (again, wikipedia and google is your friend).

Finally, note that for any given start and end position, the path from one to the other may have multiple solutions (!) - picking which solution is most efficient is not easy; in fact, if you get this far with your arm, you will be quite an expert, and might be able to write your own ticket for future employment at any number of companies.

So - good luck; do your research, and get your arm moving, first. Then take the time to learn, step-by-step, all the other stuff above. Robotic arm control is a broad field of study, with many papers and books published over the last 20-30 years; you would do well to study these.

:slight_smile:

Thank you so much for all these information! I'm still a high school student so I am not really that far into this field :P, but this is for a competition, so all the objects and goal boxes are placed at fixed position known prior the competition. That's why I wanted to use the arduino to control since I thought computer does repetitive mechanical tasks better than my hands xD. So can you tell me a bit more in detail what I'll need to get and what kind of resources I should research into? That would be extremely helpful! Thanks in advance.

James