# Move until force applied detecting wrong values UR3

**URL:** <https://forum.universal-robots.com/t/move-until-force-applied-detecting-wrong-values-ur3/23093>\
**Category:** URScript\
**Created:** [August 4, 2022, 8:04am UTC](https://forum.universal-robots.com/t/move-until-force-applied-detecting-wrong-values-ur3/23093 "2022-08-04T08:04:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon89526109](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@anon89526109](https://forum.universal-robots.com/u/anon89526109)\
**Post date:** [August 4, 2022, 8:04am UTC](https://forum.universal-robots.com/t/move-until-force-applied-detecting-wrong-values-ur3/23093/1 "2022-08-04T08:04:52Z")

</div>

Hello,

i am trying to make the UR3 move into its tool z direction until it reaches a surface and detects a force. (50N)

In some of the arm positions it is working fine, but in others it detects very high values (like almost 130N), right at the beginning of the motion. So it doesn’t even start going towards the surface.

It feels like the internal forces are very different in different arm-positions. Anything i can do about it? I am using a=1.2, v=0.01 atm.

---

<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:** [August 4, 2022, 2:27pm UTC](https://forum.universal-robots.com/t/move-until-force-applied-detecting-wrong-values-ur3/23093/2 "2022-08-04T14:27:38Z")

</div>

When using the force() command, you need to tare the force torque sensor before taking a measurement, otherwise you can see exactly what you’re experiencing right now. To do this, insert a Script node before you use force() and type “zero\_ftsensor()”. This will zero out the sensor so it’s ready for use. The manual also recommends adding a small wait (0.02 seconds) to ensure that it has zeroed before using it.

---

<div class="post-metadata">

**Author:** ![terryc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/terryc/32/3006_2.png) [@terryc](https://forum.universal-robots.com/u/terryc)\
**Post date:** [August 4, 2022, 4:54pm UTC](https://forum.universal-robots.com/t/move-until-force-applied-detecting-wrong-values-ur3/23093/3 "2022-08-04T16:54:36Z")

</div>

This is one of our common design patterns:

```python
wait is_steady()

sleep(0.05) # Optional

zero_ftsensor()

# Continously checking if
if force() < XXX:
    movel(pose_trans(get_actual_tcp_pose(), p[0, 0, -0.5, 0, 0, 0]), a=XXX, v=XXX) # Seek downwards
else:
    stopl(XXX) # Safely decelerate
    movel(pose_trans(get_actual_tcp_pose(), p[0, 0, 0.002, 0, 0, 0]), a=XXX, v=XXX) # come up a little bit
    

```

---

<div class="post-metadata">

**Author:** ![anon89526109](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@anon89526109](https://forum.universal-robots.com/u/anon89526109)\
**Post date:** [August 13, 2022, 11:56am UTC](https://forum.universal-robots.com/t/move-until-force-applied-detecting-wrong-values-ur3/23093/6 "2022-08-13T11:56:10Z")

</div>

Thank you very much. It worked. At first i implemented it to early into my code, but now it’s working fine.

---

<div class="post-metadata">

**Author:** ![anon89526109](https://avatars.discourse-cdn.com/v4/letter/a/ad7895/32.png) [@anon89526109](https://forum.universal-robots.com/u/anon89526109)\
**Post date:** [August 13, 2022, 11:56am UTC](https://forum.universal-robots.com/t/move-until-force-applied-detecting-wrong-values-ur3/23093/7 "2022-08-13T11:56:32Z")

</div>

Thank you very much. It worked.
