Crankshaft animation

Okay.I really want to understand what’s happening here…

Think of a crank, rod and piston combo built from an armature. The crank journal (an empty parented to a rotating circle) rotates around the X axis (producing Y & Z movement), one end of the rod (parent bone) rotates position around the crank center, and the other end of the rod (parent bone) moves linear along the Y axis.

The annoyance I see is with the piston (child bone) that is supposed to travel linear on the Y axis and nothing else. It is drifting up & down (slightly) along the Z axis in response to being pushed & pulled by the rod (parent) bone. I’ve tried limiting the child bone’s travel to the Y axis only, but it still moves up & down. W=0 on everything. Auto IK and deformation isn’t on.

What am I missing? I’m not about to render a steam engine with rubber bearings in it :frowning:


Ah, the rigging of a crankshaft…

Please note 2 things, in this method the rod bone has a stretch to constraint on it. It does actually stretch, causing the rod to stretch, which is impossible in real life. However, when an animation is playing, the stretching is so small you would need to pause playback and use a ruler on the screen to actually see it is stretching. 2nd this only works if the model is vertical bacause of the limit location constraint on the piston. To overcome this, rig the model so it’s vetical, set the constraint to ‘pose space’ instead of ‘world space’ then rotate the armature in object mode.

Also, MCollet I think has a tutorial on this site somewhere that uses IK constraint, works at any angle you create it at without having to adjust it, and the rod doesn’t stretch. Should be able to use the google search box at the top of forum to find it…


That’s one of the tutorials I referenced in putting this together. I didn’t find that info by Mcollet that you’d talked about, but I did manage to click around till I got most of 90+% of the weirdness stopped. Combining the IK stuff with normal constraints seems to have gotten it looking more like it should :yes:


If you’re still having problems, post up a .blend and I’ll look at it. You could also search for user name and try MCollet, perhaps getting his name and pm him for his info.


That sounds like this one;).

Best wishes,

This isn’t the precise file, but it does show the action I’m talking about. Top view, click play & watch the child bone expose the X axis red line underneath it as it travels along the X axis. Auto IK on or off, it doesn’t matter…from 2.56 & Ubuntu 10.
crankbones.blend (423 KB)

I’m gonna monkey with adding a stroke bone like Mcollet’s page suggested :smiley:


Took a look at the file, not really sure where the specific problem is that causing your problems. Actually I think the main problem is over-complication. You are using 8 constraints, 3 empties, 2 bones, and a circle. By comparison, my setup uses 5 bones and 2 constraints. In your setup, if you go into the armature bones panel, scroll down and turn on ‘axis’ display for the bones, then hit the ‘rest position’ button, both bones rotate 180 degrees around their y-axis. Rest position does exactly what it’s name implies, forces the armature into it’s rest, without any constraints affecting it. So that tells me somewhere there is a problem with the way the constraints are setup. I didn’t sort thru all of them to figure out which one(s) could be causing the problems, because at that point I decided it was way to complex for all the more it was doing. Some of the constraints could be fighting others. One thing I noticed, if I turn off all 5 constraints on the 2 bones (by using the eye icon on the constraint) they all point the exact opposite direction in top view. Turning them back on and they don’t return to the position they had initially. So yeah, there’s a problem somewhere, but like I said, too many things to sort thru to find the problem for all the more there is.


Oh, I know that file is overly complicated. I left the big batch of constraints there just to show that no matter how much effort was put into making that child bone slide where it was supposed to, it just wasn’t interested in staying there. You can lose about half of the constraints & still get the same motion from it. I just wanted to know the broader underlying concept of “why it’s weird”…not that I was interested in someone fixing it. I’m still learning…

Anyway, don’t worry too much about digging through it to sort it out…it’s more of a curioisty point than anything…

Oh, and thanks for the help by the way. My day gig is being an audio guy, just been exploring the whole 3d thing some to see if there’s something I’m missing :slight_smile:


Yes, you need to simplify things. Greatly.

  • The crankshaft will be cued to rotate, and the various objects will move under its influence.
  • Put an Empty squarely in the middle of the crank, at the point where the piston rotates.
  • Put the object-center of the connecting rod at the piston end of the rod. Cause the rod to “point to” the empty (in one axis). Parent it to the piston.
  • Cause the piston to track the empty, in one (local) axis only. Thus, the piston’s movement is linear.

As the crank turns, the piston follows the Empty’s movement, say in the X-axis only. Meanwhile, the connecting rod, which is also moving because it’s parented to the piston, is also continually pointing itself toward that empty. The two effects, combined, produce the reciprocating motion desired.

Mind you, these constraints don’t represent “what happens in real life.” But, “this is not real life, so we don’t care.” Our objective, as it were, is to keep up with appearances.