# No. 289 (Brown 1868): "288 and 289. The former is what is termed a recoil, and the latter a repose or deadbeat escapement for clocks. The same letters of reference indicate like parts in both. The anchor, H, L, K, is caused, by the oscillation of the pendulum, to vibrate upon the axis, a. Between the two extremities, or pallets, H, K, is placed the escape-wheel, A, the teeth of which come alternately against the outer surface of the pallet, K, and inner surface of pallet, H. In 289 these surfaces are cut to a curve concentric to the axis, a; consequently, during the time one of the teeth is against the pallet the wheel remains perfectly at rest. Hence the name repose or dead-beat. In 288 the surfaces are of a different form, not necessary to explain, as it can be understood that any form not concentric with the axis, a, must produce a slight recoil of the wheel during the escape of the tooth, and hence the term recoil escapement. On the pallets leaving teeth, at each oscillation of the pendulum, the extremities of teeth slide along the surfaces, c, e, and d, b, and give sufficient impulse to pendulum."
#
# Model (cm, gravity on): the repose or dead-beat escapement, laid out as No. 303 (a 30-tooth escape-wheel A, tips r 5, the anchor's axis a at 5 sqrt 2 above it, the pallets embracing
# 7 1/2 teeth), but mirrored so that A turns counter-clockwise, with Brown's letters: K (right) is the pallet whose outer face the teeth meet, H (left) the one whose inner face they meet.
# K's outer face and H's inner face are arcs about the axis a: while a tooth rests on one, its force is radial to a, so it neither drives nor turns back the
# pendulum, and the wheel stands dead still. The impulse faces c e and d b (the slanted tips) give the pendulum the energy its damping took.
# The only input is a constant torque on A (the clock's weight). The anchor H L K and the pendulum are one piece on a, swinging under gravity, kept going only by the teeth
# pressing on the pallets (convex hulls). It starts from rest, hanging straight, with a tooth about to reach K's impulse face. Generator: opencode-runs/batch12/gen288.py.
number: 289
slug: deadbeat-escapement
name: Repose or dead-beat escapement for clocks
brown: "288 and 289. The former is what is termed a recoil, and the latter a repose or deadbeat escapement for clocks. The same letters of reference indicate like parts in both. The anchor, H, L, K, is caused, by the oscillation of the pendulum, to vibrate upon the axis, a. Between the two extremities, or pallets, H, K, is placed the escape-wheel, A, the teeth of which come alternately against the outer surface of the pallet, K, and inner surface of pallet, H. In 289 these surfaces are cut to a curve concentric to the axis, a; consequently, during the time one of the teeth is against the pallet the wheel remains perfectly at rest. Hence the name repose or dead-beat. In 288 the surfaces are of a different form, not necessary to explain, as it can be understood that any form not concentric with the axis, a, must produce a slight recoil of the wheel during the escape of the tooth, and hence the term recoil escapement. On the pallets leaving teeth, at each oscillation of the pendulum, the extremities of teeth slide along the surfaces, c, e, and d, b, and give sufficient impulse to pendulum."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 50, duration_s: 10, floor: false}
bodies:
  - id: wheel
    shape: part
    pos: [0, 0, 0]
    density: 8500
    friction: 0.1
    color: "#e6d7b0"
    pieces:
      - kind: wheel
        center: [0, 0]
        teeth: 30
        tooth: [[3.9, -0.0756], [3.9, -0.165], [4.45, -0.075], [5.0, 0]]
        phase: 0.71558
        root: 4.2
        rim: 3.6
        hub: 0.8
        spokes: 4
        spoke_width: 0.45
        y: [-0.25, 0.25]
        collide: 2
      - {kind: disc, center: [0, 0], radius: 0.25, y: [-0.7, 0.9], color: "#8f8a80"}   # A's arbor
  - id: pendulum
    shape: part
    pos: [0, 0, 7.07107]
    density: 7800
    friction: 0.1
    color: "#d9cfba"
    pieces:
      - {kind: disc, center: [0, 7.07107], radius: 0.6, y: [-1.15, 0.35]}   # the anchor's hub on the axis a
      # the anchor's arms, an arched band over the wheel as Brown draws it (they touch nothing)
      - {kind: poly, points: [[4.42171, 3.98133], [4.86760, 4.38281], [4.21026, 5.01759], [3.82459, 4.55796]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[3.82459, 4.55796], [4.21026, 5.01759], [3.47097, 5.55472], [3.15302, 5.04589]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[3.15302, 5.04589], [3.47097, 5.55472], [2.66413, 5.98372], [2.42008, 5.43560]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[2.42008, 5.43560], [2.66413, 5.98372], [1.80542, 6.29626], [1.64004, 5.71951]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[1.64004, 5.71951], [1.80542, 6.29626], [0.91158, 6.48626], [0.82808, 5.89210]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[0.82808, 5.89210], [0.91158, 6.48626], [0.00000, 6.55000], [0.00000, 5.95000]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[0.00000, 5.95000], [0.00000, 6.55000], [-0.91158, 6.48626], [-0.82808, 5.89210]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[-0.82808, 5.89210], [-0.91158, 6.48626], [-1.80542, 6.29626], [-1.64004, 5.71951]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[-1.64004, 5.71951], [-1.80542, 6.29626], [-2.66413, 5.98372], [-2.42008, 5.43560]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[-2.42008, 5.43560], [-2.66413, 5.98372], [-3.47097, 5.55472], [-3.15302, 5.04589]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[-3.15302, 5.04589], [-3.47097, 5.55472], [-4.21026, 5.01759], [-3.82459, 4.55796]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[-3.82459, 4.55796], [-4.21026, 5.01759], [-4.86760, 4.38281], [-4.42171, 3.98133]], y: [-0.3, 0.3], collide: 0}
      - {kind: poly, points: [[-0.35, 6.4], [0.35, 6.4], [0.35, 7.07107], [-0.35, 7.07107]], y: [-0.3, 0.3], collide: 0}   # the stem L up to a
      - {kind: poly, points: [[4.41618, 4.25082], [4.34084, 4.13618], [4.01562, 4.35607], [4.08531, 4.46211]], y: [-0.35, 0.35], collide: 1}   # K: its outer (locking) face, an arc about a
      - {kind: poly, points: [[4.34084, 4.13618], [4.26252, 4.02356], [3.94317, 4.25188], [4.01562, 4.35607]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[4.26252, 4.02356], [4.18129, 3.91302], [3.86802, 4.14963], [3.94317, 4.25188]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[4.18129, 3.91302], [4.09719, 3.80465], [3.79022, 4.04937], [3.86802, 4.14963]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[4.09719, 3.80465], [4.01028, 3.69852], [3.70982, 3.95119], [3.79022, 4.04937]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[4.01028, 3.69852], [3.92062, 3.5947], [3.62688, 3.85515], [3.70982, 3.95119]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[3.92062, 3.5947], [3.82828, 3.49326], [3.54146, 3.76131], [3.62688, 3.85515]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[3.82828, 3.49326], [3.73331, 3.39427], [3.4536, 3.66974], [3.54146, 3.76131]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[3.48904, 3.7061], [3.30196, 3.52234], [3.73332, 3.39427], [3.77162, 3.43357]], y: [-0.35, 0.35], collide: 1, color: "#b85c38"}   # K's impulse face
      - {kind: poly, points: [[-3.67079, 3.45506], [-3.76419, 3.55239], [-3.4774, 3.82048], [-3.39112, 3.73056]], y: [-0.35, 0.35], collide: 1}   # H: its inner (locking) face, an arc about a
      - {kind: poly, points: [[-3.76419, 3.55239], [-3.85501, 3.65213], [-3.5613, 3.91262], [-3.4774, 3.82048]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-3.85501, 3.65213], [-3.94318, 3.75422], [-3.64276, 4.00693], [-3.5613, 3.91262]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-3.94318, 3.75422], [-4.02866, 3.85858], [-3.72172, 4.10333], [-3.64276, 4.00693]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-4.02866, 3.85858], [-4.11137, 3.96513], [-3.79813, 4.20177], [-3.72172, 4.10333]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-4.11137, 3.96513], [-4.19127, 4.07382], [-3.87194, 4.30218], [-3.79813, 4.20177]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-4.19127, 4.07382], [-4.26829, 4.18456], [-3.94309, 4.40448], [-3.87194, 4.30218]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-4.26829, 4.18456], [-4.34239, 4.29728], [-4.01154, 4.50862], [-3.94309, 4.40448]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-3.70845, 3.49369], [-3.50957, 3.29838], [-3.39111, 3.73056], [-3.42591, 3.76625]], y: [-0.35, 0.35], collide: 1, color: "#b85c38"}   # H's impulse face
      - {kind: rod, from: [0, -1.0, 7.07107], to: [0, -1.0, -12.92893], radius: 0.15, color: "#8f8a80"}   # the pendulum rod
      - {kind: disc, center: [0, -12.92893], radius: 1.8, y: [-1.6, -0.4], density: 8500, color: "#e6d7b0"}   # the bob
  - id: cock
    shape: part
    pos: [0, 0, 7.07107]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-1.3, 8.6], [-0.75, 6.75], [0.75, 6.75], [1.3, 8.6]], y: [0.4, 1.0]}
      - {kind: disc, center: [0, 7.07107], radius: 0.18, y: [-1.3, 1.0], color: "#8f8a80"}
