# How to apply a forth order polynomial to limit jerk

**URL:** <https://forum.universal-robots.com/t/how-to-apply-a-forth-order-polynomial-to-limit-jerk/3708>\
**Category:** URScript\
**Created:** [February 22, 2019, 4:53am UTC](https://forum.universal-robots.com/t/how-to-apply-a-forth-order-polynomial-to-limit-jerk/3708 "2019-02-22T04:53:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![christian.mackin](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@christian.mackin](https://forum.universal-robots.com/u/christian.mackin)\
**Post date:** [February 22, 2019, 4:53am UTC](https://forum.universal-robots.com/t/how-to-apply-a-forth-order-polynomial-to-limit-jerk/3708/1 "2019-02-22T04:53:48Z")

</div>

I am trying to reproduce the following experiment with a UR-10: [https://www.youtube.com/watch?v=9Z9Zws9K5kc](https://www.youtube.com/watch?v=9Z9Zws9K5kc)

The physics of Jerk: [https://en.wikipedia.org/wiki/Jerk\_(physics)](https://en.wikipedia.org/wiki/Jerk_(physics))

Just as acceleration is the rate of change (derivative) of velocity, jerk is the rate of change of acceleration. In other words, jerk is the rate at which acceleration is increasing or decreasing. Jerk is generally undesirable because it creates abrupt, jerky motion.

So the question is: How can I control jerk–the rate of change of acceleration when accelerating from Point-A and decelerating to a stop at Point-B? The result will limit settling time at Point-B, increase precision when arriving at Point-B, and with a smooth motion profile it will decrease wear on the robot from vibration.

The following paper describes [How to reduce jerk in linear motion systems](https://www.linearmotiontips.com/how-to-reduce-jerk-in-linear-motion-systems/amp/)

How can I develop a function that can be used in a similar way to adding an acceleration parameter to a move command?

Teknic servo motors have an in-depth discussion on their solution for their motors as can be seen in their video: [Teknic Jerk Solution](https://www.youtube.com/watch?v=WOyP51-PiTs&t=43s)

I hope to have something similar to Teknic for a UR robot.

---

<div class="post-metadata">

**Author:** ![kirill.sytnik](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@kirill.sytnik](https://forum.universal-robots.com/u/kirill.sytnik)\
**Post date:** [March 21, 2019, 10:00pm UTC](https://forum.universal-robots.com/t/how-to-apply-a-forth-order-polynomial-to-limit-jerk/3708/2 "2019-03-21T22:00:31Z")

</div>

Nice question! It looks like we can only do this with dynamically modifiable movel() parameters

---

<div class="post-metadata">

**Author:** ![christian.mackin](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@christian.mackin](https://forum.universal-robots.com/u/christian.mackin)\
**Post date:** [July 12, 2024, 5:01am UTC](https://forum.universal-robots.com/t/how-to-apply-a-forth-order-polynomial-to-limit-jerk/3708/3 "2024-07-12T05:01:13Z")

</div>

I still have the same question 5 years later!

I hope someone from UR will see this and chime in. I have written the attached code  
[jerk-1.1.script](https://forum.universal-robots.com/uploads/short-url/5RqAtLZGNxCFFY0u3XqmQQ2b9na.script) (9.9 KB)  
as a .script in the controller using ChatGPT. The beginning section is normal motion and works fine, but as soon as the servo motion happens, the robot starts whining and jerking and then ends in a protective stop. Servoj seems to have so much potential, but for my life, I can’t get it to work.

---

<div class="post-metadata">

**Author:** ![zaka](https://avatars.discourse-cdn.com/v4/letter/z/50afbb/32.png) [@zaka](https://forum.universal-robots.com/u/zaka)\
**Post date:** [July 13, 2024, 2:28am UTC](https://forum.universal-robots.com/t/how-to-apply-a-forth-order-polynomial-to-limit-jerk/3708/4 "2024-07-13T02:28:40Z")

</div>

Hi @christian.mackin ,

I haven’t looked at your code, but I have attached a RTDE example of using servoj and linked a forum post that may be helpful to you.

[Servoj\_RTDE\_UR5-main.zip](https://forum.universal-robots.com/uploads/short-url/6wJ7Uw3NN3a14rmSmK935bRMJUS.zip) (22.1 KB)

> [@Servoj URScript (abrupt final motion)](https://forum.universal-robots.com/t/servoj-urscript-abrupt-final-motion/8644):
>
> Hi everyone, I am using a servoj command to operate the robot, to move from point A to point B. I am not 100% sure I am using the command correctly, because at the end of the motion, robot doesn’t slow down noticeable and it stops abruptly as can be seen on the video ([UR5e Servoj issue - YouTube](https://youtu.be/MAO_vtxRiAU)) I have done a trajectory planning with an initial and final velocity/ acceleration to be zero (my conditions). Even though the graphs I received show me that the velocity and acceleration behave in t…
