# No. 141 (Brown 1868): "Endless-band saw. Continuous rotary motion of the pulleys is made to produce continuous rectilinear motion of the straight parts of the saw."
#
# Model (cm): two equal pulleys (radius 9.0) one over the other carry a closed band of elastic steel-like links; the upper is the one driven joint
# (30 turns a minute), the lower is turned by the band alone against a light bearing brake. The straight runs travel at one pulley rim speed
# (9.2 cm per radian). A small roller (radius 3.0) on the back of the right-hand run, deflecting it 2.0 cm, is turned by the band alone and
# measures that speed; the table and the work are only drawn. Generator: opencode-runs/batch10/gen141.py.
number: 141
slug: endless-band-saw
name: Endless-band saw
brown: "Continuous rotary motion of the pulleys is made to produce continuous rectilinear motion of the straight parts of the saw."
units: cm
sim: {timestep: 0.0001, integrator: implicitfast, iterations: 50, duration_s: 8, gravity: 0}
bodies:
  - {id: p_top, shape: pulley, radius: 9.0, width: 4, pos: [0, 0, 62.0], mass: 2.0, spokes: 4, hub: 2.4}
  - {id: p_bot, shape: pulley, radius: 9.0, width: 4, pos: [0, 0, 8.0], mass: 2.0, spokes: 4, hub: 2.4}
  - {id: p_T, shape: pulley, radius: 3.0, width: 4, pos: [10.4, 0, 50.0], mass: 0.3, spokes: 0, hub: 1.0, color: "#e3d7bd"}
  - id: table
    shape: part
    pos: [0, 0, 0]
    fixed: true
    pieces:
      - {kind: poly, points: [[-16, 29.0], [8.2, 29.0], [8.2, 31.0], [-16, 31.0]], y: [-4.5, 4.5], collide: 0, color: "#b9a98a"}
      - {kind: poly, points: [[10.2, 29.0], [28, 29.0], [28, 31.0], [10.2, 31.0]], y: [-4.5, 4.5], collide: 0, color: "#b9a98a"}
      - {kind: poly, points: [[8.2, 29.0], [10.2, 29.0], [10.2, 31.0], [8.2, 31.0]], y: [-4.5, -1.8], collide: 0, color: "#b9a98a"}
      - {kind: poly, points: [[4, 31.0], [8.899999999999999, 31.0], [8.899999999999999, 38.0], [4, 38.0]], y: [-3, 3], collide: 0, color: "#8f6a43"}
      - {kind: poly, points: [[9.5, 31.0], [17, 31.0], [17, 38.0], [9.5, 38.0]], y: [-3, 3], collide: 0, color: "#8f6a43"}
      - {kind: poly, points: [[5, 17.0], [8, 17.0], [8, 29.0], [5, 29.0]], y: [-3.5, -2.5], collide: 0, color: "#a89a7e"}
      - {kind: poly, points: [[18, 17.0], [21, 17.0], [21, 29.0], [18, 29.0]], y: [-3.5, -2.5], collide: 0, color: "#a89a7e"}
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.01, frictionloss: 0.05}   # the load: a bearing brake
  - {id: j_T, type: hinge, body: p_T, axis: [0, 1, 0], damping: 0.0005}
belts:
  - id: belt
    around: [p_top, p_bot, p_T]    # counter-clockwise: over the top, down the left run, round the bottom, up the right run past the roller
    outside: [p_T]
    links: 110
    segments: 11
    thickness: 0.4
    width: 3.2
    density: 950
    stiffness: 100000.0
    damping: 2
    pretension: 4.0
    friction: 0.6
contact: {solref: [0.004, 1], solimp: [0.9, 0.95, 0.001], margin: 0}
driver: {joint: j_top, kind: velocity, rpm: 30.0, kv: 2, max_torque: 5}
checks:
  - {type: ratio, out: j_bot, in: j_top, expect: 1.0, tol: 0.03, settle_s: 1.5, window_s: 2}
  - {type: ratio, out: j_T, in: j_top, expect: -2.9, tol: 0.15, settle_s: 1.5, window_s: 2}
  - {type: belt_on, belt: belt, max_radial_dev: 1.5, max_lateral: 0.6, duration_s: 2.5}
  - {type: penetration, max: 0.002, settle_s: 1}
camera: {target: [3, 0, 33.0], position: [0, -190.0, 33.0], fov: 30}
display:
  tiers:
    - {id: full, label: Full, ms: 1.0}
    - {id: friction, label: Friction model, timestep: 0.002, integrator: discrete, model: capstan, ms: 0.02}
  output: j_bot
  labels: {j_top: "Upper pulley (driver)", j_bot: "Lower pulley", j_T: "Speed roller"}
  expect: {default: 1.0}

