Q:I'm trying to simulate the rotating of gearwheels in a ticking clock. The gears all have a different radius and/or number of sprockets. Do i need expression controllers, IK or Forward Kinematics. I have no idea about how to aproach this problem.
A:I would suggest using Expression controllers. You can use the system
time variables (F or S).
CLICK HERE TO GO DIRECTLY TO THE TUTORIAL
For example, if you want wheel W1 with Radius R1 to turn once in 1
minute, and you have another wheel W2 with R2=0,5 x R1 that is being
rotated by W1, it should rotate in 30 seconds. It rotates twice as fast,
because its circumference L2 is twice as short:
L1= 2 x Pi x R1
L2= 2 x Pi x 0,5 x R1
L1/L2= 1/0,5= 2
Expression for W1:
ceil(S)*degToRad(360/Speed)
"S" is the current time in seconds
"ceil" returns the integer part, so a rotation occurs only every full
second. You can remove it if you wish a continuous rotation instead.
"degToRad" converts the Degrees into Radians to use in the expression.
"360" is the number of degrees in a full rotation.
"Speed" is the number of seconds for a full rotation of wheel W1 (in our
example 60 seconds). You can use a "helper" object to store this value
for all animated wheels. For example, you can create a Star Shape,
assign a Float controller to the Star Points track, and enter 60 there.
Then assign the scalar "Speed" to this track controller.
For W2 enter:
-(ceil(S)*degToRad(360/(Speed*R1/R2)))
Same as W1, but assign Float controllers to the Radius settings of the
Gear Primitive (if you use the free one by Antonio Cabezuelo Vivo - see
my site for download), or a Scalar Constant if you have modeled the
Gears by yourself. Assign the Scalars R1 and R2 to these
controllers/constants. If W2 is twice as small, it will rotate twice as
fast. If you change the Radius settings of one of them, the other will
react accordingly.
You can change the "Speed" variable anytime to make the whole system
rotate faster/slower.
These expressions are based on my older tutorial about a ticking clock
They are not tested, please email me in case they worked... (or didn't)
Addition:
Rotating Gearwheels Tutorial
Here is a detailed Tutorial for a Semi-Automated Pair of Wheels.
It uses the freeware plug-in "Gear" by Antonio Cabazuelo Vivo.
You can download the zipped sample MAX scene (7KB).We are going to do the following:

Create two rotating gears - a "Master" and a "Slave". Rotation speed of the "Slave" gear will depend on the size relation and the speed of the "Master". (which will be user-controlable). The number of teeth of the "Slave" gear will depend on its size and the teeth number of the "Master". The relative position of the "Slave" to the "Master" will remain constant when the Radius of any of them change. The "Inset" (the region where teeth overlap) will be user-controlable. The polar (angular) position of the "Slave" relatively to the "Master" will be user-controlable. There will be a fine adjustment possibility for the rotation of the "Slave".Let us create the geometry first.
Download and install the freeware plug-in "Gear" Start a new MAX scene, turn SNAP on
Create a Gear primitive named "GearMaster" with following parameters:
Teeth: 30
Holes ON
Radius 1: 50,0
Radius 2: 280,0
Radius 3: 300,0
Thickness: 50,0
Taper H%: 50
Taper V%: 50
Segments: 1 Create a Gear primitive named "GearSlave" with following parameters:
Teeth: 10
Holes ON
Radius 1: 50,0
Radius 2: 80,0
Radius 3: 100,0
Thickness: 50,0
Taper H%: 50
Taper V%: 50
Segments: 1 Create 4 Text Shapes named "SPEED", "INSET", "RADIUS" and "FINETUNE", and enter these names as Text. Create an Arc Shape named "Angle" with the same center as the "GearMaster"
Radius: 600,0
From: 0,0
To: 90,0
Pie Slice ON.Now let us assign all controllers needed:
Open Track View" 
FOR THE OBJECT "GearMaster":
Change the Rotation controller
to "Euler XYZ" Expand the "Euler XYZ" and change the controller for "Z Rotation" to "Float Expression". Expand the Object(Gear) tracks Change the controllers
of the tracks "Teeth" and "Radius 2" to "Linear Float".
The "Linear Float" is needed to allow expression controllers access the value of a certain track.FOR THE OBJECT "GearSlave":
Change the Rotation controller
to "Euler XYZ" Expand the "Euler XYZ" and change the controller
for "Z Rotation" to "Float Expression". Expand the Object(Gear) tracks Change the controllers
of the tracks "Teeth", "Radius 1" and "Radius 2" to "Float Expression".FOR THE 4 TEXT SHAPES:
Expand the Object(Text) and change the controller
for "Size" to "Linear Float"FOR THE "Angle" SHAPE:
Expand the Object(Arc) and change the controller
for "To" to "Linear Float"Now let us enter all expressions:
Select the Expression controller for Z Rotation of "GearMaster" and click on
Properties...
Create a Scalar "Speed" and assign to the controller "SPEED" / "Size".
Enter the expression:S*degToRad(360/Speed*10)
"S" returns the current time in seconds.
"degToRad" converts degrees into Radians (Expressions always use Radians!)
"360" is the number of degrees in one rotation.
"Speed" is the number of tenths of a second for one rotation. It is set in the "SPEED" Text Shape. A value of 300 means 30 seconds.
"360/Speed*10" returns the number of degrees in one second.
Select the Expression controller for Position of "GearSlave" and click on
Properties...
Create a Scalar "Angle" and assign to the controller "Angle" / "To".
Create a Scalar "Inset" and assign to the controller "INSET" / "Size".
Create a Scalar "R1" and assign to the controller "GearMaster" / "Radius 2".
Create a Scalar "R2" and assign to the controller "RADIUS" / "Size".
Create a Vector "Pos1" and assign to the controller "GearMaster" / "Position".
Enter the expression:[ (Pos1.x+(R1+R2-Inset/10)*cos(Angle)),
(Pos1.y+(R1+R2-Inset/10)*sin(Angle)),
0 ]
"Pos1" is the current center of "GearMaster"
"(R1+R2-Inset/10)" is the distance from the center of "GearMaster" to the center of "GearSlave".
"sin(Angle)" and "cos(Angle)" vary between -1 and 1 and place the object on a circular path.
Select the Expression controller for Z Rotation of "GearSlave" and click on
Properties...
Create a Scalar "Speed" and assign to the controller "SPEED" / "Size".
Create a Scalar "Finetune" and assign to the controller "FINETUNE" / "Size".
Create a Scalar "R1" and assign to the controller "GearMaster" / "Radius 2".
Create a Scalar "R2" and assign to the controller "RADIUS" / "Size".
Enter the expression:-(S)*degToRad(360/Speed*10*R1/R2)-degToRad(Finetune/10)
"-" makes the gear rotate in the other direction."S" returns the current time in seconds.
"degToRad" converts degrees into Radians (Expressions always use Radians!)
"360" is the number of degrees in one rotation.
"Speed" is the number of thenths of a second for one rotation. It is set in the "SPEED" Text Shape. A value of 300 means 30 seconds.
"360/Speed*10" returns the number of degrees in one second."R1/R2" gives the relation between the two gears. R1/R2=Speed1/Speed2. This relation speeds up/slows down the "GearSlave" as the gears change their size."degToRad(Finetune/10)" changes the rotation angle a bit to fit the teeth.
Select the Expression controller for "Teeth" of "GearSlave" and click on
Properties...
Create a Scalar "Teeth1" and assign to the controller "GearMaster" / "Teeth".
Create a Scalar "R1" and assign to the controller "GearMaster" / "Radius 2".
Create a Scalar "R2" and assign to the controller "RADIUS" / "Size".
Enter the expression:R2/R1*Teeth1
For two gears to fit, the number of theeth per linear unit should be constant for both.
This means that if the circumference of the second gear is twice as small as the one of the first gear, so should be the number of teeth, too.
R2/R1 gives the relation between the two gears. R2/R1=L2/L1 because L1=2*Pi*R1, L2=2*Pi*R2, 2 and Pi are constants. This relation multiplied with the number of teeth of the first wheel gives the number for the second.
Select the Expression controller for "Radius 1" of "GearSlave" and click on
Properties...
Create a Scalar "R1" and assign to the controller "RADIUS" / "Size".
Enter the expression:R1-20
NOTE: The constant 20 is the TEETH SIZE of the "Slave"! You can create a separate variable and control shape if you want this size controlable. When you change the Radius, the inner radius will always remain 20 units smaller.
Select the Expression controller for "Radius 2" of "GearSlave" and click on
Properties...
Create a Scalar "R1" and assign to the controller "RADIUS" / "Size".
Enter the expression:R1
NOTE: This expression reads the text size of the Shape "RADIUS" and assigns it to the Radius track. This is required because an expression controller cannot read the Radius 2 value to use in another track of the same object (Circular Dependency). Now, the value is set by an "external helper" text object and is available to any other object in the scene!
Let us try it out:
Move the Time Slider or press Play - both wheels should rotate as expected. Select the "SPEED" Text Shape and change the Size value - both objects will rotate faster/slower when playing the animation. Select the "INSET" Text Shape and change the Size value - "GearSlave" will move to/from "GearMaster" to fit its teeth. Select the "RADIUS" Text Shape and change the Size value - "GearSlave" will change its Radius and the Number of Teeth will be be adjusted. Select the "FINETUNE" Text Shape and change the Size value - "GearSlave" will rotate slowly to fit between the teeth of "GearMaster". Select the "Angle" shape and change the "To" value - "Gear Slave" will move around "GearMaster". Select the object "GearMaster" and change the "Radius 2" value - "GearSlave" will move to keep the distance, and the Number of Teeth will be be adjusted. What's next?
You could expand the scene by adding more gear wheels using the same expressions, but calculating relatively to the previous "GearSlave".
You can add custom controls (using Text Shapes) for the teeth size (Radius2-Radius1) of each wheel.Known Limitations:
The Teeth Number of "GearSlave" depends on the Radius values of both gears and the Teeth Number of "GearMaster". If the result is not an INTEGER, there will be a minor error that will accumulate in long animations. To avoid this, make sure the relation R2/R1*Teeth1 returns an integer.
For example, R1=200, R2=100, Teeth1=30. "GearSlave" will have exactly 15 teeth. When changing the Angular position (the Angle Shape), "GearSlave" will NOT adjust automatically. You should use "FINETUNE" to fit the teeth properly again.
Rotating Gearwheels Tutorial
(c) 1997 by Borislav Petrov
All rights reserved.