za = 16;  zb = 16;  zc = 48; atsumi = 5;  
    armlength = 30;
na = 1 + (za/zc);  nb = (za/zc) - (za/zb); 
    nd = (za/zc);
ta = na*θ;  tb = nb*θ;  
    td = nd*θ;
px1 = ((za + zb)/2) Cos[td];  py1 = ((za + zb)/2) Sin[td];  
    px2 = ((za + zb)/2) Cos[td + ((2  π)/3)];  
    py2 = ((za + zb)/2) 
        Sin[td + ((2  π)/3)];
px3 = ((za + zb)/2) Cos[td + ((4  π)/3)];  
    py3 = ((za + zb)/2) 
        Sin[td + ((4  π)/3)];

\(\(\(gear3D[x_, y_, z_, er_, ez_, pitch_, 
        t_] := 
{
Table[
Polygon[{{er*Cos[θ + t] + x, 
                er*Sin[θ + t] + y, z}, {er*Cos[θ + t] + x, 
                er*Sin[θ + t] + y, 
                z + ez}, {er*Cos[θ + pitch + t] + x, 
                er*Sin[θ + pitch + t] + y, 
                z + ez}, {er*Cos[θ + pitch + t] + x, 
                er*Sin[θ + pitch + t] + y, z}}], {θ, 0, 
            2  π, pitch}
]
}\)\(
\)
    \)\)
centerline[x_, y_, z_, er_, ez_, 
        t_] := 
{
Thickness[
          0.005], 
Table[
Line[{{er*
                    Cos[t + θ] + x, er*Sin[t + θ] + y, 
                z}, {er*Cos[t + π + θ] + x, 
                er*Sin[t + π + θ] + y, z}}], {θ, 
            0, (π/2), (π/2)}
], 
Table[
Line[{{er*Cos[t + θ] + x, 
                er*Sin[t + θ] + y, 
                z + ez}, {er*Cos[t + π + θ] + x, 
                er*Sin[t + π + θ] + y, z + ez}}], {θ, 
            0, (π/2), (π/2)}
]
}

    
geararm[x_, y_, z_, gx_, gy_, gz_, 
        length_] := 
{
Thickness[
          0.01], 
Line[{{x, y, z}, {x, y, 
              z + ((3  length)/5)}, {gx, gy, gz + ((3  length)/5)}, {gx, 
              gy, gz + length}}]
}

    
Do[
Show[
Graphics3D[{gear3D[0, 0, 
              0, (za/2), atsumi, ((2  π)/za), ta], 
            centerline[0, 0, 0, (za/2), atsumi, ta], 
            gear3D[px1, py1, 0, (zb/2), atsumi, ((2  π)/zb), tb], 
            centerline[px1, py1, 0, (zb/2), atsumi, tb], 
            gear3D[px2, py2, 0, (zb/2), atsumi, ((2  π)/zb), tb], 
            centerline[px2, py2, 0, (zb/2), atsumi, tb], 
            gear3D[px3, py3, 0, (zb/2), atsumi, ((2  π)/zb), tb], 
            centerline[px3, py3, 0, (zb/2), atsumi, tb], 
            gear3D[0, 0, 0, (zc/2), atsumi, ((2  π)/zc), 0], 
            geararm[0, 0, atsumi, 0, 0, 0, -armlength], 
            geararm[px1, py1, 0, 0, 0, 0, armlength], 
            geararm[px2, py2, 0, 0, 0, 0, armlength], 
            geararm[px3, py3, 0, 0, 0, 0, 
              armlength], 
RGBColor[1, 0, 0], 
            Thickness[0.01], 
            Line[{{0, 0, armlength}, {px1, py1, armlength}}], 
            Line[{{0, 0, -armlength}, {za*Cos[ta], 
                  za*Sin[ta], -armlength}}]
}, 
          Boxed -> False, 
          PlotRange -> {{-(zc/2), (zc/2)}, {-(zc/2), 
                (zc/2)}, {-armlength, 
                armlength}}
]
]
, {θ, 0, 6  Pi, 
        0.2}
]