# No. 288 (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 recoil 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 not arcs about a: going on from the impulse corner each reaches 1.2 cm of radius about a per radian further into the
# wheel's path, so while the pendulum swings on past the lock, the pallet pushes the tooth back and the wheel turns backward a little (the recoil), and turns
# forward again as the pendulum returns. The impulse faces c e and d b (the slanted tips) are as in No. 289.
# 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: 288
slug: recoil-escapement
name: Recoil 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
      - {kind: poly, points: [[0.02122, 6.61058], [3.80346, 3.65951], [4.23406, 4.21139], [0.45183, 7.16247]], y: [-0.3, 0.3]}   # the anchor's arms (L)
      - {kind: poly, points: [[-0.45184, 7.16242], [-4.16501, 4.26457], [-3.73434, 3.71273], [-0.02117, 6.61058]], y: [-0.3, 0.3]}
      - {kind: poly, points: [[4.628, 4.11555], [4.52302, 4.01301], [4.01562, 4.35607], [4.08531, 4.46211]], y: [-0.35, 0.35], collide: 1}   # K: its outer (locking) face reaching into the wheel
      - {kind: poly, points: [[4.52302, 4.01301], [4.41586, 3.91393], [3.94317, 4.25188], [4.01562, 4.35607]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[4.41586, 3.91393], [4.30663, 3.81835], [3.86802, 4.14963], [3.94317, 4.25188]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[4.30663, 3.81835], [4.19545, 3.72631], [3.79022, 4.04937], [3.86802, 4.14963]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[4.19545, 3.72631], [4.08241, 3.63786], [3.70982, 3.95119], [3.79022, 4.04937]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[4.08241, 3.63786], [3.96763, 3.55301], [3.62688, 3.85515], [3.70982, 3.95119]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[3.96763, 3.55301], [3.85123, 3.47181], [3.54146, 3.76131], [3.62688, 3.85515]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[3.85123, 3.47181], [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.45445, 3.84193], [-3.39112, 3.73056]], y: [-0.35, 0.35], collide: 1}   # H: its inner (locking) face reaching into the wheel
      - {kind: poly, points: [[-3.76419, 3.55239], [-3.85501, 3.65213], [-3.51429, 3.95431], [-3.45445, 3.84193]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-3.85501, 3.65213], [-3.94318, 3.75422], [-3.57063, 4.0676], [-3.51429, 3.95431]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-3.94318, 3.75422], [-4.02866, 3.85858], [-3.62347, 4.18168], [-3.57063, 4.0676]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-4.02866, 3.85858], [-4.11137, 3.96513], [-3.67279, 4.29646], [-3.62347, 4.18168]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-4.11137, 3.96513], [-4.19127, 4.07382], [-3.71861, 4.41183], [-3.67279, 4.29646]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-4.19127, 4.07382], [-4.26829, 4.18456], [-3.76092, 4.52768], [-3.71861, 4.41183]], y: [-0.35, 0.35], collide: 1}
      - {kind: poly, points: [[-4.26829, 4.18456], [-4.34239, 4.29728], [-3.79974, 4.64391], [-3.76092, 4.52768]], 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 near the compound pendulum's 2 pi sqrt(I/(m g d)) from the model: a little quicker, as the recoil faces push it back toward
  # the middle on each supplementary arc (a recoil clock's rate depends on its weight)
  - {type: period, joint: j_pend, tol: 0.06, 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}
  # recoil: while a tooth is locked the wheel turns back, and forward again, every beat
  - {type: monotonic, joint: j_wheel, direction: -1, max_back: 0.03, 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, -9.9], position: [-16.9, -82.8, -2.1], 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"}

