# No. 135 (Brown 1868): "Modification of the triangular eccentric 91, used on the steam engine in the Paris Mint. The circular disk behind carries the triangular tappet, which communicates an alternate rectilinear motion to the valve-rod. The valve is at rest at the completion of each stroke for an instant, and is pushed quickly across the steam-ports to the end of the next."
#
# Model (cm, gravity on): the shaft (the one driven joint, 15 turns a minute, clockwise in the view) carries on a disc a curved triangle turning about its centre: three arcs, each struck from the opposite corner with the side (12 cm) as radius, so that
# it is 12 cm wide whichever way it is turned. It works by real contact between the two horizontal faces of a rectangular yoke 12 cm apart (0.1 mm clearance), on the valve-rod sliding in fixed guides. The yoke is carried
# up and down 1.86 cm, three strokes to a turn, at rest for an instant at the end of each. Generator: opencode-runs/batch10/gen135.py.
number: 135
slug: triangular-tappet-valve-rod
name: A triangular tappet working a valve-rod yoke
brown: "Modification of the triangular eccentric 91, used on the steam engine in the Paris Mint. The circular disk behind carries the triangular tappet, which communicates an alternate rectilinear motion to the valve-rod. The valve is at rest at the completion of each stroke for an instant, and is pushed quickly across the steam-ports to the end of the next."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: PGS
  multiccd: true
  duration_s: 10.0
  floor: false
bodies:
  - id: shaft
    shape: part
    pos: [0, 0, 0]
    mass: 1.5
    friction: 0.05
    color: "#d9cfb6"
    pieces:
      - {kind: rod, from: [0, -2.4, 0], to: [0, 3.6, 0], radius: 0.8, color: "#8f8a80"}   # the shaft
      - {kind: poly, points: [[-6.0, -3.4641], [-5.541, -3.7159], [-5.0714, -3.9475], [-4.5922, -4.1584], [-4.1042, -4.3481], [-3.6085, -4.5164], [-3.1058, -4.6629], [-2.5973, -4.7873], [-2.0838, -4.8895], [-1.5663, -4.9691], [-1.0459, -5.0261], [-0.5234, -5.0604], [0.0, -5.0718], [0.5234, -5.0604], [1.0459, -5.0261], [1.5663, -4.9691], [2.0838, -4.8895], [2.5973, -4.7873], [3.1058, -4.6629], [3.6085, -4.5164], [4.1042, -4.3481], [4.5922, -4.1584], [5.0714, -3.9475], [5.541, -3.7159], [6.0, -3.4641], [5.9886, -2.9407], [5.9543, -2.4182], [5.8973, -1.8978], [5.8177, -1.3803], [5.7156, -0.8668], [5.5911, -0.3583], [5.4446, 0.1444], [5.2763, 0.6401], [5.0866, 1.1281], [4.8757, 1.6073], [4.6441, 2.0769], [4.3923, 2.5359], [4.1207, 2.9835], [3.8298, 3.4188], [3.5202, 3.841], [3.1925, 4.2493], [2.8473, 4.643], [2.4853, 5.0212], [2.1071, 5.3832], [1.7135, 5.7284], [1.3051, 6.0561], [0.8829, 6.3657], [0.4476, 6.6566], [0.0, 6.9282], [-0.4476, 6.6566], [-0.8829, 6.3657], [-1.3051, 6.0561], [-1.7135, 5.7284], [-2.1071, 5.3832], [-2.4853, 5.0212], [-2.8473, 4.643], [-3.1925, 4.2493], [-3.5202, 3.841], [-3.8298, 3.4188], [-4.1207, 2.9835], [-4.3923, 2.5359], [-4.6441, 2.0769], [-4.8757, 1.6073], [-5.0866, 1.1281], [-5.2763, 0.6401], [-5.4446, 0.1444], [-5.5911, -0.3583], [-5.7156, -0.8668], [-5.8177, -1.3803], [-5.8973, -1.8978], [-5.9543, -2.4182], [-5.9886, -2.9407]], y: [-0.8, 0.8], collide: 1}   # the triangular tappet
      - {kind: disc, center: [0, 0], radius: 12.84, inner: 0.0, y: [1.0, 2.2], collide: 0, color: "#cfc6b4"}   # the circular disk behind
  - id: yoke
    shape: part
    pos: [0, 0, 0]
    mass: 0.8
    friction: 0.05
    color: "#b8ad97"
    pieces:
      - {kind: poly, points: [[-13.2, -6.3818], [13.2, -6.3818], [13.2, -5.0818], [-13.2, -5.0818]], y: [-0.9, 0.9], collide: 2}   # the yoke's lower face
      - {kind: poly, points: [[-13.2, 6.9382], [13.2, 6.9382], [13.2, 8.2382], [-13.2, 8.2382]], y: [-0.9, 0.9], collide: 2}   # its upper face
      - {kind: poly, points: [[-13.2, -6.3818], [-12.299999999999999, -6.3818], [-12.299999999999999, 8.2382], [-13.2, 8.2382]], y: [-0.9, 0.9]}   # its sides
      - {kind: poly, points: [[12.299999999999999, -6.3818], [13.2, -6.3818], [13.2, 8.2382], [12.299999999999999, 8.2382]], y: [-0.9, 0.9]}
      - {kind: rod, from: [0, 0, 8.2382], to: [0, 0, 17.2382], radius: 0.6}   # the valve-rod above
      - {kind: rod, from: [0, 0, -6.3818], to: [0, 0, -15.3818], radius: 0.6}   # and below
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-1.4, -15.3818], [1.4, -15.3818], [0.9, 0], [-0.9, 0]], y: [2.4, 3.4]}   # the shaft's standard, behind
      - {kind: poly, points: [[-1.7, 11.2382], [-0.7, 11.2382], [-0.7, 12.7382], [-1.7, 12.7382]], y: [-1, 1]}   # the upper guide
      - {kind: poly, points: [[0.7, 11.2382], [1.7, 11.2382], [1.7, 12.7382], [0.7, 12.7382]], y: [-1, 1]}
      - {kind: poly, points: [[-1.7, -10.8818], [-0.7, -10.8818], [-0.7, -9.3818], [-1.7, -9.3818]], y: [-1, 1]}   # the lower guide
      - {kind: poly, points: [[0.7, -10.8818], [1.7, -10.8818], [1.7, -9.3818], [0.7, -9.3818]], y: [-1, 1]}
      - {kind: poly, points: [[-12, 11.2382], [12, 11.2382], [12, 12.7382], [-12, 12.7382]], y: [1.0, 1.8]}   # the cross-heads, behind
      - {kind: poly, points: [[-12, -10.8818], [12, -10.8818], [12, -9.3818], [-12, -9.3818]], y: [1.0, 1.8]}
      - {kind: poly, points: [[-12, -15.3818], [-11, -15.3818], [-11, 12.7382], [-12, 12.7382]], y: [1.0, 1.8]}   # the posts
      - {kind: poly, points: [[11, -15.3818], [12, -15.3818], [12, 12.7382], [11, 12.7382]], y: [1.0, 1.8]}
      - {kind: poly, points: [[-15, -16.3818], [15, -16.3818], [15, -15.3818], [-15, -15.3818]], y: [-3, 3], color: "#b9b09c"}
