Limit Rotation of an Object with IK Tag

Hi,

I’m trying to rig an IK mechanical arm with parts either rotating forward or twisting but not both.
The problem is IK rotates all object’s axis to arrive at a point, which gives an unexpected behavior.

You can see an illustration video here:
https://www.dropbox.com/s/6xk4nek2j1ai7m4/c4d139_limit_rotation_in_ik.mp4?dl=0

The one with green line is the IK set-up. The other is an FK set-up with intended behavior but I would prefer the IK set-up.

Of course, I wouldn’t expect the IK-setup to have the perfect solution but I was hoping I could get close by just limiting the rotation axis of objects affected by the IK.

Currently, I can’t orient/rotate constraint the objects/joints, affected by the IK.

Is there a way around this?

Unfortunately, the way around this is to write your own IK solver which actually works. Maya’s iterative IK, and the way it’s setup in nodes in general, is pretty rubbish, and this is one example - I’ve struggled with exactly the same thing, and as far as I know there is no way to suddenly make the basic solver aware of joint limits, joint weights, degrees of freedom etc.

1 Like

That was what I feared for (i.e. write your own IK solver). As that is beyond my current skill set.

Anyway, thanks @EdArt for the confirmation.

In terms of limits and degrees of freedom, you might not be able to limit the solver. But maybe you can try reading the isolated axis of your choosing, and use that as a driver for a secondary chain. You can often extract the info you need. The actual solver chain would just be a measuring puppet of sorts.

And whatever you are driving can be limited, clamped, remapped, etc.

1 Like

RE: But maybe you can try reading the isolated axis of your choosing, and use that as a driver for a secondary chain. You can often extract the info you need.

On one of the rough draft, I tried this. But apparently, the end result (isolated axis) didn’t match the position of the IK goal in the IK system.

I guess it required more than isolation like perhapse and “if else” behavior. Unfortunately, the logic escapes me with a chain exceeding 3 joints.

I didn’t mean that was the solution to your problem, on its own. Driving one axis from 3 wouldn’t end up with the same result. That’s what I meant by a “measuring puppet”. I was just replying to the idea that the only way to limit a solver is to write another solver.

That is just a general way to extract info from more complex info, like extracting the forearm twist from a hand controller, for example.

1 Like

@clesage

I followed your suggestion of it being a “measuring puppet”. Works so far for what I needed

So far, notes and limitation are the following:
1a) Two joint chain. One is the puppet joint chain (with IK). And the other joint chain is just a typical FK that is constrained to only one rotation axis of the puppet joint chain.
1b) Only three joint in a chain. More than that gave some unpredictable result
2) The base of the joint is rotated (or aimed to the controller)
3) The pole vector (positioned at the top) is position constrained (except Y) to the controller.
4) The IK joint chain does not math with the typical FK joint chain but it is close enough.

The 2 and 3 ensure that the IK is planar in all cases and doesn’t twist the end only bend. So even though its "Driving one axis from 3 ". It still works since the other axis only has little to no values.

Thanks again for the response. Have a great day ahead!

Hey, so sorry my answer was a bit sparse on this - @clesage is totally right in that for linkages, masking out certain axes from constraints and Ik joints can get you close to the desired behaviour, and if you’ve found a solution that works for you, fantastic.
The only reason I would go against this is that if you need a true inverse kinematic solution, deterministic constraints fundamentally cannot deliver it. Iteration and awareness of either immediate neighbours or the system as a whole is required.
The exception to this is a linkage where a fully analytical solution is known, such as this example https://researchspace.csir.co.za/dspace/bitstream/handle/10204/4944/Claasens1_2010.pdf?sequence=1&isAllowed=y - in this case, it is possible to control the system with a single iteration through a node graph, but it isn’t easy to set up.

1 Like

@EdArt
Just had look at it and indeed its beyond my current understanding. But its definitely a handy future reference.

Thanks for sharing!