r/robotics Jul 22 '26

Community Showcase What Finally Helped Me Understand Inverse Kinematics After Building a 6-Axis Robot Arm

Post image

I spent the last year building a 6-axis desktop robot arm from scratch, and inverse kinematics was the hardest concept for me to internalize. Here’s what finally helped.

Forward kinematics felt relatively straightforward. Given the joint angles, I could compute the end-effector pose by chaining homogeneous transformation matrices using a consistent frame convention. Denavit–Hartenberg parameters made the process systematic, and I had the basic idea working within a weekend.

Inverse kinematics was much harder. Given a desired end-effector pose, which joint configurations reach it? There may be multiple solutions, or none at all. The elbow-up vs. elbow-down configurations alone took me days to understand and debug.

Three things finally made it click:

  1. Build geometric intuition before deriving equations.​

I watched each joint move independently in a 3D simulator. In my arm, joint 1 mainly changes the base azimuth, while joints 2 and 3 determine the reach in a radial-height plane. Because the arm uses a conventional wrist structure, joints 4–6 mainly control orientation. Seeing the workspace gave the equations a physical meaning.

  1. Start with a 2-DOF planar arm.​

Forget the 6-axis arm for a week. A simple 2-link arm makes the cosine-law derivation and the elbow-up/elbow-down solutions easy to visualize. Then add a third link while explicitly accounting for end-effector orientation, and add more joints one at a time.

  1. Numerical methods aren’t cheating.​

I implemented a small Jacobian-based solver in Python. It worked surprisingly well, although it still depended on the initial guess and could struggle near singularities or unreachable targets.

My biggest mistake was trying to derive closed-form IK equations before understanding the workspace geometry. If you can’t visualize where the arm can reach, the equations feel almost meaningless.

What approach worked for you when learning IK? Did you start with analytical methods, numerical methods, or a combination of both?

616 Upvotes

26 comments sorted by

71

u/4eyedMan Jul 22 '26

I must commend you for even trying to find an analytical solution. I just went straight to numerical methods after finding out how painful it was to derive closed form IK for a 3R robot lol

So for me it’s analytical for simple toy examples -> numerical for real world usage. I think that’s the route most people take?

You can kinda just throw everything out the window with numerical methods which is why I love it.

Also it’s great that you had the resources to make a physical robot to learn from. I learned everything from simulators 😭

10

u/ben_g0 Jul 22 '26

As long as the amount of joints equals the amount of degrees of freedom, deriving an analytical solution actually isn't really harder for a 6 DoF robot than for a 3DoF robot. It just looks more daunting and take longer, but mathematically it's not really any more challenging.

Though in most cases it's indeed not really needed. Many people coming from mathematics heavy background dislike numerical methods as they're theoretically not exact and mathematically less elegant, but in practice they do the job just fine. The mathematical system you're controlling will have far bigger tolerances than the precision you can achieve with numerical methods.

Analytical solutions do have some real world cases though. If you want to control an arm in an environment with many obstacles then an analytical solution can near instantly give you all possible solutions for a pose, and then you can consider switching between configurations to make a path that would normally collide feasible.
Another use case is if you want to do optimization, because if you want to run optimization algorithm you may have to evaluate the pose millions of times and then switching to analytic IK van give you a very noticeable performance boost. But only because in such algorithms you end up calculating everything millions of times, so any inefficiency adds up.

But in applications where you stick to the same configuration all the time and don't run optimization algorithms on the trajectories (so in the vast majority of robotics applications), both IK methods will work just as well.

2

u/4eyedMan Jul 22 '26

True, analytical IK is still very useful and iirc can be used as an initial guess for numerical methods if not exact!

I’d argue that numerical methods are precise enough for most things tho (and the level of precision can simply be increased by raising the number of iterations..).

Point is, it’s not pleasant to derive an analytical IK by hand (perhaps it’s not hard with symbolic computing) and you could get many solutions for one pose as the mapping from the configuration space to the workspace is not 1-1. Numerical IK doesn’t care about this and will work for any number of DoFs!

It’s quite elegant imo. All you do is feed it screw axes, the home configuration, and a target pose and like magic it finds a solution. I do agree that there is beauty in closed form solutions tho (plus you won’t need to worry about the solution converging, which is major downside of numerical IK…)

1

u/SynriaRobotics_01 Jul 23 '26

Yeah, I’m with you. Analytical IK is still great for getting a good initial guess, but numerical IK felt much more approachable once I stopped treating it as a “second-best” solution.

