Planes and position variables 2

The article describes a way to setup different planes and how to use them for move from one plane to another and using pose_trans function to move between the planes.

This article uses variables and lists (also sometimes reffered to as “arrays”) to create waypoints and how variable waypoints can be manipulated with an offset defined in the variables.

The Universal-Robots is a 6 axis robot which means it has 6 turning joints. Therefore a position can be described with a set of data in a list – either as joint angles – or as a pose with cartisian cordinates. Such list can be –

[j1, j2, j3, j4, j5, j6] when representing the robot position with joint angles.

p[X, Y, Z, Rx, Ry, Rz] when representing the robot position with cartisian cordinates also called a “Pose”.

Notice the “p” in front of the second list indicationg that it is a Pose representation.

This examples will use the Pose representation.

The Universal-Robots is by default set to use the Base as plane reference, but it is also possible to setup user defined planes.

This is done in the Installation – Features menu. Notice the two planes Plane_1 and Plane_2 setup here is exactly the same as in the previous example “Working with planes and variables 2” – so if they already has been set they can be used again and therefore programming can start already by going to the program example below.

In this example 2 different planes will be created with a program example for how to move between them.

A plane is setup by setting 3 points where the first point is the plane normal (the origin of the user plane). The second point is the Y axis direction of the new plane and therefore the second point is set in the desired Y direction from the plane normal. The third point is the X axis direction of the new plane and therefore the third point is set in the desired X direction from the plane normal.

The X and Y direction for this plane is using the tool head as reference – and in the Installation – TCP configuration the orientation of the X and Y from the tool head can be seen.

When using pose_trans or pose_add in programs the difference in thiese two commands is the reference where “pose_trans” command is using the tool space coordinate system as reference. Whereas “pose_add” command uses the base as coordinate system as reference.

The X – Y orientation of the tool space can be seen on the image inside the Installation “TCP configuration” tab as shown below.

Notice the Y direction is opposite direction of the tool head I/O connector – and notice the X direction as seen on the above illustration.

The tool I/O connector is used to observe the orientation of the tool head when setting the feature points of the plane.

Notice on below photos that the I/O connector is pointing towards the robot – because the Y axis is opposite as the I/O connector – and is this case it is desired that the Y axis is pointing away from the robot.

(The X – Y orientation of the base space can be expressed as the positive Y direction is the direction where the robot cable is coming out of the base. )

Move the robot to the desired position of the origin of the first user plane (Plane 1). Here in this example a black box is used as object to move around. The lower left corner near the robot is used as the origin for the user plane. Pay attention to the orientation of the tool head rotation – in this case the blue light on the Robotiq gripper is exactly opposite the I/O connector and therefore the blue light in this case indicate the Y axis – and the Y axis for this feature plane 1 – point 1 is carefully aligned with the direction of the side edge of the black box (the object).

When the robot has been moved into position set this as the Plane 1 – Point 1. Make sure the “Show axes” – “Joggable” and “Variable” is ticked because this will enable the see the axis color in the Move screen and enable the possible to jog with the plane as reference in the Move screen and it will enable the the possibility to use the plane as a variable in the program.

Move the robot in the desired Y direction of this user plane – in this case that is upwards exactly along the side edge of the black box. It is not important how long the robot is moved along the Y axis, but as long as possible gives the best result because then the angle to the X axis becomes more accurate.

In this case the robot is moved to the corner of the black box.

When the robot has been moved into position set this as the Plane 1 – Point 2. Make sure the “Show axes” – “Joggable” and “Variable” is ticked because this will enable the see the axis color in the Move screen and enable the possible to jog with the plane as reference in the Move screen and it will enable the the possibility to use the plane as a variable in the program.

Move the robot in the desired X direction of this user plane – in this case that is sidewards exactly along the side edge of the black box. It is not important how long the robot is moved along the X axis, but as long as possible gives the best result because then the angle to the Y axis becomes more accurate.

In this case the robot is moved to the corner of the black box.

When the robot has been moved into position set this as the Plane 1 – Point 3. Make sure the “Show axes” – “Joggable” and “Variable” is ticked because this will enable the see the axis color in the Move screen and enable the possible to jog with the plane as reference in the Move screen and it will enable the the possibility to use the plane as a variable in the program.

As this article will show how it is possible to move between planes  – it is necessary to create one more user plane so a difference in the robot movement can be observed.

