1
\$\begingroup\$

I am working on a robotic arm, I am going to use servo motors, those are going to be controlled from the PC with command (it is a chess-game arm) so the command will be some thing like move piece from A1 to E7 for example.

How can I calculate the angle that I am going to pass to the servos for each specific command?

\$\endgroup\$
  • 2
    \$\begingroup\$ I'm not sure you and I mean the same thing by 'calculate'. The obvious answer is 'trigonometry', but as that's so obvious, you must mean something else. You need to know where A1 and E7 are in some coordinate system, which needs to be translated into and calibrated in machine units, which needs translating into servo moves. I tend to use SI within my programs for consistency, translating to other coordinate systems (when necessary) right at the boundary, so my steppers will be calibrated in steps/metre. Perhaps put up a block diagram of both your mechanical system, and proposed code to clarify \$\endgroup\$ – Neil_UK Dec 21 '17 at 8:55
1
\$\begingroup\$

Number the squares 1-8 in the x direction and 1-8 in the y direction, then the angle will be: \$\small arctan\large \left(\frac{(next\: y)-(current \:y)}{(next\: x)-(current \:x)}\right)\$.

\$\endgroup\$
  • \$\begingroup\$ this will work when dealing with two dimension, but i have an arm with 3 motor (the fourth is for the gripper) so i need to calculate three angles for each patch -square- .. \$\endgroup\$ – Tarek Baz Dec 21 '17 at 15:44
  • \$\begingroup\$ Move the table instead. \$\endgroup\$ – Chu Dec 21 '17 at 17:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.