# No. 27, "Multiple gearing" (Brown 1868).
#
# "The smaller triangular wheel drives the larger one by the movement of its attached
# friction-rollers in the radial grooves."
#
# Laid out as Brown draws it (1 unit = 1 cm): a large disc (outer edge r 9.3..9.8, 0.8 thick)
# pierced by six parallel-sided radial grooves (half-width 0.72), reaching from a central opening
# (r 1.44 and in, where the six webs taper to their tips) out through the rim; a cast triangular
# driver on a shaft offset 4.0 cm below the wheel's centre, its three arms reaching to pins at
# r 4.0 where the friction rollers (r 0.6, free to turn on their pins) sit opposite every other
# groove.
#
# The gearing ratio is fixed by the counts and the offset (the Cardan construction for a 2:1
# internal pair): with the pins on a circle of radius a = 4.0 about the driver axis S and the
# centres 4.0 apart, each pin lies at angle (theta/2 + 60 deg · j) from the line of centres at
# radius 2a·|cos((theta + 120 deg · j)/2)| — as the driver turns theta, the three pins always
# stand on the six groove directions provided the wheel turns at theta/2. So the wheel runs
# mean ratio 1/2 the driver's speed, same direction, turning one groove pitch (60 deg) per
# 2/3... per 120 deg of the driver: exactly the internal-gear count 3:6 (the mean over a whole
# driver cycle does not depend on where wall by wall the load is actually carried). The drive
# itself is roller-on-groove-wall contact only: each roller runs in a groove slightly wider than
# itself, so under load the wheel lags by the clearance until a roller presses a groove flank,
# which pushes the wheel round; the ripple is a few percent at most.
#
# Fully physical: the only input is the velocity driver on the driver's crank (a hand crank).
# The wheel turns only because the rollers press the groove flanks (convex hulls); nothing else
# touches it. At rest all three rollers stand dead-centre in their grooves; the wheel starts
# itself the moment the crank turns.
number: 27
slug: multiple-gearing
name: Multiple gearing
brown: "‘Multiple gearing’—a recent invention. The smaller triangular wheel drives the larger one by the movement of its attached friction-rollers in the radial grooves."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 50, duration_s: 8, floor: false}
bodies:
  # The wheel: six grooved webs (hole in the middle where the rollers pass), hub and back rim.
  - id: wheel
    shape: part
    pos: [0, 0, 0]
    density: 7600
    friction: 0.15
    color: "#dcCfba"
    pieces:
      - {kind: poly, points: [[0.7200, 1.2471], [7.6940, 5.2735], [4.9000, 8.4870], [0.7200, 9.3000]], y: [-0.4, 0.4], collide: 2}
      - {kind: poly, points: [[-0.7200, 1.2471], [-0.7200, 9.3000], [-4.9000, 8.4870], [-7.6940, 5.2735]], y: [-0.4, 0.4], collide: 2}
      - {kind: poly, points: [[-1.4400, -0.0000], [-8.4140, 4.0265], [-9.8000, 0.0000], [-8.4140, -4.0265]], y: [-0.4, 0.4], collide: 2}
      - {kind: poly, points: [[-0.7200, -1.2471], [-7.6940, -5.2735], [-4.9000, -8.4870], [-0.7200, -9.3000]], y: [-0.4, 0.4], collide: 2}
      - {kind: poly, points: [[0.7200, -1.2471], [0.7200, -9.3000], [4.9000, -8.4870], [7.6940, -5.2735]], y: [-0.4, 0.4], collide: 2}
      - {kind: poly, points: [[1.4400, -0.0000], [8.4140, -4.0265], [9.8000, -0.0000], [8.4140, 4.0265]], y: [-0.4, 0.4], collide: 2}
      # hub behind the plate (the rollers pass the centre through the opening)
      - {kind: disc, center: [0, 0], radius: 1.5, y: [0.6, 1.1], color: "#9a938a"}
      - {kind: rod, from: [0, 0.1, 0], to: [1.61638, 0.1, 0], radius: 0.55, color: "#8d877d"}
      - {kind: rod, from: [0, 0.1, 0], to: [-0.80819, 0.1, 1.39989], radius: 0.55, color: "#8d877d"}
      - {kind: rod, from: [0, 0.1, 0], to: [-0.80819, 0.1, -1.39989], radius: 0.55, color: "#8d877d"}
      - {kind: disc, center: [0, 0], radius: 0.28, y: [1.0, 1.7], color: "#8f8a80"}   # journal
      # the deep rim, behind the grooved face
      - {kind: disc, center: [0, 0], radius: 9.85, inner: 8.9, y: [0.55, 1.05], color: "#b7ad99"}
  # The driver: cast bracket on its shaft 4 cm from the wheel's centre, arms to the three pins.
  - id: driver
    shape: part
    pos: [0, 0, -4]
    density: 7400
    color: "#c9a97c"
    pieces:
      - {kind: disc, center: [0, -4], radius: 1.45, y: [-1.5, -0.55], color: "#c9a97c"}          # boss
      - {kind: poly, points: [[0, -8.1], [3.81058, -1.93783], [-3.81058, -1.93783]], y: [-1.18, -0.82]}  # the web behind the arms
      - {kind: rod, from: [0, -1.0, -4], to: [0, -0.45, -8], radius: 0.5}
      - {kind: rod, from: [0, -1.0, -4], to: [3.4641, -0.45, -2], radius: 0.5}
      - {kind: rod, from: [0, -1.0, -4], to: [-3.4641, -0.45, -2], radius: 0.5}
      # the shaft, coming out at the viewer (Brown's arrow shows the crank turn)
      - {kind: rod, from: [0, -1.5, -4], to: [0, -3.6, -4], radius: 0.45, color: "#8f8a80"}
      - {kind: disc, center: [0, -4], radius: 0.95, y: [-2.0, -1.5], color: "#8f8a80"}   # collar
      # the three pins the rollers turn on
      - {kind: rod, from: [0, -1.0, -8], to: [0, -0.3, -8], radius: 0.26, color: "#8f8a80"}
      - {kind: rod, from: [0, -1.0, -2], to: [3.4641, -0.3, -2], radius: 0.26, color: "#8f8a80"}
      - {kind: rod, from: [0, -1.0, -2], to: [-3.4641, -0.3, -2], radius: 0.26, color: "#8f8a80"}
      # crank boss to load the shaft
      - {kind: disc, center: [0, -4], radius: 0.95, y: [-3.8, -3.4], color: "#8f8a80"}
  # The three friction rollers, mounted on the driver, free to turn on their pins.
  - id: roll1
    shape: part
    pos: [0, 0, -8]
    mount: "driver"
    friction: 0.12
    color: "#cbbfa4"
    pieces:
      - {kind: disc, center: [0, -8], radius: 0.6, y: [-0.5, 0.5], collide: 1}
  - id: roll2
    shape: part
    pos: [3.4641, 0, -2]
    mount: "driver"
    friction: 0.12
    color: "#cbbfa4"
    pieces:
      - {kind: disc, center: [3.4641, -2], radius: 0.6, y: [-0.5, 0.5], collide: 1}
  - id: roll3
    shape: part
    pos: [-3.4641, 0, -2]
    mount: "driver"
    friction: 0.12
    color: "#cbbfa4"
    pieces:
      - {kind: disc, center: [-3.4641, -2], radius: 0.6, y: [-0.5, 0.5], collide: 1}
