1
$\begingroup$

I am trying to create a mechanical cam and cam follower assembly. A closed loop path is parented to a rotating disk. One end of a cam follower arm pivots at a static hinge location. The other end of the cam follower should follow (or slide along) the rotating path as the rotating disk rotates.

My problem is that the Cam follower part does not track to the rotating path. Any thoughts?

The disk, Base and Cam Follower are all Rigid Bodies. Each Rigid Body has a collision setting for shapes as "Compound Parent". That is, they are parented to individual basic geometry that make up the actual Rigid Body parts.

Here is a link to the blend file: https://drive.google.com/file/d/1i-kg3RCK7WFSifEX5Swcq3ZUgnliPf__/view?usp=sharing

enter image description here

$\endgroup$
6
  • $\begingroup$ do you really need a rigid bodies simulation..? I guess it can be done with regular constraints $\endgroup$
    – alambre
    Commented Mar 6, 2022 at 15:53
  • $\begingroup$ This drive mechanism is part of a larger assembly that will need rigid body constraints. The goal is to simulate the physics of a real mechanism. $\endgroup$
    – Jack Peach
    Commented Mar 7, 2022 at 11:15
  • $\begingroup$ Hi @Edgel3D, your two demo videos look great and they are very close to what I'm looking for. ... I work in consumer goods with a background in electromechanical systems. I am always looking for ways to simulate systems to pitch new ideas and roughly prove out mech. features. I use Solidworks, but Blender too. In this case, the cam mech. drives a toy horse's legs. The horse walks around virtual environment in Blender. The cam mech. provides the path for the leg action. $\endgroup$
    – Jack Peach
    Commented Mar 11, 2022 at 11:56
  • $\begingroup$ This is the latest blend file that is close to what I want. There are actually three different demos going on in this file. Two rotary to linear motion and one cam follower attached to the offset hinge (the one I really need). You'll see that the cam follower part doesn't entirely match up with the rate/location of where the cam follower should be: drive.google.com/file/d/1f-CA3jO7LQMc5Va2ltmNrEPfG36iOsOQ/… . And here is a ref. image: drive.google.com/file/d/1PWvWQCTjgZRUShuo5Lk5Td7t4S7dpYzS/… $\endgroup$
    – Jack Peach
    Commented Mar 11, 2022 at 12:00
  • $\begingroup$ @Edgel3D, can you please share the blend file that you are demonstrating in the video? Many thanks! $\endgroup$
    – Jack Peach
    Commented Mar 11, 2022 at 18:35

1 Answer 1

0
$\begingroup$

I'm using vers 2.77 and cannot load your Blend file. However I'm hoping this might solve your problem as the solution is fairly universal. You may need 2 cam & path followers depending on the toy horse.

You also mentioned physics would be required on some components, so it was attempted that way initially including a RB hinge constraint but inertia comes into it then and and some bouncing occurs at sudden cam changes. This is despite increasing the blue lever's mass and/or moving the RBC's point (empty) back from the lever. Blender after all is an animator and ideal for producing presentation video, but it's no engineering tool.

The solution below abandons the physics engine entirely and the end result is clean and reliable tracking.

Note - there are 2 followers. an invisible rectangular Empty on the path itself and named 'Path Follower', and a 2nd, the yellow cylinder, named 'Cam-Follower'. It's easy to confuse the two.

The Path-follower (the original path object) follows the path's perimeter. The yellow Cam-follower, a cylinder, is parented to the former.

Because the (yellow) cam-follower's outer vertice is set as it's Origin Point, and that in turn parented to the invisible Path follower, (the rectangle Empty) the (yellow) cylinder is automatically held (more or less) against the cam-path's perimeter. See the last 2 pics below.

-==========-

From the beginning -

Shape the cam by deforming a mesh circle and convert it to a curve. Give it path properties.

With the cursor at the path's Origin Point, add an empty. Give it a 'Follow Path' constraint so it will travel around the path's perimeter.

Keyframe the path's rotation one full revolution. Give that 'Linear' interpolation. (more on that below)

When played the path-follower will want to track the cam's shape accurately, but as the cam (path) also has to rotate, things can get sticky.

The Empty will want to orbit some pivot point. Even when that's fixed, it may also deviate forward and back a little when encountering the cam's deeper contours.

