How to synchronize/rig gears with just a few or one teeth?

sync gear problem

I have these two gears which i would like to sync.

I synced them via a transformation constraint like this:

unfortunately it “jumps” at 180 degrees and i have no idea why it jumps.

Can anybody tell me why it jumps and how to solve that?

Thank you!!

Try setting your animation Frames from 0 to 359 degrees
If it is set to 360 it has to jump when it reaches the end as the 0 frame is the same frame as the 360th frame… it is not a smooth LOOP if that makes sense to you…

Use a driver instead of a constraint. Constraints don’t act on your raw orientations; they act on converted, simplified orientations (so your input rotation is remapped to the -180, 180 range before the constraint acts on it.) If you use a driver, you can have the driver work on raw data instead, by right clicking on the transform/rotation/Z field of the target and selecting “copy as new driver.” (Don’t use a transform channel driver, as that’s the same converted orientation used by constraints.)

This does require working in local space instead of world space, but here that shouldn’t be a problem.

2 Likes

Hey @Blender_Fun1,

So, where to begin . . . first off, as mentioned by @bandages, drivers are your best solution, but I’ll get to that in a bit

A lot depends on your use for the animation. By far the quickest solution would just be to hand key the two rotations then add a repeating modifier in the graph Editor ( using RepeatWithOffset ) in the animation track for each and you’re done. But that is not the most flexible if you expect to have changes in timings.

You can also ‘fake’ the rotation IF there is no visible distinguishing marks, using the method you have already implemented:

However, this won’t work if there is anything that tracks the rotation - like the peg on the gear in this version -
which appears to snap - because it actually is; the gear resets to it’s original rotation at each ‘loop’

Drivers on the other hand will allow ‘proper’ control, the downside is you’ll also need to use code for this to be flexible, and while it was interesting for me to dust off my Python knowledge, it may be more than you require. But for the sake of completness . . .

And here’s my file. You’ll need to RUN the script BEFORE pressing the Update Dependencies button at the bottom of the drivers tab - see my screen shot. The script will have to be selected from the pull-down menu as it doesn’t load automatically - it’s called GearWheel.

Gears.blend (983.1 KB)

I have no idea how much use this is to you, but I had fun figuring that out :wink:

Finally - this is not the only way to code up such a method, it’s possible someone may have a more direct method with the driver window curves.

Some additional points - you’re mapping the gear rotation from -10 to +30 degrees which is 40º but a 12 tooth gear must rotate by 30º ( 360 / 12) per tooth.

Finally - Blender rotations, are displayed as degrees in the viewport but are actually calculated as Radians, which is why I have added two extra functions into the code to convert back and forth. This is not desirable as it introduces rounding errors that will accumulate over enough rotations to de-synchronise the gears.

Anyway, I hope something in that is of help.

Cheers,
Dj

4 Likes

thank you for your answer, unfortunately i tried that but it didn’t work. It still jumped…

wow, thank you so much for your time and effort for this great solution! Works like a charm!!!

1 Like