I have written a MATLAB code for inverse kinematics of 3R robotic arm, which returns value of joint angles for given link lengths and end effector position and orientation. But if location of point is outside the workspace or it can’t be reached with certain orientation the program gives error. Is there any way to check whether a particular point is reachable with a given orientation ?
You are basically asking if a given tool transformation has a corresponding IK solutions. This question, unfortunately, currently has no universal shortcut other than trying to actually compute IK solutions and see if any exists.
Nevertheless, I think there are a number of heuristics that you can use to speed up the process. For example, if the given position is farther from the base than the combined link lengths, you can be sure that no solution exists without checking further. You can also reach for works on reachability map.
First find the workspace of the robot arm.
- The easy method is to model the robot arm and to apply ramp functions to the first two joints and a sine function to the last joint. Use the probe block to record the end effector positions. Ensure that the simulation length is sufficiently long enough.
- The hard method is to find it analytically as given here.
Second export result to MATLAB and plot a 3D graph using the plot3 command.
Third for every point you want to test; plot it on the same graph and you will immediately see if it's within the workspace or not.