# How can I update speedl() parameters

**URL:** <https://forum.universal-robots.com/t/how-can-i-update-speedl-parameters/17639>\
**Category:** URScript\
**Created:** [November 16, 2021, 5:09pm UTC](https://forum.universal-robots.com/t/how-can-i-update-speedl-parameters/17639 "2021-11-16T17:09:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon57582480](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@anon57582480](https://forum.universal-robots.com/u/anon57582480)\
**Post date:** [November 16, 2021, 5:09pm UTC](https://forum.universal-robots.com/t/how-can-i-update-speedl-parameters/17639/1 "2021-11-16T17:09:14Z")

</div>

Hi there.  
At the moment, I have an application that sends the speed (in the form of a six-dimensional vector) via RTDE several times per second and a robot receives the signal and uses the data as a parameter for speedl. I need to get smooth movement of the robot without stopping.  
However, the speedl command is executed completely with the initial parameters,  
ignoring new ones. How can I start the new speedl before the old one completes or update the parameters in the old speedl without having to stop the robot?

---

<div class="post-metadata">

**Author:** ![robert.kristof](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@robert.kristof](https://forum.universal-robots.com/u/robert.kristof)\
**Post date:** [May 3, 2023, 7:37pm UTC](https://forum.universal-robots.com/t/how-can-i-update-speedl-parameters/17639/2 "2023-05-03T19:37:46Z")

</div>

Hey there,

How did you solve this problem? I have the same problem getting a smooth move over RTDE. After each moveJ it hits the breake.

---

<div class="post-metadata">

**Author:** ![robin\_gdwl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/robin_gdwl/32/2676_2.png) [@robin\_gdwl](https://forum.universal-robots.com/u/robin_gdwl)\
**Post date:** [May 8, 2023, 7:44pm UTC](https://forum.universal-robots.com/t/how-can-i-update-speedl-parameters/17639/3 "2023-05-08T19:44:49Z")

</div>

hello @robert.kristof  
You can send continuos updates to the robot with rtde by running a program that checks the registers and then calling the `servoJ()` command.  
Like this:

```auto
def realtime_control():
    
    
    while (True):
        
        new_pose = p[read_input_float_register(0),
                    read_input_float_register(1),
                    read_input_float_register(2),
                    read_input_float_register(3),
                    read_input_float_register(4),
                    read_input_float_register(5)]
           
        servoj(get_inverse_kin(new_pose), t=0.2, lookahead_time= 0.1, gain=350)
            
        sync()
    end
end

```

You will have to set the registers via the RTDE interface or alternatively via MODBUS.  
The robot will continually read the registers and update its position smoothly.  
See this project for reference UR\_Facetracking [github](https://github.com/robin-gdwl/UR_Facetracking) [video](https://www.youtube.com/watch?v=HHb-5dZoPFQ)

---

<div class="post-metadata">

**Author:** ![robert.kristof](https://avatars.discourse-cdn.com/v4/letter/r/8797f3/32.png) [@robert.kristof](https://forum.universal-robots.com/u/robert.kristof)\
**Post date:** [May 21, 2023, 12:14pm UTC](https://forum.universal-robots.com/t/how-can-i-update-speedl-parameters/17639/4 "2023-05-21T12:14:47Z")

</div>

Hello @robin_gdwl

am using the standard code provided by UR  
([GitHub - UniversalRobots/RTDE\_Python\_Client\_Library: RTDE client library and examples](https://github.com/UniversalRobots/RTDE_Python_Client_Library))

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()  
> setp1 = [-x_0.5/2000, -0.74822, y_0.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. I tried adjusting the parameters but still looks awful.

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