# No. 47, A frictional clutch-box (Brown 1868): "thrown in and out of gear by the lever at the bottom.
# This is used for connecting and disconnecting heavy machinery. The eye of the disk to the right has
# a slot which slides upon a long key or feather fixed on the shaft."
#
# Model (cm): two shafts in line (along y). The driving shaft carries a disk fixed on it; the driven
# shaft (the machinery, a bearing load) carries the other disk on a feather: a slide joint along the
# shaft on the driven shaft's own body, so the disk turns with that shaft and slides on it. Its hub
# has two collars, and the fork at the top of the lever stands in the groove between them. The
# lever's fulcrum is below; a spring holds it where the hand sets it (No. 5's hand): at 2 s it is
# thrown over, the fork pushes the sliding disk 0.5 across against the fixed one, and the spring's
# pull (about 18 N on the faces) makes the faces grip; at 5.5 s it is thrown back. The disks' flat
# faces drive by friction alone. Only the driving shaft is motor-driven.
number: 47
slug: frictional-clutch-box
name: Frictional clutch-box
brown: "A frictional clutch-box, thrown in and out of gear by the lever at the bottom. This is used for connecting and disconnecting heavy machinery. The eye of the disk to the right has a slot which slides upon a long key or feather fixed on the shaft."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: CG
  multiccd: true
  duration_s: 8
  floor: false
bodies:
  - id: drv
    shape: part
    pos: [0, 0, 0]
    density: 7800
    friction: 0.4
    color: "#e4d9bf"
    pieces:
      - {kind: rod, from: [0, -14, 0], to: [0, -0.5, 0], radius: 0.6, color: "#8f8a80"}
      - {kind: disc, center: [0, 0], radius: 5, y: [-1.5, -0.5], collide: 1}
      - {kind: disc, center: [0, 0], radius: 1.6, y: [-3, -1.5]}
  - id: shaft
    shape: part
    pos: [0, 0, 0]
    density: 7800
    color: "#d9cfb6"
    pieces:
      - {kind: rod, from: [0, 0.2, 0], to: [0, 16, 0], radius: 0.6, color: "#8f8a80"}
      - {kind: rod, from: [0, 1, 0.6], to: [0, 9, 0.6], radius: 0.18, color: "#6f6a60"}   # the feather
  - id: disk
    shape: part
    pos: [0, 0, 0]
    mount: shaft
    density: 7800
    friction: 0.4
    color: "#e8dec6"
    pieces:
      - {kind: disc, center: [0, 0], radius: 5, y: [0, 1], collide: 2}
      - {kind: disc, center: [0, 0], radius: 1.4, inner: 0.6, y: [1, 6]}
      - {kind: disc, center: [0, 0], radius: 2.4, y: [3.6, 4.2], collide: 2}
      - {kind: disc, center: [0, 0], radius: 2.4, y: [5.4, 6.0], collide: 2}
  - id: lever
    shape: part
    pos: [0, 4.8, -13]
    density: 2500
    friction: 0.05
    color: "#b8ad97"
    pieces:
      - {kind: rod, from: [0, 4.8, -13], to: [0, 4.8, -2.4], radius: 0.35}
      - {kind: poly, points: [[-0.9, -2.3], [0.9, -2.3], [0.9, -1.6], [-0.9, -1.6]], y: [4.35, 5.25], collide: 1}   # the fork's prong in the groove
      - {kind: rod, from: [0, 4.8, -13], to: [0, 9.5, -19], radius: 0.35}   # the handle, down to the right
      - {kind: disc, center: [0, -13], radius: 0.7, y: [4.3, 5.3]}
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-1.2, -21], [1.2, -21], [0.8, -13], [-0.8, -13]], y: [3.0, 3.8]}
      - {kind: poly, points: [[-1.5, -21], [1.5, -21], [1.0, 0], [-1.0, 0]], y: [-12, -11]}
      - {kind: disc, center: [0, 0], radius: 1.3, y: [-12, -11]}
      - {kind: poly, points: [[-1.5, -21], [1.5, -21], [1.0, 0], [-1.0, 0]], y: [13, 14]}
      - {kind: disc, center: [0, 0], radius: 1.3, y: [13, 14]}
      - {kind: poly, points: [[-4, -22], [4, -22], [4, -21], [-4, -21]], y: [-14, 16], color: "#b9b09c"}
joints:
  - {id: j_drv, type: hinge, body: drv, axis: [0, 1, 0], damping: 0.001}
  - {id: j_shaft, type: hinge, body: shaft, axis: [0, 1, 0], damping: 0.02}   # the machinery it drives
  - {id: j_feather, type: slide, body: disk, axis: [0, 1, 0], range: [-0.7, 0.3], damping: 2}
  - {id: j_lever, type: hinge, body: lever, axis: [1, 0, 0], range: [-0.04, 0.12], stiffness: 40, springref: 0, damping: 2}
hand:
  - {t: 2, springref: {j_lever: 0.1}}
  - {t: 5.5, springref: {j_lever: 0}}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_drv, kind: velocity, rpm: 60, kv: 2, max_torque: 5}
checks:
  # out of gear: the driven shaft stands
  - {type: ratio, out: j_shaft, in: j_drv, expect: 0, tol: 0.01, settle_s: 0.5, window_s: 1.4}
  # thrown in at 2 s: the faces grip and the driven shaft goes round with the driver
  - {type: ratio, out: j_shaft, in: j_drv, expect: 1, tol: 0.02, settle_s: 3, window_s: 2.4}
  # thrown out at 5.5 s: it stops again
  - {type: ratio, out: j_shaft, in: j_drv, expect: 0, tol: 0.02, settle_s: 6.5, window_s: 1.5}
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [0, 1, -12], position: [78, -40, 0], fov: 30}
display:
  output: j_shaft
  labels: {j_drv: "Driving shaft (fixed disk)", j_shaft: "Driven shaft (sliding disk on its feather)", j_lever: "Lever", j_feather: "Disk on the feather"}
  proof: {label: "Faces frictionless", sub: "the lever presses the disks together, but nothing grips: the driven shaft stands"}
