Proper IK rigging for 6 axis industrial robot

Hello all blender Champions!

I`m trying to build proper armature for 6 axis industrial robot. Everything seems to be easy in case of FK - all I need is to lock unnecessary axes and control the robot by changing the values of unlocked ones (attachment Armature-Robot-FK).

Unfortunately, using only FK to set the proper location of the last (gripper) bone is very problematic. I finally created one animation using only FK, but I took a loooot of time, I needed to create many key frames and sometimes still it was visible that gripper is not always parallel to ground (LINK to the animation) Therefore I was trying to use IK where situation is much more complicated… (attachment Armature-Robot-IK).

First of all, I cannot use Pole Target for this armature, because it igrones the limits of first base bone (it should rotate only in Y axis)… but without it, armature very often is “flipping” during the robots rotation - even if I set some IK limits for the bones:

Also using last bone as a controller doesn’t work as I expect, because seccond bone is not always parallel to first one in this situation:

My goal to achive is:

  • last two bones are pointed always to the ground (in any frame of animation, without creating additional key frames to correct the position)
  • control the robots by changing position of the last bone (it is easier to change only locations and rotation of Y axis - rest of the bones should follow and keeps theirs limits)

Does anyone know how to rig this robot correctly? I will be very gratefull for any sugestions!

Thank you a lot in advance!

EDIT: I forgot abouit the attachments
Armature-Robot-FK.blend (781.0 KB)
Armature-Robot-IK.blend (803.2 KB)

Not sure the reason for all your bones. Bones 3-4 look like they should only be a single bone. In animation provided, I don’t see any activity there either.

So, then:

Rather than forcing the last two bones to always be parallel, we parent them to the ik target (then copy location from 3’s tail) and then don’t rotate the ik target to not be parallel. To enforce this, ikt is an YXZ Euler with rotational transform locks.

My bone 4 (your 5) is actually parented to the final bone, rather than participating in IK, and uses a locked track -X to face the right direction.

There are no angle limits, only IK angle locks. All bones in the IK are limited to a single axis. No pole target-- we don’t need one. There’s a root bone, but it’s not going to do anything to affect the IK, because the IK structure is, as far as I can tell, fully defined, given the built-in bend preference: there’s only ever one or zero solutions to the IK.

When we disable the IK constraint, to animate FK, the final bone remains parallel as we animate other bones, because it’s still inheriting rotation only from ikt, regardless of the constraint, and ikt can’t be rotated out of parallel. If you want, you can treat it like ikt, transform locks with YXZ Euler rotation mode to lock its rotation as well, but I didn’t do that in the file:

robotik.blend (866.9 KB)

In general, use of angle limits will increase IK twitch rather than reduce it.

I strongly recommend dividing deforming bones from controlling bones as a general practice. There’s no need to use your deformers as controls, and you can get much nicer rigs once you embrace that idea.

3 Likes

robot_arm.zip (2.3 MB)
first place bandages.

here is my approach

some

test_locomotion


its possibel to controll with the main,
i would for anmation recommend to use the first bone for z-rotation.

2 Likes

Thank you a lot bandages and walt1! You saved my time… and nerves :slight_smile: I need to once again analyze the possibilities which give us basic constraints. I was too focused on the armature.

The original construction have that axis too. But it is true that it is in use very rarely. Nevertheless i added this bone for future projects - maybe some day I will use it.
image

So why we need root bone at all? And why IK bone in walt1`s solution is parrented to root and yours IK bone not?

Do you mean not use it in IK and set the angle manually? Will it prevent armature from flipping?

A added also corrected armature.
Armature-Robot-IK-Corrected.blend (805.3 KB)

this setup looks stable i guess flipping will not happen,

when the arm moves from position a to b you will get a nicer motion when rotating
the center-bone(only z-rotation) its possible with the ik.ctrl but then (i know its a roboter) the movement will not look so “natural” (moving in arcs)

test_locomotion02

robot_arm_animtest.zip (2.3 MB)

1 Like

If you want to skip the root, you can. I’m in the habit of putting an explicit root in every armature.

You can do it either way. It just depends on how you want the IK target to move. If you want it child-of’d to track some other marker that exists outside the armature, while also animating the base of the structure, you’ll generally want to move the structure using a root (or bone1 is fine here) rather than the armature object, and you’ll want to keep ikt unparented, because child-of happens after inheriting any parent transforms.

That’s just the structure that I like, but yeah, there are a lot of other ways to do things, and they’re mostly fine.

Edit: NM, you can’t really manipulate the structure by bone 1, because IK angle locks prevent you from rotating its locked axes. You can still rotate the whole armature as an object, but I don’t do that-- one reason is what I mentioned with regards to the ik target, you want ikt to be unaffected by any animation if you want to child-of it. So this is maybe a good example of why I’m always in the habit of making an explicit root bone…

When i use only IK bone, the arms are fliping in some positions.

But when I control the rotation by changing the angle of the root bone, everything looks smoth. I only need to remember to set the same angle in the root and IK bone

Once again thank you for help! :slight_smile:

I am sorry for the flipping, it does not happen here,

I do not understand the reason for animating the rotation,

why do you do that?! so that the captured object syncs to the rotation(root)

if so you can use a driver to automate the rotation.

