You can do this by the following function: (3/2) * (sin(x) + 1)
You also have to remember that in Maya, sine expects units in radians, meaning that 2*pi = (~6.28) = one full cycle of sine. Therefore, in 6 frames, you make a complete cycle of sine. In your expression, you have halved that (remember that multiplying inside the brackets does the opposite transformation), so it now takes 3 frames to cycle completely. The minimums and maximums of sine are found at pi/2 and (3*pi)/2. (Green lines) Since (2*pi)/3 = ~2.1, you are jumping past pi/2, and again past (3*pi)/2. In the example where you are currently hitting are the red lines.

In short:
float $speed = 0.02;
pCube1.rotateZ = (3.0 / 2.0) * (sin(frame * (1.0 / $speed)) + 1);
Imagination is more important than knowledge.
Last edited by NextDesign; 06-11-2012 at 04:32 AM.