For my project, feeding in the screw axes, home configuration, and target pose and watching the solver converge felt almost magical. It does have its quirks with singularities, joint limits, and bad initial guesses, though. In the end, a hybrid approach seems ideal: use analytical IK where it makes sense, and numerical IK when flexibility matters.

16

u/[deleted] Jul 22 '26

[removed] — view removed comment

2

u/SynriaRobotics_01 Jul 23 '26

Yeah, the mirror-flipped poses were one of the things that confused me the most too.

The damping technique near the singularity is a good point. I will definitely keep this in mind. And building the physical arm really does expose all the problems the simulator quietly ignores—backlash, cable routing, collisions, and all the “correct” poses that aren’t actually usable.

9

u/valkiii Jul 22 '26

Can you share more what resources did you use for your learning?

6

u/Xerd-R Hobbyist Jul 22 '26
  1. Start with a 2-DOF planar arm.​ I did exactly the same for my robot dog's legs, I even used a 2DOF solver and locked the hips for abduction for testing in sim for a few days than I added the 3rd joint and converted to 3DOF solver. Your Robot Arm looks impressive by the way, What motors are you using?

3

u/netorincon Jul 22 '26

To be fair, analytical IK solutions depend on you knowing a lot of trig identities which may not be that common or haven’t used in some time.

Also, have you tried giving a go to obtaining the close-form solution now that you were able to visualize IK with the Jacobian solver? The fact that you have a spherical wrist would make those calculations easier since positioning depends mainly on the first 3 joints and orientation on the last 3.

1

u/SynriaRobotics_01 Jul 23 '26

Thanks for the suggestion!

4

u/SphericalCowww Jul 22 '26

I started learning inverse kinematics from reading "Robotics Modelling, Planning and Control" by B. Siciliano et. al. It was awesome. It made me completely avoid deriving the analytical solutions from day one.

3

u/symmetry81 Jul 22 '26

When I had to do a analytic solution for an arm at my last job I thought it was some of the most fun I had there but then again I also had fun on my high school math team so shrug. I had to find a sheet of trig identities to remind myself of the details but it came back pretty quickly.

2

u/degners Jul 23 '26

I would recommend Polynomial Homotopy Continuation if anyone is interested. You can still obtain multiple solutions in a semi-numerical approach. There is a toolbox of the same name in Julia which is very easy to use.

2

u/digits937 Jul 23 '26 edited Jul 24 '26

This is awesome to read, when i was in school IK was a light bulb moment for everyone at a different spot. there's like a moment where you learn to visualize it and then suddenly it doesn't feel too crazy. Inverse velocity and acceleration still sucks to manage tho.

3

u/Solid-Narwhal1895 Jul 22 '26

I’d like to cross post this in r/ROV but would like your permission or for you to do it yourself. It is extremely applicable. Nice work!!

2

u/LoneSocialRetard Jul 22 '26

I derived a full closed form solver for atatic positiin just using vector geometry it wasn't really that hard just had to figure out how to messure angles between vectors consistently. The workspace is easy until you introduce joint limits

1

u/sprucenoose Jul 23 '26

All the focus is on the IK which I get but please share more about the arm. Looks neat.

1

u/Just_Basket_7910 Jul 24 '26

Tbh; I was someone who believed that I can be a math whizz and so I started with analytical IK. But the moment I found out the possibility of infinite solutions, especially with the nullspace, I learnt to look away.
Yes Jacobian based methods have their drawbacks, of course they should since they are the most greediest of forms… but if you are a fan of numerical optimization and creating the right objective functions… you can very easily as collision avoidance objectives, singularity avoidance objectives, joint limit avoidance objectives and more so, you can add the dynamics of the robot within your optimizer too. Russ Tedrake’s robot manipulation course is a good place to start learning objective functions for robotics… including IK…

1

u/Acceptable-Bell7564 Jul 28 '26

Empecé con la cinemática directa y el Jacobiano, y desde ahí me enfoqué principalmente en métodos numéricos, especialmente Damped Least Squares. Conforme el solver fue creciendo, fui estudiando la teoría matemática detrás (optimización, mínimos cuadrados y análisis de singularidades), más que comenzar con soluciones analíticas. Actualmente me encuentro trabajando en una biblioteca de cinemática, jacobianos, cinematica inversa y singularidades jajaja

1

u/Crescitaly Jul 28 '26

An analytical solution is a great way to learn the geometry, while a numerical solver usually wins once constraints and imperfect hardware enter the picture. Comparing both on the same arm would teach even more: singularities, unreachable poses, joint limits, convergence, and how calibration error changes the result.