joints:
  - {id: j_wheel, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.00002}   # the escape-wheel A; - : counter-clockwise (its way)
  - {id: j_pend, type: hinge, body: pendulum, axis: [0, 1, 0], damping: 0.0015}   # the anchor and pendulum on a (air and pivot losses)
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
# The clock's weight: a constant torque on the escape-wheel, counter-clockwise. Nothing else is driven.
driver: {joint: j_wheel, kind: torque, torque: -0.008, max_torque: 0.05}
checks:
  # the pendulum keeps time: its period against the compound pendulum's 2 pi sqrt(I/(m g d)) from the model
  - {type: period, joint: j_pend, tol: 0.03, settle_s: 4, window_s: 4}
  # half a tooth (2 pi/30 / 2) per beat: one tooth per two beats, counter-clockwise
  - {type: advance, joint: j_wheel, beat: j_pend, expect: -0.10472, tol: 0.03, settle_s: 4, window_s: 4}
  # dead beat: the wheel never turns back while locked, beyond contact compliance
  - {type: monotonic, joint: j_wheel, direction: -1, max_back: 0.004, settle_s: 2, window_s: 6}
  # the impulse keeps the swing going against the damping
  - {type: amplitude, joint: j_pend, min: 0.05, max: 0.2, sustain: 0.9, settle_s: 4, window_s: 4}
  - {type: penetration, max: 0.0005, settle_s: 1}
camera: {target: [0, 0, -1.5], position: [0, -46, -1.5], fov: 30}
display:
  output: j_pend
  swing: j_pend
  labels: {j_wheel: "Escape-wheel A (weight)", j_pend: "Pendulum and anchor H L K"}
  proof: {label: "Pallets out of contact", sub: "nothing makes good the pendulum's losses, so its swing dies away, and the weight spins the wheel freely"}