So the black box is moved in an angle in order to illustrate another plane orientation.

Move the robot to the desired position of the origin of the second user plane (Plane 2). The new lower left corner near the robot is used as the origin for the user plane. Pay attention to the orientation of the tool head rotation – in this case the blue light on the Robotiq gripper is exactly opposite the I/O connector and therefore the blue light in this case indicate the Y axis – and the Y axis for this feature plane 2 – point 4 is carefully aligned with the direction of the side edge of the black box (the object).

Because the box is now in an angle the tool head is also rotated a little to match up the angle of the black box -see a second photo of this below. The blue light which is the Y axis is aligned with the side edge of the black box.

When the robot has been moved into position set this as the Plane 2 – Point 4. Make sure the “Show axes” – “Joggable” and “Variable” is ticked because this will enable the see the axis color in the Move screen and enable the possible to jog with the plane as reference in the Move screen and it will enable the the possibility to use the plane as a variable in the program.

Move the robot in the desired Y direction of this user plane 2 – in this case that is upwards exactly along the side edge of the black box. It is not important how long the robot is moved along the Y axis, but as long as possible gives the best result because then the angle to the X axis becomes more accurate.

In this case the robot is moved to the corner of the black box.

Again notice e the box is now in an angle the tool head is also rotated a little to match up the angle of the black box – see a second photo of this below. The blue light which is the Y axis is aligned with the side edge of the black box.

When the robot has been moved into position set this as the Plane 2 – Point 5. Make sure the “Show axes” – “Joggable” and “Variable” is ticked because this will enable the see the axis color in the Move screen and enable the possible to jog with the plane as reference in the Move screen and it will enable the the possibility to use the plane as a variable in the program.

Move the robot in the desired X direction of this user plane 2 – in this case that is sidewards exactly along the side edge of the black box. It is not important how long the robot is moved along the X axis, but as long as possible gives the best result because then the angle to the Y axis becomes more accurate.

In this case the robot is moved to the corner of the black box.

Again notice e the box is now in an angle the tool head is also rotated a little to match up the angle of the black box – see a second photo of this below. The blue light which is the Y axis is aligned with the side edge of the black box.

When the robot has been moved into position set this as the Plane 2 – Point 6. Make sure the “Show axes” – “Joggable” and “Variable” is ticked because this will enable the see the axis color in the Move screen and enable the possible to jog with the plane as reference in the Move screen and it will enable the the possibility to use the plane as a variable in the program.

Also make sure that for both Plane 1 and Plane 2 the “Show axes” – “Joggable” and “Variable” is ticked because this will enable the see the axis color in the Move screen and enable the possible to jog with the plane as reference in the Move screen and it will enable the the possibility to use the plane as a variable in the program.

When the “Variable” is ticked then it is possible to select the Plane variable in drop down menus when programming the robot.

Notice that there is now two variables with the names Plane_1_var and Plane_2_var which can be used in the program as reference.

Now the planes are ready to be used in the program.

Variable Table:
Var_1 = counter
Var_2 = Reference to first corner of box. (Same as Waypoint 1 i.e. 0mm along X axis and 0mm along Y axis).
Var_3 = Reference to second corner of box. (330mm along X axis and 0mm along Y axis).
Var_4 = Reference to third corner of box. (330mm along X axis and 180mm along Y axis).
Var_5 = Reference to forth corner of box. (0mm along X axis and 180mm along Y axis).
Var_6 = Cordinates for Waypoint 1.
Var_7 = First corner of box with Plane_1 or Plane_2 as reference.
Var_8 = First corner of box with Plane_1 or Plane_2 as reference).
Var_9 = First corner of box with Plane_1 or Plane_2 as reference).
Var_10 = First corner of box with Plane_1 or Plane_2 as reference).

Notice: Var_7, Var_8, Var_9, Var_10 will change during the program run depending on Var_1 counter (Cange evry second program run).

Program description:
Below is an example of a Universal-Robots polyscope program that move between two different planes and thereby follow to edges of the black box in two different orientations.

First a counter variable is created in order make two different program runs each with a different plane as reference.

Then the box is measured to be 330mm x 180mm and therefore variables are created for offset to each of the 4 corners.

There are two “If” conditions based on the Var_1 counter variable so the program will move between the two If conditions evray second time during the program run.

