# No. 278 (Brown 1868): "C. R. Otis’s safety-stop for the platform of a hoisting apparatus. A are the stationary uprights, and B is the upper part of the platform working between them. The rope, a, by which the platform is hoisted, is attached by a pin, b, and spring, c, and the pin is connected by two elbow levers with two pawls, d, which work in ratchets secured to the uprights, A. The weight of the platform and the tension of the rope keep the pawls out of gear from the ratchets in hoisting or lowering the platform, but in case of the breakage of rope the spring, c, presses down the pin, b, and the attached ends of the levers, and so presses the pawls into the ratchets and stops the descent of the platform."
#
# Model (cm, gravity on): the platform B (0.5 kg) slides between the uprights A, whose inner faces carry the ratchets (teeth 0.5 deep at 1.5 pitch, flat tops).
# The rope a ends in a stirrup under the head of the pin b; the pin slides in the platform, the spring c (a joint spring) pressing it down, and its collar rests on the
# inner ends of two elbow levers pivoted on the platform, whose outer arms end in the pawls d (springs on the levers hold them out of gear). The rope's end is the one driven
# joint: it is wound up at 2 cm/s and hoists the platform. At 4.3 s the rope breaks: its lower end, with the stirrup, hangs from the rest on a joint spring that
# holds it to the rope until then, and the hand schedule then sets that spring's free position far below, so the broken end falls away. While the rope carries the platform,
# its weight holds the pin up against the spring and the pawls clear; once the rope is broken, the spring c drives the pin down, the levers throw the pawls out into the
# ratchets, and the platform drops a little and is stopped on the next tooth. Only the pin's collar, the levers and the ratchets' teeth hold it. Generator: opencode-runs/batch12/gen278.py.
number: 278
slug: otis-safety-stop
name: Otis's safety-stop for a hoisting platform
brown: "C. R. Otis’s safety-stop for the platform of a hoisting apparatus. A are the stationary uprights, and B is the upper part of the platform working between them. The rope, a, by which the platform is hoisted, is attached by a pin, b, and spring, c, and the pin is connected by two elbow levers with two pawls, d, which work in ratchets secured to the uprights, A. The weight of the platform and the tension of the rope keep the pawls out of gear from the ratchets in hoisting or lowering the platform, but in case of the breakage of rope the spring, c, presses down the pin, b, and the attached ends of the levers, and so presses the pawls into the ratchets and stops the descent of the platform."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: CG
  multiccd: true
  duration_s: 5.8
  floor: false
