number: 339
slug: parallel-motion-direct-action-engines
name: Parallel motion for direct-action engines
brown: "Parallel motion for direct action engines. In this, the end of the bar, B, C, is connected with the piston-rod, and the end, B, slides in a fixed slot, D. The radius bar, F, A, is connected at F with a fixed pivot, and at A, midway between the ends of B, C."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 100, solver: CG, multiccd: true, duration_s: 8, floor: false}
bodies:
  # the framing: the pivot F on a bracket, the slot D level with it, and the gland that guides the piston-rod
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    density: 7800
    color: "#9a9284"
    pieces:
      - {kind: poly, points: [[-46.0000, -33.2000], [12.0000, -33.2000], [12.0000, -32.0000], [-46.0000, -32.0000]], y: [-4.6, 4.2], collide: 0}
      - {kind: poly, points: [[8.0000, -32.0000], [10.0000, -32.0000], [10.0000, 1.0000], [8.0000, 1.0000]], y: [2.8, 3.6], collide: 0}
      - {kind: poly, points: [[-0.6000, -1.0000], [10.0000, -1.0000], [10.0000, 1.0000], [-0.6000, 1.0000]], y: [2.8, 3.6], collide: 0}
      - {kind: disc, center: [0, 0], radius: 1.4, y: [2.8, 3.6], collide: 0}
      - {kind: rod, from: [0, 1.2, 0], to: [0, 3.6, 0], radius: 0.5, collide: 0, color: "#6f6a60"}
  # the slot D: two cheeks above and below B's pin, closed at the ends, on a standard
      - {kind: poly, points: [[-44.0000, -32.0000], [-42.0000, -32.0000], [-42.0000, 2.6000], [-44.0000, 2.6000]], y: [-2.8, 0.4], collide: 0}
      - {kind: poly, points: [[-42.0000, 0.4200], [-28.6000, 0.4200], [-28.6000, 2.6000], [-42.0000, 2.6000]], y: [-2.8, -1.8], collide: 1}
      - {kind: poly, points: [[-42.0000, -2.6000], [-28.6000, -2.6000], [-28.6000, -0.4200], [-42.0000, -0.4200]], y: [-2.8, -1.8], collide: 1}
      - {kind: poly, points: [[-42.0000, -2.6000], [-28.6000, -2.6000], [-28.6000, 2.6000], [-42.0000, 2.6000]], y: [-0.2, 0.4], collide: 0}
      - {kind: poly, points: [[-6.0000, -32.0000], [-4.6000, -32.0000], [-4.6000, -25.9047], [-6.0000, -25.9047]], y: [-4.4, -3.6], collide: 0}
      - {kind: poly, points: [[-6.0000, -27.3047], [-0.5000, -27.3047], [-0.5000, -25.9047], [-6.0000, -25.9047]], y: [-4.4, -3.6], collide: 0}
      - {kind: poly, points: [[-1.6000, -28.5047], [1.6000, -28.5047], [1.6000, -25.9047], [-1.6000, -25.9047]], y: [-4.8, -3.0], collide: 0, color: "#7d776c"}
  # the radius bar F A, rocked on F (the driven joint)
  - id: R
    shape: part
    pos: [0, 0, 0]
    mount: frame
    density: 7800
    color: "#a39d90"
    pieces:
      - {kind: rod, from: [0.0000, 1.8, 0.0000], to: [-18.1262, 1.8, -8.4524], radius: 0.5, collide: 0}
      - {kind: disc, center: [0.0000, 0.0000], radius: 1.0, y: [1.4, 2.2], collide: 0}
      - {kind: disc, center: [-18.1262, -8.4524], radius: 1.0, y: [1.4, 2.2], collide: 0}
      - {kind: rod, from: [-18.1262, -1.6, -8.4524], to: [-18.1262, 2.2, -8.4524], radius: 0.4, collide: 0, color: "#6f6a60"}
  # the bar B C, on the radius bar's pin A at its middle; its end B a pin in the slot, its end C the piston-rod's pin
  - id: V
    shape: part
    pos: [-18.1262, 0, -8.4524]
    mount: R
    density: 7800
    color: "#b0a690"
    pieces:
      - {kind: rod, from: [-36.2523, -1.25, 0.0000], to: [0.0000, -1.25, -16.9047], radius: 0.5, collide: 0}
      - {kind: disc, center: [-18.1262, -8.4524], radius: 1.1, y: [-1.6, -0.9], collide: 0}
      - {kind: disc, center: [-36.2523, 0.0000], radius: 0.4, y: [-2.8, -0.9], collide: 2, color: "#6f6a60"}
      - {kind: disc, center: [-36.2523, 0.0000], radius: 0.75, y: [-1.6, -0.9], collide: 0}
      - {kind: disc, center: [0.0000, -16.9047], radius: 0.4, y: [-3.8, -0.9], collide: 2, color: "#6f6a60"}
      - {kind: disc, center: [0.0000, -16.9047], radius: 0.75, y: [-1.6, -0.9], collide: 0}
  # the cross-head C and the piston-rod, which hangs through the gland: free to move across and up and down,
  # and only the bar's end, through C's pin, places it
  - {id: Px, shape: part, pos: [0.0000, 0, -16.9047], mount: frame, mass: 0.01, color: "#8f8a80", pieces: [{kind: disc, center: [0.0000, -27.2047], radius: 0.1, y: [-4.0, -3.9], collide: 0}]}
  - id: P
    shape: part
    pos: [0.0000, 0, -16.9047]
    mount: Px
    density: 7800
    color: "#b8ad96"
    pieces:
      - {kind: band, center: [0.0000, -16.9047], r: [0.42, 0.95], a: [0, 6.2832], y: [-3.8, -3.0], slices: 36, collide: 1}
      - {kind: poly, points: [[-0.9000, -17.9047], [0.9000, -17.9047], [0.9000, -15.9047], [-0.9000, -15.9047]], y: [-4.4, -3.9], collide: 0}
      - {kind: rod, from: [0.0000, -4.1, -17.9047], to: [0.0000, -4.1, -34.9047], radius: 0.45, collide: 0, color: "#8f8a80"}
