# No. 396 (Brown 1868): "G. P. Reed’s patent anchor and lever escapement for watches. The lever is so applied in combination with chronometer escapement that the whole impulse given balance in one direction is transmitted through lever, and whole impulse in opposite direction is transmitted directly to chronometer impulse pallet, locking and unlocking the escape-wheel but once at each impulse given by said wheel."
#
# Model (cm, a plan of the watch: gravity off), built on No. 314's lever chronometer escapement and turned a quarter turn clockwise so that, as Brown draws it,
# the balance is on the left, the escape-wheel (15 ratchet teeth, tips r 3, clockwise) in the middle and the anchor's arbor on the right, the lever reaching
# back across the wheel to the balance's unlocking pin. The anchor's pallets lock the wheel; the exit pallet also has an impulse face (0.12 rise), so
# when the balance's pin unlocks it the escaping tooth drives the pallet, the lever and through the notch the pin: the balance's impulse one way, through the
# lever. The other way the pin unlocks the entry pallet just as the chronometer impulse pallet C on the balance's arbor comes to the wheel, and the next tooth
# drives C directly. Only the wheel is driven (the mainspring); the balance is set going by hand: let go 2 rad from its rest.
# Generator: opencode-runs/batch13/gen396.py (with rot396.py, the quarter turn).
number: 396
slug: reed-escapement
name: Reed's anchor and lever escapement
brown: "G. P. Reed’s patent anchor and lever escapement for watches. The lever is so applied in combination with chronometer escapement that the whole impulse given balance in one direction is transmitted through lever, and whole impulse in opposite direction is transmitted directly to chronometer impulse pallet, locking and unlocking the escape-wheel but once at each impulse given by said wheel."
units: cm
sim: {timestep: 0.0001, integrator: implicitfast, iterations: 50, duration_s: 12, floor: false, gravity: 0}
bodies:
  - id: wheel
    shape: part
    pos: [0, 0, 0]
    mass: 0.003
    friction: 0.1
    color: "#e6d7b0"
    pieces:
      - {kind: disc, center: [0, 0], radius: 2.12, inner: 1.7, y: [-0.15, 0.15]}   # the rim
      - {kind: disc, center: [0, 0], radius: 0.5, y: [-0.15, 0.15]}   # the hub
      - {kind: poly, points: [[0.10607, -0.45962], [1.0253, -1.37886], [1.37886, -1.0253], [0.45962, -0.10607]], y: [-0.15, 0.15]}   # a spoke
      - {kind: poly, points: [[0.45962, 0.10607], [1.37886, 1.0253], [1.0253, 1.37886], [0.10607, 0.45962]], y: [-0.15, 0.15]}   # a spoke
      - {kind: poly, points: [[-0.10607, 0.45962], [-1.0253, 1.37886], [-1.37886, 1.0253], [-0.45962, 0.10607]], y: [-0.15, 0.15]}   # a spoke
      - {kind: poly, points: [[-0.45962, -0.10607], [-1.37886, -1.0253], [-1.0253, -1.37886], [-0.10607, -0.45962]], y: [-0.15, 0.15]}   # a spoke
      - {kind: disc, center: [0, 0], radius: 0.2, y: [-0.6, 0.6], color: "#8f8a80"}   # its arbor
      - {kind: poly, points: [[2.55655, 1.56973], [1.53583, 1.43221], [1.30585, 1.64462], [2.4002, 1.59167]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[1.69706, 2.47386], [0.82052, 1.93307], [0.52402, 2.03357], [1.5453, 2.43032]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[0.54413, 2.95024], [-0.03666, 2.09968], [-0.34841, 2.0709], [0.42321, 2.84874]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-0.70288, 2.9165], [-0.88751, 1.90324], [-1.1606, 1.75015], [-0.77207, 2.77458]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-1.82836, 2.37847], [-1.5849, 1.37771], [-1.77211, 1.12678], [-1.83384, 2.22068]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.6377, 1.42917], [-2.00824, 0.61397], [-2.0772, 0.30859], [-2.57853, 1.2828]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.99096, 0.23277], [-2.08435, -0.25594], [-2.02313, -0.56297], [-2.87737, 0.12311]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.82705, -1.00389], [-1.80004, -1.08159], [-1.61925, -1.33718], [-2.67868, -1.05786]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.17432, -2.06696], [-1.2045, -1.72023], [-0.93537, -1.88018], [-2.01683, -2.05592]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-1.14563, -2.77264], [-0.40069, -2.06142], [-0.08977, -2.09808], [-1.00624, -2.6985]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[0.08115, -2.9989], [0.47241, -2.04617], [0.77136, -1.9532], [0.17833, -2.87447]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[1.2939, -2.70663], [1.26382, -1.67713], [1.49911, -1.4706], [1.33206, -2.55343]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.28292, -1.94635], [1.83671, -1.01809], [1.96765, -0.73372], [2.25548, -1.79087]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.8772, -0.84954], [2.09201, -0.18301], [2.09597, 0.13003], [2.78889, -0.71866]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.97399, 0.39417], [1.98558, 0.6837], [1.86188, 0.9713], [2.84009, 0.47782]], y: [-0.15, 0.15], collide: 2}   # a tooth
  - id: anchor
    shape: part
    pos: [3.4641, 0, 0]
    mass: 0.004
    friction: 0.1
    color: "#9aa3ad"
    pieces:
      - {kind: disc, center: [3.4641, 0], radius: 0.35, y: [-0.5, 0.5], color: "#8f8a80"}   # the anchor's arbor B
      - {kind: poly, points: [[3.32796, -0.03264], [2.92321, 1.65549], [3.19549, 1.72077], [3.60024, 0.03264]], y: [-0.25, -0.05]}   # an arm of the anchor
      - {kind: poly, points: [[3.60268, -0.01987], [3.2701, -2.33991], [2.99294, -2.30017], [3.32552, 0.01987]], y: [-0.25, -0.05]}   # an arm of the anchor
      - {kind: poly, points: [[2.4365, 1.4785], [2.49867, 1.37082], [3.06854, 1.68346], [3.05016, 1.6928]], y: [-0.15, 0.15], collide: 1, color: "#b85c38"}   # the entry pallet
      - {kind: poly, points: [[2.62786, -1.89793], [2.46563, -1.95169], [3.14338, -2.31713], [3.11966, -2.32294]], y: [-0.15, 0.15], collide: 1, color: "#b85c38"}   # the exit pallet
      - {kind: poly, points: [[3.18448, -0.1619], [3.14996, 0.0756], [-2.05206, -0.68049], [-2.01754, -0.91799]], y: [0.2, 0.4]}   # the lever E C
      - {kind: poly, points: [[-1.84465, -1.06465], [-1.92808, -0.49068], [-2.07652, -0.51226], [-1.99309, -1.08623]], y: [0.2, 0.4]}   # the notch's bottom
      - {kind: poly, points: [[-1.99309, -1.08623], [-2.01898, -0.9081], [-2.38248, -0.96093], [-2.35659, -1.13906]], y: [0.2, 0.4], collide: 1}   # the notch E: a horn
      - {kind: poly, points: [[-2.05063, -0.69039], [-2.07652, -0.51226], [-2.44002, -0.56509], [-2.41413, -0.74322]], y: [0.2, 0.4], collide: 1}   # the notch E: a horn
  - id: balance
    shape: part
    pos: [-4.43307, 0, -0.38784]
    mass: 0.1
    friction: 0.1
    color: "#d9c49a"
    pieces:
      - {kind: disc, center: [-4.43307, -0.38784], radius: 3.6, inner: 3.1, y: [0.85, 1.15]}   # the balance-wheel's rim
      - {kind: poly, points: [[-4.69431, -0.59821], [-5.90113, -3.23517], [-5.62834, -3.36002], [-4.42152, -0.72305]], y: [0.85, 1.15]}   # an arm of the balance-wheel
      - {kind: poly, points: [[-4.12026, -0.5089], [-1.23317, -0.23556], [-1.26145, 0.06311], [-4.14854, -0.21023]], y: [0.85, 1.15]}   # an arm of the balance-wheel
      - {kind: poly, points: [[-4.48463, -0.05642], [-6.16489, 2.3072], [-6.40941, 2.13338], [-4.72914, -0.23024]], y: [0.85, 1.15]}   # an arm of the balance-wheel
      - {kind: disc, center: [-4.43307, -0.38784], radius: 0.25, y: [0.0, 1.3], color: "#8f8a80"}   # its arbor
      - {kind: disc, center: [-4.43307, -0.38784], radius: 2.25, y: [0.55, 0.65], color: "#cfc6b4"}   # the disk
      - {kind: disc, center: [-5.17515, -2.24507], radius: 0.08, y: [0.15, 0.65], collide: 2, color: "#b85c38"}   # the pin
      - {kind: poly, points: [[-4.96417, -1.1178], [-5.27848, -1.62888], [-5.15923, -1.70222], [-4.84491, -1.19114]], y: [-0.15, 0.15], collide: 1, color: "#b85c38"}   # the impulse pallet C
  - id: plate
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#8f8a80"
    pieces:
      - {kind: disc, center: [-1.15768, -0.92438], radius: 0.12, y: [0.2, 0.6]}   # a banking pin
      - {kind: disc, center: [-1.22602, 0.46706], radius: 0.12, y: [0.2, 0.6]}   # a banking pin
