number: 358
slug: fusee-traverse
name: Traverse of carriage made variable by fusee
brown: "Traverse of carriage, made variable by fusee according to the variation in diameter where the band acts."
units: cm
sim: {timestep: 0.0001, integrator: implicitfast, iterations: 60, duration_s: 8, floor: false}
bodies:
  # the fusee on its shaft, with a flange each side to keep the band on
  - {id: fusee, shape: assembly, pos: [0, 0, 0], color: "#c9b48a"}
  - id: fusee_face
    shape: part
    pos: [0, 0, 0]
    mount: fusee
    density: 300
    color: "#c9b48a"
    pieces:
      - {kind: poly, points: [[0, 0], [-1.4116, 2.0633], [-1.1892, 2.199]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-1.1892, 2.199], [-0.9539, 2.3108]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-0.9539, 2.3108], [-0.7083, 2.3976]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-0.7083, 2.3976], [-0.455, 2.4583]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-0.455, 2.4583], [-0.1967, 2.4922]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-0.1967, 2.4922], [0.0637, 2.4992]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [0.0637, 2.4992], [0.3234, 2.479]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [0.3234, 2.479], [0.5796, 2.4319]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [0.5796, 2.4319], [0.8295, 2.3584]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [0.8295, 2.3584], [1.0704, 2.2592]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [1.0704, 2.2592], [1.324, 2.1755]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [1.324, 2.1755], [1.6064, 2.1088]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [1.6064, 2.1088], [1.8886, 2.0061]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [1.8886, 2.0061], [2.166, 1.8668]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [2.166, 1.8668], [2.4342, 1.6907]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [2.4342, 1.6907], [2.6882, 1.4785]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [2.6882, 1.4785], [2.9235, 1.2312]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [2.9235, 1.2312], [3.1356, 0.9505]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.1356, 0.9505], [3.3198, 0.6388]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.3198, 0.6388], [3.4721, 0.2988]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.4721, 0.2988], [3.5886, -0.0661]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.5886, -0.0661], [3.6657, -0.4519]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.6657, -0.4519], [3.7004, -0.8543]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.7004, -0.8543], [3.6899, -1.2686]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.6899, -1.2686], [3.6324, -1.6897]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.6324, -1.6897], [3.5263, -2.1121]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.5263, -2.1121], [3.3708, -2.5301]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.3708, -2.5301], [3.1656, -2.9381]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [3.1656, -2.9381], [2.9113, -3.33]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [2.9113, -3.33], [2.609, -3.7001]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [2.609, -3.7001], [2.2607, -4.0425]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [2.2607, -4.0425], [1.8689, -4.3516]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [1.8689, -4.3516], [1.4369, -4.622]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [1.4369, -4.622], [0.9686, -4.8486]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [0.9686, -4.8486], [0.4684, -5.0269]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [0.4684, -5.0269], [-0.0584, -5.1526]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-0.0584, -5.1526], [-0.6062, -5.2221]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-0.6062, -5.2221], [-1.1691, -5.2324]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-1.1691, -5.2324], [-1.7404, -5.1812]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-1.7404, -5.1812], [-2.3134, -5.0668]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-2.3134, -5.0668], [-2.881, -4.8883]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-2.881, -4.8883], [-3.4361, -4.6458]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-3.4361, -4.6458], [-3.9712, -4.3399]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-3.9712, -4.3399], [-4.4793, -3.9723]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-4.4793, -3.9723], [-4.9531, -3.5453]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-4.9531, -3.5453], [-5.3857, -3.0622]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-5.3857, -3.0622], [-5.7706, -2.5269]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-5.7706, -2.5269], [-6.1016, -1.9444]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-6.1016, -1.9444], [-6.3729, -1.3201]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-6.3729, -1.3201], [-6.5794, -0.6601]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-6.5794, -0.6601], [-6.7166, 0.0285]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-6.7166, 0.0285], [-6.7808, 0.7386]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-6.7808, 0.7386], [-6.769, 1.4622]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-6.769, 1.4622], [-6.6792, 2.1911]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-6.6792, 2.1911], [-6.51, 2.9169]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-6.51, 2.9169], [-6.2613, 3.6308]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-6.2613, 3.6308], [-5.9338, 4.324]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-5.9338, 4.324], [-5.529, 4.9878]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-5.529, 4.9878], [-5.0497, 5.6136]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-5.0497, 5.6136], [-4.4994, 6.1929]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-1.4695, 2.0225], [-1.4599, 2.0295]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-1.4599, 2.0295], [-1.4503, 2.0363]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-1.4503, 2.0363], [-1.4407, 2.0431]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-1.4407, 2.0431], [-1.431, 2.0499]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-1.431, 2.0499], [-1.4213, 2.0567]], y: [-1.05, 1.05], collide: 0}
      - {kind: poly, points: [[0, 0], [-1.4213, 2.0567], [-1.4116, 2.0633]], y: [-1.05, 1.05], collide: 0}
      - {kind: disc, center: [0, 0], radius: 8.8549, y: [1.0, 1.4], collide: 0, color: "#b39b6e"}
      - {kind: rod, from: [0, -1.6, 0], to: [0, 4.5, 0], radius: 0.6, collide: 0, color: "#8f8a80"}
  # the carriage, running on the rail
  - id: carriage
    shape: part
    pos: [40.0, 0, 0]
    mass: 1.0
    color: "#b8ac92"
    pieces:
      - {kind: poly, points: [[40.0, 1.5], [52.0, 1.5], [52.0, 7.5], [40.0, 7.5]], y: [-3.0, 3.0], collide: 0}
      - {kind: disc, center: [42.5, 0.4], radius: 1.4, y: [-3.6, -3.0], collide: 0, color: "#8f8a80"}
      - {kind: disc, center: [49.5, 0.4], radius: 1.4, y: [-3.6, -3.0], collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [39.2, 0, 5.0], to: [40.0, 0, 5.0], radius: 0.35, collide: 0, color: "#6f6a60"}
  # the bed: the rail, the fusee's standard, and the spring's post
  - id: bed
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cdc0a4"
    pieces:
      - {kind: poly, points: [[-12, -14.0], [62, -14.0], [62, -13.0], [-12, -13.0]], y: [-5, 5], collide: 0, color: "#b9b09c"}
      - {kind: poly, points: [[12, -13.0], [62, -13.0], [62, -1.0], [12, -1.0]], y: [-2.6, 2.6], collide: 0}
      - {kind: poly, points: [[12, -1.0], [62, -1.0], [62, -0.9], [12, -0.9]], y: [-3.6, -3.0], collide: 0, color: "#8f8a80"}
      - {kind: poly, points: [[-2.0, -13.0], [2.0, -13.0], [0.9, 0], [-0.9, 0]], y: [3.5, 4.5], collide: 0}
      - {kind: poly, points: [[59, -1.0], [61, -1.0], [61, 9.0], [59, 9.0]], y: [-1, 1], collide: 0}
