number: 504
slug: fergusons-mechanical-paradox
name: Ferguson's mechanical paradox
brown: "“Ferguson’s mechanical paradox,” designed to show a curious property of the epicyclic train. The wheel, A, is fixed upon a stationary stud about which the arm, C, D, revolves. In this arm are two pins, M, N, upon one of which is fitted loosely a thick wheel, B, gearing with A, and upon the other are three loose wheels, E, F, G, all gearing with B. When the arm, C, D, is turned round on the stud, motion is given to the three wheels, E, F, G, on their common axis, viz., the pin, N; the three forming with the intermediate wheel, B, and the wheel, A, three distinct epicyclic trains."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 100, solver: PGS, duration_s: 10, floor: false}
bodies:
  # the stand C and the stationary stud, A fast on it
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [0, 0, -9], to: [0, 0, 1.4], radius: 0.6, collide: 0}
      - {kind: rod, from: [0, 0, -9], to: [0, 0, -2.2], radius: 1.4, collide: 0}
      - {kind: poly, points: [[-5, -10.2], [5, -10.2], [4, -9], [-4, -9]], y: [-4, 4], collide: 0, color: "#a39d90"}
  # the arm C, D: a flat bar turning on the stud under the wheels, the pins M and N standing in it
  - id: arm
    shape: part
    pos: [0, 0, 0]
    density: 2500
    color: "#a39d90"
    pieces:
      - {kind: poly, points: [[-2.5, -1.6], [28, -1.6], [28, -0.6], [-2.5, -0.6]], y: [-1.8, 1.8], collide: 0}
      - {kind: rod, from: [0, 0, -2.2], to: [0, 0, -0.6], radius: 1.4, collide: 0}
      - {kind: rod, from: [12, 0, -1.6], to: [12, 0, 5], radius: 0.45, collide: 0, color: "#6f6a60"}
      - {kind: rod, from: [24, 0, -1.6], to: [24, 0, 5], radius: 0.45, collide: 0, color: "#6f6a60"}
      - {kind: rod, from: [12, 0, -0.6], to: [12, 0, 0], radius: 1.0, collide: 0}
      - {kind: rod, from: [24, 0, -0.6], to: [24, 0, 0], radius: 1.0, collide: 0}
  - {id: wB, shape: part, pos: [12, 0, 0], mount: arm, density: 7800, color: "#cbbfa4", pieces: [{kind: rod, from: [12, 0, 0], to: [12, 0, 4.4], radius: 1.0, collide: 0}]}
  - {id: wE, shape: part, pos: [24, 0, 3.9], mount: arm, density: 7800, color: "#e4d9bf", pieces: [{kind: rod, from: [25, 0, 4.46], to: [28.8, 0, 4.46], radius: 0.28, collide: 0, color: "#5a3a2a"}]}
  - {id: wF, shape: part, pos: [24, 0, 2.2], mount: arm, density: 7800, color: "#e4d9bf", pieces: [{kind: rod, from: [25, 0, 2.76], to: [28.8, 0, 2.76], radius: 0.28, collide: 0, color: "#2f3f5a"}]}
  - {id: wG, shape: part, pos: [24, 0, 0.5], mount: arm, density: 7800, color: "#e4d9bf", pieces: [{kind: rod, from: [25, 0, 1.06], to: [28.8, 0, 1.06], radius: 0.28, collide: 0, color: "#3a5a2a"}]}
joints:
  - {id: j_c, type: hinge, body: arm, axis: [0, 0, 1], damping: 0.01}      # the arm C, D: the driver
  - {id: j_b, type: hinge, body: wB, axis: [0, 0, 1], damping: 0.002}
  - {id: j_e, type: hinge, body: wE, axis: [0, 0, 1], damping: 0.004}
  - {id: j_f, type: hinge, body: wF, axis: [0, 0, 1], damping: 0.004}
  - {id: j_g, type: hinge, body: wG, axis: [0, 0, 1], damping: 0.004}
spurs:
  - {id: gA, body: frame, pos: [0, 0, 0.5], teeth: 20, module: 0.6, width: 1, backlash: 0.06, phase: 0, quat: [0.7071068, 0.7071068, 0, 0], color: "#d9cdb2"}
  - {id: gB, body: wB, pos: [0, 0, 2.2], teeth: 20, module: 0.6, width: 4.4, backlash: 0.06, phase: 0.157080, quat: [0.7071068, 0.7071068, 0, 0], color: "#cbbfa4"}
  - {id: gE, body: wE, pos: [0, 0, 0], teeth: 21, module: 0.571429, pressure_angle: 0.163416, width: 1, backlash: 0.06, phase: 0.149600, quat: [0.7071068, 0.7071068, 0, 0]}
  - {id: gF, body: wF, pos: [0, 0, 0], teeth: 20, module: 0.6, width: 1, backlash: 0.06, phase: 0.000000, quat: [0.7071068, 0.7071068, 0, 0]}
  - {id: gG, body: wG, pos: [0, 0, 0], teeth: 19, module: 0.631579, pressure_angle: 0.467477, width: 1, backlash: 0.06, phase: 0.165347, quat: [0.7071068, 0.7071068, 0, 0]}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_c, kind: velocity, rpm: 12, kv: 100, max_torque: 40}
checks:
  # relative to the arm: F -1 (it stands still in the world), E -20/21, G -20/19
  - {type: ratio, out: j_f, in: j_c, expect: -1.0, tol: 0.006, settle_s: 1.0, window_s: 8}
  - {type: ratio, out: j_e, in: j_c, expect: -0.952381, tol: 0.006, settle_s: 1.0, window_s: 8}
  - {type: ratio, out: j_g, in: j_c, expect: -1.052632, tol: 0.006, settle_s: 1.0, window_s: 8}
  - {type: ratio, out: j_b, in: j_c, expect: 1.0, tol: 0.01, settle_s: 1.0, window_s: 8}
  - {type: penetration, max: 0.0005, settle_s: 1.0}
camera: {target: [0, 0, -7], position: [0, -92, 44], fov: 32}
display:
  output: j_e
  labels: {j_c: "Arm C, D (driver)", j_b: "Thick wheel B", j_e: "E (21 teeth)", j_f: "F (20 teeth)", j_g: "G (19 teeth)"}
  expect: {default: -0.9524}
  proof: {label: "B's teeth out of contact", sub: "the arm carries E, F and G round on N, but nothing turns them on it"}

