# No. 180 (Brown 1868): "This only differs from 174 in being composed of a single pivoted clamp operating in connection with a fixed side-piece."
#
# Model (cm, no gravity; a plan): the wedge-shaped clamp (the one driven joint, a slide pushed at 0.698 cm/s) goes up between the jaws' mouths; the 4 cm mouth end of each jaw (a pin) rides the wedge's sloping face (taper 0.4) by real contact, so the jaw turns on its screw
# and its far end (5 cm the other side of the screw) closes 1.6 cm on the work after the clamp has gone 3.3 cm. Only one jaw turns; the work is held against the fixed side-piece. Generator: opencode-runs/batch11/gen180.py (MODE=180).
number: 180
slug: single-pivoted-clamp-side-piece
name: A single pivoted clamp working with a fixed side-piece
brown: "This only differs from 174 in being composed of a single pivoted clamp operating in connection with a fixed side-piece."
units: cm
sim:
  timestep: 0.0002
  integrator: implicitfast
  iterations: 100
  solver: PGS
  multiccd: true
  duration_s: 6.0
  floor: false
  gravity: 0
bodies:
  - id: jaw
    shape: part
    pos: [0.0, 0, 0]
    mass: 0.2
    friction: 0.02
    color: "#d9cfb6"
    pieces:
      - {kind: poly, points: [[-0.6, -4.0], [0.6, -4.0], [0.6, 5.0], [-0.6, 5.0]], y: [-2.4, -1.4], collide: 0, color: "#d9cfb6"}
      - {kind: rod, from: [0.0, -2.0, -4.0], to: [0.0, -0.2, -4.0], radius: 0.3, collide: 1, capsule: true, color: "#8f8a80"}
      - {kind: rod, from: [0.0, -3.0, 0.0], to: [0.0, 0.6, 0.0], radius: 0.7, collide: 0, color: "#8f8a80"}
  - id: wedge
    shape: part
    pos: [0, 0, 0]
    mass: 0.3
    friction: 0.02
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-3.4, -9.0], [1.6769, -9.0], [-1.1231, -2.0], [-3.4, -2.0]], y: [-1.2, -0.4], collide: 2, color: "#a89a7e"}
      - {kind: rod, from: [-2.7116, -0.8, -9.0], to: [-2.7116, -0.8, -11.0], radius: 0.7, collide: 0, color: "#a89a7e"}
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: poly, points: [[-5.1, -9.0], [-3.5, -9.0], [-3.5, 8.5], [-5.1, 8.5]], y: [-1.4, 0.0], collide: 0, color: "#b9b09c"}   # the fixed side-piece
      - {kind: poly, points: [[-14.0, -12.0], [14.0, -12.0], [14.0, -11.0], [-14.0, -11.0]], y: [-1.2, 1.2], collide: 0, color: "#b9b09c"}
joints:
  - {id: j_a, type: hinge, body: jaw, axis: [0, -1, 0], damping: 0.002}   # the pivoted clamp; + : its mouth end to the right, its far end toward the side-piece
  - {id: j_w, type: slide, body: wedge, axis: [0, 0, 1], damping: 0.05, range: [0, 3.5487]}   # the clamp: the one driven joint; + : pushed up between the jaws
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.0005], margin: 0}
driver: {joint: j_w, kind: velocity, speed: 0.698, kv: 6000.0, max_torque: 400}
checks:
  - {type: follow, out: j_a, in: j_w, expect: 9.6751, tol: 0.774, min_r2: 0.99, settle_s: 0.9, window_s: 1.0}
  - {type: follow, out: j_a, in: j_w, expect: 9.471, tol: 0.7577, min_r2: 0.99, settle_s: 2.1, window_s: 1.2}
  - {type: follow, out: j_a, in: j_w, expect: 9.3417, tol: 0.7473, min_r2: 0.99, settle_s: 3.5, window_s: 1.1}
  - {type: position, joint: j_a, min: -0.02, max: 0.36, settle_s: 0.0, window_s: 5.5}
  - {type: penetration, max: 0.003, settle_s: 0.5}
camera: {target: [-0.5, 0, -3.8], position: [-0.5, -46.0, -3.8], fov: 34}
display:
  output: j_a
  labels: {j_w: "Clamp (driver)", j_a: "Jaw"}

