# No. 388 (Brown 1868): "Feed-motion of Woodworth’s planing machine, a smooth supporting roller, and a toothed top roller."
#
# Model (cm, gravity on): the board (3 cm thick) lies on the smooth supporting roller (radius 7, free on its axis); the toothed top roller
# (20 pointed teeth, radius 6 + 1.3) is driven (the one driven joint, 10 rpm) and bears on the board by its weighted bearings (8 kg,
# free to rise on a vertical guide). The teeth's grip (friction alone, on their points) feeds the board along; the board, free to rise and fall
# on the lower roller and to slide along, turns that roller in its turn.
# Generator: opencode-runs/batch13/gen388.py.
number: 388
slug: woodworth-planer-feed
name: Feed-motion of Woodworth's planing machine
brown: "Feed-motion of Woodworth’s planing machine, a smooth supporting roller, and a toothed top roller."
units: cm
sim: {timestep: 0.0005, integrator: implicitfast, iterations: 60, duration_s: 5, floor: false}
bodies:
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#8f8a80"
    pieces:
      - {kind: poly, points: [[-1.2, 19.6], [1.2, 19.6], [1.2, 29.6], [-1.2, 29.6]], y: [9.5, 11.0], collide: 0}   # the top roller's guide (behind)
  - id: roll_l
    shape: part
    pos: [0, 0, -7.0]
    density: 7800
    friction: 0.6
    color: "#d8cfbd"
    pieces:
      - {kind: rod, from: [0, -6.0, -7.0], to: [0, 6.0, -7.0], radius: 7.0, capsule: true, collide: 1}   # the smooth supporting roller
      - {kind: rod, from: [0, -6.1, -7.0], to: [0, -6.3, -7.0], radius: 1.8, collide: 0, color: "#5e5850"}   # its shaft
      - {kind: rod, from: [0, -6.3, -7.0], to: [0, -6.5, -7.0], radius: 6.6, collide: 0, color: "#cfc6b4"}   # its end face's rim
  - id: yoke
    shape: part
    pos: [0, 0, 10.3]
    density: 7800
    mass: 8.0
    color: "#6f675c"
    pieces:
      - {kind: rod, from: [0, 6.5, 10.3], to: [0, 10.0, 10.3], radius: 1.2, collide: 0}   # the top roller's bearing, weighted
      - {kind: poly, points: [[-1.5, 10.3], [1.5, 10.3], [1.5, 25.6], [-1.5, 25.6]], y: [8.0, 9.5], collide: 0}
  - id: roll_t
    shape: part
    pos: [0, 0, 10.3]
    mount: yoke
    density: 7800
    friction: 0.9
    color: "#d8cfbd"
    pieces:
      - {kind: rod, from: [0, -6.0, 10.3], to: [0, 6.0, 10.3], radius: 6.0, collide: 0}   # the toothed top roller's body
      - {kind: rod, from: [0, -6.1, 10.3], to: [0, -6.3, 10.3], radius: 1.2, collide: 0, color: "#5e5850"}   # its shaft
      - {kind: loft, a: [[-0.82, -6.0, 16.0619], [0.82, -6.0, 16.0619], [0.0, -6.0, 17.6]], b: [[-0.82, 6.0, 16.0619], [0.82, 6.0, 16.0619], [0.0, 6.0, 17.6]], collide: 1}   # a tooth (each its own convex prism across the roller's face)
      - {kind: loft, a: [[1.0006, -6.0, 16.0333], [2.5604, -6.0, 15.5265], [2.2558, -6.0, 17.2427]], b: [[1.0006, 6.0, 16.0333], [2.5604, 6.0, 15.5265], [2.2558, 6.0, 17.2427]], collide: 1}
      - {kind: loft, a: [[2.7234, -6.0, 15.4435], [4.0502, -6.0, 14.4795], [4.2908, -6.0, 16.2058]], b: [[2.7234, 6.0, 15.4435], [4.0502, 6.0, 14.4795], [4.2908, 6.0, 16.2058]], collide: 1}
      - {kind: loft, a: [[4.1795, -6.0, 14.3502], [5.1435, -6.0, 13.0234], [5.9058, -6.0, 14.5908]], b: [[4.1795, 6.0, 14.3502], [5.1435, 6.0, 13.0234], [5.9058, 6.0, 14.5908]], collide: 1}
      - {kind: loft, a: [[5.2265, -6.0, 12.8604], [5.7333, -6.0, 11.3006], [6.9427, -6.0, 12.5558]], b: [[5.2265, 6.0, 12.8604], [5.7333, 6.0, 11.3006], [6.9427, 6.0, 12.5558]], collide: 1}
      - {kind: loft, a: [[5.7619, -6.0, 11.12], [5.7619, -6.0, 9.48], [7.3, -6.0, 10.3]], b: [[5.7619, 6.0, 11.12], [5.7619, 6.0, 9.48], [7.3, 6.0, 10.3]], collide: 1}
      - {kind: loft, a: [[5.7333, -6.0, 9.2994], [5.2265, -6.0, 7.7396], [6.9427, -6.0, 8.0442]], b: [[5.7333, 6.0, 9.2994], [5.2265, 6.0, 7.7396], [6.9427, 6.0, 8.0442]], collide: 1}
      - {kind: loft, a: [[5.1435, -6.0, 7.5766], [4.1795, -6.0, 6.2498], [5.9058, -6.0, 6.0092]], b: [[5.1435, 6.0, 7.5766], [4.1795, 6.0, 6.2498], [5.9058, 6.0, 6.0092]], collide: 1}
      - {kind: loft, a: [[4.0502, -6.0, 6.1205], [2.7234, -6.0, 5.1565], [4.2908, -6.0, 4.3942]], b: [[4.0502, 6.0, 6.1205], [2.7234, 6.0, 5.1565], [4.2908, 6.0, 4.3942]], collide: 1}
      - {kind: loft, a: [[2.5604, -6.0, 5.0735], [1.0006, -6.0, 4.5667], [2.2558, -6.0, 3.3573]], b: [[2.5604, 6.0, 5.0735], [1.0006, 6.0, 4.5667], [2.2558, 6.0, 3.3573]], collide: 1}
      - {kind: loft, a: [[0.82, -6.0, 4.5381], [-0.82, -6.0, 4.5381], [0.0, -6.0, 3.0]], b: [[0.82, 6.0, 4.5381], [-0.82, 6.0, 4.5381], [0.0, 6.0, 3.0]], collide: 1}
      - {kind: loft, a: [[-1.0006, -6.0, 4.5667], [-2.5604, -6.0, 5.0735], [-2.2558, -6.0, 3.3573]], b: [[-1.0006, 6.0, 4.5667], [-2.5604, 6.0, 5.0735], [-2.2558, 6.0, 3.3573]], collide: 1}
      - {kind: loft, a: [[-2.7234, -6.0, 5.1565], [-4.0502, -6.0, 6.1205], [-4.2908, -6.0, 4.3942]], b: [[-2.7234, 6.0, 5.1565], [-4.0502, 6.0, 6.1205], [-4.2908, 6.0, 4.3942]], collide: 1}
      - {kind: loft, a: [[-4.1795, -6.0, 6.2498], [-5.1435, -6.0, 7.5766], [-5.9058, -6.0, 6.0092]], b: [[-4.1795, 6.0, 6.2498], [-5.1435, 6.0, 7.5766], [-5.9058, 6.0, 6.0092]], collide: 1}
      - {kind: loft, a: [[-5.2265, -6.0, 7.7396], [-5.7333, -6.0, 9.2994], [-6.9427, -6.0, 8.0442]], b: [[-5.2265, 6.0, 7.7396], [-5.7333, 6.0, 9.2994], [-6.9427, 6.0, 8.0442]], collide: 1}
      - {kind: loft, a: [[-5.7619, -6.0, 9.48], [-5.7619, -6.0, 11.12], [-7.3, -6.0, 10.3]], b: [[-5.7619, 6.0, 9.48], [-5.7619, 6.0, 11.12], [-7.3, 6.0, 10.3]], collide: 1}
      - {kind: loft, a: [[-5.7333, -6.0, 11.3006], [-5.2265, -6.0, 12.8604], [-6.9427, -6.0, 12.5558]], b: [[-5.7333, 6.0, 11.3006], [-5.2265, 6.0, 12.8604], [-6.9427, 6.0, 12.5558]], collide: 1}
      - {kind: loft, a: [[-5.1435, -6.0, 13.0234], [-4.1795, -6.0, 14.3502], [-5.9058, -6.0, 14.5908]], b: [[-5.1435, 6.0, 13.0234], [-4.1795, 6.0, 14.3502], [-5.9058, 6.0, 14.5908]], collide: 1}
      - {kind: loft, a: [[-4.0502, -6.0, 14.4795], [-2.7234, -6.0, 15.4435], [-4.2908, -6.0, 16.2058]], b: [[-4.0502, 6.0, 14.4795], [-2.7234, 6.0, 15.4435], [-4.2908, 6.0, 16.2058]], collide: 1}
      - {kind: loft, a: [[-2.5604, -6.0, 15.5265], [-1.0006, -6.0, 16.0333], [-2.2558, -6.0, 17.2427]], b: [[-2.5604, 6.0, 15.5265], [-1.0006, 6.0, 16.0333], [-2.2558, 6.0, 17.2427]], collide: 1}
  - id: board_z
    shape: part
    pos: [0, 0, 1.5]
    density: 600
    mass: 0.05
    color: "#c9a873"
    pieces:
      - {kind: rod, from: [0, -0.1, 1.5], to: [0, 0.1, 1.5], radius: 0.1, collide: 0}
  - id: board
    shape: part
    pos: [0, 0, 1.5]
    mount: board_z
    density: 600
    friction: 0.9
    color: "#c9a873"
    pieces:
      - {kind: poly, points: [[-46.0, 0], [16.0, 0], [16.0, 3.0], [-46.0, 3.0]], y: [-4.5, 4.5], collide: 2}   # the board, fed between the rollers
      - {kind: rod, from: [-43.0, -4.55, 0.4], to: [-38.5, -4.55, 2.6], radius: 0.12, collide: 0, color: "#a88c5e"}   # its grain, as Brown hatches its end
      - {kind: rod, from: [-36.2, -4.55, 0.4], to: [-31.7, -4.55, 2.6], radius: 0.12, collide: 0, color: "#a88c5e"}
      - {kind: rod, from: [-29.4, -4.55, 0.4], to: [-24.9, -4.55, 2.6], radius: 0.12, collide: 0, color: "#a88c5e"}
      - {kind: rod, from: [-22.6, -4.55, 0.4], to: [-18.1, -4.55, 2.6], radius: 0.12, collide: 0, color: "#a88c5e"}
      - {kind: rod, from: [-15.8, -4.55, 0.4], to: [-11.3, -4.55, 2.6], radius: 0.12, collide: 0, color: "#a88c5e"}
      - {kind: rod, from: [-9.0, -4.55, 0.4], to: [-4.5, -4.55, 2.6], radius: 0.12, collide: 0, color: "#a88c5e"}
      - {kind: rod, from: [-2.2, -4.55, 0.4], to: [2.3, -4.55, 2.6], radius: 0.12, collide: 0, color: "#a88c5e"}
      - {kind: rod, from: [4.6, -4.55, 0.4], to: [9.1, -4.55, 2.6], radius: 0.12, collide: 0, color: "#a88c5e"}
      - {kind: rod, from: [11.4, -4.55, 0.4], to: [15.9, -4.55, 2.6], radius: 0.12, collide: 0, color: "#a88c5e"}
