Universal Robots Forum

What is the difference between movej and servoj

I know, that the command “servoj” has the parameters gain and lookahead_time. But would a “movej” command with properly set parameters a,v and r not have the same (or at least a similar) effect?

So: When would I want to use servoj instead of movej?

1 Like

We’ve used servoj to smoothly stream a series of ~30,000 precise coordinates for a task with a set time step between each coordinate using t and smoothness controlled by lookahead time. I notice in the manual that a and v used to be used in servoj but not anymore.

But why didn’t you use movej?
Maybe you can say, that one should use movej normally, and if the results are not satisfactory, then try servoj? Because you have more control over the “smoothness” (whatever this means) when using dense trajectories(=many coordinates)?

This would mean you replace the built-in interpolation and control-loop offered with movej by some kind of own interpolation (many coordinates) and control-loop(by setting t and lookahead)!?
To me this seems very “special”. Or is the UR built-in interpolation and control loop so unusable?


the movej() command offers you a complete trajectory planning with acceleration, de-acceleration etc.
It is designed for movements over greater distances.

If you have for example recorded/calculated a bunch of joint angles for your own trajectory, servoj() is better suited. Servoj() tries to reach the given joint angles in the given time , e.g. t=0.008. After this the movement ist stopped, if no further servoj() commands follow.

Because you are now in charge of the trajectory, a proper de-acceleration ramp has to be provided from you as well. Otherwise the movement will stop abruptly. To achieve this the distance between the joint positions could be decreased or the time for executing could be extended.