# Position with tool coordinate system as reference

**URL:** <https://forum.universal-robots.com/t/position-with-tool-coordinate-system-as-reference/13551>\
**Category:** URScript\
**Created:** [April 12, 2021, 1:44pm UTC](https://forum.universal-robots.com/t/position-with-tool-coordinate-system-as-reference/13551 "2021-04-12T13:44:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon57799496](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anon57799496](https://forum.universal-robots.com/u/anon57799496)\
**Post date:** [April 12, 2021, 1:44pm UTC](https://forum.universal-robots.com/t/position-with-tool-coordinate-system-as-reference/13551/1 "2021-04-12T13:44:43Z")

</div>

Hello,

I created a program that allows the UR3 robot to make a circular path (using the equation of a circle).  
It seems that the tool mark orientation stay the same along the trajectory.

However, I want the Y axis of the tool to be perpendicular to the tangent at any point of the path :

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/3/3dd756eb8dceabd61ac260d5e7645ee0f55fb220.png)

I had the idea to add a θ angle in RZ tool coordinate system (θ depends on each points of the path )

Is there a solution for adding any orientation (RX,RY,RZ) using the tool space coordinate system as reference.

For example, 0.4 rad in RZ tool space like : p[0,0,0,0,0,0.4]  
(only tool space and not base one)

Thank you

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [April 13, 2021, 7:25am UTC](https://forum.universal-robots.com/t/position-with-tool-coordinate-system-as-reference/13551/2 "2021-04-13T07:25:11Z")

</div>

Hi @anon57799496

The script function `pose_trans(p_from, p_from_to)` will assist you applying the rotation in the tool space. You might also take a look at the `movec(pose_via, pose_to, a=1.2, v=0.25, r=0, mode=0)` function. If you set `mode=1` will keep orientation constant relative to the tangent of the circular arc (starting from current pose)

Ebbe

---

<div class="post-metadata">

**Author:** ![anon57799496](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anon57799496](https://forum.universal-robots.com/u/anon57799496)\
**Post date:** [April 13, 2021, 7:53am UTC](https://forum.universal-robots.com/t/position-with-tool-coordinate-system-as-reference/13551/3 "2021-04-13T07:53:06Z")

</div>

Thank you for the reply !

Using movec funtion can be an idea but It is not as precise as I want the circle trajectory to be.

**I want to be able to have a postion in X Y and Z according the base system and RX RY RZ according to tool system (and not base system here)**

**If I try this function,will I get this result for example ? (I’m a bit confused about this function so could you tell me if my reasoning is correct pls ?)**

**pose\_trans(p[x,y,z,a,b,c], p[0,0,0,rx,ry,rz]) = p[x,y,z,d,e,f] (position according to base system)**

d = angle base result by adding a and rx  
e = angle base result by adding b and ry  
f = angle base result by adding c and rz

(p[x,y,z,a,b,c] : It’s a position according to the base coordinate system)

(p[0,0,0,rx,ry,rz] : Position acoording to the tool coordinate system)

(p[x,y,z,d,e,f] : final position according to the base coordinate system)

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [April 13, 2021, 7:40pm UTC](https://forum.universal-robots.com/t/position-with-tool-coordinate-system-as-reference/13551/4 "2021-04-13T19:40:47Z")

</div>

Yes, that is correct!

> [@anon57799496](#):
>
> but It is not as precise as I want the circle trajectory to be.

Can you elaborate on what you mean by that?

---

<div class="post-metadata">

**Author:** ![anon57799496](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anon57799496](https://forum.universal-robots.com/u/anon57799496)\
**Post date:** [April 16, 2021, 8:06am UTC](https://forum.universal-robots.com/t/position-with-tool-coordinate-system-as-reference/13551/5 "2021-04-16T08:06:00Z")

</div>

In fact, the trajectory I want to realise is not a perfect circle.  
Plus I want the robot to make a circle with a constant orientation of rotation (same alpha position at any points of the path) :

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

But the movec function cannot do that… The orientation of the robot is automatically chosen  
We have to make 2 arcs to use this function but it is like if the mid point of each arc is not controlled for angle (Rx,RY,RZ), only xyz position.

It would be interesting to use this function by having the possibility to change orientation coordinates for each arcs.
