# No. 1, Belt and Pulleys (Brown 1868, p. 1).
# Fully physical: only the upper pulley is motor-driven. The belt is a closed chain of 120
# elastic leather links (pin + axial spring), pretensioned, which turns the lower pulley by friction.
number: 1
slug: belt-and-pulleys
name: Belt and Pulleys
brown: "Illustrates the transmission of power by simple pulleys and an open belt. In this case both of the pulleys rotate in the same direction."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 50, duration_s: 8}
bodies:
  - {id: p_top, shape: pulley, radius: 9, width: 4, pos: [0, 0, 62], mass: 2.0, spokes: 4, hub: 2.4}
  - {id: p_bot, shape: pulley, radius: 9, width: 4, pos: [0, 0, 12], mass: 2.0, spokes: 4, hub: 2.4}
joints:
  - {id: j_top, type: hinge, body: p_top, axis: [0, 1, 0], damping: 0.002}
  - {id: j_bot, type: hinge, body: p_bot, axis: [0, 1, 0], damping: 0.05}   # the load
belts:
  - id: belt
    around: [p_top, p_bot]
    links: 120
    thickness: 0.4
    width: 3.2
    density: 950
    stiffness: 30000      # N/m per link
    damping: 2
    pretension: 30        # N
    friction: 0.6         # leather on iron
contact: {solref: [0.004, 1], solimp: [0.9, 0.95, 0.001], margin: 0}
driver: {joint: j_top, kind: velocity, rpm: 30, kv: 2, max_torque: 5}
checks:
  # Equal pulleys: the driven pulley should turn the same way at the same speed, less belt creep.
  - {type: ratio, out: j_bot, in: j_top, expect: 1.0, tol: 0.03, settle_s: 1, window_s: 1}
  - {type: belt_on, belt: belt, max_radial_dev: 1.0, max_lateral: 0.6, duration_s: 2}
camera: {target: [0, 0, 33], position: [52, -168, 50], fov: 30}
display:
  output: j_bot
  labels: {j_top: Upper pulley (driver), j_bot: Lower pulley}
  resize: {p_top: [5, 13], p_bot: [5, 13]}
  light_links: 60
  expect: {default: 1.0}
