# No. 372 (Brown 1868): "White’s dynamometer, for determining the amount of power required to give rotary motion to any piece of mechanism. The two horizontal bevel-gears are arranged in a hoop-snaped frame, which revolves freely on the middle of the horizontal shaft, on which there are two vertical bevel-gears gearing to the horizontal ones, one fast and the other loose on the shaft. Suppose the hoop to be held stationary, motion given to either vertical bevel-gear will be imparted through the horizontal gears to the other vertical one; but if the hoop be permitted it will revolve with the vertical gear put in motion, and the amount of power required to hold it stationary will correspond with that transmitted from the first gear, and a band attached to its periphery will indicate that power by the weight required to keep it still."
#
# Reading of the figure (cm, gravity on; Brown's front elevation): the horizontal shaft runs in two posts. On it, facing each other,
# are the two vertical bevel-gears (20 teeth, 5 cm pitch radius): the right one fast on the shaft, the left one loose, with the hoop
# between them, hung on the shaft. The hoop carries the two horizontal bevel-gears on pins, above and below the shaft, both in gear
# with both vertical ones. The shaft is the one driven joint (30 rev/min); the loose gear drives the "piece of mechanism", a
# load of 0.05 N m per rad/s. The band and weight that keep the hoop still are a torsional spring on the hoop (3 N m/rad):
# how far the hoop is carried round measures the torque the gears pass to the load.
# Generator: opencode-runs/batch12/gen372.py.
number: 372
slug: whites-dynamometer
name: White's dynamometer
brown: "White’s dynamometer, for determining the amount of power required to give rotary motion to any piece of mechanism. The two horizontal bevel-gears are arranged in a hoop-snaped frame, which revolves freely on the middle of the horizontal shaft, on which there are two vertical bevel-gears gearing to the horizontal ones, one fast and the other loose on the shaft. Suppose the hoop to be held stationary, motion given to either vertical bevel-gear will be imparted through the horizontal gears to the other vertical one; but if the hoop be permitted it will revolve with the vertical gear put in motion, and the amount of power required to hold it stationary will correspond with that transmitted from the first gear, and a band attached to its periphery will indicate that power by the weight required to keep it still."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 80, solver: PGS, multiccd: true, duration_s: 8, floor: false}
bodies:
  - {id: shaft, shape: assembly, pos: [0, 0, 0], color: "#d9cfb6"}
  - id: gearC
    shape: part
    pos: [0, 0, 0]
    mass: 0.6
    color: "#cfc4a8"
    pieces:
      - {kind: rod, from: [0, -8.6, 0], to: [0, -5.6, 0], radius: 1.2, collide: 0, color: "#8f8a80"}   # its hub, loose on the shaft
      - {kind: disc, center: [0, 0], radius: 2.6, y: [-8.6, -7.8], collide: 0, color: "#8f8a80"}   # the collar the load is taken from
  - id: hoop
    shape: part
    pos: [0, 0, 0]
    mass: 1.2
    color: "#b9ad93"
    pieces:
      - {kind: disc, center: [0, 0], radius: 10.4, inner: 8.8, y: [-2.1, 2.1], collide: 0}   # the hoop
      - {kind: rod, from: [0, 0, 9.0], to: [0, 0, 5.5], radius: 0.5, collide: 0, color: "#8f8a80"}   # the upper gear's pin
      - {kind: rod, from: [0, 0, -9.0], to: [0, 0, -5.5], radius: 0.5, collide: 0, color: "#8f8a80"}   # the lower gear's pin
  - id: planet_u
    shape: part
    pos: [0, 0, 0]
    mount: hoop
    mass: 0.25
    color: "#d8ceba"
    pieces:
      - {kind: rod, from: [0, 0, 5.4], to: [0, 0, 6.5], radius: 1.0, collide: 0, color: "#8f8a80"}
  - id: planet_l
    shape: part
    pos: [0, 0, 0]
    mount: hoop
    mass: 0.25
    color: "#d8ceba"
    pieces:
      - {kind: rod, from: [0, 0, -5.4], to: [0, 0, -6.5], radius: 1.0, collide: 0, color: "#8f8a80"}
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-1.3, -12], [1.3, -12], [1.3, 3], [-1.3, 3]], y: [8.6, 10.4], collide: 0}   # the right post
      - {kind: poly, points: [[-1.3, -12], [1.3, -12], [1.3, 3], [-1.3, 3]], y: [-10.4, -8.6], collide: 0}   # the left post
      - {kind: rod, from: [0, -8.6, -9.5], to: [0, 8.6, -9.5], radius: 0.45, collide: 0, color: "#8f8a80"}   # the stretcher
      - {kind: rod, from: [0, -8.6, -9.5], to: [0, -6.6, -9.5], radius: 0.75, collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [0, 6.6, -9.5], to: [0, 8.6, -9.5], radius: 0.75, collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [0, -0.8, -9.5], to: [0, 0.8, -9.5], radius: 1.1, collide: 0, color: "#8f8a80"}   # its knob
joints:
  - {id: j_s, type: hinge, body: shaft, axis: [0, 1, 0], damping: 0.002}   # the one driven joint: the shaft, with the fast gear
  - {id: j_c, type: hinge, body: gearC, axis: [0, 1, 0], damping: 0.05}   # the loose gear, driving the load
  - {id: j_h, type: hinge, body: hoop, axis: [0, 1, 0], damping: 0.08, stiffness: 3}   # the hoop, held by its band and weight (the spring)
  - {id: j_u, type: hinge, body: planet_u, axis: [0, 0, 1], damping: 0.001}
  - {id: j_l, type: hinge, body: planet_l, axis: [0, 0, 1], damping: 0.001}
bevels:
  - {id: gA, body: shaft, teeth: 20, pitch_radius: 5, cone_angle: 0.7853982, face_width: 3.6, backlash: 0.04, phase: 0.1570796}
  - {id: gC, body: gearC, teeth: 20, pitch_radius: 5, cone_angle: 0.7853982, face_width: 3.6, backlash: 0.04, phase: 0.1570796, quat: [0, 1, 0, 0]}
  - {id: gU, body: planet_u, teeth: 20, pitch_radius: 5, cone_angle: 0.7853982, face_width: 3.6, backlash: 0.04, phase: 0, quat: [0.7071068, 0.7071068, 0, 0]}
  - {id: gL, body: planet_l, teeth: 20, pitch_radius: 5, cone_angle: 0.7853982, face_width: 3.6, backlash: 0.04, phase: 0, quat: [0, 0, 0.7071068, -0.7071068]}
shafts:
  - {id: sh, body: shaft, from: [0, -12.5, 0], to: [0, 12.5, 0], radius: 0.6}
  - {id: collar, body: shaft, from: [0, 7.6, 0], to: [0, 8.6, 0], radius: 1.4}
contact: {solref: [0.0008, 1], solimp: [0.95, 0.99, 0.001], margin: 0}
driver: {joint: j_s, kind: velocity, rpm: 30, kv: 2, max_torque: 5}
checks:
  - {type: ratio, out: j_c, in: j_s, expect: -1.0, tol: 0.03, settle_s: 3, window_s: 4.5}   # the hoop held: the loose gear turns back at the shaft's speed
  - {type: position, joint: j_h, min: 0.08, max: 0.13, settle_s: 3, window_s: 4.5}   # carried round by twice the load's torque, against the band
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [0, 0, -8.8], position: [-73.0, 6.0, 0.0], fov: 34}
display:
  output: j_c
  labels: {j_s: "Shaft and fast gear (driver)", j_c: "Loose gear (to the load)", j_h: "Hoop (held by the band)"}

