number: 337
slug: parallel-motion-vibrating-rod
name: A parallel motion with a short vibrating rod
brown: "Parallel motion in which the radius rod is connected with the lower end of a short vibrating rod, the upper end of which is connected with the beam, and to the center of which the piston-rod is connected."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 100, solver: CG, multiccd: true, duration_s: 8, floor: false}
bodies:
  # the framing: the beam's centre O on its column, the radius rod's centre G, and the gland
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    density: 7800
    color: "#9a9284"
    pieces:
      - {kind: poly, points: [[-57.0000, -31.2000], [8.0000, -31.2000], [8.0000, -30.0000], [-57.0000, -30.0000]], y: [-4.6, 3.6], collide: 0}
      - {kind: poly, points: [[-1.6000, -30.0000], [1.6000, -30.0000], [1.6000, 0.0000], [-1.6000, 0.0000]], y: [2.0, 3.2], collide: 0}
      - {kind: rod, from: [0, -1.0, 0], to: [0, 3.2, 0], radius: 1.0, collide: 0, color: "#6f6a60"}
      - {kind: poly, points: [[-53.8000, -30.0000], [-52.2000, -30.0000], [-52.2000, -12.0000], [-53.8000, -12.0000]], y: [-1.6, -1.0], collide: 0}
      - {kind: disc, center: [-53.0000, -12.0000], radius: 1.0, y: [-1.6, -1.0], collide: 0}
      - {kind: rod, from: [-53.0000, -2.8, -12.0000], to: [-53.0000, -1.0, -12.0000], radius: 0.4, collide: 0, color: "#6f6a60"}
      - {kind: poly, points: [[-32.5000, -30.0000], [-31.1000, -30.0000], [-31.1000, -24.0000], [-32.5000, -24.0000]], y: [-4.2, -2.6], collide: 0}
      - {kind: poly, points: [[-32.5000, -24.0000], [-27.0000, -24.0000], [-27.0000, -22.6000], [-32.5000, -22.6000]], y: [-4.2, -2.6], collide: 0}
      - {kind: poly, points: [[-28.1000, -22.6000], [-24.9000, -22.6000], [-24.9000, -20.0000], [-28.1000, -20.0000]], y: [-4.6, -2.2], collide: 0, color: "#7d776c"}
  # the beam, rocked on O (the driven joint), with its end pin U
  - id: beam
    shape: part
    pos: [0, 0, 0]
    mount: frame
    density: 7800
    color: "#b0a690"
    pieces:
      - {kind: poly, points: [[-29.2000, -1.0], [0, -2.6], [6, -2.4], [6, 2.4], [0, 2.6], [-29.2000, 1.4]], y: [-0.6, 0.6], collide: 0}
      - {kind: disc, center: [0, 0], radius: 4.6, y: [-0.9, 0.9], collide: 0}
      - {kind: disc, center: [0, 0], radius: 1.2, y: [-1.1, 1.1], collide: 0, color: "#6f6a60"}
      - {kind: disc, center: [-28.0000, 0], radius: 1.4, y: [-0.8, 0.8], collide: 0}
      - {kind: rod, from: [-28.0000, -1.6, 0], to: [-28.0000, 0.6, 0], radius: 0.4, collide: 0, color: "#6f6a60"}
  # the short vibrating rod, hung from U: the radius rod's pin W at its lower end, the piston-rod's pin C at its centre
  - id: V
    shape: part
    pos: [-28.0000, 0, 0.0000]
    mount: beam
    density: 7800
    color: "#a39d90"
    pieces:
      - {kind: rod, from: [-28.0000, -1.25, 0.0000], to: [-25.0000, -1.25, -12.0000], radius: 0.35, collide: 0}
      - {kind: disc, center: [-28.0000, 0.0000], radius: 0.75, y: [-1.6, -0.9], collide: 0}
      - {kind: disc, center: [-26.5000, -6.0000], radius: 0.9, y: [-1.6, -0.9], collide: 0}
      - {kind: disc, center: [-25.0000, -12.0000], radius: 0.4, y: [-2.6, -0.9], collide: 2, color: "#6f6a60"}
      - {kind: disc, center: [-26.5000, -6.0000], radius: 0.4, y: [-3.8, -0.9], collide: 2, color: "#6f6a60"}
  # the radius rod G W, on its fixed centre G; its eye a bearing on W
  - id: Rr
    shape: part
    pos: [-53.0000, 0, -12.0000]
    mount: frame
    density: 7800
    color: "#a39a88"
    pieces:
      - {kind: rod, from: [-53.0000, -2.3, -12.0000], to: [-25.0000, -2.3, -12.0000], radius: 0.35, collide: 0}
      - {kind: disc, center: [-53.0000, -12.0000], radius: 0.75, y: [-2.6, -2.0], collide: 0}
      - {kind: band, center: [-25.0000, -12.0000], r: [0.42, 0.95], a: [0, 6.2832], y: [-2.6, -2.0], slices: 36, collide: 1}
  # the cross-head and the piston-rod: free to move across and up and down; only the pin C places it
  - {id: Px, shape: part, pos: [-26.5000, 0, -6.0000], mount: frame, mass: 0.01, color: "#8f8a80", pieces: [{kind: disc, center: [-26.5000, -21], radius: 0.1, y: [-3.5, -3.4], collide: 0}]}
  - id: P
    shape: part
    pos: [-26.5000, 0, -6.0000]
    mount: Px
    density: 7800
    color: "#b8ad96"
    pieces:
      - {kind: band, center: [-26.5000, -6.0000], r: [0.42, 0.95], a: [0, 6.2832], y: [-3.8, -3.0], slices: 36, collide: 1}
      - {kind: rod, from: [-26.5000, -3.4, -6.9500], to: [-26.5000, -3.4, -24.0000], radius: 0.45, collide: 0, color: "#8f8a80"}
joints:
  - {id: j_O, type: hinge, body: beam, axis: [0, -1, 0], damping: 0.001}
  - {id: j_V, type: hinge, body: V, axis: [0, -1, 0], damping: 0.001}
  - {id: j_G, type: hinge, body: Rr, 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: [-7, 7]}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_O, kind: velocity, rpm: 0, swing: {amplitude: 0.2, hz: 0.25}, kv: 2000, max_torque: 100}
checks:
  # the beam, rocked on O, carries the vibrating rod's top U up and down, and with it the piston-rod ...
  - {type: follow, out: j_z, in: j_O, expect: -0.279, tol: 0.006, min_r2: 0.999, settle_s: 0.5, window_s: 7.0}
  - {type: amplitude, joint: j_z, min: 0.053, max: 0.058, settle_s: 0.5, window_s: 7.0}
  # ... while the radius rod, as long as the beam's radius, swings as far the other way, so that the rod's
  # centre C, between two arcs bowed opposite ways, keeps to a straight line: under a millimetre across
  - {type: follow, out: j_G, in: j_O, expect: -1.003, 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: [-24, 0, -20], position: [-24, -200, -12], fov: 30}
display:
  output: j_z
  labels: {j_O: "Beam, rocked on O (driver)", j_V: Vibrating rod U W, j_G: Radius rod G W, j_x: Cross-head C across, j_z: Cross-head C and piston-rod}

