number: 341
slug: grasshopper-beam-engine
name: The grasshopper beam engine
brown: "“Grasshopper” beam engine. The beam is attached at one end to a rocking-pillar, A, and the shaft arranged as near to the cylinder as the crank will work. B is the radius-bar of the parallel motion."
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, the pillar's footstep G, the wall that carries the radius bar's centre W,
  # and the cylinder's gland
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    density: 7800
    color: "#9a9284"
    pieces:
      - {kind: poly, points: [[-29.1029, -5.2000], [28.4166, -5.2000], [28.4166, -4.0000], [-29.1029, -4.0000]], y: [-4.6, 4.2], collide: 0}
      - {kind: poly, points: [[-2.0000, -4.0000], [2.0000, -4.0000], [2.0000, 0.8000], [-2.0000, 0.8000]], y: [2.6, 3.6], collide: 0}
      - {kind: disc, center: [0, 0], radius: 1.6, y: [2.6, 3.6], collide: 0}
      - {kind: poly, points: [[23.0166, -4.0000], [27.8166, -4.0000], [27.8166, 0.1834], [23.0166, 0.1834]], y: [1.6, 3.6], collide: 0}
      - {kind: disc, center: [25.4166, -0.4166], radius: 1.4, y: [1.6, 3.6], collide: 0}
      - {kind: rod, from: [25.4166, -0.8, -0.4166], to: [25.4166, 3.6, -0.4166], radius: 0.6, collide: 0, color: "#6f6a60"}
      - {kind: poly, points: [[-28.1029, -4.0000], [-26.5028, -4.0000], [-26.5028, 33.8125], [-28.1029, 33.8125]], y: [-2.6, 3.6], collide: 0}
      - {kind: poly, points: [[-26.5028, 29.1125], [-23.5028, 29.1125], [-23.5028, 30.5125], [-26.5028, 30.5125]], y: [-2.6, -1.8], collide: 0}
      - {kind: disc, center: [-24.1029, 29.8125], radius: 0.9, y: [-2.6, -1.8], collide: 0}
      - {kind: poly, points: [[-28.5052, -4.0000], [-20.5052, -4.0000], [-20.5052, 8.8333], [-28.5052, 8.8333]], y: [-4.8, -2.6], collide: 0, color: "#7d776c"}
      - {kind: poly, points: [[-29.1052, 8.8333], [-19.9052, 8.8333], [-19.9052, 9.8333], [-29.1052, 9.8333]], y: [-5.0, -2.4], collide: 0, color: "#7d776c"}
  # the crank on the shaft (the driven joint), its pin K
  - id: Ck
    shape: part
    pos: [0, 0, 0]
    mount: frame
    density: 7800
    color: "#a39d90"
    pieces:
      - {kind: rod, from: [0, -0.2, 0], to: [5.0000, -0.2, 0.0000], radius: 0.9, collide: 0}
      - {kind: disc, center: [0.0000, 0.0000], radius: 1.6, y: [-0.6, 0.2], collide: 0}
      - {kind: disc, center: [5.0000, 0.0000], radius: 1.1, y: [-0.6, 0.2], collide: 0}
      - {kind: rod, from: [0, -0.6, 0], to: [0, 3.6, 0], radius: 0.7, collide: 0, color: "#6f6a60"}
      - {kind: disc, center: [5.0000, 0.0000], radius: 0.4, y: [-1.6, 0.2], collide: 0, color: "#6f6a60"}
  # the rocking pillar A, on its footstep G
  - id: Ak
    shape: part
    pos: [25.4166, 0, -0.4166]
    mount: frame
    density: 7800.0
    color: "#a39d90"
    pieces:
      - {kind: rod, from: [25.4166, 1.0, -0.4166], to: [24.1666, 1.0, 28.7500], radius: 0.6, collide: 0}
      - {kind: disc, center: [25.4166, -0.4166], radius: 1.2, y: [0.6, 1.4], collide: 0}
      - {kind: disc, center: [24.1666, 28.7500], radius: 1.2, y: [0.6, 1.4], collide: 0}
      - {kind: rod, from: [24.1666, -0.8, 28.7500], to: [24.1666, 1.4, 28.7500], radius: 0.5, collide: 0, color: "#6f6a60"}
  # the beam P Q R, on the pillar's top R; the pin Q for the radius bar and the connecting-rod, and the pin P
  # for the piston-rod
  - id: Bm
    shape: part
    pos: [24.1666, 0, 28.7500]
    mount: Ak
    density: 7800.0
    color: "#b0a690"
    pieces:
      - {kind: poly, points: [[-26.0293, 24.3711], [0.1435, 28.6925], [25.4253, 30.0975], [25.6908, 27.7122], [0.6744, 23.9220], [-25.7639, 21.9859]], y: [-0.6, 0.6], collide: 0}
      - {kind: disc, center: [24.1666, 28.7500], radius: 1.4, y: [-0.8, 0.8], collide: 0}
      - {kind: disc, center: [0.3782, 26.5833], radius: 0.4, y: [-2.6, 0.6], collide: 0, color: "#6f6a60"}
      - {kind: disc, center: [-24.5052, 23.3333], radius: 0.4, y: [-3.8, 0.6], collide: 0, color: "#6f6a60"}
  # the radius bar B, on its fixed centre W; its eye a bearing on Q
  - id: Rb
    shape: part
    pos: [-24.1029, 0, 29.8125]
    mount: frame
    density: 7800
    color: "#a39a88"
    pieces:
      - {kind: rod, from: [-24.1029, -2.2, 29.8125], to: [0.3782, -2.2, 26.5833], radius: 0.3, collide: 0}
      - {kind: disc, center: [-24.1029, 29.8125], radius: 0.7, y: [-2.6, -1.8], collide: 0}
      - {kind: band, center: [0.3782, 26.5833], r: [0.42, 0.95], a: [0, 6.2832], y: [-2.6, -1.8], slices: 36, collide: 0}
  # the connecting-rod, hung from Q; its lower eye a bearing on the crank pin
  - id: Cr
    shape: part
    pos: [0.3782, 0, 26.5833]
    mount: Bm
    density: 7800
    color: "#a39a88"
    pieces:
      - {kind: rod, from: [0.3782, -1.25, 26.5833], to: [5.0000, -1.25, 0.0000], radius: 0.45, collide: 0}
      - {kind: disc, center: [0.3782, 26.5833], radius: 1.0, y: [-1.6, -0.9], collide: 0}
      - {kind: band, center: [5.0000, 0.0000], r: [0.42, 1.5], a: [0, 6.2832], y: [-1.6, -0.9], slices: 36, collide: 0}
  # the cross-head P and the piston-rod, which hangs into the cylinder: free to move across and up and down,
  # and only the beam's end, through P's pin, places it
  - {id: Px, shape: part, pos: [-24.5052, 0, 23.3333], mount: frame, mass: 0.01, color: "#8f8a80", pieces: [{kind: disc, center: [-24.5052, 6.8333], radius: 0.1, y: [-4.0, -3.9], collide: 0}]}
  - id: P
    shape: part
    pos: [-24.5052, 0, 23.3333]
    mount: Px
    density: 7800
    color: "#b8ad96"
    pieces:
      - {kind: band, center: [-24.5052, 23.3333], r: [0.42, 0.95], a: [0, 6.2832], y: [-3.8, -3.0], slices: 36, collide: 0}
      - {kind: poly, points: [[-25.4052, 22.3333], [-23.6052, 22.3333], [-23.6052, 24.3333], [-25.4052, 24.3333]], y: [-4.4, -3.9], collide: 0}
      - {kind: rod, from: [-24.5052, -4.1, 22.3333], to: [-24.5052, -4.1, 1.3333], radius: 0.45, collide: 0, color: "#8f8a80"}
