number: 361
slug: pin-clutch-pulley
name: A pin clutch for a pulley
brown: "Another simple form of clutch for pulleys, consisting of a pin on the lower shaft and a pin on side of pulley. The pulley is moved lengthwise of the shaft by means of a lever or other means to bring its pin into or out of contact with the pin on shaft."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 200, solver: CG, multiccd: false, duration_s: 8, floor: false}
bodies:
  # the lower shaft, driven, with its pin through it
  - id: shaft
    shape: part
    pos: [0, 0, 0]
    density: 7800
    friction: 0.15
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [0, -10, 0], to: [0, 13, 0], radius: 0.6, collide: 0}
      - {kind: rod, from: [-3.0, 0, 0], to: [3.0, 0, 0], radius: 0.35, capsule: true, collide: 1}
      - {kind: disc, center: [0, 0], radius: 1.0, y: [-0.5, 0.5], collide: 0}
      - {kind: disc, center: [0, 0], radius: 4.5, inner: 0.6, y: [-7.0, -5.6], collide: 0, color: "#9c958a"}   # the driving pulley
  # a sleeve that slides on the shaft without turning, and the pulley turning loose on it
  - id: sleeve
    shape: part
    pos: [0, 0, 0]
    density: 7800
    color: "#8f8a80"
    pieces:
      - {kind: disc, center: [0, 0], radius: 0.75, inner: 0.6, y: [2.2, 9.5], collide: 0}
  - id: pulley
    shape: part
    pos: [0, 0, 0]
    mount: sleeve
    density: 7800
    friction: 0.15
    color: "#e4d9bf"
    pieces:
      - {kind: disc, center: [0, 0], radius: 6.0, inner: 5.2, y: [2.0, 6.0]}
      - {kind: disc, center: [0, 0], radius: 1.6, inner: 0.75, y: [2.0, 7.5]}
      - {kind: rod, from: [1.4041, 4.0, 0.7671], to: [4.4757, 4.0, 2.4451], radius: 0.4}
      - {kind: rod, from: [-0.7671, 4.0, 1.4041], to: [-2.4451, 4.0, 4.4757], radius: 0.4}
      - {kind: rod, from: [-1.4041, 4.0, -0.7671], to: [-4.4757, 4.0, -2.4451], radius: 0.4}
      - {kind: rod, from: [0.7671, 4.0, -1.4041], to: [2.4451, 4.0, -4.4757], radius: 0.4}
      - {kind: rod, from: [0, 2.5, -2.2], to: [0, 1.0, -2.2], radius: 0.35, capsule: true, collide: 2}   # the pin on its side
      - {kind: disc, center: [0, -2.2], radius: 0.8, y: [1.7, 2.2], collide: 0}
      - {kind: disc, center: [0, 0], radius: 2.4, y: [6.8999999999999995, 7.5], collide: 2}   # the groove's cheeks
      - {kind: disc, center: [0, 0], radius: 1.4, inner: 0.75, y: [7.5, 8.7], collide: 0}
      - {kind: disc, center: [0, 0], radius: 2.4, y: [8.7, 9.299999999999999], collide: 2}
  # the lever, its fork's prong in the groove
  - id: lever
    shape: part
    pos: [0, 8.1, -13]
    density: 7800
    friction: 0.05
    color: "#b8ad97"
    pieces:
      - {kind: rod, from: [0, 8.1, -13], to: [0, 8.1, -2.4], radius: 0.35}
      - {kind: poly, points: [[-0.9, -2.3], [0.9, -2.3], [0.9, -1.6], [-0.9, -1.6]], y: [7.6499999999999995, 8.549999999999999], collide: 1}
      - {kind: rod, from: [0, 8.1, -13], to: [0, 12.8, -19], radius: 0.35}
      - {kind: disc, center: [0, -19], radius: 1.2, y: [11.6, 14.0]}
      - {kind: disc, center: [0, -13], radius: 0.7, y: [7.6, 8.6]}
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-1.2, -21], [1.2, -21], [0.8, -13], [-0.8, -13]], y: [6.699999999999999, 7.5]}
      - {kind: poly, points: [[-1.5, -21], [1.5, -21], [1.0, 0], [-1.0, 0]], y: [-9, -8]}
      - {kind: disc, center: [0, 0], radius: 1.3, y: [-9, -8]}
      - {kind: poly, points: [[-1.5, -21], [1.5, -21], [1.0, 0], [-1.0, 0]], y: [11, 12]}
      - {kind: disc, center: [0, 0], radius: 1.3, y: [11, 12]}
      - {kind: poly, points: [[-4, -22], [4, -22], [4, -21], [-4, -21]], y: [-11, 14], color: "#b9b09c"}
joints:
  - {id: j_s, type: hinge, body: shaft, axis: [0, 1, 0], damping: 0.001}   # the one driven joint
  - {id: j_sl, type: slide, body: sleeve, axis: [0, 1, 0], range: [-1.7, 0.2], damping: 0.5}   # + : away from the shaft's pin
  - {id: j_p, type: hinge, body: pulley, axis: [0, 1, 0], damping: 0.05}   # the pulley, loose; its belt's load
  - {id: j_lever, type: hinge, body: lever, axis: [1, 0, 0], range: [-0.04, 0.2], stiffness: 8, springref: 0, damping: 1}
hand:
  - {t: 2, springref: {j_lever: 0.16}}
  - {t: 5.5, springref: {j_lever: -0.04}}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_s, kind: velocity, rpm: 30, kv: 2, max_torque: 5}
checks:
  - {type: ratio, out: j_p, in: j_s, expect: 0, tol: 0.01, settle_s: 0.5, window_s: 1.4}
  - {type: ratio, out: j_p, in: j_s, expect: 1, tol: 0.005, settle_s: 3.5, window_s: 1.8}
  - {type: ratio, out: j_p, in: j_s, expect: 0, tol: 0.01, settle_s: 6.5, window_s: 1.4}
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [0, 2, -16], position: [92, -52, 2], fov: 30}
display:
  output: j_p
  labels: {j_s: "Lower shaft (driver)", j_p: "Pulley", j_lever: "Lever", j_sl: "Pulley sliding on the shaft"}

