# No. 291 (Brown 1868): Arnold's chronometer or free (detent) escapement.
#
# Model (cm, a plan of the watch: gravity off). The balance turns on its axis a 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 it carries a small roller with the impulse pallet (the side of the notch g, reaching to r 2.1), and, in front
# of that, the discharging stud a (r 1.3). The escape-wheel B (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 stop d, which hangs under the detent spring A. A is a stiff blade from its foot b at (14, -1) (a hinge with a light spring, lying on its banking).
# On A, at the stud i, is the lighter passing spring, which runs out under the stud a's path and lies up against the hook k at A's end (a hinge on A, its upper stop the hook,
# a feeble spring). Swinging clockwise (Brown's arrow), the stud a comes down on the passing spring and bends it down, freely, A unmoved. Swinging back, it lifts the passing
# spring, which bears on k and lifts A and the stop d: one tooth escapes, and at once the next tooth strikes the pallet (notch g) and pushes the balance on; the stud leaves the
# passing spring, A falls to its banking, and d arrests the following tooth. 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/gen291.py.
number: 291
slug: arnold-chronometer-escapement
name: Arnold's chronometer or free escapement
brown: "Arnold’s chronometer or free escapement, sometimes used in watches. A spring, A, is fixed or screwed against the plate of the watch at b. To the under side of this spring is attached a small stop, d, against which rest successively the teeth of the escape-wheel, B; and on the top of spring is fixed a stud, i, holding a lighter and more flexible spring which passes under a hook, k, at the extremity of A, so that it is free on being depressed, but in rising would lift A. On the axis of the balance is a small stud, a, which touches the thin spring at each oscillation of balance-wheel. When the movement is in the direction shown by the arrow, the stud depresses the spring in passing, but on returning raises it and the spring, A, and stop, d, and thus allows one tooth of escape-wheel to pass, letting them fall immediately to arrest the next. At the same time that this tooth escapes another strikes against the side of the notch, g, and restores to balance-wheel the force lost during a vibration. It will be understood that only at one point is the free movement of balance opposed during an oscillation."
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: the side of the notch g
      - {kind: disc, center: [0, 0], radius: 1.05, y: [-1.3, -0.9], color: "#c9b27e"}   # the discharging roller
      - {kind: disc, center: [-0.96686, -0.86901], radius: 0.12, y: [-1.35, -0.85], collide: 2, color: "#b85c38"}   # the stud a
  - 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 detent spring A
      - {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 stop d
      - {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 hook k: 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 hook k 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 i
  - 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: poly, points: [[13.1, -1.9], [14.9, -1.9], [14.9, -0.09999999999999998], [13.1, -0.09999999999999998]], y: [0.3, 0.9]}   # the block b
      - {kind: disc, center: [14.0, -1.0], radius: 0.3, y: [-0.4, 0.3], color: "#8f8a80"}   # its screw
      - {kind: poly, points: [[5.0, -1.6], [6.0, -1.6], [6.0, -0.72], [5.0, -0.72]], y: [0.3, 0.9]}   # the banking under A
joints:
  - {id: j_wheel, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.000005}   # the escape-wheel B; + : 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)
  - {id: j_detent, type: hinge, body: detent, axis: [0, 1, 0], range: [0, 0.07], stiffness: 0.02, springref: -0.03, damping: 0.00002}   # A on its foot b; + : lifted; 0 its banking
  - {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 at i; + : up; 0 against the hook k
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 d)
  - {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 B (mainspring)", j_bal: "Balance", j_detent: "Detent A"}
  proof: {label: "Impulse pallet and stud out of contact", sub: "nothing makes good the balance's losses, so its swing dies away, and the mainspring spins the wheel freely"}