The difference between the two “If” staements are that first time it is the Plane_1 that is used as reference and therefore the robot will follow Plane_1 as origin. The second time it is Plane_2 that is used as refference and therefore the robot will follow Plane_2 as origin.

There are 4 variable waypoints (Var_7, Var_8, Var_9 and Var_10) so the robot will move between these 4 waypoints based on the variable contents calculated in the “If” statements with the pose_trans function.

Also notice that both MoveL are set to use the Base_1_var as reference.

Below is a video that show the program run. Notice the change in plane orientation.

It is also possible to use variables inside the reference lists – as this example show. The movements is the same as above, but different method of using lists. This can be useful for example when getting the data from a vision camera.

 Contribute moderator Option 1 \$50.00 SGDOption 2 \$100.00 SGDOption 3 \$500.00 SGD

Disclaimer: While the Zacobria Pte. Ltd. believes that information and guidance provided is correct, parties must rely upon their skill and judgement when making use of them. Zacobria Pte. Ltd. assumes no liability for loss or damage caused by error or omission, whether such an error or omission is the result of negligence or any other cause. Where reference is made to legislation it is not to be considered as legal advice. Any and all such liability is disclaimed.

If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.

Author:
By Zacobria Lars Skovsgaard
Accredited 2015-2018 Universal Robots support Centre and Forum.

Also check out the CB3 forum

1. Vincent says:

Hi,

Is it possible to use the script code to make the robot travel specific distances similar to what pose_add would do but i want to use a custom plane as reference instead of the base.

I use script because i need to handle many externally defined variables in a generic program,
I also can’t use pose_trans as my tool needs to be tilted with a constant angle.
It is mostly for convenience and to simplify the coding as having to apply offsets to coordinates and rotations on each move gets tedious and makes the code heavy pretty quickly.

1. zacobria says:

Hi Vincent

Thanks for the question.

The port for receiving external script code uses the robot base as reference and I am not aware of any method to change that.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

2. Baptiste says:

Hello,
Hum, i hope i can post my question here.
So, here is my problem : I need to use a vacuum to take out some pieces of a bin a release them on a palett with 32 different positions. So i used the variable pose like (p[X,Y,Z,Rx,Ry,Rz]) and i do an iteration on the X and Y at each loop to change the “release pose”. But, I don’t know how to use the (Rx,Ry,Rz), because when i take all the parameters to my “original pose” to enter them on a variable pose the head of the robot is in the other direction. I mean, i want that the head is down like the shape of “L” and when i run the program the head of the robot is like the shape of “╔” so either I bump into the palette or the vacuum is too high.
So please can you tell me how i can put the head of the robot upside down and just modify the X, Y and Z to go to the 32 other place ?
I hope my problem is not too difficult to understand.

1. zacobria says:

Hello Baptiste

Thanks for the question.

Maybe it can be considered to use the function “get_actual_tcp_pose()” when the robot is at a desired position – and thereby learn what the Rx, Ry and Rz values really are in that position.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

3. user1492 says:

Hi,

i don’t know where to ask this question. I hope I am not completely wrong in this topic.

Is it possible to set a tool offset longer than 500 mm in the Z direction? The user interface restricts the input from -500 mm to +500 mm. I want to use a tool with a z-offset of around 600 mm.
Is it possible to enter a higher offset using the URScript function set_tcp(pose)?

1. zacobria says:

Hi ludevig

Thanks for the question.

I have not seen a method to enter a higher offset. And it might also not be feasible to have such a high value and long tool as it can produce high strain on the joints.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

4. Andreas says:

Hello.
I am currently in the process of creating a program using polyscope v3.7 and im facing a challenge or two using planes.
The idea is to have the robot feel a number of points on a movable table, so the orientation of the table can be calculated and used to create a plane. That way when i want to say move to arm 100mm in X direction it will travel along the X axis of the table, when the table is removed and placed near the robot again it will create a new plane so that it can travel along the new X axis. Is this possible?, and using the new version i cannot seem to be able to access the 3 points under “planes” in features, a wizard has been added instead.
If this is not possible using planes, can a feature “line” do the same thing?, if so how?

1. zacobria says:

Hello Andreas

Thanks for the question.

1.
You might consider to set a new Plane for the new position of the table as shown in the article.

2.
I am not sure what you mean by wizard. The screen has been changed and is more explanatory – and there are a feature to set the three points in the plane.

