# No. 9, Variable Speed Cone Pulleys (Brown 1868, p. 1).
#
# "9. Cone-pulleys for the same purpose as 8. This motion is used in cotton machinery, and in all
# machines which are required to run with a gradually increased or diminished speed."
#
# Layout, from the plate: two horizontal shafts, one above the other, each carrying a straight cone,
# the two cones turned opposite ways (the upper large at its left end, the lower large at its right),
# so that the sum of the two radii is the same at every station and one band fits all of them. The
# band hangs at one axial station and is traversed along the cones by hand to vary the speed
# gradually, which is the point of the movement (No. 8 does it in four steps).
#
# Fully physical: only the upper shaft is motor-driven. A flat band of 120 elastic links,
# pretensioned, turns the lower cone by friction alone. Each cone is collided as a stack of eight
# convex frustum hulls (the profile: primitive of No. 10; a straight cone is the simplest profile).
# A planar band cannot follow the taper: it rests where the cone comes up to its face near the edge
# of its width. No fork: as in the plate the taut band keeps its station by itself. The station is
# the passive configuration: the three stations in `variants` are all compiled and tested.
number: 9
slug: variable-speed-cone-pulleys
name: Variable Speed Cone Pulleys
brown: "Cone-pulleys for the same purpose as 8. This motion is used in cotton machinery, and in all machines which are required to run with a gradually increased or diminished speed."
units: cm
sim: {floor: false, timestep: 0.0001, integrator: implicitfast, iterations: 60, duration_s: 4}
bodies:
  # straight cones, 26 long: r = 5.45 ∓ 4.1·y/26 (7.5 → 3.4 above, 3.4 → 7.5 below)
  - {id: p_top, shape: pulley, radius: 7.5, width: 26, pos: [0, 0, 50], mass: 1.6, spokes: 0, hub: 1.3,
     profile: [[-13, 7.5], [-9.75, 6.9875], [-6.5, 6.475], [-3.25, 5.9625], [0, 5.45], [3.25, 4.9375], [6.5, 4.425], [9.75, 3.9125], [13, 3.4]]}
  - {id: p_bot, shape: pulley, radius: 7.5, width: 26, pos: [0, 0, 0], mass: 1.6, spokes: 0, hub: 1.3,
     profile: [[-13, 3.4], [-9.75, 3.9125], [-6.5, 4.425], [-3.25, 4.9375], [0, 5.45], [3.25, 5.9625], [6.5, 6.475], [9.75, 6.9875], [13, 7.5]]}
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]
    station: 0                # the band, as drawn in the plate (world y): the middle of both cones
    section: flat
    links: 120
    segments: 8
    joint_armature: 0.002
    thickness: 0.8
    width: 2.0
    density: 4000
    stiffness: 300000
    damping: 2
    pretension: 30
    bend_damping: 0.02
    friction: 0.6             # the band on iron
contact: {solref: [0.006, 1], solimp: [0.9, 0.95, 0.001], margin: 0}
driver: {joint: j_top, kind: velocity, rpm: 30, kv: 2, max_torque: 5}
# Passive configurations: the band traversed along the cones. −8 = on the upper cone's large end and
# the lower's small end (the lower shaft fastest); 0 = the plate (equal radii, 1:1); +8 = the other
# way (the lower shaft slowest).
variants:
  - id: fast
    note: "band to the left: on the upper cone's large end and the lower's small end, so the lower shaft turns fastest"
    belt_station: {belt: -8}
  - id: plate
    note: "the band where the plate has it, in the middle of both cones: equal radii, 1:1"
    belt_station: {belt: 0}
  - id: slow
    note: "band to the right: on the upper cone's small end and the lower's large end, so the lower shaft turns slowest"
    belt_station: {belt: 8}
variant: plate
checks:
  - {type: ratio, out: j_bot, in: j_top, expect: 1.0, tol: 0.05, settle_s: 1.2, window_s: 1}
  - {type: belt_on, belt: belt, max_radial_dev: 1.2, max_lateral: 2.0, duration_s: 2.2}
  # the band's soft contact (as No. 10's) sinks up to 3 mm where a link crosses a facet edge of the
  # 12-sided frustum hulls (a stiffer contact makes it worse: 4.0 mm at solref 0.004)
  - {type: penetration, max: 0.003, settle_s: 1.2}
camera: {target: [0, 0, 25], position: [180, 11, 30], fov: 30}   # side view as in the plate, the shafts horizontal
display:
  output: j_bot
  labels: {j_top: Upper cone (driver), j_bot: Lower cone}
  expect: {default: 1.0, plate: 1.0, fast: 1.5, slow: 0.64}
