Rigging mechanical mechanisms with play

Hi trying rig a mechanical mechanism were a rod (green part) is pushing a pin (red).
The joint between the two parts have a fair bit of play and the pin should only move when it’s being “pushed” by the rod. Here’s a keyframed animation of what I’m trying to achive with constraints:
2023-11-24_10-22-37

I’ve played around a fair bit different constraints without sucess. For example using the limit distance constraint, I get unwanted effect were the pin spring back to it’s original position:
2023-11-24_10-06-19

Any ideas how I can solve this without keyframing or using the physics engine?

The difference between your top and bottom anims is that in the top anim, the position depends on what happened last frame.

You can never get what happened last frame with constraints or drivers alone. You can get it with physics, with GN simulation nodes, with a script designed to cache the previous frames, with making the animation and then doing some copying and translation of it. These techniques all have something in common: they don’t update live-- basically, they all need to be baked.

2 Likes

You can do this sort of thing with some Floor constraints.

Sample.blend (1.1 MB)

Or use RBF nodes addon from brave rabbit (Google that)

2 Likes

My first sample has the issue where the dot will travel back to it’s rest position without being ‘pushed’.

Here’s an update that will address that, but needs a little manual intervention when you change direction.
Sample2.blend (1.1 MB)

If you enable the Animation: Copy Global Transform addon, you can copy the location of the Dot bone, and paste it onto Dot_parent when you change direction from one of the extremes.

1 Like

I have a version of this with a script to remove the manual step, and automatically move the Dot_parent location after each frame change. I reset it back to (0,0,0) on frame 1, otherwise it can lose it’s starting point if you scrub around the timeline.

Sample3.blend (1.0 MB)

The script is very specific to the names of things in the sample file. So use it for ‘inspiration’, rather than dropping it in as-is.

1 Like