View Full Version : How do I animate gears?
Jack Winge
07-31-2008, 12:38 AM
I'm trying to animate rotating gears using rigid bodies, hinge constraints and motor force on the driving gear. It's working for a bit but the gears get stuck quickly and the movement is inconsistent (the shape of the gears, size of cogs etc is correct). I've tried a lot of different settings with only marginal improvement. Is there a better way to do this or am I just doing it wrong?
andystopps
07-31-2008, 04:08 AM
Do you need to use dynamics ? The gears in a real gear train always rotate in a fixed relationship to each other, e.g. one rotation of a 48 tooth gear will cause two rotations of a 24 tooth gear meshed with it, and you could reproduce this more easily with a simple expression.
If you really want to use dynamics, I would imagine you'd have to set up the gear train as per a real one, with correct tooth profile, diametral pitch, etc.; the design of gears is quite complicated, and if you get it wrong in the real world they will jam, break teeth, or at the least make a terrible noise - all tiresome, but probably easier to diagnose than a non-working simulation.
Here's a link to some gear formulae:
http://www.engineersedge.com/gear_formula.htm
Milosh
07-31-2008, 06:16 AM
Simple expression is best for gears. Simply put expression to kinematics->local transform->ori->euler->Z or other axis and write someObject.kine.local.rotz*(-1/some value or * some value) :)
Jack Winge
07-31-2008, 07:46 AM
Thanks guys :-) The reason for using dynamics is to get all the small nuances when the gears start and stop and easier acceleration with many gears - I'm thinking acceleration will be tricky when having many wheels of different sizes. But I'm not an experienced animator so I might be missing something. The gears that I use are physically correct. I have cnc milled them in plastic and they work together. What might be incorrect though is the mesh, as I have imported it from Rhino via obj and perhaps it's not water tight as polys, being converted from nurbs. I don't know what the requirements and limitations are for colliding meshes, what can be done and not.
andystopps
07-31-2008, 10:04 AM
I reckon you'll have problems because collision simulations don't like intersections, and intersections are going to be pretty well inevitable since the faces of the teeth are a series of polygons, unless you use an excessive (and unrealistic) clearance. Also, the simulation is, at best, an approximation of reality, and slight errors will be rapidly amplified if whatever's going on undergoes a series of iterations, such as the rotations in a gear train.
Increasing the number of edges might help, and running the simulation at half speed or slower often makes a big difference, but I still reckon it's probably easier to use expressions: you can waste a lot of time on trying to get simulations to work.
If all your gears are in one train, then you'd be referring the expressions on them back to one "master" gear (perhaps keyframe animated) and so your accelerations will all be in correct proportion to the master. You could even write in a slight delay to imitate the effect of backlash, if you need that degree of realism.
Incidentally, if you have Houdini apprentice (or even the full version), it's worth taking a look at its rigid body stuff, because you can set the display to show what parts of the objects are actually being used to make the calculations. It can be quite an eye-opener to see how different this is from the modelled shape and, assuming all packages work in a roughly similar manner, suggests why simulations at their default settings often fail.
Jack Winge
07-31-2008, 09:05 PM
Thank you very much Andy, I believe you just saved me a couple of days of experimenting :) I will use expressions instead.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.