# How to track a pre computed trajectory using speedj command?

**URL:** <https://forum.universal-robots.com/t/how-to-track-a-pre-computed-trajectory-using-speedj-command/13838>\
**Category:** URScript\
**Created:** [April 22, 2021, 6:08am UTC](https://forum.universal-robots.com/t/how-to-track-a-pre-computed-trajectory-using-speedj-command/13838 "2021-04-22T06:08:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon66903575](https://avatars.discourse-cdn.com/v4/letter/a/b9bd4f/32.png) [@anon66903575](https://forum.universal-robots.com/u/anon66903575)\
**Post date:** [April 22, 2021, 6:08am UTC](https://forum.universal-robots.com/t/how-to-track-a-pre-computed-trajectory-using-speedj-command/13838/1 "2021-04-22T06:08:23Z")

</div>

Hi All,

I am curious to know that how can we track a pre-computed trajectory using a “speedj” URScript command. Can anyone please help me with this?

And what is the advantage of “speedj” over “movej” to if we want to track some trajectory?

Thanks

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [April 22, 2021, 7:40am UTC](https://forum.universal-robots.com/t/how-to-track-a-pre-computed-trajectory-using-speedj-command/13838/2 "2021-04-22T07:40:24Z")

</div>

Hi @anon66903575

_movej_ is targeted movements from actual set of joint angles to a target set of joint angles , if there is no need for the robot to stop at the target you can at a blend. In this case the function will return when the robot enters the sphere around the target pose(forward kinematic of the set of joint angles).  
_speedj_ can be used to control the angular speed of each joint. The function will return either when the target speed is reached or after the specified time.  
If you are targeting to follow your own trajectory you can also take a look at _speedl_ that is similar to _speedj_ but acting in the cartesian space. Or _servoj_ that is built for chasing a target set of joint angles, but have the option to return after a shorter amount of time. So you have the option to update the target.

No matter the script function you are using for following the trajectory, Your task is to segment the trajectory in to small piece and parse it to the script function. For the e-series the minimal timestep is 2ms and the CB series is 8ms. So that is the smallest time slices you can create.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/system/32/1_2.png) [@system](https://forum.universal-robots.com/u/system)\
**Post date:** [April 24, 2021, 7:40am UTC](https://forum.universal-robots.com/t/how-to-track-a-pre-computed-trajectory-using-speedj-command/13838/3 "2021-04-24T07:40:55Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
