# No. 177 (Brown 1868): "Contrivance for uncoupling engines. The wrist which is fixed on one arm of the crank (not shown) will communicate motion to the arm of the crank which is represented, when the ring on the latter has its slot in the position shown in 176. But when the ring is turned to bring the slot in the position shown in 177, the wrist passes through the slot without turning the crank to which said ring is attached."
#
# Reading of the figures (cm, no gravity; a plan): the wrist of the engine's other crank is a pin that moves to and fro across the head of the crank arm shown (2.8 cm either way, the one driven joint, a slide). The head carries a ring with a slot; the wrist runs in that slot.
# In 177 the ring is turned so that the slot lies along the wrist' + chr(39) + 's path: the wrist runs through it without touching, and the arm stands still. The ring is held in its position by a stiff joint spring (turning it by hand is not modelled). Generator: opencode-runs/batch11/gen176.py (MODE=177).
number: 177
slug: uncoupling-engines-uncoupled
name: "Contrivance for uncoupling engines: uncoupled"
brown: "Contrivance for uncoupling engines. The wrist which is fixed on one arm of the crank (not shown) will communicate motion to the arm of the crank which is represented, when the ring on the latter has its slot in the position shown in 176. But when the ring is turned to bring the slot in the position shown in 177, the wrist passes through the slot without turning the crank to which said ring is attached."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: PGS
  multiccd: true
  duration_s: 9.0
  floor: false
  gravity: 0
bodies:
  - id: arm
    shape: part
    pos: [0, 0, 0]
    mass: 0.4
    friction: 0.02
    color: "#cfc6b4"
    pieces:
      - {kind: disc, center: [0, 0], radius: 2.6, y: [-0.8, 0.0], collide: 0, color: "#d9cfb6"}
      - {kind: disc, center: [0, 0], radius: 1.7, y: [-1.2, -0.8], collide: 0, color: "#8f8a80"}
      - {kind: poly, points: [[-1.9, 0.0], [1.9, 0.0], [2.6, 13.0], [-2.6, 13.0]], y: [-0.8, 0.0], collide: 0, color: "#cfc6b4"}
      - {kind: disc, center: [0, 16.0], radius: 4.4, y: [-0.8, 0.0], collide: 0, color: "#cfc6b4"}
  - id: ring
    shape: part
    pos: [0, 0, 16.0]
    mount: arm
    mass: 0.1
    friction: 0.02
    color: "#d9cfb6"
    pieces:
      - {kind: disc, center: [0, 16.0], radius: 3.9, y: [-1.8, -0.8], collide: 0, color: "#d9cfb6"}
      - {kind: poly, points: [[-3.6, 14.92], [3.6, 14.92], [3.6, 14.02], [-3.6, 14.02]], y: [-1.8, -0.9], collide: 2, color: "#8f7f66"}
      - {kind: poly, points: [[-3.6, 17.08], [3.6, 17.08], [3.6, 17.98], [-3.6, 17.98]], y: [-1.8, -0.9], collide: 2, color: "#8f7f66"}
  - id: wrist
    shape: part
    pos: [0, 0, 16.0]
    mass: 0.2
    color: "#a89a7e"
    pieces:
      - {kind: rod, from: [0.0, -2.6, 16.0], to: [0.0, 0.8, 16.0], radius: 1.0, collide: 1, capsule: true, color: "#a89a7e"}
      - {kind: disc, center: [0, 16.0], radius: 1.8, y: [-3.2, -2.6], collide: 0, color: "#8f8a80"}
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-9, -4.5], [9, -4.5], [9, -3.3], [-9, -3.3]], y: [-3, 1.5], collide: 0, color: "#b9b09c"}
      - {kind: rod, from: [0, 0.2, 0], to: [0, 1.4, 0], radius: 1.0, collide: 0, color: "#8f8a80"}
      - {kind: poly, points: [[-1.2, -3.3], [1.2, -3.3], [0.8, 0], [-0.8, 0]], y: [0.4, 1.4], collide: 0}
joints:
  - {id: j_arm, type: hinge, body: arm, axis: [0, -1, 0], damping: 0.05}   # the crank arm: it turns only if the wrist pushes it
  - {id: j_ring, type: hinge, body: ring, axis: [0, -1, 0], stiffness: 400, springref: 0, damping: 0.5}   # the ring, held in its slot position
  - {id: j_w, type: slide, body: wrist, axis: [1, 0, 0], damping: 0.01}   # the wrist moving to and fro: the one driven joint
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_w, kind: velocity, rpm: 0, swing: {amplitude: 0.028, hz: 0.25}, kv: 100, max_torque: 200}
checks:
  - {type: still, joint: j_arm, max: 0.02, settle_s: 0.5, window_s: 8.0}
  - {type: position, joint: j_arm, min: -0.01, max: 0.01, settle_s: 0.0, window_s: 8.5}
  - {type: position, joint: j_w, min: -3.0999999999999996, max: 3.0999999999999996, settle_s: 0.0, window_s: 8.5}
camera: {target: [0.0, 0, 3.1], position: [0.0, -66.0, 3.1], fov: 34}
display:
  output: j_arm
  labels: {j_w: "Wrist (driver)", j_arm: "Crank arm", j_ring: "Ring"}

