Anyone PRO in blender drivers? Please help

Hey everyone) I’m working now on project with pulleys and rope animation.
More specifically its a Tide Prediction Machine so I have a bit of a problem here with pulley rotation, which is needed to be rotated to the exact degree back & forth, please see animation below


This animation is pretty good except that pulleys are not rotating!

So basically what would be great to achieve is to rotate EACH pulley to specific angle depending on friction with the rope, or somehow use drivers to rotate this value (see video below)

and variable to the pulley can be Hook that is empty object used to control the rope movement at each pulley points (screen below)

Anyone with good knowledge of drivers, please help to figure out how to achieve the final result
I’ve attached blend file, so you can play around and test it (its pretty heavy, sorry)) and I used Blender 3.0)
https://drive.google.com/file/d/1Voi-JxIU0oFY4utjqPBzpeMV75uTYDIW/view?usp=sharing
Thank you!

1 Like

Nice setup on a first look: the discs O1 is driven by frame/value and the bolts are driven by parented to them and their position is used with a copy location constraint…to ‘lift’ the pulleys…
So now the ratio of the rotation to the normed circumference rot/(2*pi) is the same as the difference in height to the puleys circumference dif_height/(pi*50cm) (if i did measure correctly) (or something like that, just a quick thought)…
But you don’t have the height yet because you are getting them from the copy location constraint (and don’t has the initial pos… in particular if changing the radius of the ONKP12 pulleys )… so if you wanna make this universal and for the other NMKP12 pulleys the position change shoulde be also calculated explicite from the rotatry motion of the bolts to the height (sin or cos of rotation)…

On the other hand i think i don’t get your setup yet at all while trying to calulate the bolts position of O_1 because it’s all parented to the object O_1 which… have to think about it…
(duplicating the Bolt sphere3 and unparenting it from Cylinder.006 gives a y poistion of -149.18cm while C6 has -50cm but is lower??? ohe yes becasue it’s parent is dummy O_1)…

[fiddleing over 1h now…PAUSE]

1 Like

This was given me headaches :frowning: …i don’t know?? Do the parenting of the object modify their previous positions ?? Because i would model every object (/part of the machine) in a neutral position (the bolts which are defining the size of the amplitude maybe with an unvisible center behind the machine??)… anyway i tried on a simpler version and for the first disc driven piston machine thingie… i even parameterized the rotational speed… (dummy M-p on Z=-12) Next challenge: make this a group (?) which can have different rot speed and level length aaannnddd adding initionl movement of prevous machine…Machina001.blend (150.3 KB)
(Using 2.93.4 on debian-linux)

Thank you for sharing your thoughts) the machine setup is great, however its still not clear how it will behave with several pulley system (3 or more) cause when one of the machines goes up some might go down and move the rope to opposite direction, so basically what rotate each pulley is friction with rope (in physical world) but how to simulate this in blender? rigid body maybe?
Here is the clear example on how it should behave (simulated in java, but Im not good in code)

Here is the link: http://www.ams.org/publicoutreach/feature-column/fcarc-tidesiii3

Anyway you definitely understand this better than me)) I’m just trying to make it look as realistic as possible.
Thanks

OK, I think we need to look at this from a different angle, no pun intended…

Let’s start with a simple setup, some points to note:

  • The left hand end of the rope is fixed in space.
  • The right hand end of the rope moves as affected by the movement of the three pulleys.
  • The rope must not change in length.
  • The pulleys rotate by the amount of rope that is passing over them.

So, the right hand end of the rope’s movement can be expressed as “the sum of the movements of the three pulleys” So in this case add together the delta transforms of the bones moving the pulleys and the vertices of the rope wound around the pulleys. Therefore the driver for this rope end will be based on three variables, the position in Local Space of the three pulley bones. it is therefore:

So it is the net result of the movement of the three pulleys! Note that the effect of pulley 2 is negated (multiplied by -1) since this pulley is at the top, so has the opposite effect of pulleys at the bottom… It lowers, the rope gets longer at the free end, the others shorten the free end of the rope if they lower.

The rotation of the first pulley in the chain is driven by the amount of rope passing over it which can be expressed as the linear height change of pulley 1 (left one) divided by the radius of the pulley. All rotational drivers work in Radians in Blender and there are 2 * pi radians in a circle, so the driver is this:

The radius is multiplied by -1 to get it going the right way…

The rotation for the second pulley is determined by the combined linear movement of the first two pulleys, they fix how much rope is passing over it so the driver is this:

Note again that the variable associated with a pulley at the top is negated.

Pulley three rotation would therefore be this:

I hope this makes sense!!! It is far easier with systems like this to use an Armature and Local Space for a bone, rather than trying to work out where parented objects are in World Space, that method requires you to do a lot more fiddling around, rather than simple stuff done in Local Space.

