# Move RelTool for x and y Axis

**URL:** <https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300>\
**Category:** RAPID Programming\
**Created:** [December 4, 2023, 9:32am UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300 "2023-12-04T09:32:49Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gapps](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Gapps](https://tech-community.robotics.abb.com/u/Gapps)\
**Post date:** [December 4, 2023, 9:32am UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/1 "2023-12-04T09:32:49Z")

</div>

I am in the process of automating pick and place applications and have unfortunately encountered a problem that I need help with. The command “RelTool” implies that a movement should be made relative to the tool, but this still works for me in the z-direction. I would like to have a relativ movement in x and y direction.

As I have to rotate some components and want to “push” them sideways, an offset point from the end point where the component should go would be very helpful, as I could save myself a point.

Here is my code:

TASK PERS tooldata toolgrip:=[TRUE,[[0,0,382.640],[1,0,0,0]],[45.5,[162.2,-8.4,164],[1,0,0,0],0,0,0]];

TASK PERS wobjdata wobjformworktable:=[FALSE,TRUE,“”,[[-320.949,1590.29,486.978],[1,0.000165245,1.40909E-05,0.000159776]],[[0,0,0],[1,0,0,0]]];

PERS robtarget pNehmenP1:=[[300.01,50.00,42.05],[3.64828E-07,0.707107,-0.707106,3.95569E-06],[1,0,0,0],[1200.01,9E+09,9E+09,9E+09,9E+09,9E+09]];

PERS robtarget pNehmenP2:=[[300,300,42.06],[3.64828E-07,0.707107,-0.707106,3.95569E-06],[1,0,0,0],[1200.01,9E+09,9E+09,9E+09,9E+09,9E+09]];

!Turning the Object around Z! - NO Offset in x and y to the TURNED Gripper is possible.

MoveL RelTool(pAblegenAktuell,0,0,-nDistanzVorNehmen \Rz:= nWinkelAblegen),vZufahrt,z1,toGreiferAktuell\WObj:=woSchalugstischAktuell;

MoveL RelTool(pAblegenAktuell,0,0,0 \Rz:= nWinkelAblegen),vAnnaehern,fine,toGreiferAktuell\WObj:=woSchalugstischAktuell;

…

The thing is, that the offsets move in the wobj, and not to the tool, thats turning about 45°.

Please help.

Best,  
Peter

---

<div class="post-metadata">

**Author:** ![Braap](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/braap/32/2544_2.png) [@Braap](https://tech-community.robotics.abb.com/u/Braap)\
**Post date:** [December 4, 2023, 10:21am UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/2 "2023-12-04T10:21:47Z")

</div>

Hey Gapps,

did you try it with the Offset command?  
This command is defined on the position instead of the tool.

```auto
MoveL Offs(P_Test_01,inX,inY,inZ\Rx:=0\Ry:=0\Rz:=0),vmax,fine,T_Gripper\WObj:=wobj0;

```

---

<div class="post-metadata">

**Author:** ![Gapps](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Gapps](https://tech-community.robotics.abb.com/u/Gapps)\
**Post date:** [December 4, 2023, 10:29am UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/3 "2023-12-04T10:29:53Z")

</div>

Thanks for your quick reply, it says the command “offs” has too many commands and underlines the Rx/Ry and Rz.

---

<div class="post-metadata">

**Author:** ![Braap](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/braap/32/2544_2.png) [@Braap](https://tech-community.robotics.abb.com/u/Braap)\
**Post date:** [December 4, 2023, 10:36am UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/4 "2023-12-04T10:36:57Z")

</div>

Hey,  
yeah sorry rotation commands are not allowed on an OFFS command. Only working on RelTool for definition on tool.

But you could read out curr position on a Variable and rotate it via reltool

---

<div class="post-metadata">

**Author:** ![DenisFR](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@DenisFR](https://tech-community.robotics.abb.com/u/DenisFR)\
**Post date:** [December 4, 2023, 10:53am UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/5 "2023-12-04T10:53:50Z")

</div>

Hello,  
Offs and RelTool compute new robtarget.  
So you can combine them:

```auto
MoveL Offs(RelTool(pAblegenAktuell,0,0,-nDistanzVorNehmen \Rz:= 
nWinkelAblegen),nOffsX,nOffsY,nOffsZ),vZufahrt,z1,toGreiferAktuell\WObj:=woSchalugstischAktuell;

```

With nOffsX,Y and Z as num values.

---

<div class="post-metadata">

**Author:** ![mandolas](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/mandolas/32/2496_2.png) [@mandolas](https://tech-community.robotics.abb.com/u/mandolas)\
**Post date:** [December 4, 2023, 11:20am UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/6 "2023-12-04T11:20:51Z")

</div>

> [@DenisFR](#):
>
> Hello,  
> Offs and RelTool compute new robtarget.  
> So you can combine them:
> 
> ```auto
> MoveL Offs(RelTool(pAblegenAktuell,0,0,-nDistanzVorNehmen \Rz:= 
> nWinkelAblegen),nOffsX,nOffsY,nOffsZ),vZufahrt,z1,toGreiferAktuell\WObj:=woSchalugstischAktuell;
> 
> ```
> 
> With nOffsX,Y and Z as num values.

Hi…  
To improve accuracy and ensure movement is achieved I suggest it calculates position so objects and tools can be changed and you still have position control.

NO change to tools and\or objects

```auto
MoveL CalcRobT(CalcJointT(Offs(RelTool(pAblegenAktuell,0,0,-nDistanzVorNehmen\Rz:=nWinkelAblegen),nOffsX,nOffsY,nOffsZ),toGreiferAktuell\WObj:=woSchalugstischAktuell),toGreiferAktuell\WObj:=woSchalugstischAktuell),vZufahrt,z1,toGreiferAktuell\WObj:=woSchalugstischAktuell;

```

WITH changing tools and\or objects

```auto
MoveL CalcRobT(CalcJointT(Offs(RelTool(pAblegenAktuell,0,0,-nDistanzVorNehmen\Rz:=nWinkelAblegen),nOffsX,nOffsY,nOffsZ),toGreiferAktuell\WObj:=woSchalugstischAktuell),toGreiferAktuell_2\WObj:=woSchalugstischAktuell_2),vZufahrt,z1,toGreiferAktuell_2\WObj:=woSchalugstischAktuell_2;

```

---

<div class="post-metadata">

**Author:** ![Gapps](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Gapps](https://tech-community.robotics.abb.com/u/Gapps)\
**Post date:** [December 4, 2023, 11:49am UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/7 "2023-12-04T11:49:18Z")

</div>

The current problem is that I want to create geometric shapes with components, but corner pieces cannot be placed from above but have to be placed from the side under already placed components. As the gripper has to rotate for each corner, it would be great to have an offset from which the final position is reached.

Quick drawing. So the same offset for each corner would be fine, so i just need one/final position.  
[https://imgur.com/a/ZovQHnq](https://imgur.com/a/ZovQHnq)

---

<div class="post-metadata">

**Author:** ![mandolas](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/mandolas/32/2496_2.png) [@mandolas](https://tech-community.robotics.abb.com/u/mandolas)\
**Post date:** [December 4, 2023, 12:58pm UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/8 "2023-12-04T12:58:19Z")

</div>

Hi…  
[Gapps](https://forums.robotstudio.com/profile/Gapps) …

Does the solution presented by [DenisFR](https://forums.robotstudio.com/profile/DenisFR) not meet your needs? With it, it is possible to move the robot in X and Y in relation to the object by rotating the tool to the desired position.  
Looking at your drawing, the robot’s movement doesn’t seem to me to be in relation to the object’s X and Y coordinates, so the RelTool command alone already works.  
If the robot is moving in an orientation other than that of the object or the claw, it is interesting to calculate the final position of the point to make it possible to check the robot’s range before executing the trajectory, as I suggested.

---

<div class="post-metadata">

**Author:** ![Gapps](https://avatars.discourse-cdn.com/v4/letter/g/edb3f5/32.png) [@Gapps](https://tech-community.robotics.abb.com/u/Gapps)\
**Post date:** [December 6, 2023, 12:06pm UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/9 "2023-12-06T12:06:04Z")

</div>

I have found a workaround, but unfortunately I have to define one more point for each corner.  
Thanks for your support.

Example:

```auto

```

PERS robtarget Triangle\_C\_60\_1:= [[680.52, 102.9, 42.8],[3.64828E-07,0.707107,-0.707106,3.95569E-06],[1,0,0,0],[1200.01,9E+09,9E+09,9E+09,9E+09,9E+09]];

PERS robtarget Triangle\_C\_60\_1\_OFF:=[[730.52, 52.9, 42.8],[3.64828E-07,0.707107,-0.707106,3.95569E-06],[1,0,0,0],[1200.01,9E+09,9E+09,9E+09,9E+09,9E+09]];

PERS robtarget Triangle\_C\_60\_2:= [[519.48, 102.9, 42.8],[3.64828E-07,0.707107,-0.707106,3.95569E-06],[1,0,0,0],[1200.01,9E+09,9E+09,9E+09,9E+09,9E+09]];

PERS robtarget Triangle\_C\_60\_2\_OFF:=[[469.48, 52.9, 42.8],[3.64828E-07,0.707107,-0.707106,3.95569E-06],[1,0,0,0],[1200.01,9E+09,9E+09,9E+09,9E+09,9E+09]];

PERS robtarget Triangle\_C\_60\_3:= [[600, 214.7, 42.8],[3.64828E-07,0.707107,-0.707106,3.95569E-06],[1,0,0,0],[1200.01,9E+09,9E+09,9E+09,9E+09,9E+09]];

PERS robtarget Triangle\_C\_60\_3\_OFF:=[[600, 264.7, 42.8],[3.64828E-07,0.707107,-0.707106,3.95569E-06],[1,0,0,0],[1200.01,9E+09,9E+09,9E+09,9E+09,9E+09]];

---

<div class="post-metadata">

**Author:** ![mandolas](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/mandolas/32/2496_2.png) [@mandolas](https://tech-community.robotics.abb.com/u/mandolas)\
**Post date:** [December 6, 2023, 1:25pm UTC](https://tech-community.robotics.abb.com/t/move-reltool-for-x-and-y-axis/11300/10 "2023-12-06T13:25:53Z")

</div>

Hi…  
I really don’t like using too many positions in my programs.  
From what I saw, I think you could use just one position and reference the others.  
But if it works and solves the customer’s pain, congratulations.
