Problems programming a smooth trayectory using URScript

I am trying to program a trajectory in a UR5e robot using URScript in PolyScope. I program the trajectory using movej giving the points at every 5ms.
The code is something similar to (there is only variations in the second and sixth joint angles)

movej([0.000,-4.294,0.000,-3.142,4.712,-1.745],t=0.005,r=0)
movej([0.000,-4.293,0.000,-3.142,4.712,-1.745],t=0.005,r=0)
movej([0.000,-4.293,0.000,-3.142,4.713,-1.745],t=0.005,r=0)
movej([0.000,-4.292,0.000,-3.142,4.713,-1.746],t=0.005,r=0)
movej([0.000,-4.292,0.000,-3.142,4.714,-1.746],t=0.005,r=0)
movej([0.000,-4.291,0.000,-3.142,4.714,-1.746],t=0.005,r=0)
movej([0.000,-4.291,0.000,-3.142,4.715,-1.746],t=0.005,r=0)

there are about 500 lines.

When I run the code in simulation mode the program runs correctly. But when I run the code in the robot (with the emergency stop button ready) the robot moves very slow and with a lot of vibrations that move even its table and I have to stop it. It seems that at every movement the robot start and stop and not join all the movements.
Is there any way of making a smooth movement with all the points?

Hi @JJ_ULPGC ,
movej stops at every movement if you don’t specify a blending radius, that’s way you see the robot shaking. :slightly_smiling_face:

So try to define also a radius (r parameter) in your commands.

If blending radius would be too small for your trajectory consider using servoj command instead.

Thank you for your suggestions.
I tried the solution using movej with non-zero r parameter but many errors appear. I spent about two hours and everything was getting worse.
But the solution with servo was great and solved the problem successfully.

1 Like