number: 364
slug: intermittent-right-angle-rollers
name: Intermittent rotary motion about an axis at right angles
brown: "Intermittent rotary motion from continuous rotary motion about an axis at right angles. Small wheel on left is driver; and the friction rollers on its radial studs work against the faces of oblique grooves or projections across the face of the larger wheel, and impart motion thereto."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 100, solver: PGS, multiccd: false, duration_s: 9.5, floor: false}
bodies:
  # the larger wheel, its oblique ribs on the face towards the driver
  - id: wheel
    shape: part
    pos: [0, 0, 0]
    density: 2000
    friction: 0.05
    color: "#d9cfb6"
    pieces:
      - {kind: disc, center: [0, 0], radius: 10.0, inner: 0.7, y: [0, 1.5], collide: 0}
      - {kind: rod, from: [0, -1.5, 0], to: [0, 6, 0], radius: 0.7, collide: 0, color: "#8f8a80"}
      - {kind: disc, center: [0, 0], radius: 2.0, y: [-1.2, 0], collide: 0}
      - {kind: rod, from: [5.5597, -0.8, -0.6704], to: [9.531, -0.8, 1.1492], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [5.0396, -0.8, 2.4418], to: [7.3966, -0.8, 6.1196], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [2.9194, -0.8, 4.7788], to: [2.9139, -0.8, 9.1471], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [-0.1277, -0.8, 5.5985], to: [-2.4939, -0.8, 9.2704], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [-3.1342, -0.8, 4.6408], to: [-7.11, -0.8, 6.4504], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [-5.1457, -0.8, 2.2096], to: [-9.4687, -0.8, 1.5825], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [-5.5234, -0.8, -0.9231], to: [-8.8211, -0.8, -3.7879], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [-4.1475, -0.8, -3.7628], to: [-5.3729, -0.8, -7.9556], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [-1.4548, -0.8, -5.4077], to: [-0.2189, -0.8, -9.5975], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [1.6998, -0.8, -5.3358], to: [5.0047, -0.8, -8.1923], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
      - {kind: rod, from: [4.3147, -0.8, -3.5698], to: [8.6393, -0.8, -4.186], radius: 0.6, capsule: true, collide: 1, color: "#9a8f78"}
  # the driver: a small wheel on a shaft across the face, with its radial studs and their rollers
  - id: driver
    shape: part
    pos: [-7.8, -4.8, 0]
    density: 2000
    friction: 0.05
    color: "#c9b48a"
    pieces:
      - {kind: rod, from: [-24, -4.8, 0], to: [-7.0, -4.8, 0], radius: 0.5, collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [-8.6, -4.8, 0], to: [-7.0, -4.8, 0], radius: 1.2, collide: 0}
      - {kind: rod, from: [-21, -4.8, 0], to: [-18, -4.8, 0], radius: 5.0, collide: 0}
      - {kind: rod, from: [-7.8, -4.4376, 0.932], to: [-7.8, -3.6405, 2.9825], radius: 0.3, collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [-7.8, -3.6405, 2.9825], to: [-7.8, -3.2781, 3.9146], radius: 0.55, capsule: true, collide: 2, color: "#6f6a60"}
      - {kind: rod, from: [-7.8, -5.1624, -0.932], to: [-7.8, -5.9595, -2.9825], radius: 0.3, collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [-7.8, -5.9595, -2.9825], to: [-7.8, -6.3219, -3.9146], radius: 0.55, capsule: true, collide: 2, color: "#6f6a60"}
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-1.6, -14], [1.6, -14], [1.0, 1.0], [-1.0, 1.0]], y: [4, 5.2]}
      - {kind: disc, center: [0, 0], radius: 1.4, y: [4, 5.2]}
      - {kind: poly, points: [[-1.0, -14], [1.0, -14], [0.6, 1.0], [-0.6, 1.0]], y: [-5.3999999999999995, -4.2], color: "#cfc6b4"}
      - {kind: rod, from: [-12.6, -4.8, -14], to: [-12.6, -4.8, -0.9], radius: 0.8}
      - {kind: rod, from: [-15.4, -4.8, -14], to: [-15.4, -4.8, -0.9], radius: 0.8}
      - {kind: poly, points: [[-26, -15], [12, -15], [12, -14], [-26, -14]], y: [-8.8, 6], color: "#b9b09c"}
joints:
  - {id: j_d, type: hinge, body: driver, axis: [1, 0, 0], damping: 0.001}   # the one driven joint
  - {id: j_w, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.05, frictionloss: 0.01}
contact: {solref: [0.002, 1], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_d, kind: velocity, rpm: 20, kv: 1.0, max_torque: 10}
checks:
  - {type: ratio, out: j_w, in: j_d, expect: 0.1818, tol: 0.03, settle_s: 3.2, window_s: 6}
  - {type: ratio_range, out: j_w, in: j_d, min: -0.02, max: 0.8, min_swing: 0.3, settle_s: 3.2, window_s: 6, slices: 24}
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [-5, 0, -15], position: [-75, -94, 26], fov: 30}
display:
  output: j_w
  labels: {j_d: "Small wheel (driver)", j_w: "Larger wheel"}

