number: 336
slug: side-lever-parallel-motion-rock-shaft
name: A side-lever parallel motion with radius arms on a rock-shaft
brown: "An arrangement of parallel motion for side lever marine engines. The parallel rods connected with the side rods from the beams or side levers are also connected with short radius arms on a rock-shaft working in fixed bearings."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 100, solver: CG, multiccd: true, duration_s: 8, floor: false}
bodies:
  # the framing: the side lever's centre A, the radius bar's centre F, and the cylinder
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    density: 7800
    color: "#9a9284"
    pieces:
      - {kind: poly, points: [[-18.0000, -10.0000], [50.0000, -10.0000], [50.0000, -9.0000], [-18.0000, -9.0000]], y: [-2.6, 5.4], collide: 0}
      - {kind: poly, points: [[-1.2000, -9.0000], [1.2000, -9.0000], [1.2000, 0.0000], [-1.2000, 0.0000]], y: [3.6, 4.2], collide: 0}
      - {kind: disc, center: [0, 0], radius: 1.4, y: [3.6, 4.2], collide: 0}
      - {kind: poly, points: [[23.9561, 20.0000], [25.5561, 20.0000], [25.5561, 35.0000], [23.9561, 35.0000]], y: [-3.0, -2.4], collide: 0}
      - {kind: disc, center: [24.7561, 35.0000], radius: 1.2, y: [-3.0, -2.4], collide: 0}
      - {kind: rod, from: [24.7561, -3.0, 35.0000], to: [24.7561, -1.4, 35.0000], radius: 0.5, collide: 0, color: "#6f6a60"}
      - {kind: poly, points: [[18.0000, 6.0000], [40.0000, 6.0000], [40.0000, 19.0000], [18.0000, 19.0000]], y: [-3.4, 1.5], collide: 0, color: "#8a8274"}
      - {kind: poly, points: [[17.0000, 19.0000], [41.0000, 19.0000], [41.0000, 20.0000], [17.0000, 20.0000]], y: [-3.6, 1.8], collide: 0, color: "#7d776c"}
      - {kind: poly, points: [[18.5000, -9.0000], [20.0000, -9.0000], [20.0000, 6.0000], [18.5000, 6.0000]], y: [-1.2, 1.2], collide: 0}
      - {kind: poly, points: [[38.0000, -9.0000], [39.5000, -9.0000], [39.5000, 6.0000], [38.0000, 6.0000]], y: [-1.2, 1.2], collide: 0}
  # the side lever, rocked on A by the engine (the driven joint)
  - id: L
    shape: part
    pos: [0, 0, 0]
    density: 7800
    color: "#a39d90"
    pieces:
      - {kind: poly, points: [[-3.0000, -1.1000], [36.0000, -1.1000], [36.0000, 1.1000], [-3.0000, 1.1000]], y: [2.8, 3.5], collide: 0}
      - {kind: disc, center: [0, 0], radius: 2.6, y: [2.8, 3.5], collide: 0}
      - {kind: poly, points: [[-12.0000, -1.1000], [-3.0000, -1.1000], [-3.0000, 1.1000], [-12.0000, 1.1000]], y: [2.8, 3.5], collide: 0}
      - {kind: disc, center: [-12, 0], radius: 4.5, y: [2.6, 5.2], collide: 0, color: "#7d776c"}   # the lever's other arm, a weight in place of the engine's crank side
      - {kind: rod, from: [0, 2.4, 0], to: [0, 4.0, 0], radius: 0.6, collide: 0, color: "#6f6a60"}
      - {kind: rod, from: [14.5, 1.6, 0], to: [14.5, 3.0, 0], radius: 0.35, collide: 0, color: "#6f6a60"}
      - {kind: rod, from: [35.0, 1.6, 0], to: [35.0, 3.0, 0], radius: 0.35, collide: 0, color: "#6f6a60"}
  # the side rod, from the lever's end B up to the cross-head E: its upper eye a bearing on E's pin
  - id: S
    shape: part
    pos: [35.0, 0, 0]
    mount: L
    density: 2650
    color: "#b0a690"
    pieces:
      - {kind: rod, from: [35.0000, 2.3, 0.0000], to: [35.0000, 2.3, 35.0000], radius: 0.6, collide: 0}
      - {kind: disc, center: [35.0000, 0.0000], radius: 0.75, y: [2.0, 2.6], collide: 0}
      - {kind: band, center: [35.0000, 35.0000], r: [0.42, 0.95], a: [0, 6.2832], y: [2.0, 2.6], slices: 36, collide: 1}
  # the rod from M on the lever up to D, its pin D shared by the parallel rod and the radius arm
  - id: R
    shape: part
    pos: [14.5, 0, 0]
    mount: L
    density: 2650
    color: "#b0a690"
    pieces:
      - {kind: rod, from: [14.5000, 2.3, 0.0000], to: [14.5000, 2.3, 35.0000], radius: 0.6, collide: 0}
      - {kind: disc, center: [14.5000, 0.0000], radius: 0.75, y: [2.0, 2.6], collide: 0}
      - {kind: disc, center: [14.5000, 35.0000], radius: 0.75, y: [2.0, 2.6], collide: 0}
      - {kind: disc, center: [14.5, 35.0000], radius: 0.4, y: [-2.2, 2.6], collide: 2, color: "#6f6a60"}
  # the parallel rod D-E, on D; its other eye a bearing on E's pin
  - id: Pb
    shape: part
    pos: [14.5, 0, 35.0000]
    mount: R
    density: 2650
    color: "#a39a88"
    pieces:
      - {kind: rod, from: [14.5000, -0.9, 35.0000], to: [35.0000, -0.9, 35.0000], radius: 0.6, collide: 0}
      - {kind: disc, center: [14.5000, 35.0000], radius: 0.75, y: [-1.2, -0.6], collide: 0}
      - {kind: band, center: [35.0000, 35.0000], r: [0.42, 0.95], a: [0, 6.2832], y: [-1.2, -0.6], slices: 36, collide: 1}
  # the short radius arm F-D on the rock-shaft F; its eye a bearing on D's pin
  - id: Fb
    shape: part
    pos: [24.7561, 0, 35.0000]
    mount: frame
    density: 2650
    color: "#a39a88"
    pieces:
      - {kind: rod, from: [24.7561, -1.9, 35.0000], to: [14.5000, -1.9, 35.0000], radius: 0.6, collide: 0}
      - {kind: disc, center: [24.7561, 35.0000], radius: 0.75, y: [-2.2, -1.6], collide: 0}
      - {kind: band, center: [14.5000, 35.0000], r: [0.42, 0.95], a: [0, 6.2832], y: [-2.2, -1.6], slices: 36, collide: 1}
  # the cross-head E on the piston-rod. The piston in its cylinder keeps the rod upright; it is free to move
  # across and up and down, and only the side rod and the parallel bar, through E's pin, place it
  - {id: Px, shape: part, pos: [35.0, 0, 35.0000], mount: frame, mass: 0.01, color: "#8f8a80", pieces: [{kind: disc, center: [35.0, 12], radius: 0.1, y: [0.0, 0.05], collide: 0}]}
  - id: P
    shape: part
    pos: [35.0, 0, 35.0000]
    mount: Px
    density: 7800
    color: "#b8ad96"
    pieces:
      - {kind: disc, center: [35.0, 35.0000], radius: 0.4, y: [-1.2, 2.6], collide: 2, color: "#6f6a60"}
      - {kind: poly, points: [[34.0000, 34.0000], [36.0000, 34.0000], [36.0000, 36.2000], [34.0000, 36.2000]], y: [-0.5, 1.9], collide: 0}
      - {kind: rod, from: [35.0, 0.7, 34.0000], to: [35.0, 0.7, 12], radius: 0.45, collide: 0, color: "#8f8a80"}
