number: 348
slug: snyder-two-reciprocations-one-revolution
name: Two reciprocating movements of a rod by one revolution
brown: "Mode of obtaining two reciprocating movements of a rod by one revolution of a shaft, patented in 1836 by B. F. Snyder, has been used for operating the needle of a sewing machine, by J. S. McCurdy, also for driving a gang of saws. The disk, A, on the central rotating shaft has two slots, a, a, crossing each other at a right angle in the center, and the connecting-rod, B, has attached to it two pivoted slides, c, c, one working in each slot."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 100, solver: CG, multiccd: true, duration_s: 8, floor: false}
bodies:
  # the framing: the shaft's bearing behind the disk, the needle-bar's guide above
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    density: 7800
    color: "#9a9284"
    pieces:
      - {kind: poly, points: [[-3.0000, -24.0000], [3.0000, -24.0000], [3.0000, -2.2000], [-3.0000, -2.2000]], y: [4.0, 6.0], collide: 0}
      - {kind: disc, center: [0.0000, 0.0000], radius: 3.0, y: [4.0, 6.0], collide: 0}
      - {kind: poly, points: [[-30.0000, -25.4000], [30.0000, -25.4000], [30.0000, -24.0000], [-30.0000, -24.0000]], y: [-6, 8], collide: 0}
      - {kind: poly, points: [[-3.2000, 30.0000], [-1.2500, 30.0000], [-1.2500, 38.0000], [-3.2000, 38.0000]], y: [-5.0, -1.2], collide: 0}
      - {kind: poly, points: [[1.2500, 30.0000], [3.2000, 30.0000], [3.2000, 38.0000], [1.2500, 38.0000]], y: [-5.0, -1.2], collide: 0}
      - {kind: poly, points: [[3.2000, 33.0000], [6.0000, 33.0000], [6.0000, 35.0000], [3.2000, 35.0000]], y: [-5.0, 6.0], collide: 0}
      - {kind: poly, points: [[6.0000, -24.0000], [8.0000, -24.0000], [8.0000, 35.0000], [6.0000, 35.0000]], y: [4.0, 6.0], collide: 0}
  # the disk A on its shaft (the driven joint), with the slots a, a, crossing at the centre; the slots' cheeks
  # stand out from the face, one slot's above the other's
  - id: K
    shape: part
    pos: [0, 0, 0]
    mount: frame
    density: 7800
    friction: 0.05
    color: "#a39d90"
    pieces:
      - {kind: disc, center: [0, 0], radius: 14.0, y: [1.0, 2.4], collide: 0}
      - {kind: rod, from: [0, 2.4, 0], to: [0, 6.0, 0], radius: 1.6, collide: 0, color: "#6f6a60"}
      - {kind: poly, points: [[-12.0000, 1.0000], [12.0000, 1.0000], [12.0000, 1.8000], [-12.0000, 1.8000]], y: [0.0, 1.0], collide: 1}
      - {kind: poly, points: [[-12.0000, -1.8000], [12.0000, -1.8000], [12.0000, -1.0000], [-12.0000, -1.0000]], y: [0.0, 1.0], collide: 1}
      - {kind: poly, points: [[1.0000, -12.0000], [1.8000, -12.0000], [1.8000, 12.0000], [1.0000, 12.0000]], y: [-1.2, 0.0], collide: 1, color: "#b0a690"}
      - {kind: poly, points: [[-1.8000, -12.0000], [-1.0000, -12.0000], [-1.0000, 12.0000], [-1.8000, 12.0000]], y: [-1.2, 0.0], collide: 1, color: "#b0a690"}
  # the needle-bar, sliding in its guide
  - id: N
    shape: part
    pos: [0, 0, 26.0000]
    mount: frame
    density: 7800
    color: "#b8ad96"
    pieces:
      - {kind: poly, points: [[-1.2000, 24.6000], [1.2000, 24.6000], [1.2000, 42.0000], [-1.2000, 42.0000]], y: [-4.0, -2.2], collide: 0}
  # the connecting-rod B, pinned to the needle-bar
  - id: B
    shape: part
    pos: [0, 0, 26.0000]
    mount: N
    density: 7800
    color: "#a39d90"
    pieces:
      - {kind: poly, points: [[-1.0000, -12.0000], [1.0000, -12.0000], [1.0000, 26.0000], [-1.0000, 26.0000]], y: [-2.0, -1.4], collide: 0}
      - {kind: disc, center: [0.0000, 26.0000], radius: 0.5, y: [-4.2, -1.4], collide: 0, color: "#6f6a60"}
      - {kind: disc, center: [0.0000, 0.0000], radius: 0.4, y: [-2.0, 0.05], collide: 0, color: "#6f6a60"}
      - {kind: disc, center: [0.0000, -10.0000], radius: 0.4, y: [-2.0, -1.15], collide: 0, color: "#6f6a60"}
  # the slides c, c, each pivoted on B, one in each slot
  - id: S1
    shape: part
    pos: [0, 0, 0]
    mount: B
    density: 7800
    color: "#8f8a80"
    pieces:
      - {kind: poly, points: [[-2.0000, -0.9800], [2.0000, -0.9800], [2.0000, 0.9800], [-2.0000, 0.9800]], y: [0.05, 0.95], collide: 2}
  - id: S2
    shape: part
    pos: [0, 0, -10.0000]
    mount: B
    density: 7800
    color: "#8f8a80"
    pieces:
      - {kind: poly, points: [[-0.9800, -12.0000], [0.9800, -12.0000], [0.9800, -8.0000], [-0.9800, -8.0000]], y: [-1.15, -0.05], collide: 2}
joints:
  - {id: j_K, type: hinge, body: K, axis: [0, -1, 0], damping: 0.0005}
  - {id: j_z, type: slide, body: N, axis: [0, 0, 1], damping: 0.05, range: [-3, 14]}
  - {id: j_B, type: hinge, body: B, axis: [0, -1, 0], damping: 0.001}
  - {id: j_c1, type: hinge, body: S1, axis: [0, -1, 0], damping: 0.001}
  - {id: j_c2, type: hinge, body: S2, axis: [0, -1, 0], damping: 0.001}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_K, kind: velocity, rpm: 30, kv: 30, max_torque: 50}
checks:
  - {type: turning, joint: j_K, direction: 1, min_mean: 2.8, min_fraction: 0.95, settle_s: 0.5, window_s: 7.0}
  # the slides, the ends of a trammel in the crossed slots, carry B's lower end round a small circle twice a turn,
  # and B works the needle-bar up and down twice to each turn of the disk (once a second at 30 rev/min) ...
  - {type: period, joint: j_z, expect_s: 1.0, tol: 0.02, settle_s: 0.5, window_s: 7.0}
  # ... through a stroke of about the slides' distance apart
  - {type: amplitude, joint: j_z, min: 0.049, max: 0.051, settle_s: 0.5, window_s: 7.0}
  - {type: penetration, max: 0.0003, settle_s: 0.2}
camera: {target: [0, 0, 0], position: [0, -205, 3], fov: 30}
display:
  output: j_z
  labels: {j_K: Disk A (driver), j_B: Connecting-rod B, j_c1: Slide c (upper), j_c2: Slide c (lower), j_z: Needle-bar}

