Creating a Safe Home routine
Describes how a Safe Home routine can be created in the program
Created Date: December 2nd, 2015
Examples are valid for:
CB2 Software version: 1.8.16941
CB3 Software version: 3.2.18744
e-Series Software version: 5.1
Note that older or newer software versions may behave differently.
This how-to describes how to start the robot automatically, without using the "Automove" feature.
A Safe Home routine is implemented to avoid hitting different objects, from where the robot is when program starts, and until it gets to the normal starting procedure.
Safety notice:
When first waypoint in program is either Variable or Relative, robot will start moving when "Play" is pressed, and no "Automove" is needed.
This needs to be taken into account in the risk assessment.
The Safe Home routine is only as good, as the complexity designed by the programmer and is not related to the Safety Settings of the robot.
Consider a workspace for the robot, where it during the program, will go into a box in the robot workspace.
If the robot for some reason stops inside the box, and the robot program needs to be restarted (power interruption, E-stop or other reasons) , the robot might need to take a different path from the position it stopped in and to the normal start position.
We implement a Safe Home routine to make the robot take different trajectories to the normal start position, depending on where the robot is when the program starts.
Thus the operator will not have to use Automove or manually jog the robot to the start position.
- We start out by checking where the robot is, when the program starts.
And make it move to a variable waypoint, at exactly that place.
start_pose = get_actual_tcp_pose()
MoveL
start_pose
We use the script-code "get_actual_tcp_pose()" to save the current position of the TCP, to the variable "start_pose". - After we have saved where the robot is, we break the different coordinates into directions; X, Y and Z position.
See this article on how to read the individual position.
start_x = start_pose[0]
start_y = start_pose[1]
start_z = start_pose[2] - The confined space, the robot can go into is placed as on the above illustration.
Thus if the actual TCP pose is within the box, we shall first move above the edge of the box.
If the X-parameter of the TCP is greater than 200 mm (0.2 m) and Y-parameter is greater than 100 mm (0.1 m), we are inside the box and needs to move outside of it.
IF (start_x >= 0.2) and (start_y >= 0.1) - If both statements are true, we are inside the box, and needs to move above it.
Thus we create a "Safe_Pose" where all the positions are the same, except for the Z-parameter, that we want to be 350 mm (0.35 m) to make sure that we are above the box, and can now move freely directly to the "Normal_start" position.
Safe_Z_value = 0.350
Safe_Pose = p[start_pose[0],start_pose[1],Safe_Z_value,start_pose[3],start_pose[4],start_pose[5]]
MoveL
Safe_Pose
The pose variable consists of 6 parameters: pose_variable = p[x,y,z,rx,ry,rz] - If we are inside the box, we have now moved above it, and can move directly to the Normal_start position. If we were outside the box, we could already move directly to the Normal_start position.
Thus our Safe_Home routine is complete, and we can now move onto the normal program execution in our Robot Program.
See attached program in the bottom.
Above Safe Home routine is only a very simple illustration of how this could be done.
More complex trajectories and if-statements can be done, to determine the robots' position for larger programs working closely to machines.