joints:
  - {id: j_A, type: hinge, body: L, axis: [0, -1, 0], damping: 0.001}
  - {id: j_S, type: hinge, body: S, axis: [0, -1, 0], damping: 0.001}
  - {id: j_R, type: hinge, body: R, axis: [0, -1, 0], damping: 0.001}
  - {id: j_Pb, type: hinge, body: Pb, axis: [0, -1, 0], damping: 0.001}
  - {id: j_F, type: hinge, body: Fb, axis: [0, -1, 0], damping: 0.001}
  - {id: j_x, type: slide, body: Px, axis: [1, 0, 0], damping: 0.05, range: [-1, 1]}
  - {id: j_z, type: slide, body: P, axis: [0, 0, 1], damping: 0.05, range: [-7, 7]}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_A, kind: velocity, rpm: 0, swing: {amplitude: 0.18, hz: 0.25}, kv: 2000, max_torque: 100}
checks:
  # the side lever, rocked on A, lifts the cross-head E in step with it ...
  - {type: follow, out: j_z, in: j_A, expect: 0.3485, tol: 0.007, min_r2: 0.999, settle_s: 0.5, window_s: 7.0}
  - {type: amplitude, joint: j_z, min: 0.060, max: 0.066, settle_s: 0.5, window_s: 7.0}
  # ... while the short radius arm on the rock-shaft swings AM / FD = 1.41 times as far, the other way,
  # holding D (and through the parallelogram, E) to a straight line: E strays across by under a millimetre
  - {type: follow, out: j_F, in: j_A, expect: -1.42, tol: 0.03, min_r2: 0.999, settle_s: 0.5, window_s: 7.0}
  - {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: [18, 0, 11], position: [18, -120, 15], fov: 30}
display:
  output: j_z
  labels: {j_A: "Side lever, rocked on A (driver)", j_x: Cross-head E across, j_z: Cross-head E and piston-rod, j_F: Radius arm F D on the rock-shaft, j_Pb: Parallel rod D E}