joints:
  - {id: j_F, type: hinge, body: R, axis: [0, -1, 0], damping: 0.001}
  - {id: j_A, type: hinge, body: V, axis: [0, -1, 0], damping: 0.001}
  - {id: j_x, type: slide, body: Px, axis: [1, 0, 0], damping: 0.2, range: [-1, 1]}
  - {id: j_z, type: slide, body: P, axis: [0, 0, 1], damping: 0.2, range: [-9, 9]}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_F, kind: velocity, rpm: 0, swing: {amplitude: 0.18, hz: 0.25}, kv: 2000, max_torque: 100}
checks:
  # the radius bar, rocked on F, carries the bar's middle A round its arc; B, held in the slot, slides along the
  # level of F, so the bar's other end C rises and falls with the radius bar (2 F A cos 25 deg = 0.36 m a radian) ...
  - {type: follow, out: j_z, in: j_F, expect: -0.3605, tol: 0.008, min_r2: 0.999, settle_s: 0.5, window_s: 7.0}
  - {type: amplitude, joint: j_z, min: 0.062, max: 0.068, settle_s: 0.5, window_s: 7.0}
  # ... the bar turning on A twice as far as the radius bar, the other way, FA, AB and AC being equal ...
  - {type: follow, out: j_A, in: j_F, expect: -2.0, tol: 0.03, min_r2: 0.999, settle_s: 0.5, window_s: 7.0}
  # ... so that C keeps to the upright line through F: the cross-head strays across by under a millimetre
  - {type: position, joint: j_x, min: -0.1, max: 0.1, settle_s: 0.5, window_s: 7.0}
  - {type: penetration, max: 0.0003, settle_s: 0.2}
camera: {target: [-17, 0, -19.4], position: [-17, -102, -15.4], fov: 30}
display:
  output: j_z
  labels: {j_F: "Radius bar F A (driver)", j_A: Bar B C, j_x: Cross-head C across, j_z: Cross-head C and piston-rod}

