# 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? Mar 12, 2016 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. Mar 13, 2016 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? Mar 13, 2016 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. Mar 13, 2016 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. Jul 15, 2017 at 10:01

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.
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.