What is inverse kinematics?
How much do you need to know about it to get the most from your robot?
Inverse kinematics for robotics is a huge and often complex topic. Depending on your project, you might need to know about it in great detail or get by with basic knowledge.
Here is the essential information that you need to know about inverse kinematics for robotics.
What Is Inverse Kinematics?
Inverse kinematics is a mathematical process used to calculate the joint positions that are needed to place a robot’s end effector at a specific position and orientation (also known as its “pose”). A reliable inverse kinematic solution is necessary for programming a robot to perform tasks.
It’s important to be clear about the differences between the inverse kinematics and the robot’s forward kinematics.
Forward kinematics determines where the end effector will be if the joints are set to a specific position. There is only ever one solution to the forward kinematic equation. When the joints are set to a specific position, the end effector will always end up in the same place.
With inverse kinematics, there are often multiple different solutions and multiple approaches to calculating the inverse kinematic solution.
Why We Need Inverse Kinematics in Robotics
If we didn’t have inverse kinematics, robot programming would be extremely difficult… if not impossible.
When you want your robot’s end effector to move to a particular spot in its workspace, it makes sense that you would input your desired pose into the program.
But, you can’t just tell a robot to go to your desired X, Y, and Z coordinates and expect the robot to understand your instructions… not without inverse kinematics.
Most industrial robots are constructed of several independently controllable articulated joints. Each joint is connected to one or more of the other joints, sometimes in complex configurations. The end effector is attached at the end of the entire “kinematic chain”. When you move any one joint, this will affect the end effector’s pose in various ways.
This means that there is no simple, direct relationship between the end effector position and any one particular joint.
For example, if you want the robot’s end effector to move 1 mm linearly along the Z-axis, you may need to move all of the joints by a different amount.
Finally, inverse kinematics algorithms calculate the exact position of each of the robot’s joints required to reach your desired end effector pose.
How to Find the Inverse Kinematics of a Robot Arm
When you do some research into inverse kinematics for robotics, you will often find pages and pages of equations, formulas, and algorithm descriptions. This is because calculating inverse kinematics is a well-established field in robotics research. Not many people talk about inverse kinematics outside of the research field (except for 3D animators).
However, when we are using robots for industrial applications, there are 2 basic options to find an inverse kinematics solution:
- You can do all of the mathematical and programming work yourself to create an inverse kinematic solver for your specific robot.
- You can use an existing inverse kinematic solver for your specific robot that works “out of the box.”
Which of these you choose will depend on your unique situation.
If you have built the robot yourself — i.e built it from scratch by connecting motors and mechanical links together — you will likely have to choose Option 1.
If you are using an industrial robot that has come from a robot manufacturer, Option 2 is almost always going to be quicker and easier.
The Hard Method: Create an Inverse Kinematics Solver
If you are choosing to create your own inverse kinematic solver, get ready for some serious programming!
There are 2 fundamental approaches to calculating the inverse kinematics:
1. Analytical Inverse Kinematic Solutions
An analytical inverse kinematic solver will be able to take the desired end effector pose and (almost) immediately spit out the required joint positions.
This is because, “under the hood”, the robot’s kinematic chain has been reduced to a closed-form expression — for any end effector pose, there is a mathematical definition of the required joint positions.
Although you could go through the work of generating the closed-form expression yourself (by hand) this is not usually necessary. These days the IKFast library makes this task a lot easier than it used to be in the past.
2. Numerical/Iterative Kinematics Solvers
Not all robots have an analytical inverse kinematic solution. When the robot’s kinematic structure is complex or unusual, the only option is to use a numerical inverse kinematics solver.
Moreover, in a numerical solution, there isn’t a clear closed-form expression. Instead, when you input your desired end effector position, an iterative algorithm works towards a solution for the required joint positions by treating it as an optimization solution.
At each iteration, the algorithm inputs some joint positions into the robot’s forward kinematic equation to find out where the end effector ends up. In the next iteration, it uses this information to further tweak the joint positions. This will gradually move the end effector toward the desired pose.
Due to this iterative approach, numerical inverse kinematics solutions are slower than analytical solutions.
The Easy Method: Use a Proven Inverse Kinematics Solver
Creating your own inverse kinematics solver is a good intellectual exercise when you are at university or if you are building your own robot from scratch.
But, if you just want to use your robot in a production environment, it’s unlikely that you will need to create your own inverse kinematics solver.
It’s much easier and quicker to just use an existing solver that is already incorporated into your robot programming environment.
All of the robots in RoboDK’s Robot Library come with their own inverse kinematic solvers. This allows you to start programming them immediately without ever having to think about it.
Most of our solvers are pre-generated analytical solutions that come packaged with the robot file. However, some of the more complex robots in the library do use numerical solvers. Even with the numerical solvers, the reduced speed of calculation is not an issue with RoboDK as you will be programming your robot offline before sending your program to the robot itself.
After all, only create your own inverse kinematic solver if you really have to.
If not, your time will be much better spent creating the robot program for your task and getting it into production quicker.