# No. 256 (Brown 1868): "A plain pulley for a flat belt."
#
# Model (cm, gravity on, front view, shafts level): two plain pulleys (no flanges, faces 4 wide), the larger (radius 9) on the driving shaft,
# turned at 40 rpm (the one driven joint), the smaller (radius 5.5) 30 away carrying a load (a damper). A flat belt of links on real contact,
# tensioned, lies on the plain faces and drives the smaller by friction at the ratio of the pitch radii, r + 0.2 (1.6140).
# Generator: opencode-runs/batch11/gen256.py.
number: 256
slug: plain-pulley-flat-belt
name: A plain pulley for a flat belt
brown: "A plain pulley for a flat belt."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 50, duration_s: 6, floor: false}
bodies:
  - {id: p_a, shape: pulley, radius: 9, width: 4, flange: 0, pos: [0, 0, 0], mass: 2.0, spokes: 6, hub: 2.4}
  - {id: p_b, shape: pulley, radius: 5.5, width: 4, flange: 0, pos: [30, 0, 0], mass: 1.2, spokes: 4, hub: 1.8, color: "#e6dcc4"}
shafts:
  - {id: s_a, body: p_a, from: [0, -4, 0], to: [0, 6, 0], radius: 0.8}
  - {id: s_b, body: p_b, from: [0, -4, 0], to: [0, 6, 0], radius: 1.0}
joints:
  - {id: j_a, type: hinge, body: p_a, axis: [0, 1, 0], damping: 0.002}   # the one driven joint
  - {id: j_b, type: hinge, body: p_b, axis: [0, 1, 0], damping: 0.05}   # the load
belts:
  - id: belt
    around: [p_a, p_b]
    links: 120
    thickness: 0.4
    width: 3.4
    density: 950
    stiffness: 30000
    damping: 2
    pretension: 30
    friction: 0.6
contact: {solref: [0.004, 1], solimp: [0.9, 0.95, 0.001], margin: 0}
driver: {joint: j_a, kind: velocity, rpm: 40, kv: 2, max_torque: 5}
checks:
  - {type: ratio, out: j_b, in: j_a, expect: 1.6140, tol: 0.03, settle_s: 1, window_s: 4.5}   # the ratio of the pitch radii, less creep
  - {type: belt_on, belt: belt, max_radial_dev: 1.0, max_lateral: 0.6, duration_s: 2}
  - {type: penetration, max: 0.004, settle_s: 0.5}
camera: {target: [15, 0, 0], position: [33, -105, 14], fov: 30}
display:
  output: j_b
  labels: {j_a: "Large pulley (driver)", j_b: "Small pulley"}
  expect: {default: 1.6140}

