number: 330
slug: piston-rod-prolonged-guide-forked-connecting-rod
name: Piston-rod prolonged into a guide, with a forked connecting-rod
brown: "The piston-rod is prolonged and works in a guide, A, which is in line with the center of the cylinder. The lower part of the connecting-rod is forked to permit the upper part of the piston-rod to pass between."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 100, solver: CG, multiccd: true, duration_s: 8, floor: false}
bodies:
  # the frame: the cylinder's gland below, guide A above the cross-head (on a bracket that passes between
  # the fork's tines), and the crank-shaft's bearing at the top
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    density: 7800
    friction: 0.1
    color: "#9a9284"
    pieces:
      - {kind: poly, points: [[-12.0000, -32.0000], [12.0000, -32.0000], [12.0000, -31.0000], [-12.0000, -31.0000]], y: [-2.0, 5.0], collide: 0}
      - {kind: poly, points: [[-12.0000, -31.0000], [-11.0000, -31.0000], [-11.0000, 1.5000], [-12.0000, 1.5000]], y: [3.4, 4.6], collide: 0}
      - {kind: poly, points: [[11.0000, -31.0000], [12.0000, -31.0000], [12.0000, 1.5000], [11.0000, 1.5000]], y: [3.4, 4.6], collide: 0}
      - {kind: poly, points: [[-12.0000, 1.5000], [12.0000, 1.5000], [12.0000, 2.5000], [-12.0000, 2.5000]], y: [3.4, 4.6], collide: 0}
      - {kind: poly, points: [[-1.0000, -0.8000], [1.0000, -0.8000], [1.0000, 1.5000], [-1.0000, 1.5000]], y: [4.4, 5.0], collide: 0}
      - {kind: disc, center: [0, 0], radius: 1.1, y: [4.4, 5.0], collide: 0}
      - {kind: poly, points: [[-3.5000, -31.0000], [3.5000, -31.0000], [3.5000, -22.0000], [-3.5000, -22.0000]], y: [-2.0, 2.0], collide: 0, color: "#7d776c"}
      - {kind: poly, points: [[-3.5000, -22.0000], [-0.3700, -22.0000], [-0.3700, -20.5000], [-3.5000, -20.5000]], y: [-1.2, 1.2], collide: 0}
      - {kind: poly, points: [[0.3700, -22.0000], [3.5000, -22.0000], [3.5000, -20.5000], [0.3700, -20.5000]], y: [-1.2, 1.2], collide: 0}
      - {kind: poly, points: [[-1.2000, -22.0000], [-0.3700, -22.0000], [-0.3700, -20.5000], [-1.2000, -20.5000]], y: [-1.2, 1.2], collide: 1, color: "#7d776c"}
      - {kind: poly, points: [[0.3700, -22.0000], [1.2000, -22.0000], [1.2000, -20.5000], [0.3700, -20.5000]], y: [-1.2, 1.2], collide: 1, color: "#7d776c"}
      - {kind: poly, points: [[-11.0000, -11.7000], [-1.2000, -11.7000], [-1.2000, -10.2000], [-11.0000, -10.2000]], y: [-0.5, 0.5], collide: 0}
      - {kind: poly, points: [[1.2000, -11.7000], [11.0000, -11.7000], [11.0000, -10.2000], [1.2000, -10.2000]], y: [-0.5, 0.5], collide: 0}
      - {kind: poly, points: [[-1.2000, -11.7000], [-0.3700, -11.7000], [-0.3700, -10.2000], [-1.2000, -10.2000]], y: [-0.5, 0.5], collide: 1, color: "#7d776c"}
      - {kind: poly, points: [[0.3700, -11.7000], [1.2000, -11.7000], [1.2000, -10.2000], [0.3700, -10.2000]], y: [-0.5, 0.5], collide: 1, color: "#7d776c"}
      - {kind: poly, points: [[-11.0000, -11.7000], [-10.0000, -11.7000], [-10.0000, -10.2000], [-11.0000, -10.2000]], y: [-0.5, 4.6], collide: 0}
      - {kind: poly, points: [[10.0000, -11.7000], [11.0000, -11.7000], [11.0000, -10.2000], [10.0000, -10.2000]], y: [-0.5, 4.6], collide: 0}
  # the crank, its fly-wheel behind; the crank-pin is the connecting-rod's only hold on it
  - id: K
    shape: part
    pos: [0, 0, 0]
    density: 7800
    color: "#a39d90"
    pieces:
      - {kind: rod, from: [0, 0.9, 0], to: [0, 4.4, 0], radius: 0.6, collide: 0, color: "#8f8a80"}
      - {kind: poly, points: [[-1.0, -1.0], [3.0, -0.7], [3.0, 0.7], [-1.0, 1.0]], y: [0.7, 1.3], collide: 0}
      - {kind: disc, center: [3.0, 0], radius: 0.5, y: [-0.7, 1.3], collide: 2, color: "#6f6a60"}
      - {kind: disc, center: [0, 0], radius: 7.5, inner: 6.3, y: [2.0, 3.4], collide: 0, color: "#7d776c"}
      - {kind: rod, from: [-6.5, 2.7, 0], to: [6.5, 2.7, 0], radius: 0.4, collide: 0, color: "#7d776c"}
      - {kind: rod, from: [0, 2.7, -6.5], to: [0, 2.7, 6.5], radius: 0.4, collide: 0, color: "#7d776c"}
  # the piston-rod, with the cross-head on it, free to move across, up and down and to turn: only the gland
  # and guide A hold it
  - {id: Px, shape: part, pos: [0, 0, -15.7162], mount: frame, mass: 0.01, color: "#8f8a80", pieces: [{kind: disc, center: [0, -15.7162], radius: 0.1, y: [1.6, 1.65], collide: 0}]}
  - {id: Pz, shape: part, pos: [0, 0, -15.7162], mount: Px, mass: 0.01, color: "#8f8a80", pieces: [{kind: disc, center: [0, -15.7162], radius: 0.1, y: [1.6, 1.65], collide: 0}]}
  - id: P
    shape: part
    pos: [0, 0, -15.7162]
    mount: Pz
    density: 7800
    color: "#b8ad96"
    pieces:
      - {kind: rod, from: [0, 0, -25.7162], to: [0, 0, -6.7162], radius: 0.35, collide: 2, capsule: true, color: "#8f8a80"}
      - {kind: poly, points: [[-1.0000, -16.3162], [1.0000, -16.3162], [1.0000, -15.1162], [-1.0000, -15.1162]], y: [-0.6, 0.6], collide: 0}
      - {kind: rod, from: [0, -1.5, -15.7162], to: [0, 1.5, -15.7162], radius: 0.3, collide: 0, color: "#6f6a60"}
  # the connecting-rod: forked below, its tines on the cross-head pin either side of the piston-rod;
  # its big end a bearing ring round the crank-pin
  - id: R
    shape: part
    pos: [0, 0, -15.7162]
    mount: P
    density: 7800
    color: "#a39a88"
    pieces:
      - {kind: rod, from: [0, 0.9, -15.7162], to: [2.0625, 0.9, -4.9113], radius: 0.25, collide: 0}
      - {kind: rod, from: [0, -0.9, -15.7162], to: [2.0625, -0.9, -4.9113], radius: 0.25, collide: 0}
      - {kind: rod, from: [2.0625, -1.15, -4.9113], to: [2.0625, 1.15, -4.9113], radius: 0.4, collide: 0}
      - {kind: rod, from: [2.0625, 0, -4.9113], to: [3.0, 0, 0], radius: 0.35, collide: 0}
      - {kind: disc, center: [0, -15.7162], radius: 0.55, y: [0.65, 1.15], collide: 0}
      - {kind: disc, center: [0, -15.7162], radius: 0.55, y: [-1.15, -0.65], collide: 0}
      - {kind: band, center: [3.0, 0], r: [0.52, 1.1], a: [0, 6.2832], y: [-0.5, 0.5], slices: 36, collide: 1}
