Algorithm for Multiple Servo Robotic Arm

I need some guidance concerning the 5 servo robotic arm (RA) I have made. I am unable to control the RA to bend down and pickup an object that it finds using a Pixy camera. I find the object, but coordinating the 3 servos (shoulder, elbow, wrist) to fluidly approach the object does not work so well. Depending on how near or far the object is from the RA base dictates how the servos respond. I can not get the RA to reach down to the object to pick it up. The object is randomly placed in a field in front of the RA. When the Pixy camera finds an object, I would like to use the Pixy camera object height, length and x/y center offset commands to reposition the RA down towards the object in the field.

I understand that I could use a ping module to calculate the distance. But, that is not what I am asking here. This is more a question of algorithm procedure not one of coding. Maybe I should use a recursive call to traverse a tree structure? I have searched for websites but did not find anything helpful.

Any input would be deeply appreciated, Scott

Can you post your code? Also, a video and/or some pics of how your system is acting now might help.

Controlling an arm like that is part of a general and difficult problem called "inverse kinematics".

In this case it means you need to figure out what joint rotations to make, in order to put the gripper where you want it. Google "arm inverse kinematics" for plenty of information on the topic.

Does your camera provide you with the position of the object?
If you have X,Y,Z coordinates relative to your RA, you can use reverse kinematics to determine the angle commands to send to your servos.

Perhaps you can assume that Z is zero if the object is sitting on the same surface as your RA.

How good is your trigonometry? Not to scare you, even if you are not a top mathematician, we can get you through that part.

You will need some dimension information about the components of you RA. Can you post pictures so that we can start asking more specific questions?

edit: or inverse kinematics, like jremington said. :smiley:

How good is your trigonometry? Not to scare you, even if you are not a top mathematician, we can get you through that part.

True. When I mentioned "difficult" above, the problem is simply stated and reasonably easy to solve, but there are almost always many ways of moving the gripper from point A to B.

Usually there are other considerations, like obeying joint motion restrictions, not banging into things and moving in a nice, smooth path. Then the problem becomes difficult.

OMG!

After looking into the IK and FK dynamics I have realized that I am WAY OUT of my pay grade on this! I did not realize how complicated this was to do prior to starting this project. I thought the Pixy camera could generate real time data for the RA to follow. It would be cool if the RA smoothly tracked and picked up an object on a table top using a electromagnet. Oh Nooooooooooooooooooooooo ... I need to rethink this.

I really appreciate all the help, information and guidance that the Arduino Forum members provide. You guys really are the hard core value of this forum. Again, many many thanks!!! Scott

Yep, motion control would be out of the Pixy camera's pay grade too.

I have been working on the IK calculations for a 3DOF robotic arm. I have been able to calculate all the angles except angle "B" (please see scan.jpg image). I have searched the internet trying to find ways to solve this angle but with no luck.

I know that this is not "specifically" an arduino question. But if there are any math majors out there that can at least offer some sort of guidance it would really be very helpful.

Thanks, Scott

It is not clear what you mean by "angle B". How is it defined? Provide an example by showing us your solutions for the other angles.

Have you investigated IKFast, which automatically solves problems like yours?

I spent several hours trying to install OpenRAVE and was not able to. During the windows install it tries to install Boost 1.44 and fails due to Boost being no longer supported. So it looks like I am dead in the water again.

You ask..."It is not clear what you mean by "angle B". How is it defined? Provide an example by showing us your solutions for the other angles."

Angle B is an unknown angle required to get to point (6,7). In fact all the angles are defined as unknown. I do not have any solutions for the other angles. I do have a formula that I found on Youtube that can calculate an angle given an adjacent point on a 2DOF robotic arm. But I can't use it here, my robotic arm is 3DOF.

Maybe this is just unsolvable????

Of course this is solvable, but your posts are quite confusing.

I have been able to calculate all the angles except angle "B" (please see scan.jpg image).

I do not have any solutions for the other angles.

At the very least you can do a brute force calculation to explore the position of the gripper for all possible values of the angles, and select combinations that are allowed and match the gripper to the target position. That could be done in much fewer than 100 lines of code.

However, I would install openRAVE on a linux system.

kikidog:
I spent several hours trying to install OpenRAVE and was not able to. During the windows install it tries to install Boost 1.44 and fails due to Boost being no longer supported. So it looks like I am dead in the water again.

You ask..."It is not clear what you mean by "angle B". How is it defined? Provide an example by showing us your solutions for the other angles."

Angle B is an unknown angle required to get to point (6,7). In fact all the angles are defined as unknown. I do not have any solutions for the other angles. I do have a formula that I found on Youtube that can calculate an angle given an adjacent point on a 2DOF robotic arm. But I can't use it here, my robotic arm is 3DOF.

Maybe this is just unsolvable????

This sounds like problems we encountered in an operations research class I took many years ago. Look at "linear programming".

Paul