# No. 313 (Brown 1868): "Chronometer escapement, the form now commonly constructed. As the balance rotates in the direction of the arrow, the tooth, V, on the verge, presses the passing-spring against the lever, pressing aside the lever and removing the detent from the tooth of the escape-wheel. As balance returns, tooth, V, presses aside and passes spring without moving lever, which then rests against the stop, E. P is the only pallet upon which impulse is given."
#
# Model (cm, a plan of the watch: gravity off). The balance turns on its verge at the origin, held by its balance spring (a joint spring, 0.00237 N·m/rad: about 1 s a
# vibration pair). Its rim is behind; in front of the plate the verge carries a small roller with the impulse pallet P (reaching to r 2.1), and, in front of that,
# the discharging tooth V (r 1.3). The escape-wheel (12 teeth, tips r 3.6, axis at (3, -4.6)) is urged clockwise by a constant torque (the mainspring) and
# rests a tooth on the detent (the locking stone) under the lever. The lever turns on a pivot at (14, -1); a light spring holds it down against the stop E.
# On the lever is the lighter passing-spring, which runs out under V's path and lies up against the lever's horn at its end (a hinge on the lever, its upper stop the
# horn, a feeble spring). Swinging counterclockwise (Brown's arrow), V lifts the passing-spring, which bears on the horn and presses the lever aside: the detent leaves
# the tooth, the wheel escapes, and at once the next tooth strikes P and pushes the balance on; V leaves the spring, the lever falls back against E, and the detent
# arrests the following tooth. Swinging back (clockwise), V presses the passing-spring down and passes it, the lever unmoved on E. The wheel goes one tooth
# (30 degrees) each vibration pair. Only the wheel is driven. Set going by hand: at the start the balance stands turned 2.2 rad from its rest (its spring's
# free position) and is let go. Generator: opencode-runs/batch12/gen313.py.
number: 313
slug: chronometer-escapement
name: "Chronometer escapement, the form now commonly constructed"
brown: "Chronometer escapement, the form now commonly constructed. As the balance rotates in the direction of the arrow, the tooth, V, on the verge, presses the passing-spring against the lever, pressing aside the lever and removing the detent from the tooth of the escape-wheel. As balance returns, tooth, V, presses aside and passes spring without moving lever, which then rests against the stop, E. P is the only pallet upon which impulse is given."
units: cm
sim: {timestep: 0.0001, integrator: implicitfast, iterations: 50, duration_s: 12, floor: false, gravity: 0}
bodies:
  - id: wheel
    shape: part
    pos: [3.0, 0, -4.6]
    mass: 0.004
    friction: 0.1
    color: "#e6d7b0"
    pieces:
      - kind: wheel
        center: [3.0, -4.6]
        teeth: 12
        tooth: [[3.6, 0], [2.95, 0], [2.95, 0.41888]]   # a tooth: its face radial, leading clockwise; its back sloped
        phase: 1.35787
        root: 3.0
        rim: 2.5
        hub: 0.5
        spokes: 4
        spoke_width: 0.35
        y: [-0.25, 0.25]
        collide: 2
      - {kind: disc, center: [3.0, -4.6], radius: 0.25, y: [-0.7, 0.9], color: "#8f8a80"}   # its arbor
  - id: balance
    shape: part
    pos: [0, 0, 0]
    mass: 0.06
    friction: 0.1
    color: "#d9c49a"
    pieces:
      - {kind: disc, center: [0, 0], radius: 4.6, inner: 4.0, y: [0.8, 1.2]}   # the balance's rim (behind)
      - {kind: poly, points: [[0.12485, -0.33825], [3.19714, -2.57455], [3.43254, -2.25116], [0.36025, -0.01485]], y: [0.85, 1.15]}   # an arm
      - {kind: poly, points: [[0.23051, 0.27725], [0.63106, 4.05608], [0.23329, 4.09824], [-0.16726, 0.31941]], y: [0.85, 1.15]}   # an arm
      - {kind: poly, points: [[-0.35536, 0.061], [-3.8282, -1.48152], [-3.66583, -1.84709], [-0.19299, -0.30456]], y: [0.85, 1.15]}   # an arm
      - {kind: disc, center: [0, 0], radius: 0.25, y: [-1.6, 1.4], color: "#8f8a80", density: 7800}   # the axis a
      - {kind: disc, center: [0, 0], radius: 1.45, y: [-0.25, 0.25], color: "#c9b27e"}   # the impulse roller
      - {kind: poly, points: [[-0.62543, 1.03113], [-1.16643, 1.75039], [-1.35823, 1.60612], [-0.81723, 0.88687]], y: [-0.25, 0.25], collide: 1, color: "#b85c38"}   # the impulse pallet P
      - {kind: disc, center: [0, 0], radius: 1.05, y: [-1.3, -0.9], color: "#c9b27e"}   # the discharging roller on the verge
      - {kind: disc, center: [-0.96686, -0.86901], radius: 0.12, y: [-1.35, -0.85], collide: 2, color: "#b85c38"}   # the tooth V
  - id: detent
    shape: part
    pos: [14.0, 0, -1.0]
    mass: 0.0008
    friction: 0.05
    color: "#9aa3ad"
    pieces:
      - {kind: poly, points: [[1.9, -0.75], [14.3, -1.15], [14.3, -0.85], [1.9, -0.45]], y: [-0.25, 0.25]}   # the lever
      - {kind: poly, points: [[3.76, -1.4], [4.21, -1.4], [4.21, -0.5], [3.76, -0.5]], y: [-0.25, 0.25], collide: 1, color: "#b85c38"}   # the detent: the tooth rests on it
      - {kind: poly, points: [[1.9, -0.7], [2.25, -0.7], [2.25, 0.42], [1.9, 0.42]], y: [-1.45, -0.25]}   # the horn: its post
      - {kind: poly, points: [[1.4, 0.22], [2.25, 0.22], [2.25, 0.42], [1.4, 0.42]], y: [-1.45, -0.8]}   # the horn, over the passing-spring
      - {kind: poly, points: [[7.7, -0.7], [8.3, -0.7], [8.3, 0.4], [7.7, 0.4]], y: [-1.45, -0.25]}   # the stud that carries the passing-spring
  - id: passing
    shape: part
    pos: [8.0, 0, 0.15]
    mount: detent
    mass: 0.0002
    friction: 0.05
    color: "#5c6670"
    pieces:
      - {kind: poly, points: [[1.16, 0.1], [8.6, 0.1], [8.6, 0.2], [1.16, 0.2]], y: [-1.35, -0.85], collide: 1}   # the passing-spring
  - id: plate
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: disc, center: [14.0, -1.0], radius: 0.6, y: [0.3, 0.9]}   # the lever's cock
      - {kind: disc, center: [14.0, -1.0], radius: 0.15, y: [-0.5, 0.3], color: "#8f8a80"}   # its pivot
      - {kind: poly, points: [[5.0, -1.6], [6.0, -1.6], [6.0, -0.72], [5.0, -0.72]], y: [0.3, 0.9], color: "#8f8a80"}   # the stop E, under the lever