joints:
  - {id: j_s, type: hinge, body: shaft, axis: [0, 1, 0], damping: 0.002}   # the one driven joint; + : clockwise
  - {id: j_v, type: slide, body: yoke, axis: [0, 0, 1], range: [-3.3564, 0.5012], damping: 3.0}   # the valve-rod in its guides; + : up
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_s, kind: velocity, rpm: 15.0, kv: 20.0, max_torque: 20}
checks:
  - {type: follow, out: j_v, in: j_s, expect: -0.0303, tol: 0.0012, min_r2: 0.99, settle_s: 4.2222, window_s: 0.1333}   # the yoke's speed per radian of the shaft, 20-32 degrees of the turn
  - {type: follow, out: j_v, in: j_s, expect: 0.0303, tol: 0.0012, min_r2: 0.99, settle_s: 4.8889, window_s: 0.1333}   # the yoke's speed per radian of the shaft, 80-92 degrees of the turn
  - {type: follow, out: j_v, in: j_s, expect: -0.0303, tol: 0.0012, min_r2: 0.99, settle_s: 5.5556, window_s: 0.1333}   # the yoke's speed per radian of the shaft, 140-152 degrees of the turn
  - {type: follow, out: j_v, in: j_s, expect: 0.0303, tol: 0.0012, min_r2: 0.99, settle_s: 6.2222, window_s: 0.1333}   # the yoke's speed per radian of the shaft, 200-212 degrees of the turn
  - {type: position, joint: j_v, min: -1.9164, max: 0.0612, settle_s: 0.5, window_s: 9}   # the stroke: 1.86 cm
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [0, 0, -2.0], position: [0, -100.0, -2.0], fov: 34}
display:
  output: j_v
  labels: {j_s: "Shaft (driver)", j_v: "Valve-rod yoke"}
  proof: {label: "Tappet out of contact", sub: "the shaft turns but the yoke falls and stands"}

