# No. 253 (Brown 1868): "Centrifugal check-hooks, for preventing accidents in case of the breakage of machinery which raises and lowers
# workmen, ores, etc., in mines. ... If the drum acquires a dangerously rapid motion, the hooks fly out by centrifugal force, and one or other or
# all of them catch hold of the studs, D, and arrest the drum ..."
#
# Model (cm, gravity on, face view of the drum, axis level): the load on the rope turns the drum with a steady torque 0.2 N m (the one driven
# joint: the brake gear broken), against light bearing drag, so it runs faster and faster. Three hooks are pinned to the drum's flange B, each arm
# leading its pin, held in against its stop by a light spring preloaded 25 rad. When the drum runs fast enough the hooks fly out against their
# springs; a barb strikes a stud D on the frame A, which (leading arm, sloped stud face) drives the hook out onto its stop, and the drum is arrested. The frame stands on a stiff spring and damper (32 N m/rad), Brown's spring against the jerk.
# Generator: opencode-runs/batch11/gen253.py.
number: 253
slug: centrifugal-check-hooks
name: Centrifugal check-hooks
brown: "Centrifugal check-hooks, for preventing accidents in case of the breakage of machinery which raises and lowers workmen, ores, etc., in mines. ... If the drum acquires a dangerously rapid motion, the hooks fly out by centrifugal force, and one or other or all of them catch hold of the studs, D, and arrest the drum and stop the descent of whatever is attached to the rope."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 60, duration_s: 5, floor: false}
bodies:
  - id: frame_a
    shape: part
    pos: [0, 0, 0]
    mass: 3
    color: "#d9cfba"
    pieces:
      - {kind: disc, center: [0, 0], radius: 15.5, inner: 6.2, y: [1.0, 1.6], collide: 0}   # the frame-work A (behind)
      - {kind: loft, a: [[-6.5388, -1.0, 9.3383], [-6.197, -1.0, 11.6549], [-9.0024, -1.0, 9.6539], [-7.7748, -1.0, 8.3374]], b: [[-6.5388, 1.0, 9.3383], [-6.197, 1.0, 11.6549], [-9.0024, 1.0, 9.6539], [-7.7748, 1.0, 8.3374]], collide: 1, color: "#5a554c"}   # a stud D: its face meeting the hooks slopes outward, so a hook part-way out is ramped onto its stop
      - {kind: loft, a: [[-4.8178, -1.0, -10.3319], [-6.9949, -1.0, -11.1942], [-3.8593, -1.0, -12.6232], [-3.333, -1.0, -10.9019]], b: [[-4.8178, 1.0, -10.3319], [-6.9949, 1.0, -11.1942], [-3.8593, 1.0, -12.6232], [-3.333, 1.0, -10.9019]], collide: 1, color: "#5a554c"}   # a stud D: its face meeting the hooks slopes outward, so a hook part-way out is ramped onto its stop
      - {kind: loft, a: [[11.3566, -1.0, 0.9936], [13.192, -1.0, -0.4607], [12.8617, -1.0, 2.9694], [11.1078, -1.0, 2.5644]], b: [[11.3566, 1.0, 0.9936], [13.192, 1.0, -0.4607], [12.8617, 1.0, 2.9694], [11.1078, 1.0, 2.5644]], collide: 1, color: "#5a554c"}   # a stud D: its face meeting the hooks slopes outward, so a hook part-way out is ramped onto its stop
  - id: drum
    shape: part
    pos: [0, 0, 0]
    mass: 3
    color: "#b8ad97"
    pieces:
      - {kind: disc, center: [0, 0], radius: 5.6, inner: 0.9, y: [0.2, 0.9], collide: 0}   # the flange B
      - {kind: disc, center: [0, 0], radius: 2.6, inner: 0.9, y: [-1.8, 0.2], collide: 0, color: "#9c8f78"}   # the drum, the rope wound on it
      - {kind: rod, from: [0, -2.2, 0], to: [0, 1.4, 0], radius: 0.9, collide: 0, color: "#5a554c"}   # the shaft
  - id: hook_0
    shape: part
    pos: [0.0, 0, 4.5]
    mount: drum
    mass: 0.05
    friction: 0.3
    color: "#b03a2e"
    pieces:
      - {kind: rod, from: [0.0, 0, 4.5], to: [-7.6604, 0, -1.9279], radius: 0.3, collide: 2, capsule: true}   # the hook's arm
      - {kind: rod, from: [-7.6604, 0, -1.9279], to: [-9.0913, 0, -1.9786], radius: 0.3, collide: 2, capsule: true}   # its barb, turned forward
      - {kind: rod, from: [0.0, -0.6, 4.5], to: [0.0, 0.6, 4.5], radius: 0.5, collide: 0, color: "#3d3a34"}   # its pin in the flange
  - id: hook_1
    shape: part
    pos: [-3.8971, 0, -2.25]
    mount: drum
    mass: 0.05
    friction: 0.3
    color: "#b03a2e"
    pieces:
      - {kind: rod, from: [-3.8971, 0, -2.25], to: [5.4998, 0, -5.6702], radius: 0.3, collide: 2, capsule: true}   # the hook's arm
      - {kind: rod, from: [5.4998, 0, -5.6702], to: [6.2592, 0, -6.884], radius: 0.3, collide: 2, capsule: true}   # its barb, turned forward
      - {kind: rod, from: [-3.8971, -0.6, -2.25], to: [-3.8971, 0.6, -2.25], radius: 0.5, collide: 0, color: "#3d3a34"}   # its pin in the flange
  - id: hook_2
    shape: part
    pos: [3.8971, 0, -2.25]
    mount: drum
    mass: 0.05
    friction: 0.3
    color: "#b03a2e"
    pieces:
      - {kind: rod, from: [3.8971, 0, -2.25], to: [2.1606, 0, 7.5981], radius: 0.3, collide: 2, capsule: true}   # the hook's arm
      - {kind: rod, from: [2.1606, 0, 7.5981], to: [2.8321, 0, 8.8626], radius: 0.3, collide: 2, capsule: true}   # its barb, turned forward
      - {kind: rod, from: [3.8971, -0.6, -2.25], to: [3.8971, 0.6, -2.25], radius: 0.5, collide: 0, color: "#3d3a34"}   # its pin in the flange
  - id: rope
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#7a6a50"
    pieces:
      - {kind: rod, from: [-2.75, -1.0, 0], to: [-2.75, -1.0, -14.2], radius: 0.25, collide: 0}   # the rope's falls (drawn)
      - {kind: rod, from: [2.75, -1.0, 0], to: [2.75, -1.0, -14.2], radius: 0.25, collide: 0}
