Servoj URScript (abrupt final motion)

Hi,

seemed for me like rtde_c.waitPeriod(0.006) was not working, but that is more of the question for SDU ur_rtde library developers.

I switched to your standard RTDE python interface and it works perfectly now.

Glad you found a way forward!

@ajp I did what you said but the movement is still jagged

I am using the standard code provided by UR

I want to move the robot in real time based on the mouse position, so I modified the python script to send just setp1 like this:>

x, y = pyautogui.position()
# Setpoints to move the robot to
setp1 = [-x0.5/2000, -0.74822, y0.5/2000, -0.02607, -3.14017, 0.01985]

I send that data at 500Hz from Python.

on the UR instead of MoveL → setp1 I used
servoj(get_inverse_kin(setp1]), 0,0,0.002,0.2,2000)
stopj(2)

The movement is jagged.

Can you help ? How can I make the movement smooth?

Does anybody have an ideea how to fix this?

Hi Robert,
I have tested on real robot and it seems like your Robot Program is running in forever loop.
If there are only two instructions inside this loop, acceleration(servoj) and deceleration(stopj) occur, resulting in jerky motion.

  1. insert Halt after stopj(2)
  2. modify your parameters in servoj f.e. to move to zero position example:
    servoj([0,d2r(-90),0,d2r(-90),0,d2r(1)],0,0,2,0.1,300)

I want it to run forever so as I move the mouse, the robot moves on the same path.

I used your parameters, but t=2 seems a lot… it has a huge delay between positions. I want to move the mouse and in realtime to move the robot on (x,y), so the user doesn’t sense a delay or jagged move

Any other ideas? Tried 100 changes but still can’t get a smooth move. I am using UR10e, could there be some safety features that makes the robot break?

SOLVED. For anyone who is planning to do something similar be aware that there could be a small delay on the network due to the number of threads/sync()/communication between the computer and the UR. For the e-Series, you need to send data at 500Hz, so when you use servoj you need to use t=0.002 but because of the “noise” I used t=0.00205 and it worked just fine. Another thing to take in consideration, don’t set the speed slider to 100% because it affects the smoothness of the movement. I used 60% it looked nice.