joints:
  - {id: j_wheel, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.02}      # its bearing
  - {id: j_driver, type: hinge, body: driver, axis: [0, 1, 0], damping: 0.01}
  - {id: j_r1, type: hinge, body: roll1, axis: [0, 1, 0], damping: 0.0005}
  - {id: j_r2, type: hinge, body: roll2, axis: [0, 1, 0], damping: 0.0005}
  - {id: j_r3, type: hinge, body: roll3, axis: [0, 1, 0], damping: 0.0005}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
# The crank: a steady 30 turns a minute. Nothing else is driven.
driver: {joint: j_driver, kind: velocity, rpm: 30, max_torque: 30}
checks:
  # 3 rollers ride in 6 grooves: the wheel turns one groove pitch (2π/6) per 120 deg of the
  # driver — half its speed, same direction. Window 6 s = a whole number (3) of driver turns,
  # so the ripple cancels in the mean.
  - {type: ratio, out: j_wheel, in: j_driver, expect: 0.5, tol: 0.01, settle_s: 2, window_s: 6}
  # the wheel turns on steadily, always the same way
  - {type: turning, joint: j_wheel, direction: 1, min_mean: 1.2, slow: 0.3, min_fraction: 0.9, settle_s: 2, window_s: 5}
  - {type: monotonic, joint: j_wheel, direction: 1, max_back: 0.004, settle_s: 2, window_s: 5}
  - {type: penetration, max: 0.0008, settle_s: 1}
camera: {target: [0, 0, -0.6], position: [15, -52, 4], fov: 30}
display:
  output: j_driver
  labels: {j_driver: Driver, j_wheel: Grooved wheel}
  brake: Extra load on the wheel
  proof: {label: Rollers out of the grooves, sub: "the rollers no longer press the groove flanks: the driver still turns, but nothing pushes the wheel round and it stands still"}
