# 优傲机器人随意停止之后程序怎么设置安全的返回原位置

**URL:** <https://forum.universal-robots.com/t/topic/20982>\
**Category:** 其他\
**Created:** [May 1, 2022, 8:03am UTC](https://forum.universal-robots.com/t/topic/20982 "2022-05-01T08:03:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon49685283](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@anon49685283](https://forum.universal-robots.com/u/anon49685283)\
**Post date:** [May 1, 2022, 8:03am UTC](https://forum.universal-robots.com/t/topic/20982/1 "2022-05-01T08:03:00Z")

</div>

机器人抓工件时候由于外部因素突然停止，想让它安全的回到原位，怎么编程序或者怎么设置

---

<div class="post-metadata">

**Author:** ![sya](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/sya/32/216_2.png) [@sya](https://forum.universal-robots.com/u/sya)\
**Post date:** [May 2, 2022, 4:24pm UTC](https://forum.universal-robots.com/t/topic/20982/2 "2022-05-02T16:24:49Z")

</div>

Hi,

大略作法如下,  
你需要在before start程序段补写个判断式透过get\_actual\_tcp\_pose()知道机器人不正常停止后目前停留在什么位置, 比如目前机器人的位置可能过低，在运行程序进入移动到原本的第一个位置前，先让机器人原地移动往base Z+方向提高后, 再进入程序开始回到你的第一个位置,请洽询当地经销商让他们给进行Advanced training训练, 里头会有相关的练习题

---

<div class="post-metadata">

**Author:** ![anon49685283](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@anon49685283](https://forum.universal-robots.com/u/anon49685283)\
**Post date:** [May 3, 2022, 12:19am UTC](https://forum.universal-robots.com/t/topic/20982/3 "2022-05-03T00:19:31Z")

</div>

就是ur 机器人在自动运行程序的情况下 突然有人停止机器人之后 没有任何人操作的情况下 怎么做一个程序让它安全的回到原位 按照之前的轨迹回到原位 需要有中断程序还是重新编写程序

---

<div class="post-metadata">

**Author:** ![Voya](https://avatars.discourse-cdn.com/v4/letter/v/cc9497/32.png) [@Voya](https://forum.universal-robots.com/u/Voya)\
**Post date:** [January 6, 2025, 6:30am UTC](https://forum.universal-robots.com/t/topic/20982/4 "2025-01-06T06:30:37Z")

</div>

A commonly used method is:

1. Before starting, assign the value of get-actual\_tcp\_pose to the variable Var\_1, and then use the move command to walk to the var\_1 variable point, in order to skip the manual return to the origin at startup.

2. Decompose var\_1 into six variables: var\_1 [0], var\_1 [1]… var\_1 [5]. For example, the variable var-x=var\_1 [0] corresponds to x, y，z，rx，ry，rz。

3. Add if judgment after the first step and plan an avoidance path back to the origin, for example: if var-x\>0.5, move to avoid point 1 at the origin.

A commonly used method is:

1. Before starting, assign the value of get-actual\_tcp\_pose to the variable Var\_1, and then use the move command to walk to the var\_1 variable point, in order to skip the manual return to the origin at startup.

2. Decompose var\_1 into six variables: var\_1 [0], var\_1 [1]… var\_1 [5]. For example, the variable var-x=var\_1 [0] corresponds to x, y，z，rx，ry，rz。

3. Add if judgment after the first step and plan an avoidance path back to the origin, for example: if var-x\>0.5, move to avoid point 1 at the origin.