pins:
  - {id: p_K, a: Cr, b: Ck, at: [5.0000, -1.25, 0.0000]}   # the connecting-rod's lower eye on the crank pin
  - {id: p_Q, a: Rb, b: Bm, at: [0.3782, -2.2, 26.5833]}   # the radius bar's eye on the beam's pin Q
  - {id: p_P, a: P, b: Bm, at: [-24.5052, -3.4, 23.3333]}   # the cross-head on the beam's end pin P
joints:
  - {id: j_S, type: hinge, body: Ck, axis: [0, -1, 0], damping: 0.001}
  - {id: j_G, type: hinge, body: Ak, axis: [0, -1, 0], damping: 0.05}
  - {id: j_R, type: hinge, body: Bm, axis: [0, -1, 0], damping: 0.05}
  - {id: j_W, type: hinge, body: Rb, axis: [0, -1, 0], damping: 0.05}
  - {id: j_Q, type: hinge, body: Cr, axis: [0, -1, 0], damping: 0.05}
  - {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: [-18, 18]}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_S, kind: velocity, rpm: 15.0, kv: 100, max_torque: 100}
checks:
  # the parallel motion: the cross-head P travels the cylinder's line within half a millimetre (0.05 cm), free to move across
  - {type: position, joint: j_x, min: -0.05, max: 0.05, settle_s: 0.5, window_s: 7.0}
  # the piston's half-stroke from the crank's 5 cm through the conn-rod, the beam and its pillar
  - {type: amplitude, joint: j_z, min: 0.098, max: 0.105, settle_s: 0.5, window_s: 7.0}
  - {type: position, joint: j_z, min: -12, max: 13, settle_s: 0.0, window_s: 8}
camera: {target: [-1.3431, 0, 10], position: [-1.3431, -230, 18], fov: 16}
display:
  output: j_z
  labels: {j_S: "Crank (driver)", j_G: Rocking pillar A, j_R: Beam P Q R, j_W: Radius bar B, j_x: Cross-head P across, j_z: Cross-head P and piston-rod}

