number: 321
slug: harrisons-going-barrel
name: Harrison's Going-Barrel
brown: "Harrison’s “going-barrel.” Larger ratchet-wheel, to which the click, R, is attached, is connected with the great wheel, G, by a spring, S, S'. While the clock is going, the weight acts upon the great wheel, G, through the spring; but as soon as the weight is taken off by winding, the click, T, whose pivot is set in the frame, prevents the larger ratchet from falling back, and so the spring, S, S', still drives the great wheel during the time the clock takes to wind, as it need only just keep the escapement going, the pendulum taking care of itself for that short time. Good watches have a substantially similar apparatus."
units: cm
sim: {timestep: 0.0005, integrator: implicitfast, iterations: 50, duration_s: 16.0, floor: false, gravity: 0}
bodies:
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: rod, from: [0, -1.0, 0], to: [0, 5.8, 0], radius: 0.35, color: "#8f8a80"}
      - {kind: rod, from: [-2.9140, -0.2, 8.8128], to: [-2.9140, 3.0, 8.8128], radius: 0.2, color: "#8f8a80"}
      - {kind: poly, points: [[-3.4140, 8.8128], [-2.4140, 8.8128], [-2.4140, 13], [-3.4140, 13]], y: [2.2, 3.0]}
      - {kind: poly, points: [[-12, 12.2], [12, 12.2], [12, 13.4], [-12, 13.4]], y: [2.2, 3.0], color: "#b9b09c"}
  # the barrel with its own ratchet: the weight's line comes off it (the one driven arbor)
  - id: barrel
    shape: part
    pos: [0, 0, 0]
    friction: 0.1
    mass: 1.5
    color: "#d9cfb6"
    pieces:
      - {kind: disc, center: [0, 0], radius: 3.6, inner: 0.4, y: [3.2, 5.4], color: "#cdbf9f"}
      - {kind: poly, points: [[-2.4000, 0.0000], [-2.0785, 1.2000], [-3.2000, 0.0000]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[-2.0785, 1.2000], [-1.2000, 2.0785], [-2.7713, 1.6000]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[-1.2000, 2.0785], [-0.0000, 2.4000], [-1.6000, 2.7713]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[-0.0000, 2.4000], [1.2000, 2.0785], [-0.0000, 3.2000]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[1.2000, 2.0785], [2.0785, 1.2000], [1.6000, 2.7713]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[2.0785, 1.2000], [2.4000, 0.0000], [2.7713, 1.6000]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[2.4000, 0.0000], [2.0785, -1.2000], [3.2000, 0.0000]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[2.0785, -1.2000], [1.2000, -2.0785], [2.7713, -1.6000]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[1.2000, -2.0785], [0.0000, -2.4000], [1.6000, -2.7713]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[0.0000, -2.4000], [-1.2000, -2.0785], [0.0000, -3.2000]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[-1.2000, -2.0785], [-2.0785, -1.2000], [-1.6000, -2.7713]], y: [-0.6, 0.0], collide: 1}
      - {kind: poly, points: [[-2.0785, -1.2000], [-2.4000, -0.0000], [-2.7713, -1.6000]], y: [-0.6, 0.0], collide: 1}
      - {kind: disc, center: [0, 0], radius: 2.4499999999999997, inner: 0.4, y: [-0.6, 0.0]}
  # the great wheel G (the going train's load on its arbor)
  - id: G
    shape: part
    pos: [0, 0, 0]
    color: "#c9a96e"
    pieces:
      - {kind: disc, center: [0, 0], radius: 7.6, inner: 6.8999999999999995, y: [1.0, 1.4]}
      - {kind: disc, center: [0, 0], radius: 0.9, inner: 0.4, y: [1.0, 1.4]}
      - {kind: poly, points: [[-0.35, 0.6], [0.35, 0.6], [0.35, 7.0], [-0.35, 7.0]], y: [1.0, 1.4]}
      - {kind: poly, points: [[-0.35, -0.6], [0.35, -0.6], [0.35, -7.0], [-0.35, -7.0]], y: [1.0, 1.4]}
      - {kind: poly, points: [[0.6, -0.35], [7.0, -0.35], [7.0, 0.35], [0.6, 0.35]], y: [1.0, 1.4]}
      - {kind: poly, points: [[-0.6, -0.35], [-7.0, -0.35], [-7.0, 0.35], [-0.6, 0.35]], y: [1.0, 1.4]}
      - {kind: rod, from: [3.5238, 0.6, -2.9568], to: [3.5238, 1.0, -2.9568], radius: 0.2, color: "#8f8a80"}
  # the larger ratchet, carried on G's arbor through the spring S, S'
  - id: L
    shape: part
    pos: [0, 0, 0]
    mount: G
    friction: 0.1
    color: "#e4d9bf"
    pieces:
      - {kind: poly, points: [[6.0000, 0.0000], [5.9088, 1.0419], [7.0000, 0.0000]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[5.9088, 1.0419], [5.6382, 2.0521], [6.8937, 1.2155]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[5.6382, 2.0521], [5.1962, 3.0000], [6.5778, 2.3941]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[5.1962, 3.0000], [4.5963, 3.8567], [6.0622, 3.5000]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[4.5963, 3.8567], [3.8567, 4.5963], [5.3623, 4.4995]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[3.8567, 4.5963], [3.0000, 5.1962], [4.4995, 5.3623]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[3.0000, 5.1962], [2.0521, 5.6382], [3.5000, 6.0622]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[2.0521, 5.6382], [1.0419, 5.9088], [2.3941, 6.5778]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[1.0419, 5.9088], [0.0000, 6.0000], [1.2155, 6.8937]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[0.0000, 6.0000], [-1.0419, 5.9088], [0.0000, 7.0000]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-1.0419, 5.9088], [-2.0521, 5.6382], [-1.2155, 6.8937]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-2.0521, 5.6382], [-3.0000, 5.1962], [-2.3941, 6.5778]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-3.0000, 5.1962], [-3.8567, 4.5963], [-3.5000, 6.0622]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-3.8567, 4.5963], [-4.5963, 3.8567], [-4.4995, 5.3623]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-4.5963, 3.8567], [-5.1962, 3.0000], [-5.3623, 4.4995]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-5.1962, 3.0000], [-5.6382, 2.0521], [-6.0622, 3.5000]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-5.6382, 2.0521], [-5.9088, 1.0419], [-6.5778, 2.3941]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-5.9088, 1.0419], [-6.0000, 0.0000], [-6.8937, 1.2155]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-6.0000, 0.0000], [-5.9088, -1.0419], [-7.0000, 0.0000]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-5.9088, -1.0419], [-5.6382, -2.0521], [-6.8937, -1.2155]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-5.6382, -2.0521], [-5.1962, -3.0000], [-6.5778, -2.3941]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-5.1962, -3.0000], [-4.5963, -3.8567], [-6.0622, -3.5000]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-4.5963, -3.8567], [-3.8567, -4.5963], [-5.3623, -4.4995]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-3.8567, -4.5963], [-3.0000, -5.1962], [-4.4995, -5.3623]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-3.0000, -5.1962], [-2.0521, -5.6382], [-3.5000, -6.0622]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-2.0521, -5.6382], [-1.0419, -5.9088], [-2.3941, -6.5778]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-1.0419, -5.9088], [-0.0000, -6.0000], [-1.2155, -6.8937]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[-0.0000, -6.0000], [1.0419, -5.9088], [-0.0000, -7.0000]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[1.0419, -5.9088], [2.0521, -5.6382], [1.2155, -6.8937]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[2.0521, -5.6382], [3.0000, -5.1962], [2.3941, -6.5778]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[3.0000, -5.1962], [3.8567, -4.5963], [3.5000, -6.0622]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[3.8567, -4.5963], [4.5963, -3.8567], [4.4995, -5.3623]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[4.5963, -3.8567], [5.1962, -3.0000], [5.3623, -4.4995]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[5.1962, -3.0000], [5.6382, -2.0521], [6.0622, -3.5000]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[5.6382, -2.0521], [5.9088, -1.0419], [6.5778, -2.3941]], y: [0.0, 0.6], collide: 1}
      - {kind: poly, points: [[5.9088, -1.0419], [6.0000, -0.0000], [6.8937, -1.2155]], y: [0.0, 0.6], collide: 1}
      - {kind: disc, center: [0, 0], radius: 6.05, inner: 5.0, y: [0.0, 0.6]}
      - {kind: poly, points: [[-0.4, 0.5], [0.4, 0.5], [0.4, 5.1], [-0.4, 5.1]], y: [0.0, 0.6]}
      - {kind: poly, points: [[-0.4, -0.5], [0.4, -0.5], [0.4, -5.1], [-0.4, -5.1]], y: [0.0, 0.6]}
      - {kind: disc, center: [0, 0], radius: 0.8, inner: 0.4, y: [0.0, 0.6]}
      - {kind: rod, from: [1.0096, -0.6, 4.8851], to: [1.0096, 0.3, 4.8851], radius: 0.15, color: "#8f8a80"}
      - {kind: rod, from: [-4.3226, 0.75, -1.5733], to: [-3.9010, 0.75, -2.4376], radius: 0.12, collide: 0, color: "#6f6a62"}
      - {kind: rod, from: [-3.9010, 0.75, -2.4376], to: [-3.3090, 0.75, -3.1954], radius: 0.12, collide: 0, color: "#6f6a62"}
      - {kind: rod, from: [-3.3090, 0.75, -3.1954], to: [-2.5723, 0.75, -3.8136], radius: 0.12, collide: 0, color: "#6f6a62"}
      - {kind: rod, from: [-2.5723, 0.75, -3.8136], to: [-1.7232, 0.75, -4.2650], radius: 0.12, collide: 0, color: "#6f6a62"}
      - {kind: rod, from: [-1.7232, 0.75, -4.2650], to: [-0.7988, 0.75, -4.5301], radius: 0.12, collide: 0, color: "#6f6a62"}
      - {kind: rod, from: [-0.7988, 0.75, -4.5301], to: [0.1605, 0.75, -4.5972], radius: 0.12, collide: 0, color: "#6f6a62"}
      - {kind: rod, from: [0.1605, 0.75, -4.5972], to: [1.1128, 0.75, -4.4634], radius: 0.12, collide: 0, color: "#6f6a62"}
      - {kind: rod, from: [1.1128, 0.75, -4.4634], to: [2.0165, 0.75, -4.1345], radius: 0.12, collide: 0, color: "#6f6a62"}
      - {kind: rod, from: [2.0165, 0.75, -4.1345], to: [2.8320, 0.75, -3.6248], radius: 0.12, collide: 0, color: "#6f6a62"}
      - {kind: rod, from: [2.8320, 0.75, -3.6248], to: [3.5238, 0.75, -2.9568], radius: 0.12, collide: 0, color: "#6f6a62"}
  - id: R
    shape: part
    pos: [1.0096, 0, 4.8851]
    mount: L
    friction: 0.1
    color: "#6b5a44"
    pieces:
      - {kind: poly, points: [[1.3090, 4.9033], [1.2416, 2.2944], [1.0919, 2.2854], [0.7101, 4.8670]], y: [-0.55, -0.05], collide: 2}
      - {kind: disc, center: [1.0096, 4.8851], radius: 0.45, inner: 0.15, y: [-0.55, -0.05]}
  - id: T
    shape: part
    pos: [-2.9140, 0, 8.8128]
    friction: 0.1
    color: "#6b5a44"
    pieces:
      - {kind: poly, points: [[-3.2139, 8.8205], [-3.0759, 5.4158], [-2.9260, 5.4120], [-2.6141, 8.8051]], y: [0.05, 0.55], collide: 2}
      - {kind: disc, center: [-2.9140, 8.8128], radius: 0.5, inner: 0.2, y: [0.05, 0.55]}
