Prevent move command from reaching joint limits

Hi,
The wrist-3 joint of my ur5 can rotate from -360 to +360°

When calling a move command (e.g. moveL), it sometimes happens that the wrist-3 tries to go outside of this range. This of course causes an error.

  • My question: how can I avoid that?

  • My temporary solution: check before each new move command, that wrist-3 is not to close to its limits. If it is, then rotate by +/-360° to get it closer to the center of the permitted range. This reduces the errors, but do not prevent them all.

  • I saw that old topic but it does not answer my question: Movej runs into joint limit

Hi Simon,
If you aren’t limited in the working area, the best way to solve this problem is using MoveJ with joint angles. MoveJ makes a curve when executing so, be aware that there isn’t standing anything close robot.

thank you giorgigedaminski,
Indeed I am very limited in the working area, so moveJ is unfortunately not an option.

To be honest, I would have expected the controller to take care of that.

  • Compute the target joint-angles from the taget pose.
  • Then check if any of them is out of range.
  • If so, apply some modulo or so to make sure they all remain safe.

It would be good, but this has to be counted by developer.
I would suggest to

  1. Change waypoints in your program and try joint positions to be close to 0 degree. This way joint safety limit problem will be very very low.
    Second option is to:
  2. Define additional waypoint somewhere in the safe area with movej(use joint angles), and then send a waypoint where robot goes out of limit. Additional waypoint will Recorrect joint values and at the waypoint, where robot goes out of limit.

thank you giorgigedaminski for the answer