3.
As shown in the article the Plane variable can be changed in the code.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

5. George says:

Hi,
Could you help me on this..
I have two pieces with many WPs and I want to mirror these pieces with Y axis. How can I do? I tried to define a plan, I selected WPs, I created a variable offset for translation of the plan, but the result is not a new mirrored piece, is symmetrical piece. Sorry for my English, I try to explain in simple words my problem.

1. zacobria says:

Hi George

Thanks for the question.

Maybe consider to use variable waypoints with pose.

This program mirror two position arround the Y axis.

Program
BeforeStart
MoveJ
Waypoint_1
X≔0.2
Y≔0.3
Z≔0.3
Rx≔0
Ry≔3.14
Rz≔0
Pose≔p[X,Y,Z,Rx,Ry,Rz]
Robot Program
MoveJ
Pose
X≔-0.2
Pose≔p[X,Y,Z,Rx,Ry,Rz]
MoveJ
Pose
X≔0.2
Pose≔p[X,Y,Z,Rx,Ry,Rz]

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

1. George says:

Thank you for your quick answer. I understand what you say, but my piece is more complicated. I have a piece for cars, which I have to apply glue. Because this piece has not simple form, I must to define 30 WPs, to follow the trajectory of its edge. To define all 30 WPs as variable takes long time (I don’t say is incorrect).
I was thinking how to make the robot to read the position defined manually by me, and then, to mirrored all points with Y axis. These pieces are pairs (left – right).

1. zacobria says:

Hi George

I have not seen a function that instantly can mirror waypoints.

30 waypoints is not a lot. Some math can be applied to the waypoints cartisian coordinates in the pose and then apply the new cartisian cordinate into new waypoints poses – to get the mirror position along the Y axis.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

6. GuoRan says:

Hi zacobria
I meet a problem，why does UR10 error C1533A1:Protective Stop: Deviates from path:Shoulder??
The shoulder cannot move when starting it.
The UR is running free and there is no any obstacles.

1. zacobria says:

Hi GuoRan

Thanks for the question.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

7. Hello !

Thank you very much for this “easy-to-understand – manual”. I need this function you explained in a diffrent way. I want to move the tcp on three points of a plane in the space. Out of this 3 points I want automatically create a new plane which I use for the following movements.
So my idea is for example:
Move P1
Var1 := get_actual_tcp_pose
Move P1
Var2 := get_actual_tcp_pose

Move (Feature: the new plane)

I already tried to overwrite the plane_point_variables (point1_var,…) but this has no impact of the plane.

This function is should be used to find something in space an move relative from there.

I hope someone can help me!

Have a nice day!

1. zacobria says:

Hello Marco

Thanks for the question.

I think thats what these examples already maybe instead of references to a “tcp_pose” – then reference to a Plane_var by setting the feature to a Plane_var from the Feature drop down.

http://www.zacobria.com/universal-robots-knowledge-base-tech-support-forum-hints-tips/knowledge-base/planes-and-position-variables-1/

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

8. Jonathan says:

Hi

I would like to ‘find’ a flat surface in space, by touching it in three places to create a plane. However if I do that, I have no way of knowing if the tool z-axis was at a right-angle to the surface when it was touched.

If I create a plane that way, how can I then move to a position where the tool’s z-axis is at a right-angle to that plane?

Thank you,
Jonathan

1. zacobria says:

Hi Jonathan

Thanks for the question.

I have not seen a function that can do this – so it might be necessary to perform some math.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

9. Mohammed Sharafath says:

Hi,

I have a doubt but I am not sure if I am asking in the right location.

Anyway, I had designed and installed a custom end effector on a UR3 robot. And I have entered the values of X, Y & Z according to my dimension report in the setup for the Tool Center Point. But I noticed that when I rotate the robot about the TCP there is a ‘run-out’ visible in after it rotates 180 degrees. I tried fine tuning the values but it doesnt seem to work.

I then tried using the Position and orientation wizard, but I am not able to get the TCP as all the 4 points are grey after I have set them. I may be doing something wrong and hence tried searching for resoures on the net for the same but nothing new is available other than the UR3 user manual.

Any help on this would be of great use as I am using ‘Pallet’ for most of my applications and the rotation error is causing huge problems,

Thanks and best regards,
MOhammed Sharafath.

10. Nas says:

HI.. could you help me on this..
let say I have point 1, point2 and point3(straight movement). and my robot will go to point3, when the robot get a signal that robot will stop.. my question how to measure distance from stop point robot to point3?
could you give some suggestion or any example program which may I can refer?

1. zacobria says:

Hi Nas

Thanks for the question.

It is possible to get the current position of the robot with the function var_1≔get_actual_tcp_pose() and the result is a list of X, Y, Z, Rx, Ry, Rz cartesian variables which then can be used to perform maths on.

I do not have a direct example of measuring the distance because that is pure math, but the forum has some examples on using the pose lists. For example at this link.

http://www.zacobria.com/universal-robots-knowledge-base-tech-support-forum-hints-tips/knowledge-base/position-variables-1/

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

11. Lambok says:

Hi,
During running,
Why does UR always error C1533A1:Protective Stop: Deviates from path:Shoulder??
I see the position robot, it still in range position.

1. zacobria says:

Hi Lambok

Thanks for the question.

Does “Always” mean that every time you run the program then this error messages appear ?

Is the robot running free or is the robot meeting any obstacles when the error messages appear ?

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

12. Lambok says:

Hi..
I am a beginning in UR programming, i found a ur program that it use plane and pose. In current program, to move the point tcp use movel(pose_trans[Plan_Pick_Mate,P_Emty_Mat]
Actually the tcp points is already correct, but have the problem for the position of arm robot(wrist 5 n 6) cause touching frame of machine. So it need to rotate position of arm, it just need to rotate the x rotation. So how to change the rotation x without chance the tcp point(x,y,z)value.?
Thank you,

1. zacobria says:

Hi Lambok

Thanks for the question.

Maybe consider the speedl command –

speedl(Y, Y, Z, Rx, Ry, Rz), accleration, time

For example:

speedl([0,0,0,0.1,0,0], 1.2,0.5)
stopj(1.0)

Maybe values needs to be adjusted for the actual case.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

13. Dan says:

Hi,

I’m no robot programming expert but hopefully you can help me, I’m working on a current project to pick labels from a stack. There are 4 identical stations lined up square along the Y axis 200mm apart. I’m trying to program all 4 stacks from the first stack position using variable positions to provide consistency between the 4 stations and easier set up.

e.g. second_stack_pick = pose_add (first_stack_pick, p[0,0.200,0,0,0,0])
third_stack_pick = pose_add (first_stack_pick, p[0,0.400,0,0,0,0]) etc

However, the variable positions are slightly out both in x and y axis direction by a few mm, is this due to planes/features or my bad programming?

1. zacobria says:

Hi Dan

Thanks for the question.

There might be different things causing this.

First of all – it is maybe better to use the robot in “Teach” mode because that is repeatability which is where the robot is much better – because the robot has been at the position before during the teaching of the position – and repeatability also what is specified by the robot.

Whereas to send the robot to some position based on coordinates is accuracy – because the robot has not been thought the position by being there during the teach position process – and accuracy is not specified on the robot.

It can also be because the X – Y position of the stations are not aligned exactly up with X – Y lines of the robot. And thats what the teaching of planes can correct if it is not possible to physically line the stations up with the robots X – Y lines. But then there must also be a reference to that Plane that has been made instead of the “first_stack”.

It is noticed that “pose_add” is used in the program – maybe it is intentionally, and pose_add is based on the robots base coordinate system. Wheras “pose_trans” is based on the tool heads coordinate position – which is different.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

14. Jonathan says:

Hi
Please could you tell me if there is an easy way to measure the (shortest) z distance from a pose to a plane?
I seem to be able to do it at the single point that is the ‘start’ of the plane, but I would like to be able to do it anywhere…

(I would like to use a plane to compensate for the tilt of a flat surface, but the rest of my program is referenced from two separate fixed points so I can’t use the plane as a reference there.)

1. zacobria says:

Hi Jonathan

Thanks for the question.

I have not seen such function, but maybe the “pose_trans” can help.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum

15. Matthew says:

My move window for my ‘moveL’ command doen not contain a drop down box for selecting the reference feature for the move. Am I overlooking a setting that would allow me to select my reference coordinate system?

Thank you for any help.

1. zacobria says:

Hi Matthew

Under Installation in the Features setup – there is a tick boxes “Show Axes” – “Joggable” and “Variable”. When they are checked the feature will show up in the Move screen.

Author:
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.

Also check out the CB3 forum