Ok. At strong angles, it’s trying to minimize the bend of all bones, so it’s accepting a different bend of 2 and 3 to minimize the bend of 1. Guess it’s not a single solution system after all.

You can fix this by increasing the stiffness of the Z axis rotation of 2 and 3 to .99 in properties/bone/ik:

After that, it’ll always prefer rotating 1 whenever rotation of 1 can help it meet its target. And it will no longer want to spin 180 degrees to be able to reach far targets. You will still have twitch if you move ikt directly through bone 1’s Y axis, but that’s not something you should want to do anyways.

robotik2.blend (868.6 KB)

1 Like

During normal work of the robot, when it grab the product (for example cardboard box) and need to transport it somewhere but without rotation, it is necessary. That way you could eliminate unnecesary inertial forces.

WOW! Thank you bandages! I would never have figured it out on my own… at least at current level of my blender knowledge. :wink:

Guys… I need your help again I hope for the last time in case of this armature.

I have created separately FK rig, IK rig and controller to switch smoothly between them. In bones 2-4 I used transforms constraint, in 5-6 copy rotation. Unfortunately bone 6 is changing their rotation not only in required Y axis (visible on movie below).

I am so close to creating a working and universal armature for 6 axis robots but this last thing is still bothering me.
Armature-Robot-IK-Corrected-v2.blend (1.8 MB)

Well, there are issues with 5 and 6-- you have to ask, is local Y really the rotation you want to copy, and copying single axis rotation is a pretty dangerous thing to do anyways-- but I’d say your issues go deeper than that. Let’s look at all our layers, halfway through the transition you’ve keyframed:

Notice all our axes. Like, FK4’s X axis is pointing away from the camera, IK4’s X axis is pointing towards the camera. So this transition means your bones are rotating through a whole 180 degrees. Your FK position isn’t going to look good, but your transition especially is going to look awful.

What you really want is to do the whole FK/IK transition over a single frame. You’d keyframe constraints and loc/rot, advance a frame, snap FK to IK, disable constraints, and keyframe constraints and loc/rot. The tough part of that is snapping FK to IK, where if you want it to be reversible, you need to do some scripting. (Otherwise, there’s a dependency loop, even with 0 influence constraints.)

But in this case, the rig that I offered earlier is simple enough that there’s no need to snap. The structure works fine with direct adjustments to the IK influence.

When you want to switch to FK: Keyframe visual rotation on all bones in IK chain. Keyframe IK constraint influence at 1.0. Advance one frame. Keyframe visual rotation on all bones in IK chain. Keyframe constraint influence at 0.0.

When you want to switch to IK: Keyframe rotation (visual or otherwise) on all bones in IK chain. Keyframe IK constraint influence at 0.0. Snap cursor to your bones 6 or 5 (because they are at the tail of your IK constrained bone) and then snap ikt to cursor and keyframe the location of ikt. Advance one frame. Keyframe IK constraint to 1.0.

If you do things that way, you don’t have to worry about your bones 5-6. They do what they always do, which is remain aimed at the ground, rotatable only in their Y axis, and never under the control of IK to begin with.

You are completely right but in some cases (for sure future projects) I don’t want them to point to the ground but follow bone 4 in rotation, for example to achive some weird position like on my animation above (bone 5 should then behave like normally parrended and connected to bone 4).

Let’s say that I can control the position of the head of bone 4 always by IKT (it is perfect), but when I rotate bone 4 in Y axis, I want bone 5 and 6 follow the rotation.

If I’d known you wanted that, I might have done things a little differently, and I’d be careful of thoughts like,

because I think one of the principles of good rigging is to rig for what you’re going to do now, rather than trying to build an uber rig that can do anything. (When you build an uber-rig, you build tons of unnecessary complexity into the rig that works against the main purpose of a rig, which is to simplify operations that we do on meshes.)

But if I wanted to take the last file I linked and do a quick modification to it, to permit manual control of its bone 5, I might do something like:

  1. Duplicate bone 5. Parent the duplicate to bone 3.

  2. Give bone 5 a copy transforms constraint targeting bone 3.

  3. Animate the influence of that copy transforms constraint to switch between manual control (from the duplicate) and automatic control (in line with armature’s axes, inheriting rotation from ikt.)

Note that since I’m talking about the rig I uploaded, those are my names, not your names that include an additional bone in the chain.

I would not make any changes to bone 4, because bone 4, even with all that direct control, is determined entirely from bone 5 and bone 3, and there’s nothing anybody would reasonably want to do to control it more manually than that.

1 Like

Hi again,

as I said before, now for other project I want to build a rig where I have full control of the last bone (where the robots tool is connected). I mean that I can change the loc/rot of last bone and rest of them will follow the bone at the same time keeping their IK limits. In this case last bone can also be a target (since this bone will be defiining positions of others). It will allow to generate easly more complex movements of the robot (for example the last bone which is following the path in case of welding processes etc)

In bellow attached rig we have above situation. The only problem is that I cannot add constrain which will force bone 5 Y axis to be always in line with bone 6 (target) Y axis.

@bandages I have already tried to modify your rig propossal but it doesnt work correctly in case of keeping the limits. I have tried with damped track, lock track constrains but without sucess.

Robot Rig -6 axis - Full IK.blend (775.3 KB)