# No. 26, Crown Wheel (Brown 1868).
#
# "The wheel to the right is termed a 'crown-wheel;' that gearing with it is a spur-gear. These
# wheels are not much used, and are only available for light work, as the teeth of the crown-wheel
# must necessarily be thin."
#
# Laid out as in the plate (1 unit = 1 cm): a spur pinion on a vertical shaft, face-on as drawn, its
# wheel horizontal (pitch radius 6.5, 25 thin teeth of the same pitch as the crown's), dips over the
# crown-wheel's rim band; the crown-wheel is a disc on a horizontal shaft pointing right, seen
# edge-on (band radius 9.4, disc 2.2 thick), whose teeth stand out axially from its rim face — a
# serrated band parallel to the shaft, 1.4 cm deep radially, 0.8 cm long out of the face, thin
# (0.42 cm wide). The two shafts are at right angles and the teeth of both have the same pitch.
#
# Fully physical. Only the pinion's shaft is motor-driven. The pinion's own teeth sweep across the
# crown's fin band and strike its thin fins; each strike presses a fin sideways (both carry the
# stroke, and it slides), so the crown turns solely through tooth contact — this is exactly the
# engagement Brown's figure draws, and why he calls it good only for light work. The fin band's
# radius is 9.36 for a 0.52 cm module, and the pinion's is 6.5 for the same module, so the fin and
# the tooth pass at the same rate: the crown turns 25/36 as fast as the pinion, whatever load slips.
number: 26
slug: crown-wheel
name: Crown-wheel and spur-gear
brown: "The wheel to the right is termed a ‘crown-wheel;’ that gearing with it is a spur-gear. These wheels are not much used, and are only available for light work, as the teeth of the crown-wheel must necessarily be thin."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 80
  solver: PGS        # Newton/CG are not stable through the skew tooth strikes (as at No. 7)
  multiccd: true
  duration_s: 4
  floor: false       # both shafts sit in bearings on the standard, not on the ground
# One casting per shaft: its wheel and its stub shaft are one piece of iron.
bodies:
  - {id: shaft_crown, shape: assembly, pos: [0, 0, 0], quat: [0.7071068, 0, 0, 0.7071068], color: "#cfc4a8"}   # horizontal shaft, pointing right
  # vertical shaft above the crown's left rim
  - {id: shaft_pinion, shape: assembly, pos: [-8.02, 0, 8.888], quat: [0.7071068, 0.7071068, 0, 0], color: "#d8ceba"}
  # bearings, No. 24's way: two seen-on fixed collars, one across each shaft, and no stand
  - id: bearings
    shape: frame
    rods:
      - {from: [10.4, -1.1, 0], to: [10.4, 1.1, 0], radius: 0.55}   # across the crown's shaft, at its right end
      - {from: [-8.02, -1.1, 8.888], to: [-8.02, 1.1, 8.888], radius: 0.55}  # across the pinion's shaft, just below the gear
joints:
  # hinge axes are each assembly's own local +y: world +x for the crown's shaft, world +z for the pinion's
  - {id: j_crown, type: hinge, body: shaft_crown, axis: [0, 1, 0], damping: 0.0004}
  - {id: j_pin, type: hinge, body: shaft_pinion, axis: [0, 1, 0], damping: 0.0001}
# the crown-wheel: band radius 9.36 at the fins' outer faces, same module (0.52) as the pinion;
# fins sunk 0.3 into the face, standing 0.8 out of it; 0.42 wide to the azimuth, "thin"
crowns:
  - {id: crown, body: shaft_crown, pos: [0, 0, 0], teeth: 36, radius: 9.36, tooth_depth: 1.36, tooth_width: 0.42, axial_length: 0.8, disc_thickness: 2.2, stage: -0.3, phase: 1.5708, quat: [1, 0, 0, 0], density: 7800, color: "#e4d9bf"}
# the spur pinion: the No. 24 involute gear keyed to the vertical shaft, same module (0.52) as the
# crown's band — its east teeth dip over the band, phased half a tooth over (2π/25 · 0.5) so tooth 0
# starts clear of a fin, as in the scan of No. 24's second gear
spurs:
  - {id: pinion, body: shaft_pinion, pos: [0, 0, 0], teeth: 25, module: 0.52, width: 1.5, pressure_angle: 0.3490659, backlash: 0.02, phase: 0.1256637, quat: [1, 0, 0, 0], density: 7800, color: "#d8ceba"}
shafts:
  - {id: sh_crown, body: shaft_crown, from: [0, 4, 0], to: [0, -11, 0], radius: 0.35}          # stub to the right, as in the plate
  - {id: sh_pinion, body: shaft_pinion, from: [0, -0.7, 0], to: [0, 6.6, 0], radius: 0.3}      # stub up through the pinion
# the standard: a base plate, two posts and across-the-shaft bearing collars (drawn, weighed, touchless)
contact: {solref: [0.0005, 1], solimp: [0.98, 0.99, 0.0002], margin: 0}
driver: {joint: j_pin, kind: velocity, rpm: 27, kv: 6, max_torque: 6}
# crown turns at z_spur/z_crown = 25/36 of the pinion, same sense; the pinion is above the crown's
# left rim and its east teeth press the fins along the crown's own motion, so both turn alike
checks:
  - {type: ratio, out: j_crown, in: j_pin, expect: 0.69444, tol: 0.02, settle_s: 1, window_s: 1.5}
  - {type: turning, joint: j_crown, direction: 1, min_mean: 1.5, slow: 0.55, min_fraction: 0.92, settle_s: 1, window_s: 1.8}
  - {type: penetration, max: 0.0008, settle_s: 0.5}
camera: {target: [-3.5, 0, 4.5], position: [-48, -62, 25], fov: 30}   # the plate's own view: pinion up left, crown wheel edge-on right
display:
  output: j_crown
  labels: {j_pin: Spur pinion (driver), j_crown: Crown wheel}
  proof: {label: Teeth out of contact, sub: "the pinion's teeth stop touching the crown's fin band: the pinion still spins, the crown stops"}
