# No. 243 (Brown 1868): "Represents a mode of transmitting power from a horizontal shaft to two vertical ones by means of pulleys and a band."
#
# Model (cm, gravity on): the driving pulley (radius 6) on the horizontal shaft, turned at 30 rev/min (the one driven joint), with two guide
# pulleys (radius 3.5) on horizontal studs either side of it and above. The band, a round cord of links on real contact, runs under the driving
# pulley, up over each guide, which turns it to run level at the guides' height (6) along the front of an upright drum (radius 5); it goes half
# round each drum and the two drums are joined by the band's back run. So one horizontal shaft turns two upright ones, the same way, at the ratio of
# the pulleys. A spatial route (src/geom/path3d.ts), as in No. 4. Generator: opencode-runs/batch11/gen243.py.
number: 243
slug: horizontal-to-two-upright-shafts
name: Power from a horizontal shaft to two vertical ones by pulleys and a band
brown: "Represents a mode of transmitting power from a horizontal shaft to two vertical ones by means of pulleys and a band."
units: cm
sim: {timestep: 0.0001, integrator: implicitfast, iterations: 50, duration_s: 5, floor: false}
bodies:
  - {id: p_main, shape: pulley, radius: 6, width: 2.4, groove: 1.0, flange: 0.5, pos: [0, -5, 0], mass: 1.5, spokes: 0, hub: 2.2}
  - {id: g_left, shape: pulley, radius: 3.5, width: 2.0, groove: 1.0, flange: 0.5, pos: [-15, -5, 2.5], mass: 0.4, spokes: 0, hub: 1.2, color: "#e6dcc4"}
  - {id: g_right, shape: pulley, radius: 3.5, width: 2.0, groove: 1.0, flange: 0.5, pos: [15, -5, 2.5], mass: 0.4, spokes: 0, hub: 1.2, color: "#e6dcc4"}
  - {id: d_left, shape: assembly, pos: [-29, 0, 6], color: "#ded2b6"}
  - {id: d_right, shape: assembly, pos: [29, 0, 6], color: "#ded2b6"}
wheels:
  - {id: w_left, body: d_left, pos: [0, 0, 0], quat: [0.7071068, 0.7071068, 0, 0], radius: 5, width: 4.5, groove: 1.0, flange: 0.7, mass: 1.0, spokes: 0, hub: 2.0, color: "#ded2b6"}
  - {id: w_right, body: d_right, pos: [0, 0, 0], quat: [0.7071068, 0.7071068, 0, 0], radius: 5, width: 4.5, groove: 1.0, flange: 0.7, mass: 1.0, spokes: 0, hub: 2.0, color: "#ded2b6"}
shafts:
  - {id: s_left, body: d_left, from: [0, 0, -14], to: [0, 0, 12], radius: 0.9}    # the upright shafts
  - {id: s_right, body: d_right, from: [0, 0, -14], to: [0, 0, 12], radius: 0.9}
  - {id: s_main, body: p_main, from: [0, -3, 0], to: [0, 9, 0], radius: 0.8}     # the horizontal shaft
joints:
  - {id: j_main, type: hinge, body: p_main, axis: [0, 1, 0], damping: 0.002}
  - {id: j_gl, type: hinge, body: g_left, axis: [0, 1, 0], damping: 0.0005}
  - {id: j_gr, type: hinge, body: g_right, axis: [0, 1, 0], damping: 0.0005}
  - {id: j_left, type: hinge, body: d_left, axis: [0, 0, 1], damping: 0.01}    # the loads
  - {id: j_right, type: hinge, body: d_right, axis: [0, 0, 1], damping: 0.01}
belts:
  - id: band
    around: [p_main, g_left, w_left, w_right, g_right]
    senses: [1, -1, -1, -1, -1]
    section: round
    self_contact: false
    links: 160
    segments: 16
    thickness: 0.6
    width: 0.6
    density: 950
    stiffness: 30000
    damping: 2
    pretension: 20
    joint_armature: 0.000001
    root_damping: 0.0001
    friction: 0.6
contact: {solref: [0.002, 1], solimp: [0.9, 0.95, 0.001], margin: 0}
driver: {joint: j_main, kind: velocity, rpm: 30, kv: 2, max_torque: 5}
checks:
  - {type: ratio, out: j_left, in: j_main, expect: -1.18, tol: 0.06, settle_s: 1, window_s: 1.5}
  - {type: ratio, out: j_right, in: j_main, expect: -1.18, tol: 0.06, settle_s: 1, window_s: 1.5}
  - {type: belt_on, belt: band, max_radial_dev: 2.5, max_lateral: 1.0, duration_s: 2}
  - {type: penetration, max: 0.0035, settle_s: 0.5}
camera: {target: [0, 0, 3], position: [0, -175, 38], fov: 30}
display:
  output: j_left
  labels: {j_main: "Horizontal shaft (motor)", j_gl: "Left guide pulley", j_gr: "Right guide pulley", j_left: "Left upright shaft", j_right: "Right upright shaft"}
  expect: {default: -1.18}