joints:
  - {id: j_wheel, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.000005}   # the escape-wheel; + : clockwise (its way)
  - {id: j_bal, type: hinge, body: balance, axis: [0, 1, 0], stiffness: 0.00237, springref: -2.2, damping: 4e-06}   # the balance and its spring; + : clockwise (Brown's arrow is -)
  - {id: j_detent, type: hinge, body: detent, axis: [0, 1, 0], range: [0, 0.07], stiffness: 0.02, springref: -0.03, damping: 0.00002}   # the lever on its pivot; + : pressed aside; 0 against the stop E
  - {id: j_pass, type: hinge, body: passing, axis: [0, 1, 0], range: [-0.25, 0], stiffness: 0.002, springref: 0.05, damping: 0.000002}   # the passing-spring; + : up; 0 against the horn
contact: {solref: [0.002, 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.002, max_torque: 0.05}
checks:
  # one tooth per vibration pair: half a tooth per beat (vibration) of the balance
  - {type: advance, joint: j_wheel, beat: j_bal, expect: 0.2618, tol: 0.03, settle_s: 3, window_s: 8.5}
  # the free balance keeps its own time: its spring and inertia, 2π√(I/k)
  - {type: period, joint: j_bal, expect_s: 1.00257, tol: 0.03, settle_s: 3, window_s: 8}
  # kept swinging by the impulses alone
  - {type: amplitude, joint: j_bal, min: 1.2, max: 3.0, sustain: 0.9, settle_s: 3, window_s: 8}
  # the wheel never runs back more than a trifle (dead locking on the detent)
  - {type: monotonic, joint: j_wheel, direction: 1, max_back: 0.03, settle_s: 2, window_s: 9}
  - {type: penetration, max: 0.0005, settle_s: 1}
camera: {target: [6.5, 0, -5.3], position: [6.5, -60.0, -5.3], fov: 30}
display:
  output: j_wheel
  swing: j_bal
  labels: {j_wheel: "Escape-wheel (mainspring)", j_bal: "Balance", j_detent: "Lever"}
  proof: {label: "Pallet P and tooth V out of contact", sub: "nothing makes good the balance's losses, so its swing dies away, and the mainspring spins the wheel freely"}