The answer to both problems is to bake the (invisible) path follower's actions and -

  • Remove it's 3 'Rotation' strips in the Dopesheet.

  • Remove the Z axis & deviating axis' strips. (the X axis deviates)

  • As no scaling is involved, remove those 3 strips also, leaving just the one Transform (Y) axis.

When played, all should return to normal with the cam and path-followers held to the one motion axis and tracking as they should.

As you no longer need the curve, it can be converted to mesh - That's done by firstly using a plane converted to a curve and that used to 'Bevel' the path. (cam) Beveling produces an accurately shaped rectangular pipe - a duct of sorts, and importantly with uniform thickness.

Scale the Bevel Plane and that will scale the duct uniformly until it's dimensions aren't bloated or too thin.

Convert that to mesh. (That's ALT-C for me)

It's inner (or outer) vertices are then removed so you end up with cam shaped walls but no top or bottom. (like a vertical cylinder without end caps) Go to Edit mode and fill those in.

You could try scaling that so it's up against the yellow cam follower but scaling can deform the shape and thickness some, so using the Graph Editor is recommended.
Simply bias the yellow follower's only remaining axis keyframes. (Select all keyframes in that axis (ONLY) and use G Y to drag them up or down so the follower is against the cam's walls)

That's about it for the cam follower and cam...

-===============-

As things stand some small tracking errors may still be apparent but mostly when viewed from the Top in Ortho Mode. Whether these errors are worth pursuing will depend on what it's for and the camera angle used. The graph editor's handles or additional keyframes will eliminate those.

Path Properties -

All evaluation keyframes should be Linear interpolation. This is also necessary for the path's rotation.

For absolute smoothness between last and first frames when looped, the path's rotation should be set to 360 degrees over the required number of frames + 1. (250+1 = 251) The path's total frames should also be set to this. The final evaluation frame also. (keyframe the evaluation slot)

Play it at least once and step back one frame from the last. Keyframe that ROTATION angle in the 3D window.

Set the animation (or loop) end-frame to one less, (250) so frame 251 is never played.

-==============-

Making the blue arm lean against the the yellow cam-follower -

A single vertice on the (yellow) cam-follower's surface that's nearest the (blue) arm's surface is to be the parent for an Empty, and that in turn is used as a target for the lever arm to 'Look at'. ('track-to' constraint) That's what holds the arm (without bouncing) against the follower as though with a spring or gravity.

Note - the (blue) lever arm's origin point (hinge) is set to the same surface as that which sits on the (yellow) follower.

$\endgroup$
4
  • $\begingroup$ Hi @Edgel3D, your solution is the cleanest I have seen/tried that keeps the Cam Follow Arm (BLUE) on the Cam Roller (YELLOW). ... Lately, I have been experimenting with combing path driven/animated action with Rigid Body objects and have had success. I'm still working through many different steps to get something worthwhile, but your input is very helpful. Thank you very much for the insight and good solution. ... I'll be sure to make an update to this post once I have updated my model. $\endgroup$
    – Jack Peach
    Commented Mar 15, 2022 at 18:07
  • $\begingroup$ Glad to hear it went well in the version you are using @Jack Peach . I enjoyed exploring your idea of tracking a rotating path and upvoted your question some days back. Further to that I would imagine that drivers and/or constraints could drive the horse's legs (bones) at each side of it's body. A common 'Master parent' would glue it all together when the horse was to move around a scene. Good luck with it all. $\endgroup$
    – Edgel3D
    Commented Mar 16, 2022 at 2:13
  • $\begingroup$ PS to the above - A successive chain of constraint/modifier/parentage use can often get sticky and unpredictable. In those instances I keep things modular. This might also help - blender.stackexchange.com/questions/189665/… $\endgroup$
    – Edgel3D
    Commented Mar 16, 2022 at 2:14
  • $\begingroup$ I like the solution of baking frame regions and will give it a try. The right sequence of deleting, baking, saving new physics collections, resetting physics parameters and adjusting other settings when running physics can be finicky and frustrating since many different results can be produced. You'd think it would be a "linear" physics system... but over time, the same inputs can result in diff. outputs. I'm still new to it and learning, but it is a very powerful tool. Thanks again! $\endgroup$
    – Jack Peach
    Commented Mar 17, 2022 at 11:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .