Cams and Cam Followers

Hello Chaps - & Chapesses!

I have been tinkering with an engine model and have managed to arrive at a possible solution for driving cam followers and valve gear from a rotating cam. My solution is not elegant or precise, but it works. I wonder if anybody has a better solution to the problem? For example, can you use Physics to keep the cam followers running on the cam? I know I can duplicate motion for some of the engine valves, in other words I don’t have to make profiles for all the cam followers, but it would be nice to make it a little better.

I should appreciate any help, criticism, thrown brick-bats or whatever to find a more efficient solution.

As ever - here is the blend file:

http://www.pasteall.org/blend/33118

Just press PLAY to watch it operate.

and the piccie:


To me, physics sim has overhead. So unless you really need it, it tends to be a rather slow way of doing things.

Hmmm… I think this is something where I’d keyframe rotation of the rocker arm, then use the cyclic F-curve modifier to indefinitely repeat what has been keyframed. Duplicate object containing that animation (so animation gets duplicated with it), and go back and adjust the phase offset in the F-curve modifier of each copy so it properly follows in synch with the next cam down the shaft.

I think that’s about right. (Tied up in doing a render right now, so I can’t test at this very moment.)

Of course there’s likely more than one way to do this. If controled by bones, NLA editor or action constraints + some fairly basic drivers could be options too. This way would allow you to base animation on a (rotation?) property rather than the timeline.

Thanks - I have never played with f-curves, but have used drivers here. I have an empty rotating the cam shaft and this drives the two bezier curves near the first two rockers. I then have a icosphere tracking each curve through the curve modifier and empties parented to these to give me something to track a bone to. There are then bones parented to these “tracked to” bones, which move the rockers and operate the valves through an IK constraints and “stroke” bones, with all three IK axes locked and stretch enabled as 1, to keep the valves moving only in the Z axis. The valve set on the right copy motion from the left set. So I think I am there with the principle - I just need to know how to translate this into a a “cyclic F-curve modifier”. I used a frame-tied driver expression to rotate the cam shaft empty - (((frame - 1) / 50) * 2 * pi) so it rotates one tun every 50 frames starting at frame 1 and (((var / (2 * pi) ) * 25) * -1) to drive the bezier curve where var is the y rotation of the cam empty. The second beziers curve has a phase shift of 1/4 of the first one’s travel. I have left these in expanded form so I understand the maths behind them. The valve springs have drivers as well, using one third of the z value of the valve bone, as there are 3 iterations in the “screw” modifier used to make the springs. Presumably if I keyframe the rotation of the rockers, I can also keyframe the movement of the valves and springs - he said hopefully.

Could you let me know how to get started with f-curves and their modifiers please, perhaps a simple example in a blend file? I have read the manual pages, but have to admit I dd not entirely understand it. This is probably due to my age, being old enough to have gone to a Grateful Dead concert in my youth!

Eureka! I think I have got it. Enclosed blend file should show 4 armatures working 90 degrees out of phase to each other for four cam actions - I will build the rest and see how it looks. Please shoot me down in flames if I got it wrong. The bouncing twisting ball and cube is just me playing with Drivers and Keyframes.

Here’s the blend:

f-curve.blend (510 KB)

PS. I will use armatures as I think that’s the only way to synch the valves to the rockers correctly.

Heres a file with a cam and follower: http://www.pasteall.org/blend/33135
First I animated the cam to rotate with linear interpolation.
Then for the follower, for each 5 frames I keyframed the Y location.

The cam extrapolation is linear, so this animation will repeat.
The follower has a cycles fmodifier to repeat the animation.

I find the easiest way to rig this motion, is to use an Action constraint.

First, set the time cursor to frame 0, then in the Dopesheet Action Editor, press the F button on the action browser, for both actions, to set a Fake User.
This will prevent blender from deleting the action, for when it has no users. Then unlink the actions by pressing the X button.

Add an empty to the scene and put it somewhere convenient for rigging.
For both the cam and follower, add an action constraint.
Set the Target to the empty, select the correct action.
Set Target Range to something like 0.000 to 1.000.
Set the Action Range to the frames of the action, 0 to 100 for this example.

The object may jump a bit, so you may have to reposition them.
Heres a modified example: http://www.pasteall.org/blend/33136

The cam and follower should animate when moving the empty in the X+ direction.
To repeat the animation increase the Target and Action ranges.

This can also be setup with drivers, its just easier to keyframe actions, by moving objects then inserting keyframes.
Though if you can generate the correct curve for the follower, that may make it easier to use drivers.

The rotation could also be done with armature bones.

Thanks Dirty-stick - I will download the file and get my head around it tomorrow - it’s bed time in England!

Thanks for yours and Pauljs75_'s help.

I have a reasonable solution based upon what I thought Pauljs_ had written - I will upload it tomorrow to this comment.

Update

Here is my effort - the engine parts aren’t really the best but the principle works I think - next stop a proper engine!

http://www.pasteall.org/blend/33152

Just press PLAY - cheers and thanks again for all the help, Clock :o

Here’s the pic:


That’s pretty cool! Are you drawing it so big to help with physics?

It’s all done with Drivers and F-curves, no Physics as I have not looked at this aspect of Blender. I draw big to get high levels of accuracy. Someone told me you cannot make accurate models with Blender - I disagree, but I found I need to make things quite big to get the accuracy I want. As an example, the Cam Pulleys are 16 units diameter. Thanks for your kind comment.

I think we can mark this as solved now - How do I do this? I cannot find anything to click on :no:

Here is the pushrod and side cam version, just what I need for my old tractor transmission model:


Once again thanks for the help. :smiley:

It’s been 4 years?

Anyhow I thought it might be worth revisiting the idea for this since it’s likely to come up in searches…

And some changes since… I don’t think the shrinkwrap and floor constraints were available for bones when the subject of this topic discussion was last worked upon.

I know I mentioned some other driver based methods earlier, but I think this rig with bone constraints may be easier. Everything happens by rotating the cam. The rig uses three control bones with the shrinkwrap bone constraint in projection mode to keep the proper offset of the cam follower from the surface. The bones are put slightly below so projection keeps them on the bottom cam surface. The cam follower then is made a child of the center bone, along with having a floor modifier in reference to all three control bones to maintain proper offset. Surprisingly this works fairly well with no driver calculations or excessive manual keyframing needed. Only adjustments are spacing of the 3 bones and offset on constraints in relation to the cam and follower shape. Also you might be able to just get away with one follower bone if your cam and follower are closer to round in shape, the leading and trailing bones are there to help with interference in profile shapes.

1 Like

Hi my friend. Sorry I didn’t reply sooner, up to my arse in aliggators!! I will look at this later. I have used shrink wrap cons on suspension systems, so this should be a good solution.

Cheers, Clock