# How to make a robot arm follow a shape/path

I have constructed a 3 DOF robot arm. I want it to follow a trajectory on a 2D plane (XY). Tha shapes I want to follow are lines, cycles and splines. I now the math behind these 3 shaped (how they are defined). I have the kinematics, the inverse kinematics the jacobian and the whole control system (with the PID controller). The system receives as inputs, Xd(position), Xd'(velocity) and Xd''(acceleration) over time.

I found the following image that shows (more or less) my system. So here is were I am stuck. How do I translate the shape to the position, velocity and acceleration that each joint needs to make so the end effector moves in the Cartesian space according to that shape?

• Can you show the dynamics equations of the manipulator? – CroCo Mar 12 '16 at 23:26
• @Croco I am using the following: M(q)q" + V(q,q') + G(q) = [Generalized forces] . I derived it by using the Lagrange formulation. Although because I am not sure if I impimented the V correctly I will probably not use it at first. Hope this is what you were asking for. – Jim Mar 13 '16 at 1:31
• Can you add a little info on what you have tried and what went wrong? Are you struggling with how to create the trajectories or how to reduce error between the arm motion and the desired trajectories? – hauptmech Mar 13 '16 at 2:42
• @DimitrisPantelis, first of all, you don't have to control the position and velocity together, although you can do so. Secondly, determine the equations that govern your desired trajectories and then establish relations between the joint angles and Cartesian coordinates. – CroCo Mar 13 '16 at 6:29
• Are you sure your actuators allow you to get access of their torque signal so directly? I would suggest you to check that and to have a read of this before talking about implementing a control law like that one you showed. – cyberdyne Jul 15 '17 at 10:01

## 1 Answer

The image you post is one way that should work. In the image, $\tau$ is the joint torques, and $x_d(t)$, $\dot{x}_d(t)$, and $\ddot{x}_d(t)$ are the Cartesian shape trajectory.

You mention "whole control system (with the PID controller)". Perhaps you were talking about a motor or joint torque controller?

The control loop image you post assumes that joint torque is more or less perfect (ie it does not care if there is a controller or not) and is wrapping a controller around the Cartesian state of the end point which would generate the shape.

To be pedantic, you are not translating the shape to the position, velocity, and acceleration that each joint makes... You are giving the actual cartesian position, velocity, and acceleration parameters of the shape to the control loop image you post and the $k_v$ and $k_p$ parameters will reduce the error between the measured shape and desired shape.

• sorry for the delay. Thanks for your clarification. On what you said, if I know my shape (lets say a line) how can I get the cartesian velocity, and acceleration (of the shape)? I just take the derivative of the cartesian position? – Jim Apr 18 '16 at 22:16