# No. 293 (Brown 1868): "Duplex escapement, for watches, so called from partaking of the characters of the spur and crown wheels. The axis of balance carries pallet, B, which at every oscillation receives an impulse from the crown teeth. In the axis, A, of balance-wheel is cut a notch into which the teeth round the edge of the wheel successively fall after each one of the crown teeth passes the impulse pallet, B."
#
# Model (cm, a plan of the watch: gravity off). The balance's axis A is at the origin, with its balance spring (a joint spring, 0.00202 N·m/rad, about 1 s a vibration pair).
# On A is the roller (0.6 in radius) with its notch, 50 degrees wide. The escape-wheel (12 spur teeth, tips r 7, axis 7.3 below A, clockwise as Brown's arrow)
# has its spur (locking) teeth's tips passing 0.3 below A's axis, so a tip rests against the roller's side (the frictional rest);
# and its crown teeth (pins standing up from its face at r 6) reach up to the impulse pallet B (on A, reaching 1.4). When the balance swings counter-clockwise the notch
# comes round to the resting tip; the tip falls in, crosses the axis in the notch (giving the balance a small push) and escapes; the wheel turns, a crown tooth strikes B and
# drives the balance on, and the next spur tooth falls on the roller. Swinging back, the notch passes the tip: the tip drops in and is pushed back out, the wheel recoils a little.
# The roller is built of 10 overlapping convex pieces whose inner ends taper in, so a resting tip never meets an inner face. One tooth each vibration pair. Only the wheel is driven (the mainspring). The balance is set going by hand: let go 2.6 rad from its rest. Generator: opencode-runs/batch12/gen293.py.
number: 293
slug: duplex-escapement
name: Duplex escapement
brown: "Duplex escapement, for watches, so called from partaking of the characters of the spur and crown wheels. The axis of balance carries pallet, B, which at every oscillation receives an impulse from the crown teeth. In the axis, A, of balance-wheel is cut a notch into which the teeth round the edge of the wheel successively fall after each one of the crown teeth passes the impulse pallet, B."
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, -7.3]
    mass: 0.006
    friction: 0.1
    color: "#e6d7b0"
    pieces:
      - kind: wheel
        center: [0.0, -7.3]
        teeth: 12
        tooth: [[7.0, 0], [6.25, 0], [6.25, 0.06]]   # a spur tooth: long and thin, its face radial, leading clockwise
        phase: 1.6435
        root: 6.3
        rim: 0.6
        hub: 0.6
        spokes: 0
        y: [-0.2, 0.2]
        collide: 2
      - {kind: poly, points: [[0.98995, -6.87574], [4.24264, -3.62304], [3.67696, -3.05736], [0.42426, -6.31005]], y: [-0.15, 0.15]}   # a spoke
      - {kind: poly, points: [[-0.42426, -6.31005], [-3.67696, -3.05736], [-4.24264, -3.62304], [-0.98995, -6.87574]], y: [-0.15, 0.15]}   # a spoke
      - {kind: poly, points: [[-0.98995, -7.72426], [-4.24264, -10.97696], [-3.67696, -11.54264], [-0.42426, -8.28995]], y: [-0.15, 0.15]}   # a spoke
      - {kind: poly, points: [[0.42426, -8.28995], [3.67696, -11.54264], [4.24264, -10.97696], [0.98995, -7.72426]], y: [-0.15, 0.15]}   # a spoke
      - {kind: disc, center: [0.0, -7.3], radius: 0.3, y: [-0.6, 0.8], color: "#8f8a80"}   # its arbor
      - {kind: disc, center: [-1.78421, -1.57142], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [-4.40946, -3.23101], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [-5.8532, -5.98088], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [-5.72858, -9.08421], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [-4.06899, -11.70946], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [-1.31912, -13.1532], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [1.78421, -13.02858], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [4.40946, -11.36899], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [5.8532, -8.61912], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [5.72858, -5.51579], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [4.06899, -2.89054], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
      - {kind: disc, center: [1.31912, -1.4468], radius: 0.09, y: [-0.75, -0.2], collide: 2, color: "#8f8a80"}   # a crown tooth
  - id: balance
    shape: part
    pos: [0, 0, 0]
    mass: 0.06
    friction: 0.1
    color: "#d9c49a"
    pieces:
      - {kind: disc, center: [0, 0], radius: 3.6, inner: 3.1, y: [0.8, 1.2]}   # the balance's rim (behind)
      - {kind: poly, points: [[-0.01673, -0.36017], [1.47823, -2.84514], [1.82098, -2.63894], [0.32603, -0.15397]], y: [0.85, 1.15]}   # an arm
      - {kind: poly, points: [[0.32028, 0.1656], [1.72485, 2.70275], [1.3749, 2.89649], [-0.02968, 0.35933]], y: [0.85, 1.15]}   # an arm
      - {kind: poly, points: [[-0.30355, 0.19457], [-3.20308, 0.14239], [-3.19588, -0.25754], [-0.29635, -0.20537]], y: [0.85, 1.15]}   # an arm
      - {kind: disc, center: [0, 0], radius: 0.2, y: [-1.2, 1.4], color: "#8f8a80", density: 7800}   # the axis A above and below the roller
      - {kind: poly, points: [[0, 0], [-0.5999, -0.0108], [-0.59649, -0.06478], [-0.58824, -0.11823], [-0.5752, -0.17072], [-0.55749, -0.22183], [-0.53525, -0.27113], [-0.50866, -0.31823], [-0.43501, -0.35265]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller (by the notch)
      - {kind: poly, points: [[0, 0], [-0.5074, -0.23694], [-0.50866, -0.31823], [-0.47793, -0.36274], [-0.44333, -0.40431], [-0.40511, -0.44259], [-0.36361, -0.47727], [-0.31916, -0.50807], [-0.27211, -0.53475], [-0.19125, -0.52633]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller
      - {kind: poly, points: [[0, 0], [-0.3129, -0.46443], [-0.27211, -0.53475], [-0.22284, -0.55708], [-0.17177, -0.57489], [-0.1193, -0.58802], [-0.06587, -0.59637], [-0.01189, -0.59988], [0.04218, -0.59852], [0.10715, -0.54965]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller
      - {kind: poly, points: [[0, 0], [-0.02901, -0.55925], [0.04218, -0.59852], [0.0959, -0.59229], [0.14885, -0.58124], [0.20059, -0.56548], [0.2507, -0.54512], [0.29877, -0.52032], [0.34441, -0.49131], [0.37494, -0.41596]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller
      - {kind: poly, points: [[0, 0], [0.26317, -0.49431], [0.34441, -0.49131], [0.38726, -0.45829], [0.42695, -0.42156], [0.46318, -0.3814], [0.49565, -0.33814], [0.52408, -0.29213], [0.54826, -0.24375], [0.53562, -0.16344]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller
      - {kind: poly, points: [[0, 0], [0.48017, -0.28816], [0.54826, -0.24375], [0.56798, -0.19338], [0.58309, -0.14145], [0.59346, -0.08836], [0.599, -0.03456], [0.59968, 0.01952], [0.59549, 0.07344], [0.54329, 0.13577]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller
      - {kind: poly, points: [[0, 0], [0.56, 0.0003], [0.59549, 0.07344], [0.58645, 0.12677], [0.57266, 0.17907], [0.5542, 0.22991], [0.53125, 0.27888], [0.50397, 0.32559], [0.47261, 0.36965], [0.39577, 0.39619]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller
      - {kind: poly, points: [[0, 0], [0.47986, 0.28868], [0.47261, 0.36965], [0.4374, 0.41071], [0.39864, 0.44843], [0.35663, 0.48251], [0.31173, 0.51266], [0.2643, 0.53865], [0.21472, 0.56026], [0.13518, 0.54344]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller
      - {kind: poly, points: [[0, 0], [0.26264, 0.49459], [0.21472, 0.56026], [0.16339, 0.57732], [0.11074, 0.58969], [0.05718, 0.59727], [0.00317, 0.59999], [-0.05088, 0.59784], [-0.10451, 0.59083], [-0.16402, 0.53544]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller
      - {kind: poly, points: [[0, 0], [-0.02961, 0.55922], [-0.10451, 0.59083], [-0.15729, 0.57902], [-0.20879, 0.5625], [-0.2586, 0.54141], [-0.3063, 0.51592], [-0.35152, 0.48624], [-0.39388, 0.45261]], y: [-0.2, 0.2], collide: 1, color: "#c9b27e"}   # the roller (by the notch)
      - {kind: poly, points: [[0.09832, 0.2115], [-0.02551, 1.00287], [-0.18462, 0.98606], [-0.14035, 0.18629]], y: [-0.7, -0.4], color: "#9aa3ad"}   # the pallet B's arm
      - {kind: poly, points: [[-0.02551, 1.00287], [-0.06754, 1.40066], [-0.22665, 1.38385], [-0.18462, 0.98606]], y: [-0.7, -0.4], collide: 1, color: "#b85c38"}   # the impulse pallet B
  - id: plate
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-1.0, -8.3], [1.0, -8.3], [1.0, -6.3], [-1.0, -6.3]], y: [0.85, 1.05]}   # the cock behind the wheel
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.00202, springref: -2.6, damping: 4e-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.0035, max_torque: 0.05}
checks:
  - {type: advance, joint: j_wheel, beat: j_bal, expect: 0.2618, tol: 0.03, settle_s: 3, window_s: 8.2}
  - {type: period, joint: j_bal, expect_s: 1.001, tol: 0.03, settle_s: 3, window_s: 8}
  - {type: amplitude, joint: j_bal, min: 1.8, max: 3.0, sustain: 0.9, settle_s: 3, window_s: 8}
  - {type: penetration, max: 0.0005, settle_s: 1}
camera: {target: [0.0, 0, -8.7], position: [0.0, -77.0, -8.7], fov: 30}
display:
  output: j_wheel
  swing: j_bal
  labels: {j_wheel: "Escape-wheel (mainspring)", j_bal: "Balance"}
  proof: {label: "Pallet and roller out of contact", sub: "nothing makes good the balance's losses, so its swing dies away, and the mainspring spins the wheel freely"}