joints:
  - {id: j_frame, type: hinge, body: frame_a, axis: [0, -1, 0], stiffness: 32, damping: 1.5}   # the frame A on its spring (+: counter-clockwise)
  - {id: j_drum, type: hinge, body: drum, axis: [0, -1, 0], damping: 0.0012}   # the drum: the one driven joint
  - {id: j_h0, type: hinge, body: hook_0, axis: [0, 1, 0], range: [0, 1.2], stiffness: 0.004, springref: -25, damping: 0.0002}   # hook 0 (+: out, clockwise)
  - {id: j_h1, type: hinge, body: hook_1, axis: [0, 1, 0], range: [0, 1.2], stiffness: 0.004, springref: -25, damping: 0.0002}   # hook 1 (+: out, clockwise)
  - {id: j_h2, type: hinge, body: hook_2, axis: [0, 1, 0], range: [0, 1.2], stiffness: 0.004, springref: -25, damping: 0.0002}   # hook 2 (+: out, clockwise)
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_drum, kind: torque, torque: 0.2, max_torque: 0.2}
checks:
  - {type: position, joint: j_h0, min: -0.01, max: 0.02, settle_s: 0, window_s: 0.6}   # the hooks lie in while the drum is slow
  - {type: still, joint: j_drum, max: 0.05, settle_s: 3.4, window_s: 1.5}   # arrested, and held
  - {type: penetration, max: 0.002, settle_s: 0.0}
camera: {target: [0, 0, -5], position: [0, -90, -5], fov: 34}
display:
  output: j_drum
  labels: {j_drum: "Drum (driver)", j_h0: "Hook", j_frame: "Frame A on its spring"}

