Go Down

Topic: Inverse kinematics (Planar) library that works for N joints using FABRIK (Read 521 times) previous topic - next topic

henriksod

Hello!

I am a Master student at UmeƄ University in Robotics and Control and I created an Arduino library for an inverse kinematics solver for planar manipulators that is computationally efficient and works for N number of joints! The library also allows for setting a specific tool angle, allowing your manipulator to approach a point from a particular angle.

I created this library for a robotics competition and it works perfectly. I found that there are no good inverse kinematics libraries out there for Arduino where you have a general solver that fits everyone's needs, either the libraries were made for one particular manipulator or it was created for 2 or 3 joints using the regular geometric approach.

This library uses an iterative method called FABRIK, proposed by Andreas Aristidou and Joan Lasenby, which is more computationally efficient than the geometric and algebraic approach. It guarantees one solution based on the previous configuration of the manipulator and it works for an infinite (theoretically) number of joints.

Here is a link to the repository, please try it out: https://github.com/henriksod/Fabrik2DArduino

Happy making!


dsyleixa

that sounds amazing!
I am just searching for a inverse kinematics lib  for this 5-6DOF robot (target position = middle of the claw):

https://www.ebay.de/itm/Assembled-6DOF-Robot-Arm-Mechanical-Robotic-Clamp-Claw-with-Servos-Controller/252317775624?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m1438.l2649

do you think the lib is suitable for it?
(tbh, actually 3D x,y,z coordinates have to be calculated)

henriksod

that sounds amazing!
I am just searching for a inverse kinematics lib  for this 56DOF robot (target position = middle of the claw):

https://www.ebay.de/itm/Assembled-6DOF-Robot-Arm-Mechanical-Robotic-Clamp-Claw-with-Servos-Controller/252317775624?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m1438.l2649

do you think the lib is suitable for it?
(tbh, actually 3D x,y,z coordinates have to be calculated)

Thank you!

I made this library specifically for planar manipulators, I will maybe create a 3D version in the future. The proposed algorithm (FABRIK) allows for 3D, but when it comes to R^3 kinematics, it gets quite computationally expensive on an Arduino, maybe even for a FABRIK solution.

For a 6DOF manipulator I would suggest to go with the traditional approach using Homogenous Transform Matrices and Jacobians instead. If you are interested in learning about kinematics and also robot dynamics, I strongly recommend this book:

Spong, Mark W. Robot Modeling and Control.

dsyleixa

thank you for your reply!

Actually Arduinos are getting more and more powerful, many people (like me) always use 32bit ARM Cortex cores, e.g., the  Arduino Due (M3), the Zero/M0, and the M4 (by Adafruit and Teensy) feat. even a single-core fpu.

As to matrices, I don't have the mathematical skills to write Arduino matrix math  code, and tbh, I also don't understand matrices actually at all, so I would need a ready-to-use lib for that, too, which works out of the box.

As to fp maths, please notice that (single-precision)  float calculations are about  twice as fast  as double fp on ARM cpus, on an M4 even more than 10x as fast. So in that case explicite single-float calculations in your libs will be highly appreciated!
Would you kindly write a notification here in this topic if it's finished?

Gladly looking forward to your 6DOF-3D enhancements, thank you in advance!

henriksod


Actually Arduinos are getting more and more powerful, many people (like me) always use 32bit ARM Cortex cores, e.g., the  Arduino Due (M3), the Zero/M0, and the M4 (by Adafruit and Teensy) feat. even a single-core fpu.

Yes, certainly. I will look into an implementation for 3D using FABRIK. 6DOF kinematics can be tough, though, even for a PC when the configuration of the manipulator is close to a singularity. What is good with FABRIK, though is that singularities aren't a problem since it is an iterative approach. If I were to implement this so that it can be used by a 6DOF manipulator, I would have to do much more than just adding the z-axis. In 6DOF, as the name states, you have 6 variables to consider (x, y, z, theta, phi, psi), whereas in the planar case (3DOF) you have (x, y, theta).


As to fp maths, please notice that (single-precision)  float calculations are about  twice as fast  as double fp on ARM cpus, on an M4 even more than 10x as fast. So in that case explicite single-float calculations in your libs will be highly appreciated!
Would you kindly write a notification here in this topic if it's finished?

I think I already use single-precision floats in my library, right? "Float" is used for fast, but unprecise floating point calculations, and "Double" is used for slower, but precise floating point calculations.

dsyleixa

yes, I noticed that there is already float mostly being used, I just wanted to point out to that in order to make it still as quick as possible for future enhancements.

But do I understand correctly that you won't release a 6DOF version?

I was curious about that lib and that option because you wrote at github:
Quote
It works for N number of joints
and that sounded as if N could be far > than just 2 or 3, and 5-6 DOF would be needed actually, at least.

henriksod

But do I understand correctly that you won't release a 6DOF version?
Not in the near future since it will require a lot of work. I have a degree to work on. :) A 6DOF implementation will probably be it's own library and not using FABRIK. I will extend the current library with support for 3D with a rotating base so that you get a 4DOF manipulator.

I was curious about that lib and that option because you wrote at github ... and that sounded as if N could be far > than just 2 or 3, and 5-6 DOF would be needed actually, at least.
The thing is that the number of joints does not describe the number of DOF. The number of DOF is described by the number of variables you can use to set a particular configuration of the end effector. You can have a planar manipulator with 6000 joints and you will still only have 3DOF; x position, y position and approaching angle of the end effector. To achieve 4DOF, you could add a revolute joint at the base and to achieve 6DOF, you would require three "tilting" joints and three "rotating" joints in order to describe a pose in 6 variables.

The robotic arm on the KUKA YouBot, for example, is a 5DOF manipulator. It can rotate its base and its gripper but it is lacking one of the "rotational" joints as you can see here: https://www.turbosquid.com/3d-models/kuka-youbot-3d-model-1158728

Take a look at the picture in this wiki page: https://en.wikipedia.org/wiki/Six_degrees_of_freedom

dsyleixa

I see, my robot has 2 rotating joints, 3 tilting joints, and 1 linear actuator (the claw).
Anyway how you'd count that by dimensions, all motors will have to be controlled independently, so for this design both a kinematic lib and a inverse kinematic lib actually would be required.

henriksod

Yes, well you can get the forward kinematics with this lib as well, the forward kinematics gets computed with the inverse kinematics. :) Maybe I should create a separate function for it... But for your case, I would recommend playing around with Robotics Toolbox by Peter Corke in MATLAB if you have access to that to get a feeling of how it works or read some online source on how the mathematics works behind the kinematics of a 6DOF manipulator.

dsyleixa

thanks for your hints, but I don't know MATLAB and I don't have the maths skills to develop all that by my own.
That's why I'm looking for a lib which provides all those calculations out of the box.

Killer800

Hi, your post is really interesting. I'm an Italian student of Automation and Robotics. I'm working on a exam's project which is about to craft a 3d laser printer.

/Users/Utente/Desktop/b5f4a5e5-79e2-4a4b-a94b-8b4860d1a7ee.jpg

You can see the image of the structure. I'm using the inverse kinematics to study the robotic movements and I'm trying to fit your library to the structure. But I have a problem: the movement of the laser on the "plate" ,which is 2D, has to be evaluated in angular values. How can I adapt it with your library?

Thanking you since now for your response,


Go Up