# No. 314 (Brown 1868): "Lever chronometer escapement. In this the pallets, A, B, and lever, look like those of the lever escapement 296: but these pallets only lock the escape-wheel, having no impulse. Impulse is given by teeth of escape-wheel directly to a pallet, C, attached to balance."
#
# Model (cm, a plan of the watch: gravity off). The escape-wheel (15 ratchet teeth, tips r 3, clockwise) at the origin. The anchor, 3.464 above it, carries the
# pallets A and B, which only lock: each is a narrow stone (2.5 degrees) whose locking face, where a tooth's point rests, leans so the tooth draws it
# in. They are set unequally, so the wheel goes 20 degrees when A lets go and 4 when B does. The lever
# (4.14 long) has the notch at its end and two banking pins; the balance's axis is 2 beyond it, down and to the right of the wheel, and its pin enters
# the notch at the middle of each vibration and unlocks a pallet. On the balance's arbor is the pallet C (1.5 out), which reaches 0.05 inside the teeth's points.
# As the balance turns counter-clockwise it unlocks A just as C comes up to the wheel, and the next tooth overtakes C and drives it (the impulse). Coming back,
# C passes the locked wheel through a gap between two teeth before the pin unlocks B: one impulse each time the balance goes and comes back. Only the wheel is driven
# (the mainspring). The balance is set going by hand: let go 2 rad from its rest. Generator: opencode-runs/batch12/gen314.py.
number: 314
slug: lever-chronometer-escapement
name: Lever chronometer escapement
brown: "Lever chronometer escapement. In this the pallets, A, B, and lever, look like those of the lever escapement 296: but these pallets only lock the escape-wheel, having no impulse. Impulse is given by teeth of escape-wheel directly to a pallet, C, attached to balance."
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.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: 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: disc, center: [0, 0], radius: 0.2, y: [-0.6, 0.6], color: "#8f8a80"}   # its arbor
      - {kind: poly, points: [[-1.56973, 2.55655], [-1.43221, 1.53583], [-1.64462, 1.30585], [-1.59167, 2.4002]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.47386, 1.69706], [-1.93307, 0.82052], [-2.03357, 0.52402], [-2.43032, 1.5453]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.95024, 0.54413], [-2.09968, -0.03666], [-2.0709, -0.34841], [-2.84874, 0.42321]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.9165, -0.70288], [-1.90324, -0.88751], [-1.75015, -1.1606], [-2.77458, -0.77207]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-2.37847, -1.82836], [-1.37771, -1.5849], [-1.12678, -1.77211], [-2.22068, -1.83384]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-1.42917, -2.6377], [-0.61397, -2.00824], [-0.30859, -2.0772], [-1.2828, -2.57853]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-0.23277, -2.99096], [0.25594, -2.08435], [0.56297, -2.02313], [-0.12311, -2.87737]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[1.00389, -2.82705], [1.08159, -1.80004], [1.33718, -1.61925], [1.05786, -2.67868]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.06696, -2.17432], [1.72023, -1.2045], [1.88018, -0.93537], [2.05592, -2.01683]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.77264, -1.14563], [2.06142, -0.40069], [2.09808, -0.08977], [2.6985, -1.00624]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.9989, 0.08115], [2.04617, 0.47241], [1.9532, 0.77136], [2.87447, 0.17833]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[2.70663, 1.2939], [1.67713, 1.26382], [1.4706, 1.49911], [2.55343, 1.33206]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[1.94635, 2.28292], [1.01809, 1.83671], [0.73372, 1.96765], [1.79087, 2.25548]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[0.84954, 2.8772], [0.18301, 2.09201], [-0.13003, 2.09597], [0.71866, 2.78889]], y: [-0.15, 0.15], collide: 2}   # a tooth
      - {kind: poly, points: [[-0.39417, 2.97399], [-0.6837, 1.98558], [-0.9713, 1.86188], [-0.47782, 2.84009]], y: [-0.15, 0.15], collide: 2}   # a tooth
  - id: anchor
    shape: part
    pos: [0, 0, 3.4641]
    mass: 0.004
    friction: 0.1
    color: "#9aa3ad"
    pieces:
      - {kind: disc, center: [0, 3.4641], radius: 0.35, y: [-0.5, 0.5], color: "#8f8a80"}   # the anchor's arbor B
      - {kind: poly, points: [[0.03264, 3.32796], [-1.65549, 2.92321], [-1.72077, 3.19549], [-0.03264, 3.60024]], y: [-0.25, -0.05]}   # an arm of the anchor
      - {kind: poly, points: [[0.02941, 3.60098], [2.32086, 3.10858], [2.26204, 2.83483], [-0.02941, 3.32723]], y: [-0.25, -0.05]}   # an arm of the anchor
      - {kind: poly, points: [[-1.4785, 2.4365], [-1.37082, 2.49867], [-1.68346, 3.06854], [-1.6928, 3.05016]], y: [-0.15, 0.15], collide: 1, color: "#b85c38"}   # the entry pallet
      - {kind: poly, points: [[1.83549, 2.49848], [1.94201, 2.43434], [2.28937, 2.98374], [2.29353, 2.95968]], y: [-0.15, 0.15], collide: 1, color: "#b85c38"}   # the exit pallet
      - {kind: poly, points: [[0.30484, 3.35698], [0.14687, 3.1763], [2.77338, 0.87992], [2.93135, 1.0606]], y: [0.2, 0.4]}   # the lever E C
      - {kind: poly, points: [[2.93032, 1.28731], [2.54856, 0.85067], [2.66149, 0.75194], [3.04325, 1.18858]], y: [0.2, 0.4]}   # the notch's bottom
      - {kind: poly, points: [[3.04325, 1.18858], [2.92477, 1.05307], [3.13811, 0.86655], [3.25659, 1.00206]], y: [0.2, 0.4], collide: 1}   # the notch E: a horn
      - {kind: poly, points: [[2.77996, 0.88745], [2.66149, 0.75194], [2.87483, 0.56541], [2.99331, 0.70092]], y: [0.2, 0.4], collide: 1}   # the notch E: a horn
  - id: balance
    shape: part
    pos: [4.36824, 0, -0.8491]
    mass: 0.1
    friction: 0.1
    color: "#d9c49a"
    pieces:
      - {kind: disc, center: [4.36824, -0.8491], radius: 3.6, inner: 3.1, y: [0.85, 1.15]}   # the balance-wheel's rim
      - {kind: poly, points: [[4.57861, -1.11034], [7.21557, -2.31716], [7.34041, -2.04438], [4.70345, -0.83755]], y: [0.85, 1.15]}   # an arm of the balance-wheel
      - {kind: poly, points: [[4.4893, -0.5363], [4.21596, 2.35079], [3.91729, 2.32252], [4.19063, -0.56457]], y: [0.85, 1.15]}   # an arm of the balance-wheel
      - {kind: poly, points: [[4.03682, -0.90066], [1.67319, -2.58093], [1.84702, -2.82544], [4.21064, -1.14518]], y: [0.85, 1.15]}   # an arm of the balance-wheel
      - {kind: disc, center: [4.36824, -0.8491], radius: 0.25, y: [0.0, 1.3], color: "#8f8a80"}   # its arbor
      - {kind: disc, center: [4.36824, -0.8491], radius: 2.25, y: [0.55, 0.65], color: "#cfc6b4"}   # the disk
      - {kind: disc, center: [6.23824, -0.13981], radius: 0.08, y: [0.15, 0.65], collide: 2, color: "#b85c38"}   # the pin
      - {kind: poly, points: [[5.07997, -0.29381], [5.52298, 0.11083], [5.42857, 0.2142], [4.98555, -0.19045]], 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: [2.37701, 1.71795], radius: 0.12, y: [0.2, 0.6]}   # a banking pin
      - {kind: disc, center: [1.77615, 1.10942], 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.12324], 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.4, 0, -2.1], position: [2.4, -36.0, -2.1], fov: 30}
display:
  output: j_wheel
  swing: j_bal
  labels: {j_wheel: "Escape-wheel (mainspring)", j_bal: "Balance", j_anchor: "Lever"}
  proof: {label: "Pallets and pin out of contact", sub: "nothing makes good the balance's losses, so its swing dies away, and the mainspring spins the wheel freely"}

