# How to lift random weight at certain distance?

**URL:** <https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229>\
**Category:** General Application Help: How do I?\
**Created:** [September 22, 2025, 3:40pm UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229 "2025-09-22T15:40:40Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivory](https://avatars.discourse-cdn.com/v4/letter/i/b487fb/32.png) [@Ivory](https://forum.universal-robots.com/u/Ivory)\
**Post date:** [September 22, 2025, 3:40pm UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/1 "2025-09-22T15:40:41Z")

</div>

I have a UR10e that I want to program to pick up a bin filled with washed toys of all shapes and sizes. The most I think I’ll ever toss in are up to 15lbs so the robot doesn’t enter a stop if it’s like 30 lbs. The tricky part is guessing how much the bin weighs with toys that retain water such as plushies. The weight can vary from 2-15lbs after a wash so I’m not sure if I should be using a Force template or Direction feature. Can I get some ideas please? I am currently using the simulation but I don’t think it’s giving accurate results. When Polyscope indicates Lift\_Up is active during runtime, it just goes to Above\_Bin\_1 then back to First\_Pose. The force is in “Simple” mode.

 ![Lift Bin Force Node](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/5/59608dfcc78887b969a434e25626a26d72218f04.jpeg)

---

<div class="post-metadata">

**Author:** ![efn](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@efn](https://forum.universal-robots.com/u/efn)\
**Post date:** [September 23, 2025, 5:02am UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/2 "2025-09-23T05:02:29Z")

</div>

What is your idea behind using either Force or Direction? To accomodate for the varying payload?

I doubt you’ll get good results with any moving around after picking up the bin, if you do not tell the robot what the bin weighs. It will also introduce unwanted wear on the joints.  
It is possible to make some code that makes the robot (e-series and newer) weigh the picked up load, but I have only had success doing so with a payload extended directly downwards in the Z direction of the robot tool flange and the robot flange being horizontal.

---

<div class="post-metadata">

**Author:** ![Ivory](https://avatars.discourse-cdn.com/v4/letter/i/b487fb/32.png) [@Ivory](https://forum.universal-robots.com/u/Ivory)\
**Post date:** [September 23, 2025, 2:54pm UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/3 "2025-09-23T14:54:15Z")

</div>

Yes, this is to accommodate for the varying payloads. I did some digging around the forum for any other ideas and you came up with this code (link to topic: [Dynamic Payload setting in UR E series to pick the dynamic payload - #2 by sya](https://forum.universal-robots.com/t/dynamic-payload-setting-in-ur-e-series-to-pick-the-dynamic-payload/12130/2) )

```auto
Wait 0.2
zero_ftsensor()
Pick_Part
Wait 0.2
Var_1 = force()
Var_2 = Var_1/10 //Newton to kg
set_payload_mass(Var_2)

```

So I put that in my code to look something like this:

```auto
Before Start
Weight_Shift:= False
Wait 2.0
...
Robot Program
Weight_Shift:= False
MoveL
 First_Pose
 Above_Bin_1
 Trap_Handle
 Gripper Close
 Wait: 0.3
 Weight_Shift:= True
 Wait: 0.3
 Weigh_Bin
 Wait: 3.0
 Lift_Up
 Wait: 1.0
 Weight_Shift:= False
 ...

Thread_1
If Weight_Shift =? True
 zero_ftsensor()
 var_1:= force()
 var_2:= var_1/10
 set_payload_mass(var_2)
 sync()

 

```

I ran this in the simulator and it seems to work fine but there are no real life external forces acting on it so I’m a bit skeptical if I uploaded this to my Cobot. The idea is that the thread is monitoring the code and when Weight\_Shift goes to True, it will change the payload constantly until the variable is set to False again. Is this a bad approach? I don’t have much experience coding such large robots..

---

<div class="post-metadata">

**Author:** ![efn](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@efn](https://forum.universal-robots.com/u/efn)\
**Post date:** [September 24, 2025, 5:11am UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/4 "2025-09-24T05:11:36Z")

</div>

Yes, that won’t work. The robot must be completely still when you execute the code once. The zeroing must be done before picking up the part - not after.

The Wait 0.2 is to make sure the robot is not vibrating/shaking after a movement.  
Then zero the sensor (before touching the part to pick).  
Then move down to the part and pick it up (lift it above the table so that the part doesn’t touch anything).  
Then wait again to have as few vibrations as possible.  
Now you can do the reading (ideally you can use get\_tcp\_force() instead of Force(). Then extract the third variable from the array so you only get the force exerted in Z ( var\_2 = var\_1[2] )).

---

<div class="post-metadata">

**Author:** ![cp11](https://avatars.discourse-cdn.com/v4/letter/c/3ab097/32.png) [@cp11](https://forum.universal-robots.com/u/cp11)\
**Post date:** [September 26, 2025, 1:30pm UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/5 "2025-09-26T13:30:25Z")

</div>

Hi,

We have done this to multiple customer and it works fine even when the robot is moving, you just need to move slowly the first few centimeter (we are moving 5mm/s with 200mm/s² for about 10mm) and the payload will increase during the process.

Our code :

In a thread :

If calcul = True:

global Force=get\_tcp\_force()  
global mass=(-Force[1]/9.82) (here I put “-” because our robot with in a certain position, maybe it will ne be the case with yours  
load\_data=get\_target\_payload()

global WeightGlobal=load\_data+mass

set\_target\_payload(WeightGlobal,[0,0.060,0.100]) (here you put your cog tcp)

sleep(0.1)

end  
sync()

You need to keep the variable “calcul” true during all the first movement

---

<div class="post-metadata">

**Author:** ![Ivory](https://avatars.discourse-cdn.com/v4/letter/i/b487fb/32.png) [@Ivory](https://forum.universal-robots.com/u/Ivory)\
**Post date:** [September 26, 2025, 3:46pm UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/6 "2025-09-26T15:46:02Z")

</div>

Thank you for sharing your code! Your CoG TCP is based on the gripper itself or gripper + object?

I’ve heard issues of objects containing water. They can slosh around and throw the CoG around. I have an image here from hyperphysics that I would use to calculate this CoG. But…it sounds like I may be out of luck if my CoG is moving around as the water drains from the toys.

 ![CoG calculation](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/a/ac6041eea231271eaedbc23426914bb68b74e0b6.jpeg)

---

<div class="post-metadata">

**Author:** ![efn](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@efn](https://forum.universal-robots.com/u/efn)\
**Post date:** [September 29, 2025, 5:09am UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/7 "2025-09-29T05:09:45Z")

</div>

Can you set up a function related to the time it takes to drain the water? It would be relatively linear I’d imagine. But that will require you to know the dry weight of the box as well as weighing the wet bin when lifting it.

You’re right about sloshing water - that’s always an issue if it has a considerable free-moving weight.

---

<div class="post-metadata">

**Author:** ![mvosseler](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mvosseler](https://forum.universal-robots.com/u/mvosseler)\
**Post date:** [October 6, 2025, 11:23am UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/8 "2025-10-06T11:23:49Z")

</div>

What is the size of object? What is the speed you want to move at?

As far as I know the payload does shift the band width of acceptable motor currents (resulting in force) for the safety functions. Have you tried setting the payload at 15 lb and just running it at such?

You have a lot of wait-calls in your code, so I assume it is not a time critical. With that you should be finde with slower concistent moving.

Ultimately the best with such complex objects is just to try it out.

---

<div class="post-metadata">

**Author:** ![efn](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@efn](https://forum.universal-robots.com/u/efn)\
**Post date:** [October 6, 2025, 12:10pm UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/9 "2025-10-06T12:10:18Z")

</div>

Setting the payload higher than the actual weight will also result in protective stops. The controller calculates the safety limits both positively and negatively so to speak.

Also, it’s not recommended to run the robot with a wrong payload since it can introduce unwanted wear on the joints.

---

<div class="post-metadata">

**Author:** ![mvosseler](https://avatars.discourse-cdn.com/v4/letter/m/77aa72/32.png) [@mvosseler](https://forum.universal-robots.com/u/mvosseler)\
**Post date:** [October 6, 2025, 12:41pm UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/10 "2025-10-06T12:41:24Z")

</div>

I guess you are right, if you would want to accelerate a lower mass too fast it should also stop.

The unwanted wear on the joints should only happen if the used acceleration is greater with higher payloads. Or what am I missing here?

---

<div class="post-metadata">

**Author:** ![Ivory](https://avatars.discourse-cdn.com/v4/letter/i/b487fb/32.png) [@Ivory](https://forum.universal-robots.com/u/Ivory)\
**Post date:** [October 6, 2025, 5:13pm UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/11 "2025-10-06T17:13:28Z")

</div>

I asked my team for ideas and someone suggested I could measure the bin with washed parts using a fish scale myself. I’d set up a slow motion camera to capture the highest value on the scale after I lift it up quicker than intended.

Since I don’t have the equipment yet, assume the highest value on the scale was 6.8kg & the lowest was 4.8kg when the bin is still and water is drained.

**Method 1:**

 ![Method 1](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/7/76661323736cab91d4780bd199156495a1975be1.jpeg)  
I would set a payload “MaximumWeight” [6.8kg+1.3kg(gripper) = 8.1kg] right after the grippers engage. The Cobot will then lift up, stop, run the thread provided by cp11 for a few seconds until it reaches the “Lift\_Up” pose.

**Method 2:**

 ![Method 2](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/0/08fecac64dece0d2352665e951a0afeb9933b874.jpeg)  
This other method would have another payload “MinimumWeight” [4.8kg + 1.3kg(gripper) = 6.1kg] set after the bin is still in the air. It will not include the thread.

I think either way the Cobot will suffer some wear on the joints & possibly enter a protective stop. It would be best to set up a standard of what parts can go in the bin to keep the payloads somewhat true. Any recommendations and feedback are appreciated.

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [October 6, 2025, 5:48pm UTC](https://forum.universal-robots.com/t/how-to-lift-random-weight-at-certain-distance/41229/12 "2025-10-06T17:48:04Z")

</div>

Where is it picking the bin from, and does the water drain at all? My thought would be to introduce another piece of hardware. Can the bin be placed on a simple scale that can provide analog data to the robot so it KNOWS how much it weighs before picking it up? If it’s pulling the bin straight from the water, could the bin first be lifted out by some kind of linear actuator and allowed to drain before the robot comes and picks it up?