joints:
  - {id: j_wheel, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.000003}   # the escape-wheel; + : clockwise (its way)
  - {id: j_anchor, type: hinge, body: anchor, axis: [0, 1, 0], range: [-0.002, 0.19253], damping: 1e-05, frictionloss: 0.0003}   # the anchor and lever; + : clockwise; the range is the banking pins
  - {id: j_bal, type: hinge, body: balance, axis: [0, 1, 0], stiffness: 0.0028, springref: -2.0, damping: 3e-06}   # the balance and its spring; + : clockwise
contact: {solref: [0.001, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
# The mainspring: a constant torque on the escape-wheel, clockwise. Nothing else is driven.
driver: {joint: j_wheel, kind: torque, torque: 0.0038, max_torque: 0.05}
checks:
  - {type: advance, joint: j_wheel, beat: j_bal, expect: 0.20944, tol: 0.03, settle_s: 3, window_s: 8.6}
  - {type: period, joint: j_bal, expect_s: 1.01868, tol: 0.03, settle_s: 3, window_s: 8}
  - {type: amplitude, joint: j_bal, min: 1.2, max: 3.0, sustain: 0.9, settle_s: 3, window_s: 8}
  - {type: penetration, max: 0.0005, settle_s: 1}
camera: {target: [-2.0, 0, -1.95], position: [-2.0, -24, -1.95], fov: 30}
display:
  output: j_wheel
  swing: j_bal
  labels: {j_wheel: "Escape-wheel (mainspring)", j_bal: "Balance", j_anchor: "Lever"}
  proof: {label: "Pallets, pin and pallet C out of contact", sub: "neither the lever nor pallet C makes good the balance's losses, so its swing dies away, and the mainspring spins the wheel freely"}