Inevitably, you will want a blend file, so here it is: pulleys.blend (1004.0 KB)

It was done in Blender 3.0 on a Mac btw. You can just run, or scrub the animation to see how it behaves. Your task is to extrapolate this onto you much larger model… Don’t forget the formula for Radian Based Rotation of an object, which can be defined as: “Its linear movement divided by its radius”. Conveniently for us Blender users, all Drivers work in Radians although they may well show the rotations the Transform Boxes in degrees.

Im’ happy to answer any questions you may have on this. Just throw beer/narcotics/loose women my way by way of a bribe.

Cheers, Clock.

Edit:

Shit! or words to that effect, the driver for cylinder 2 should be this:

(var_1 + (var_2 * -1)) / 1

So it also goes the right way… :rofl: :rofl:

Revised Blend File: pulleys.blend (1004.0 KB)

Its obviously too sober when I posted first time…

2 Likes

Ahhh more data :slight_smile: ohh and i wanted to pause again :frowning: … i did some quick measure in your file… and did this rotational and level distance parameterized version: Machina004.blend (174.7 KB)
And yes the pull difference of prevoius pulley has to to be added to the next… gimme a break :wink:
Oh and in this minute @clockmender is posting… damnn, anyway i always wanted to do such animated presentationof a physical problem (nice… i have too look into that too)

2 Likes

@hanni5bal A Question, just for clarity. You have the pulleys moving by a frame driven sinusoidal wave motion, I presume that they will all operate at different Speeds and different Amplitudes, is this correct, or will they ever operate under any other form of motion?

Answer please on a young lady’s butt and I will show you how to do this the easy way in Blender.

Cheers, Clock.

Hey @clockmender Thanks for detailed post) Really appreciate that!
Yes, thats right, all 10 mechanisms will work at different amplitude and speed, which will give us that complex curve at the end. The scene I’ve sent was set up with random inputs but here are more accurate data to use for each pulleys:

c=[{'name':'M2', 'amp':1.82, 'phase':271.3, 'speed':28.984104, 'fancy_name': 'Principal lunar semidiurnal'},
{'name':'S2', 'amp':0.75, 'phase':260.2, 'speed':30.0, 'fancy_name': 'Principal solar semidiurnal'},
{'name':'N2', 'amp':0.43, 'phase':256.2, 'speed':28.43973, 'fancy_name': 'Larger lunar elliptic semidiurnal'},
{'name':'K1', 'amp':1.14, 'phase':87.6, 'speed': 15.041069, 'fancy_name': 'Lunar diurnal'},
{'name':'O1', 'amp':0.72, 'phase':80.8, 'speed': 13.943035, 'fancy_name': 'Lunar diurnal'},
{'name':'K2', 'amp':0.22, 'phase':253.6, 'speed':30.082138, 'fancy_name': 'Lunisolar semidiurnal'},
{'name':'L2', 'amp':0.05, 'phase':267.7, 'speed':29.528479, 'fancy_name':'Smaller lunar elliptic semidiurnal'},
{'name':'P1', 'amp':0.36, 'phase':85.8, 'speed': 14.958931, 'fancy_name': 'Solar diurnal'},
{'name':'M4', 'amp':0.0, 'phase':0.9, 'speed':57.96821 , 'fancy_name': 'Shallow water overtides of principal lunar'},
{'name':'MS4', 'amp':0.0, 'phase':0.0, 'speed': 58.984104, 'fancy_name': 'Shallow water quarter diurnal constituent'}
]

so in our case amplitude defined by diameter of the disc and the frequency of each component is the “speed” term divided by 360 (this gives cycles per hour)

Here is the animation I have already based on that data:


Still need to figure out your setup with rotating pulleys
Thanks!

OK, Got impatient (these things happen in old age…) Here is a picture:

As you can see I have added a driver to the bones to move them sinusoidally up and down. I have also added three custom properties to each bone, namely Amplitude, Frames and Offset. Amplitude is the maximum deflection of the bone, and therefore its pulley, Frames is the number of frames over which a complete 360 degree cycle is performed, Offset is the number of the first frame in your animation where the value of the driver is 0.

So the driver is this: amplitude * sin((frame - offset) / frames * 2 * pi)

All you need to do to change the amplitude, cycle length, or offset is alter these Custom Properties for each bone, NOT edit the drivers… The Offset is in effect your Phase setting. So for example if you have a cycle length of 30 and a Phase Shift of +90 degrees your offset would be 7.5.

Blend File now: pulleys.blend (1.0 MB)

Hope this helps!

Cheers, Clock.

I guess now I need to look at how to make the trace line work… I would use a Curve Object (with a Bevel Object for the section) and Hook Modifiers I think.

1 Like

Knew I remember seeing that here!
Good job man!

2 Likes

Thank you!