joints:
  - {id: j_f, type: hinge, body: fusee, axis: [0, -1, 0], damping: 0.01}   # the fusee, the one driven joint; + : winding (against the clock)
  - {id: j_ff, type: hinge, body: fusee_face, axis: [0, -1, 0]}
  - {id: j_c, type: slide, body: carriage, axis: [1, 0, 0], damping: 0.5, stiffness: 20.0, springref: 40.0, range: [-30, 5]}   # + : away from the fusee; the spring pulls it away
wheels:
  - {id: v0, body: fusee, pos: [0, 0, 0], radius: 2.5, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v1, body: fusee, pos: [0.8415, 0, 0.5403], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v2, body: fusee, pos: [1.451, 0, 0.1614], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v3, body: fusee, pos: [1.8041, 0, -0.6569], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v4, body: fusee, pos: [1.6424, 0, -1.7225], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v5, body: fusee, pos: [0.8436, 0, -2.7118], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v6, body: fusee, pos: [-0.5206, 0, -3.2587], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v7, body: fusee, pos: [-2.1798, 0, -3.0637], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v8, body: fusee, pos: [-3.7187, 0, -1.9949], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v9, body: fusee, pos: [-4.6775, 0, -0.1516], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v10, body: fusee, pos: [-4.6772, 0, 2.1315], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
  - {id: v11, body: fusee, pos: [-3.5351, 0, 4.3432], radius: 2.0, width: 1.9, rim_width: 1.4, flange: 0.0, spokes: 0, web: true, mass: 0.1}
pins:
  - {id: face_pin, a: fusee, b: fusee_face, at: [0, 0, 1.5]}   # the face is the fusee's own (drawn on its hinge, pinned to it)
cords:
  - id: band
    from: {body: fusee, at: [0, 0, 2.8]}
    to: {body: carriage, at: [39.2, 0, 5.0]}
    links: 90
    thickness: 0.6
    density: 1400
    stiffness: 40000.0
    pretension: 8.0
    damping: 12.0
    friction: 0.5
contact: {solref: [0.0006, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_f, kind: velocity, rpm: 6.0, kv: 50.0, max_torque: 10}
checks:
  - {type: ratio_range, out: j_c, in: j_f, min: -0.075, max: -0.025, min_swing: 0.03, settle_s: 0.5, window_s: 7.3, slices: 8}
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [24, 0, -4.6], position: [24, -150, -4.6], fov: 30}
display:
  output: j_c
  labels: {j_f: "Fusee (driver)", j_c: Carriage}