bodies:
  - id: platform
    shape: part
    pos: [0, 0, 0]
    mass: 0.5
    color: "#c9a26b"
    pieces:
      - {kind: poly, points: [[-5.2, -0.4], [5.2, -0.4], [5.2, 0.6], [-5.2, 0.6]], y: [-0.5, 0.5], collide: 0}   # B, the platform's upper part
      - {kind: poly, points: [[-5.2, 3.0], [5.2, 3.0], [5.2, 3.8], [-5.2, 3.8]], y: [0.6, 1.2], collide: 0}   # its head, carrying the pin's guide
      - {kind: poly, points: [[-5.2, -1.2], [-4.4, -1.2], [-4.4, -0.4], [-5.2, -0.4]], y: [-0.5, 0.5], collide: 0}   # its sides, down to the floor of the cage
      - {kind: poly, points: [[4.4, -1.2], [5.2, -1.2], [5.2, -0.4], [4.4, -0.4]], y: [-0.5, 0.5], collide: 0}
      - {kind: poly, points: [[-5.2, -2.0], [5.2, -2.0], [5.2, -1.2], [-5.2, -1.2]], y: [-3, 3], collide: 0, color: "#a07f4f"}   # the floor of the cage
      - {kind: rod, from: [-4.5, -0.6, 1.5], to: [-4.5, 0.6, 1.5], radius: 0.15, collide: 0, color: "#8f8a80"}   # the levers' pivots
      - {kind: rod, from: [4.5, -0.6, 1.5], to: [4.5, 0.6, 1.5], radius: 0.15, collide: 0, color: "#8f8a80"}
  - id: pin
    shape: part
    pos: [0, 0, 1.78]
    mount: platform
    mass: 0.05
    friction: 0.3
    color: "#efe6d2"
    pieces:
      - {kind: poly, points: [[-2.0, 1.78], [2.0, 1.78], [2.0, 2.28], [-2.0, 2.28]], y: [-0.9, 0.3], collide: 1}   # the pin's collar on the levers' ends
      - {kind: rod, from: [0, -0.3, 2.28], to: [0, -0.3, 6.0], radius: 0.22, collide: 0}   # the pin b
      - {kind: rod, from: [-0.9, -0.3, 6.0], to: [0.9, -0.3, 6.0], radius: 0.25, capsule: true, collide: 2}   # its head
      - {kind: rod, from: [0, -0.3, 3.28], to: [0, -0.3, 3.0], radius: 0.45, collide: 0, color: "#3f8f5a"}   # the spring c, round the pin
  - id: rope
    shape: part
    pos: [0, 0, 6.0]
    mass: 0.2
    color: "#a0522d"
    pieces:
      - {kind: rod, from: [0, -1.0, 8.2], to: [0, -1.0, 40], radius: 0.2, collide: 0}   # the rope a, to the drum above
  - id: stirrup
    shape: part
    pos: [0, 0, 6.0]
    mount: rope
    mass: 0.05
    friction: 0.3
    color: "#a0522d"
    pieces:
      - {kind: rod, from: [-0.6, -1.0, 5.5], to: [-0.6, 0.4, 5.5], radius: 0.25, capsule: true, collide: 1}   # the stirrup's bars, under the pin's head
      - {kind: rod, from: [0.6, -1.0, 5.5], to: [0.6, 0.4, 5.5], radius: 0.25, capsule: true, collide: 1}
      - {kind: rod, from: [-0.6, -1.0, 5.5], to: [0, -1.0, 7.6], radius: 0.15, collide: 0}
      - {kind: rod, from: [0.6, -1.0, 5.5], to: [0, -1.0, 7.6], radius: 0.15, collide: 0}
      - {kind: rod, from: [0, -1.0, 7.6], to: [0, -1.0, 8.0], radius: 0.2, collide: 0}   # the rope's lower end, where it breaks
  - id: lever_r
    shape: part
    pos: [4.5, 0, 1.5]
    mount: platform
    density: 7800
    friction: 0.3
    color: "#b03a2e"
    pieces:
      - {kind: rod, from: [4.5, -0.9, 1.5], to: [1.5, -0.9, 1.5], radius: 0.2, collide: 0}   # the inner arm, to the pin
      - {kind: rod, from: [1.5, -0.9, 1.5], to: [1.5, 0.3, 1.5], radius: 0.2, capsule: true, collide: 2}   # its end, under the pin's collar
      - {kind: rod, from: [4.5, -0.9, 1.5], to: [5.05, -0.9, -1.0], radius: 0.2, collide: 0}   # the outer arm
      - {kind: rod, from: [5.05, -0.6, -1.0], to: [5.05, 0.6, -1.0], radius: 0.2, capsule: true, collide: 2}   # the pawl d
      - {kind: disc, center: [4.5, 1.5], radius: 0.35, inner: 0.12, y: [-1.1, -0.7], collide: 0, color: "#8f8a80"}
  - id: lever_l
    shape: part
    pos: [-4.5, 0, 1.5]
    mount: platform
    density: 7800
    friction: 0.3
    color: "#b03a2e"
    pieces:
      - {kind: rod, from: [-4.5, -0.9, 1.5], to: [-1.5, -0.9, 1.5], radius: 0.2, collide: 0}   # the inner arm, to the pin
      - {kind: rod, from: [-1.5, -0.9, 1.5], to: [-1.5, 0.3, 1.5], radius: 0.2, capsule: true, collide: 2}   # its end, under the pin's collar
      - {kind: rod, from: [-4.5, -0.9, 1.5], to: [-5.05, -0.9, -1.0], radius: 0.2, collide: 0}   # the outer arm
      - {kind: rod, from: [-5.05, -0.6, -1.0], to: [-5.05, 0.6, -1.0], radius: 0.2, capsule: true, collide: 2}   # the pawl d
      - {kind: disc, center: [-4.5, 1.5], radius: 0.35, inner: 0.12, y: [-1.1, -0.7], collide: 0, color: "#8f8a80"}
  - id: uprights
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#5d6f82"
    pieces:
      - {kind: poly, points: [[6.0, -1.5], [7.5, -1.5], [7.5, 13.5], [6.0, 13.5]], y: [-1.5, 1.5], collide: 1}   # the right upright A
      - {kind: poly, points: [[-7.5, -1.5], [-6.0, -1.5], [-6.0, 13.5], [-7.5, 13.5]], y: [-1.5, 1.5], collide: 1}   # the left
      - {kind: poly, points: [[6.0, -1.48], [6.0, 0.0], [5.5, 0.0]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[6.0, 0.02], [6.0, 1.5], [5.5, 1.5]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[6.0, 1.52], [6.0, 3.0], [5.5, 3.0]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[6.0, 3.02], [6.0, 4.5], [5.5, 4.5]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[6.0, 4.52], [6.0, 6.0], [5.5, 6.0]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[6.0, 6.02], [6.0, 7.5], [5.5, 7.5]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[6.0, 7.52], [6.0, 9.0], [5.5, 9.0]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[6.0, 9.02], [6.0, 10.5], [5.5, 10.5]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[-5.5, 0.0], [-6.0, 0.0], [-6.0, -1.48]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[-5.5, 1.5], [-6.0, 1.5], [-6.0, 0.02]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[-5.5, 3.0], [-6.0, 3.0], [-6.0, 1.52]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[-5.5, 4.5], [-6.0, 4.5], [-6.0, 3.02]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[-5.5, 6.0], [-6.0, 6.0], [-6.0, 4.52]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[-5.5, 7.5], [-6.0, 7.5], [-6.0, 6.02]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[-5.5, 9.0], [-6.0, 9.0], [-6.0, 7.52]], y: [-0.6, 0.6], collide: 1}
      - {kind: poly, points: [[-5.5, 10.5], [-6.0, 10.5], [-6.0, 9.02]], y: [-0.6, 0.6], collide: 1}