joints:
  - {id: j_B, type: hinge, body: barrel, axis: [0, -1, 0], damping: 0.001}   # +: counter-clockwise as seen, the weight's way
  - {id: j_G, type: hinge, body: G, axis: [0, -1, 0], damping: 0.05}   # the going train's load
  - {id: j_S, type: hinge, body: L, axis: [0, -1, 0], stiffness: 0.02, damping: 0.0005, range: [-0.05, 1.6]}   # the spring S, S': + when the ratchet leads the wheel
  - {id: j_R, type: hinge, body: R, axis: [0, 1, 0], damping: 0.0002, range: [-0.6, 0], stiffness: 0.004, springref: 0.3}
  - {id: j_T, type: hinge, body: T, axis: [0, -1, 0], damping: 0.0002, range: [-0.6, 0], stiffness: 0.004, springref: 0.3}
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_B, kind: velocity, rpm: 0, swing: {amplitude: 0.6, hz: 0.25}, kv: 0.3, max_torque: 2}
checks:
  # Brown's point: the great wheel never stops or runs back, through the strokes with the weight on
  # (the barrel forward) and the strokes with it off (winding, the barrel back): the spring drives G.
  - {type: turning, joint: j_G, direction: 1, min_mean: 0.08, slow: 0.2, min_fraction: 0.95, settle_s: 3.5, window_s: 12.0}
  - {type: monotonic, joint: j_G, direction: 1, max_back: 0.005, settle_s: 3.5, window_s: 12.0}
  # the spring S, S' stays bent the whole time: it is never let down while winding
  - {type: position, joint: j_S, min: 0.05, max: 0.8, settle_s: 3.5, window_s: 12.0}
  # the click T steps over the larger ratchet's teeth while the weight drives it, and R over the
  # barrel's while it is wound back
  - {type: clicks, joint: j_T, lift: 0.2, min: 6, settle_s: 3.5, window_s: 12.0}
  - {type: clicks, joint: j_R, lift: 0.2, min: 3, settle_s: 3.5, window_s: 12.0}
  - {type: penetration, max: 0.0005, settle_s: 0.5}
camera: {target: [0, 0, -2.8], position: [0, -101.0, -2.8], fov: 30}
display:
  output: j_G
  labels: {j_B: Barrel (weight then winding), j_G: Great wheel G, j_S: Spring S, j_R: Click R, j_T: Click T}

