# No. 200 (Brown 1868): "A mode of obtaining two different speeds on the same shaft from one driving-wheel."
#
# Model (cm), after No. 26's crown-wheel: the driving-wheel is a face (crown) wheel on a horizontal shaft (axis x) with two
# concentric rows of thin teeth standing out of its face, 34 on the inner row (outer radius 9.36) and 52 on the outer (outer radius 14.04), spaced to the pinions'
# pitch (module 0.52) where the pinions' teeth cross them. Over its top runs one upright line of shaft: the lower pinion (25 teeth, keyed to the upright shaft) gears
# with the inner row, the upper (25 teeth, on a sleeve that turns loose round the same shaft) with the outer. The face-wheel is
# the one driven part (12 rpm); the shaft turns 34/25 and the sleeve 52/25 as fast, the same way round. Generator: opencode-runs/batch11/gen200.py.
number: 200
slug: two-speeds-one-driving-wheel
name: Two speeds on one shaft from one driving-wheel
brown: "A mode of obtaining two different speeds on the same shaft from one driving-wheel."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 80
  solver: PGS
  multiccd: true
  duration_s: 6.0
  floor: false
bodies:
  - {id: face_wheel, shape: assembly, pos: [0, 0, 0], quat: [0.7071068, 0, 0, 0.7071068], color: "#cfc4a8"}
  - {id: shaft_low, shape: assembly, pos: [-8.02, 0, 8.888], quat: [0.7071068, 0.7071068, 0, 0], color: "#d8ceba"}
  - {id: sleeve_up, shape: assembly, pos: [-8.02, 0, 13.568], quat: [0.7071068, 0.7071068, 0, 0], color: "#c9b78f"}
  - id: bearings
    shape: frame
    rods:
      - {from: [10.4, -1.1, 0], to: [10.4, 1.1, 0], radius: 0.55}
      - {from: [-8.02, -1.1, 11.088], to: [-8.02, 1.1, 11.088], radius: 0.55}
      - {from: [-8.02, -1.2, 17.968], to: [-8.02, 1.2, 17.968], radius: 0.6}
joints:
  - {id: j_face, type: hinge, body: face_wheel, axis: [0, 1, 0], damping: 0.0004}
  - {id: j_shaft, type: hinge, body: shaft_low, axis: [0, 1, 0], damping: 0.0001}
  - {id: j_sleeve, type: hinge, body: sleeve_up, axis: [0, 1, 0], damping: 0.0001}
crowns:
  - {id: row_in, body: face_wheel, pos: [0, 0, 0], teeth: 34, 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"}
  - {id: row_out, body: face_wheel, pos: [0, 0, 0], teeth: 52, radius: 14.04, 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"}
spurs:
  - {id: pinion_low, body: shaft_low, 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"}
  - {id: pinion_up, body: sleeve_up, 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: "#c9b78f"}
shafts:
  - {id: sh_face, body: face_wheel, from: [0, 4, 0], to: [0, -11, 0], radius: 0.35}
  - {id: sh_low, body: shaft_low, from: [0, -0.7, 0], to: [0, 13.68, 0], radius: 0.3}
  - {id: sh_sleeve, body: sleeve_up, from: [0, -0.7, 0], to: [0, 5.2, 0], radius: 0.55}
contact: {solref: [0.0005, 1], solimp: [0.98, 0.99, 0.0002], margin: 0}
driver: {joint: j_face, kind: velocity, rpm: 12, kv: 6.0, max_torque: 6.0}
checks:
  - {type: ratio, out: j_shaft, in: j_face, expect: 1.36, tol: 0.0272, settle_s: 1, window_s: 4.5}   # the shaft: 34/25
  - {type: ratio, out: j_sleeve, in: j_face, expect: 2.08, tol: 0.0416, settle_s: 1, window_s: 4.5}   # the sleeve: 52/25
  - {type: penetration, max: 0.0008, settle_s: 0.5}
camera: {target: [-4, 0, 6], position: [-68, -88, 36], fov: 30}
display:
  output: j_sleeve
  labels: {j_face: "Face-wheel (driver)", j_shaft: "Shaft (inner row)", j_sleeve: "Sleeve (outer row)"}
  proof: {label: "Teeth out of contact", sub: "the face-wheel turns; the shaft and the sleeve stand"}

