number: 505
slug: epicyclic-train-annular
name: Another simple form of the epicyclic train
brown: "Another simple form of the epicyclic train, in which the arm, D, carries a pinion, B, which gears both with a spur-wheel, A, and an annular wheel, C, both concentric with the axis of the arm. Either of the wheels, A, C, may be stationary, and the revolution of the arm and pinion will give motion to the other wheel."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 100, solver: CG, multiccd: true, duration_s: 8, floor: false}
bodies:
  # the annular wheel C, stationary (Brown: either A or C may be held)
  - id: ringC
    shape: part
    pos: [0, 0, 0]
    fixed: true
    friction: 0.1
    color: "#e8dec6"
    pieces:
      - {kind: band, center: [0, 0], r: [15.22, 16.8], a: [0, 6.2831853], y: [-0.8, 0.8], collide: 0}
      - {kind: poly, points: [[8.7562, 10.7221], [8.2853, 11.09], [8.7325, 12.4665], [9.9836, 11.489]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[6.7613, 12.0797], [6.2336, 12.3603], [6.4351, 13.7935], [7.8369, 13.0481]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[4.561, 13.0703], [3.9926, 13.255], [3.9421, 14.7014], [5.452, 14.2108]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[2.2221, 13.6637], [1.6302, 13.7469], [1.3293, 15.1626], [2.9015, 14.9416]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-0.1844, 13.842], [-0.7817, 13.8211], [-1.3238, 15.163], [0.2629, 15.2184]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-2.5852, 13.5997], [-3.1698, 13.4754], [-3.9367, 14.7028], [-2.3838, 15.0329]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-4.9075, 12.9442], [-5.4616, 12.7203], [-6.43, 13.7958], [-4.958, 14.3906]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-7.0807, 11.8953], [-7.5875, 11.5786], [-8.728, 12.4697], [-7.3816, 13.311]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-9.0387, 10.4851], [-9.4828, 10.0852], [-10.7607, 10.7646], [-9.5809, 11.827]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-10.7221, 8.7562], [-11.09, 8.2853], [-12.4665, 8.7325], [-11.489, 9.9836]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-12.0797, 6.7613], [-12.3603, 6.2336], [-13.7935, 6.4351], [-13.0481, 7.8369]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-13.0703, 4.561], [-13.255, 3.9926], [-14.7014, 3.9421], [-14.2108, 5.452]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-13.6637, 2.2221], [-13.7469, 1.6302], [-15.1626, 1.3293], [-14.9416, 2.9015]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-13.842, -0.1844], [-13.8211, -0.7817], [-15.163, -1.3238], [-15.2184, 0.2629]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-13.5997, -2.5852], [-13.4754, -3.1698], [-14.7028, -3.9367], [-15.0329, -2.3838]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-12.9442, -4.9075], [-12.7203, -5.4616], [-13.7958, -6.43], [-14.3906, -4.958]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-11.8953, -7.0807], [-11.5786, -7.5875], [-12.4697, -8.728], [-13.311, -7.3816]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-10.4851, -9.0387], [-10.0852, -9.4828], [-10.7646, -10.7607], [-11.827, -9.5809]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-8.7562, -10.7221], [-8.2853, -11.09], [-8.7325, -12.4665], [-9.9836, -11.489]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-6.7613, -12.0797], [-6.2336, -12.3603], [-6.4351, -13.7935], [-7.8369, -13.0481]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-4.561, -13.0703], [-3.9926, -13.255], [-3.9421, -14.7014], [-5.452, -14.2108]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-2.2221, -13.6637], [-1.6302, -13.7469], [-1.3293, -15.1626], [-2.9015, -14.9416]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[0.1844, -13.842], [0.7817, -13.8211], [1.3238, -15.163], [-0.2629, -15.2184]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[2.5852, -13.5997], [3.1698, -13.4754], [3.9367, -14.7028], [2.3838, -15.0329]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[4.9075, -12.9442], [5.4616, -12.7203], [6.43, -13.7958], [4.958, -14.3906]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[7.0807, -11.8953], [7.5875, -11.5786], [8.728, -12.4697], [7.3816, -13.311]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[9.0387, -10.4851], [9.4828, -10.0852], [10.7607, -10.7646], [9.5809, -11.827]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[10.7221, -8.7562], [11.09, -8.2853], [12.4665, -8.7325], [11.489, -9.9836]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[12.0797, -6.7613], [12.3603, -6.2336], [13.7935, -6.4351], [13.0481, -7.8369]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[13.0703, -4.561], [13.255, -3.9926], [14.7014, -3.9421], [14.2108, -5.452]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[13.6637, -2.2221], [13.7469, -1.6302], [15.1626, -1.3293], [14.9416, -2.9015]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[13.842, 0.1844], [13.8211, 0.7817], [15.163, 1.3238], [15.2184, -0.2629]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[13.5997, 2.5852], [13.4754, 3.1698], [14.7028, 3.9367], [15.0329, 2.3838]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[12.9442, 4.9075], [12.7203, 5.4616], [13.7958, 6.43], [14.3906, 4.958]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[11.8953, 7.0807], [11.5786, 7.5875], [12.4697, 8.728], [13.311, 7.3816]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[10.4851, 9.0387], [10.0852, 9.4828], [10.7646, 10.7607], [11.827, 9.5809]], y: [-0.8, 0.8], collide: 1}
  - {id: stud, shape: frame, rods: [{from: [0, 0.8, 0], to: [0, 4.5, 0], radius: 0.9}], color: "#8f8a80"}
  - id: wheelA
    shape: part
    pos: [0, 0, 0]
    density: 7800
    friction: 0.1
    color: "#d9cdb2"
    pieces:
      - {kind: disc, center: [0, 0], radius: 4.02, y: [-0.8, 0.8], collide: 0}
      - {kind: rod, from: [0, -1.2, 0], to: [0, 0.8, 0], radius: 0.6, collide: 0, color: "#8f8a80"}
      - {kind: disc, center: [0, 2.2], radius: 0.55, y: [-0.82, -0.8], collide: 0, color: "#8f7f62"}
      - {kind: poly, points: [[3.0882, 2.6633], [1.8371, 3.6408], [3.0645, 4.4077], [3.5354, 4.0398]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[1.3428, 3.8506], [-0.2294, 4.0716], [0.45, 5.3494], [1.0419, 5.2662]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-0.7624, 4.0061], [-2.2345, 3.4114], [-2.285, 4.8578], [-1.7308, 5.0816]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-2.6633, 3.0882], [-3.6408, 1.8371], [-4.4077, 3.0645], [-4.0398, 3.5354]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-3.8506, 1.3428], [-4.0716, -0.2294], [-5.3494, 0.45], [-5.2662, 1.0419]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-4.0061, -0.7624], [-3.4114, -2.2345], [-4.8578, -2.285], [-5.0816, -1.7308]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-3.0882, -2.6633], [-1.8371, -3.6408], [-3.0645, -4.4077], [-3.5354, -4.0398]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[-1.3428, -3.8506], [0.2294, -4.0716], [-0.45, -5.3494], [-1.0419, -5.2662]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[0.7624, -4.0061], [2.2345, -3.4114], [2.285, -4.8578], [1.7308, -5.0816]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[2.6633, -3.0882], [3.6408, -1.8371], [4.4077, -3.0645], [4.0398, -3.5354]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[3.8506, -1.3428], [4.0716, 0.2294], [5.3494, -0.45], [5.2662, -1.0419]], y: [-0.8, 0.8], collide: 1}
      - {kind: poly, points: [[4.0061, 0.7624], [3.4114, 2.2345], [4.8578, 2.285], [5.0816, 1.7308]], y: [-0.8, 0.8], collide: 1}
  # the arm D, turning about the same axis in front of the wheels; the handle at its outer end
  - id: armD
    shape: part
    pos: [0, 0, 0]
    density: 2700
    color: "#a39d90"
    pieces:
      - {kind: poly, points: [[-1.6943, -0.7067], [-0.2758, -1.8149], [13.3303, 15.6001], [11.9119, 16.7083]], y: [-2.4, -1.6], collide: 0}
      - {kind: disc, center: [0, 0], radius: 1.6, inner: 0.6, y: [-2.6, -1.4], collide: 0}
      - {kind: disc, center: [5.9104, 7.5649], radius: 1.4, y: [-2.6, -1.4], collide: 0}
      - {kind: rod, from: [12.6211, -2.4, 16.1542], to: [12.6211, -5.5, 16.1542], radius: 0.7, collide: 0, color: "#8f8a80"}
  # the pinion B, free on its stud in the arm
  - id: pinionB
    shape: part
    pos: [5.9104, 0, 7.5649]
    mount: armD
    density: 7800
    friction: 0.1
    color: "#e4d9bf"
    pieces:
      - {kind: disc, center: [5.9104, 7.5649], radius: 4.02, y: [-0.8, 0.8], collide: 0}
      - {kind: rod, from: [5.9104, -1.4, 7.5649], to: [5.9104, 0.8, 7.5649], radius: 0.6, collide: 0, color: "#8f8a80"}
      - {kind: disc, center: [7.2648, 9.2985], radius: 0.55, y: [-0.82, -0.8], collide: 0, color: "#8f7f62"}
      - {kind: poly, points: [[8.204, 10.9367], [6.7425, 11.5571], [7.7296, 12.6156], [8.2797, 12.382]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[6.2108, 11.6318], [4.635, 11.4383], [4.9605, 12.8485], [5.5537, 12.9214]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[4.1371, 11.2372], [2.8691, 10.2817], [2.446, 11.6657], [2.9233, 12.0254]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[2.5385, 9.8586], [1.9182, 8.3971], [0.8597, 9.3841], [1.0932, 9.9343]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[1.8434, 7.8653], [2.0369, 6.2895], [0.6267, 6.6151], [0.5539, 7.2083]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[2.2381, 5.7916], [3.1935, 4.5237], [1.8095, 4.1005], [1.4498, 4.5778]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[3.6167, 4.1931], [5.0782, 3.5727], [4.0911, 2.5142], [3.541, 2.7478]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[5.6099, 3.498], [7.1857, 3.6915], [6.8602, 2.2813], [6.267, 2.2084]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[7.6836, 3.8926], [8.9516, 4.8481], [9.3747, 3.4641], [8.8974, 3.1044]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[9.2822, 5.2713], [9.9025, 6.7327], [10.961, 5.7457], [10.7275, 5.1955]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[9.9773, 7.2645], [9.7838, 8.8403], [11.194, 8.5147], [11.2668, 7.9215]], y: [-0.8, 0.8], collide: 2}
      - {kind: poly, points: [[9.5826, 9.3382], [8.6272, 10.6061], [10.0112, 11.0293], [10.3709, 10.552]], y: [-0.8, 0.8], collide: 2}
joints:
  - {id: j_d, type: hinge, body: armD, axis: [0, 1, 0], damping: 0.01}     # the arm D: the driver
  - {id: j_b, type: hinge, body: pinionB, axis: [0, 1, 0], damping: 0.001}
  - {id: j_a, type: hinge, body: wheelA, axis: [0, 1, 0], damping: 0.01}   # A's load
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_d, kind: velocity, rpm: 8, kv: 20, max_torque: 10}
checks:
  # C fixed: A turns 1 + zC/zA = 4 times the arm, the same way; B on its stud -zC/zB = -3 times relative to the arm
  - {type: ratio, out: j_a, in: j_d, expect: 4.0, tol: 0.04, settle_s: 1.0, window_s: 6}
  - {type: ratio, out: j_b, in: j_d, expect: -3.0, tol: 0.03, settle_s: 1.0, window_s: 6}
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [0, 0, -4], position: [0, -100, -4], fov: 34}
display:
  output: j_a
  labels: {j_d: "Arm D (driver)", j_b: "Pinion B", j_a: "Spur-wheel A"}
  expect: {default: 4.0}
  proof: {label: "B's teeth out of contact", sub: "the arm carries B round inside C, but nothing turns A"}

