# No. 12, Simple Pulley for Lifting Weights (Brown 1868, p. 2).
#
# "Simple pulley used for lifting weights. In this the power must be equal to the weight to obtain
# equilibrium."
#
# Layout, as in the plate: a fixed pulley hangs on a hook from the ceiling; the rope runs over it,
# down-left to a hand that pulls it, and straight down on the right to a bag. Nothing is driven but
# the hand: a slide joint in a guide along the rope, pulled at a constant 6 cm/s — the same direction
# as the rope's strand there, so the force that joint measures is the pull itself. The bag hangs from
# its end of the rope on a vertical guide (the rope is what keeps a load under a pulley, and the
# plate draws it plumb), the pulley turns on its axle, and the rope is a real rope: 34 round links
# with a stretch joint at each, its two eyes pinned to the hand and to the bag. So the load is
# carried by the rope's own tension, the pulley is turned by the rope rubbing on its rim, and the
# whole lift is contact and friction — nothing couples the hand to the bag except the rope.
#
# Brown's statement is what the checks measure: the bag rises at the speed the hand pulls (1.0), and
# the pull needed in a steady lift is the bag's weight (196 N for 20 kg), the rope itself hanging on
# the hand side adding 0.6 N (0.3%) and the sheave's bearing friction a little more.
number: 12
slug: simple-pulley-for-lifting-weights
name: Simple Pulley for Lifting Weights
brown: "Simple pulley used for lifting weights. In this the power must be equal to the weight to obtain equilibrium."
units: cm
sim: {timestep: 0.0001, integrator: implicitfast, iterations: 60, duration_s: 2.4}
bodies:
  # Fixed structure: the ceiling, and the hook and eye the pulley's axle hangs in.
  - id: beam
    shape: frame
    color: "#cdc0a4"
    rods: [{from: [0, 0, 78.4], to: [0, 0, 64.6], radius: 0.42}, {from: [-2.9, 0, 63.7], to: [2.9, 0, 63.7], radius: 0.42}]
    boxes: [{pos: [0, 0, 79.4], size: [21, 3.2, 1.1]}]
  # The pulley: a solid sheave on its axle, as Brown draws it (no spokes).
  - {id: pulley, shape: pulley, radius: 9, width: 3.2, pos: [0, 0, 62], mass: 1.2, spokes: 0, hub: 1.8, flange: 0.5, color: "#e6dcc6"}
  # The hand, gripping the rope: a guide along the rope's strand, carrying the drawn fist and sleeve.
  - id: hand
    shape: grip
    pos: [-27.86, 0, 47.434]
    mass: 0.9
    color: "#c9bda2"
    rods:
      # the hand as the plate shows it: a fist closed on the rope, then the cuff and the forearm
      - {from: [-29.7, 0, 45.6], to: [-26.45, 0, 48.85], radius: 2.0}     # the fist
      - {from: [-32.1, 0, 43.19], to: [-29.7, 0, 45.6], radius: 1.55}     # the cuff
      - {from: [-34.93, 0, 40.36], to: [-32.1, 0, 43.19], radius: 1.25}   # the forearm
  # The load: a sack hung by its neck.
  - {id: bag, shape: weight, pos: [9.4, 0, 21.6], mass: 20, size: [5.6, 5.6, 9.0], taper: 0.34, color: "#b9a179"}
joints:
  - {id: j_pulley, type: hinge, body: pulley, axis: [0, 1, 0], damping: 0.01}   # the axle in the hook's eye
  - {id: j_hand, type: slide, body: hand, axis: [-0.7071068, 0, -0.7071068]}  # the hand's guide, along the rope
  - {id: j_bag, type: slide, body: bag, axis: [0, 0, 1], range: [-2, 60]}      # the bag hangs plumb
cords:   # the rope: a chain of links on real contact with the sheave
  # One rope, from the hand over the sheave to the bag. Its centreline rides 0.4 cm above the rim.
  - id: rope
    from: {body: hand, at: [-27.86, 0, 47.434]}
    to: {body: bag, at: [9.4, 0, 31.2]}
    over: [pulley]
    links: 34
    thickness: 0.8
    density: 1400          # hemp
    stiffness: 400000      # N/m per link: a rope is nearly inextensible (196 N stretches it 1.6 cm)
    pretension: 196        # N, so the rope hangs taut at the start, as it would under its load
    damping: 12
    friction: 0.5          # hemp on a wooden sheave
# The rope lies on the sheave under the load's whole weight, so its contact has to be stiff:
# the links press about 2.5 mm into the rim, which the pull then has to work against.
contact: {solref: [0.0005, 1], solimp: [0.98, 0.999, 0.0001], margin: 0}
driver: {joint: j_hand, kind: velocity, speed: 6, kv: 60000, max_torque: 600}
checks:
  # A fixed pulley has no advantage: the bag rises exactly as fast as the hand pulls (1.0). The rope
  # takes up about 2 cm of its own stretch in the first second, so the window is taken after that.
  - {type: ratio, out: j_bag, in: j_hand, expect: 1.0, tol: 0.03, settle_s: 1.2, window_s: 1.0}
  # The rope rubs the sheave round as it passes over it: v = ωR with R = 9 + 0.4 = 9.4 cm, so
  # ω/v = 10.64 rad/s per cm/s, the sheave turning the way the rope runs over it. Nothing turns the
  # axle but the rope on the rim.
  - {type: ratio, out: j_pulley, in: j_hand, expect: -10.638, tol: 0.6, settle_s: 1.2, window_s: 1.0}
  # Brown's point: the pull in a steady lift is the weight: 20 kg = 196.2 N, the rope's own 0.59 kg
  # adds 0.6 N on this side, and the hand's own 0.9 kg already pulls 6.2 N along the rope (its guide
  # is the rope's own strand, which slopes down at 45 deg), so 191 N is the balance to expect.
  - {type: force, expect: 191, tol: 10, settle_s: 1.2, window_s: 1.0}
  # And the bag is seen to rise: 6 cm/s after the rope takes up.
  - {type: position, joint: j_bag, min: 3, max: 12, settle_s: 1.2, window_s: 1.2}
  - {type: penetration, max: 0.001, settle_s: 1.2}
camera: {target: [-9, 0, 47], position: [30, -186, 58], fov: 30}   # the plate's view: rope, sheave and bag
display:
  output: j_bag
  labels: {j_hand: Hand pulling the rope (driver), j_bag: Bag on the rope's end, j_pulley: Pulley on its hook}
  expect: {default: 1.0}