joints:
  - {id: j_t, type: hinge, body: roll_t, axis: [0, 1, 0], damping: 0.01}   # the toothed top roller: the one driven joint
  - {id: j_y, type: slide, body: yoke, axis: [0, 0, 1], range: [-1.0, 3.0], damping: 2.0}   # its weighted bearings, free to rise on the guide
  - {id: j_l, type: hinge, body: roll_l, axis: [0, 1, 0], frictionloss: 0.02, damping: 0.005}   # the smooth supporting roller, free on its axis
  - {id: j_bz, type: slide, body: board_z, axis: [0, 0, 1], damping: 1.0}   # the board, free to rise and fall
  - {id: j_bx, type: slide, body: board, axis: [1, 0, 0], damping: 0.5}   # and to slide along
driver: {joint: j_t, kind: velocity, rpm: -10.0, kv: 30.0, max_torque: 20}
checks:
  - {type: follow, out: j_bx, in: j_t, expect: -0.073, tol: 0.06, min_r2: 0.99, settle_s: 0.5, window_s: 4}   # the teeth feed the board along, at their points' speed
  - {type: follow, out: j_l, in: j_t, expect: -1.0429, tol: 0.06, min_r2: 0.99, settle_s: 0.5, window_s: 4}   # the board turns the smooth roller
camera: {target: [-6.0, 0, 4.0], position: [0.0, -95.0, 10.0], fov: 34}
display:
  output: j_bx
  labels: {j_t: "Toothed roller (driver)", j_bx: "Board, fed", j_l: "Smooth roller"}
  proof: {label: "No grip on the board", sub: "the teeth slip over it and it stays put"}