joints:
  - {id: j_K, type: hinge, body: K, axis: [0, -1, 0], damping: 0.0005}
  - {id: j_x, type: slide, body: Px, axis: [1, 0, 0], damping: 0.05, range: [-1, 1]}
  - {id: j_z, type: slide, body: Pz, axis: [0, 0, 1], damping: 0.05, range: [-3.8000, 3.8000]}
  - {id: j_rot, type: hinge, body: P, axis: [0, -1, 0], damping: 0.001}
  - {id: j_R, type: hinge, body: R, axis: [0, -1, 0], damping: 0.001}
contact: {solref: [0.001, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_K, kind: velocity, rpm: 30, kv: 0.5, max_torque: 5}
checks:
  - {type: turning, joint: j_K, direction: 1, min_mean: 3.0, min_fraction: 0.95, settle_s: 0.5, window_s: 7.0}
  # the crank throws the piston-rod up and down its full stroke, twice the crank's 3 cm radius ...
  - {type: amplitude, joint: j_z, min: 0.0295, max: 0.0305, settle_s: 0.5, window_s: 7.0}
  # ... and the gland and guide A, either side of the cross-head, keep it on its line though the
  # connecting-rod pushes it sideways: it moves across by no more than its clearance, and barely turns
  - {type: position, joint: j_x, min: -0.03, max: 0.03, settle_s: 0.5, window_s: 7.0}
  - {type: position, joint: j_rot, min: -0.005, max: 0.005, settle_s: 0.5, window_s: 7.0}
  - {type: penetration, max: 0.0003, settle_s: 0.2}
camera: {target: [0, 0, -18], position: [-70, -175, -4], fov: 30}
display:
  output: j_z
  labels: {j_K: Crank and fly-wheel (driver), j_R: Connecting-rod, j_x: Piston-rod across, j_z: Piston-rod, j_rot: Turn of piston-rod}

