# Smooth TCP motion and remove jerkiness

**URL:** <https://forum.universal-robots.com/t/smooth-tcp-motion-and-remove-jerkiness/41917>\
**Category:** URScript\
**Created:** [December 4, 2025, 4:24pm UTC](https://forum.universal-robots.com/t/smooth-tcp-motion-and-remove-jerkiness/41917 "2025-12-04T16:24:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tskhan](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@tskhan](https://forum.universal-robots.com/u/tskhan)\
**Post date:** [December 4, 2025, 4:24pm UTC](https://forum.universal-robots.com/t/smooth-tcp-motion-and-remove-jerkiness/41917/1 "2025-12-04T16:24:34Z")

</div>

I’m programming UR3e to perform stirring/rinsing motions. For path, I have a script to generate movel waypoints. Inside script, I have a loop where I increment circular radius, sway distance, tilt angle, and Z amplitude to generate desired trajectory using movel waypoints. I have no issues with the trajectory, however the robot TCP motion is very jerky. It feels like a stop n go kind of motion. At high acceleration, I can feel the vibrations on the base plate.

What can I do to smoothen this motion? I’m trying to mimic the fluidity of human hands performing stirring/rinsing motions. I have tried reducing acceleration, reduce blend radius in movel, and reduce angle increment but it hasn’t helped. I’d appreciate any advice if there’s a different script directory command that can help me achieve this or any other method. Thanks!

Here’s the script:

def function():

center = get\_actual\_tcp\_pose() # start pose  
radius = 0.01 # circle radius in meters  
v\_circ = 0.15 \* 2 # speed (m/s) during circles  
a\_circ = 1.2 \* 2 # accel for circle motions

z\_amp = 0.01 \* 7 # vertical oscillation amplitude (m)  
tilt\_amp = 0.18 # radians (~10.3°) max tilt (X/Y axes)  
sway\_amp = 0.012 # side-to-side sway amplitude (m)  
tilt\_z\_amp = 3.14159/2 # radians (±90°) tilt around Z  
duration\_s = 30 # time duration for process

t\_start = time().sec  
while ((time().sec - t\_start) \< duration\_s):

```auto
angle = 0
while (angle < 6.28): # loop through 0 → 2π

  # vertical up/down oscillation
  z_offset = z_amp * sin(angle)
  
  # side-to-side sway added to X path
  dx = radius*cos(angle) + sway_amp*sin(2*angle)
  dy = radius*sin(angle)

  # small tilt oscillations
  tilt_x = tilt_amp * sin(angle) # around X-axis
  tilt_y = tilt_amp * cos(angle) # around Y-axis
  tilt_z = tilt_z_amp * sin(angle) # around Z-axis, swings ±90°

  # build pose offset
  offset = p[dx, dy, z_offset, tilt_x, tilt_y, tilt_z]
  target = pose_trans(center, offset)

  movel(target, a=a_circ, v=v_circ, r=0.001)
  angle = angle + 0.3

  # Stop if total time exceeded mid-loop
  if ((time().sec - t_start) >= duration_s):
    break
  end
end

```

end

stopl(2.0)

end

---

<div class="post-metadata">

**Author:** ![thomas.denepoux.pro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/thomas.denepoux.pro/32/7365_2.png) [@thomas.denepoux.pro](https://forum.universal-robots.com/u/thomas.denepoux.pro)\
**Post date:** [December 4, 2025, 4:45pm UTC](https://forum.universal-robots.com/t/smooth-tcp-motion-and-remove-jerkiness/41917/2 "2025-12-04T16:45:27Z")

</div>

Hello,

Which version of Polyscope are you using?  
In the latest versions, the OptiMove function allows (in certain cases and depending on the parameters entered) for smoother movements and reduced jerkiness.

> **[script\_directory\_Poly5.pdf](https://www.universal-robots.com/manuals/EN/PDF/SW5_24/scriptmanualG5/script_directory_Poly5.pdf)**
>
> 1522.86 KB

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/9/989ce00f46922c7cc53f70e981b1e8e3fd4fdcd0.png)

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/9/91ccff1e593e425f33457a7b232556cc5f0b3448.png)
