We have a program where we often halt at random positions and need to jog it back to home position. I recently learned how to create a safe position by modifying the current pose Z axis. Here is how it looks:
Before Start
Activate Gripper
Gripper Open (50%)
(Folder) Safe Position
currpose := get_actual_tcp_pose()
safeZpose := p[currpose[0], currpose[1], .27513, currpose[3], currpose[4], currpose[5]]
MoveL
safeZpose
Robot Program
Home_Position
…
…
It works well with waypoints closest to Home_Position but as I test waypoints farther away, the robot wants to collide into itself, triggering a stop. And if it’s halted at a far distance from Home_Position, it goes back to it too fast. How to avoid these issues?
If you change the MoveL to a MoveJ it should stop colliding with itself. (Assuming you’re telling it to go somewhere it can physically reach) As for moving too fast if it’s stopped far away, just drop the speed of the MoveJ. Personally, I would just set it to the slowest speed that I was comfortable with and just let it move that fast for the recovery move no matter where it’s at. If you really need DIFFERENT speeds depending on how far away it is, use multiple MoveJ commands with different speeds and use an If statement to run one or the other depending on the TCP location.
(Folder) Get to Home
safeheight:= get_actual_tcp_pose()
MoveJ
safeheight
current_x:= safeheight[0]
current_y:= safeheight[1]
current_z:= safeheight[2]
if (current_x <= -.380) or (current_y>= .296)
MoveJ
Half_2
Home_Position
Else
MoveJ
Home_Position
Robot Program
…
Home_Position
…
This one works way better. However, when I tested it where the TCP was really far from the base, the Z Clearance routine makes it go into singularity. I will need to revise my program to make up for this case. Anyways, changing MoveL to MoveJ made a significant improvement, thank you.
You’re hardcoding your Z coordinate. I could believe that if you’re sufficiently far away from the robot base, that Z height could produce a singularity. You should check the X and Y values and determine if they are “significantly” far from the base. If they are, alter the X and Y values of adjust_z accordingly.