joints:
  - {id: j_rope, type: slide, body: rope, axis: [0, 0, 1], range: [-30, 30], damping: 0.01}   # the one driven joint: the rope, wound up; + : up
  - {id: j_break, type: slide, body: stirrup, axis: [0, 0, 1], range: [-40, 0], stiffness: 30.0, springref: 25, damping: 0.5}   # the rope's lower end, held to the rest until it breaks
  - {id: j_p, type: slide, body: platform, axis: [0, 0, 1], range: [-22, 14], damping: 0.05}   # the platform; + : up
  - {id: j_b, type: slide, body: pin, axis: [0, 0, 1], range: [-1.2, 0], stiffness: 150.0, springref: -2.5, damping: 0.2}   # the pin b on its spring c; 0 : drawn up by the rope
  - {id: j_r, type: hinge, body: lever_r, axis: [0, 1, 0], range: [-0.45, 0.02], stiffness: 0.01, springref: 0.1, damping: 0.0005}   # the right lever; - : the pawl out
  - {id: j_l, type: hinge, body: lever_l, axis: [0, -1, 0], range: [-0.45, 0.02], stiffness: 0.01, springref: 0.1, damping: 0.0005}   # the left lever; - : the pawl out
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_rope, kind: velocity, speed: 2, kv: 5000.0, max_torque: 80}
hand:
  - {t: 4.3, springref: {j_break: -40}}   # the rope breaks
checks:
  - {type: position, joint: j_b, min: -0.05, max: 0.01, settle_s: 0.2, window_s: 4}   # hoisting: the platform's weight holds the pin up, the pawls clear
  - {type: position, joint: j_p, min: 6.3, max: 7.5, settle_s: 4.8, window_s: 0.9}   # once the rope breaks the platform stands on the pawls, though the broken end falls away
  - {type: position, joint: j_b, min: -1.0, max: -0.8, settle_s: 4.8, window_s: 0.9}   # the spring c holds the pin down: the pawls in the ratchets
  - {type: penetration, max: 0.0008, settle_s: 0.5}
camera: {target: [0, 0, 2.9], position: [0.0, -54.0, 3.0], fov: 34.0}
display:
  output: j_p
  labels: {j_rope: "Rope (driver)", j_p: "Platform", j_b: "Pin b"}
  proof: {label: "Otis's safety-stop", sub: "the rope breaks and the pawls catch the platform"}

