Universal-Robots – Position variables 1:
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.
This application shows how the robot moves from a starting position with three different size of increments depending on the status of the Inputs DI1, DI2 and DI3. When an input is selected the robot will move in increments according to the input set which is associated to a variable.
If input 0 is set the robot moves in X direction with increments of 0.1 mm.
If input 1 is set the robot moves in X direction with increments of 1 mm.
If input 2 is set the robot moves in X direction with increments of 5 mm.
I/O table Inputs:
DI0 = Move in increments of 0.1 mm.
DI1 = Move in increments of 1 mm.
DI2 = Move in increments of 5 mm.
I/O table Outputs:
Var_1 = Starting position.
Var_2 = X increments of 0.1mm.
Var_3 = X increments of 1mm.
Var_4 = x increments of 5mm.
Var_10 = New position after increment.
In the Before Start sequence the variables are defined where Var_1 is a starting position (Pose). Var_2 is defined as X= 0.1mm. Var_3 is defined as X=1mm and Var_4 is defined as X=5mm. The robot moves to starting position var_1.
In the robot program – the program loops forever and checks the status of the inputs with “IF” statements. When an input is set high the variable var_10 is pose_transfered with the associated variable – for example if input 0 is set high – then var_10 is pose_transfered with var_2 (which represent 0.1mm). Then the robot moves to position var_10. And var_1 is assigned the value of the new position in order to be the origin for the next increment.
Same is the case when input 1 and input 2 is true, but with their respective associated variables for increments of 1 mm and 5 mm.
The “Tool speed” is set to 10mm/s in this case in order to obtain a smooth move. This value can be considered to be adjusted according to the increment and desired speed.
This example was made on a UR3 robot. If using a UR5 or UR10 the starting position var_1 might need to be further away from the base.
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.
By Zacobria Lars Skovsgaard
Accredited Universal Robots support Centre and Forum.