How to solve inverse kinematic problem in real-time?

I want to make a real-time end-effector position control simulation of a 6 DOF robotic arm in simscape multi-body. In the simulation I want to make a matlab GUI like sliders to change the posiotion and the robotic arm starts to move in real-time. To do so, I should solve the inverse kinematic problem and the best way is to use matlab robotic toolbox. The problem is even with using this toolbox, robot cannot move in real-time and it should be done offline. Can anyone help me with that or suggest me a solution?
As I know, industrial robots like KUKA or ABB can solve the inverse kinematic problem in real-time or may be they use lookup table for moving in their workspace.

 Accepted Answer

In 21a, RST introduced a new IK solver called analyticalInverseKinematics which allows you generate a closed-form IK function for a particular 6-DoF serial-link manipulator arm. Give it a try. AIK currently doesn't cover all the 6 DoF variations, but it covers a lot of them. the function will tell you if your robot is compatible.
It seems that your use case is for fast interaction with a manipulator end-effector in a GUI. So in this case, the "real time" feel depends on how fast you intend to move the manipulator end-effector. For a 6-DoF, even if you use the numeric iterative solver provided through inverseKinematics, you can still solve the IK reasonably fast with the LM solver with a small upper bound on number of iterations, assuming you are moving the end-effector smoothly (no sudden change in the desired EE pose) and you are passing the previously solved result to the IK as initial guess every time.
Also keep in mind that for grahpical interaction, the rendering of the robot in figure can actually take a lot of time if you don't use the correct way to draw. Check 'FastUpdate' — Fast updates to existing plot option on rigidBodyTree.show method.

5 Comments

Thanks for your information. As I mentioned earlier, I want to make the simulation in the simscape multi-body. I was thinking of using a look-up table and neural network to find the angular values based on the end-effector position. In this case, I can find the end-effector position using the simscape sensor, and with the agular value for the joints that I applied, I can create a look-up table for training the neural network. The accuracy that I want to achieve is not too much, and less than 0.5 mm is acceptable. The only thing that is important for me is being real-time with a delay of less than 0.2 s. I will be grateful if you tell me your idea about this solution.
By the way, in this simulation, I don't have any sudden movements, and it is like what you explained.
I am not a fan for using NN on problems like IK - as the "conventional" solution is already fast enough (I don't think a lookup table can beat the analyatical IK solution).
I checked the method that you explained but I had to change my robot in order to have 7 DOF so I think I can not use the new IK solver. what about the inverse kinematic block in robotics system toolbox that solve IK numerically. Can it be use as a real-time solution for my simulation?
For a 7-DOF robot arm with good initial guess, It's possible to get close to a couple of hundred Hz update rate with genreated code.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!