# No. 373 (Brown 1868): "Robert’s contrivance for proving that friction of a wheel carriage does not increase with velocity, but only with load. Loaded wagon is supported on surface of large wheel, and connected with indicator constructed with spiral spring, to show force required to keep carriage stationary when large wheel is put in motion. It was found that difference in velocity produced no variation in the indicator, but difference in weight immediately did so."
#
# Reading of the figure (cm, gravity on; Brown's side elevation): the large wheel (14 cm, turned by the band on its pulley) is the one
# driven joint, 20 rev/min. The loaded wagon stands on its rim: its two axles' wheels (1.8 cm) roll on the rim's top, and the
# wagon is free to rise and fall, and to move endwise, but is held from going with the rim by a rod to the indicator on the right,
# whose arbor turns against a spiral spring (0.5 N m/rad). All the wagon gives to the rod is the friction of its axles (a steady
# 0.05 N m on each, the same at any speed), so the pointer stands still at one reading while the wheel runs.
# Generator: opencode-runs/batch12/gen373.py.
number: 373
slug: roberts-friction-wagon
name: Robert's friction wagon
brown: "Robert’s contrivance for proving that friction of a wheel carriage does not increase with velocity, but only with load. Loaded wagon is supported on surface of large wheel, and connected with indicator constructed with spiral spring, to show force required to keep carriage stationary when large wheel is put in motion. It was found that difference in velocity produced no variation in the indicator, but difference in weight immediately did so."
units: cm
sim: {timestep: 0.0002, integrator: implicitfast, iterations: 80, solver: CG, multiccd: true, duration_s: 8, floor: false}
bodies:
  - id: wheel
    shape: part
    pos: [0, 0, 0]
    density: 7800
    friction: 0.9
    color: "#e8dec6"
    pieces:
      - {kind: band, center: [0, 0], r: [12.6, 14.0], a: [0, 6.2832], y: [-1.6, 1.6], slices: 160, collide: 1}   # the rim the wagon runs on
      - {kind: rod, from: [1.1314, 0, 1.1314], to: [9.051, 0, 9.051], radius: 0.7, collide: 0}
      - {kind: rod, from: [-1.1314, 0, 1.1314], to: [-9.051, 0, 9.051], radius: 0.7, collide: 0}
      - {kind: rod, from: [-1.1314, 0, -1.1314], to: [-9.051, 0, -9.051], radius: 0.7, collide: 0}
      - {kind: rod, from: [1.1314, 0, -1.1314], to: [9.051, 0, -9.051], radius: 0.7, collide: 0}
      - {kind: disc, center: [0, 0], radius: 1.8, y: [-1.8, 1.8], collide: 0}   # the hub
      - {kind: disc, center: [0, 0], radius: 5.2, inner: 4.4, y: [-4.6, -3.4], collide: 0, color: "#d8ceba"}   # the band's pulley, in front
      - {kind: rod, from: [0.8, -4.0, 0.0], to: [4.5, -4.0, 0.0], radius: 0.45, collide: 0, color: "#d8ceba"}
      - {kind: rod, from: [0.0, -4.0, 0.8], to: [0.0, -4.0, 4.5], radius: 0.45, collide: 0, color: "#d8ceba"}
      - {kind: rod, from: [-0.8, -4.0, 0.0], to: [-4.5, -4.0, 0.0], radius: 0.45, collide: 0, color: "#d8ceba"}
      - {kind: rod, from: [-0.0, -4.0, -0.8], to: [-0.0, -4.0, -4.5], radius: 0.45, collide: 0, color: "#d8ceba"}
      - {kind: disc, center: [0, 0], radius: 0.8, y: [-4.6, -1.8], collide: 0, color: "#8f8a80"}
  - id: cart_x
    shape: part
    pos: [0, 0, 15.6726]
    mass: 0.05
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [-0.3, 0, 15.6726], to: [0.3, 0, 15.6726], radius: 0.1, collide: 0}
  - id: cart_z
    shape: part
    mount: cart_x
    pos: [0, 0, 15.6726]
    mass: 0.05
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [0, -0.3, 15.6726], to: [0, 0.3, 15.6726], radius: 0.1, collide: 0}
  - id: wagon
    shape: part
    mount: cart_z
    pos: [0, 0, 15.6726]
    mass: 3.0
    color: "#b9ad93"
    pieces:
      - {kind: poly, points: [[-4.6, 16.2726], [4.6, 16.2726], [5.4, 19.072599999999998], [-5.4, 19.072599999999998]], y: [-2.0, 2.0], collide: 0}   # the wagon's box
      - {kind: poly, points: [[-4.8, 19.072599999999998], [-2.6, 19.072599999999998], [-3.2, 21.6726], [-5.0, 21.272599999999997]], y: [-1.6, 1.6], collide: 0, color: "#a08a68"}   # the load
      - {kind: poly, points: [[-2.6, 19.072599999999998], [0.2, 19.072599999999998], [0.0, 22.272599999999997], [-2.2, 21.8726]], y: [-1.6, 1.6], collide: 0, color: "#8f7a5a"}
      - {kind: poly, points: [[0.2, 19.072599999999998], [2.8, 19.072599999999998], [3.4, 21.4726], [0.6, 22.0726]], y: [-1.6, 1.6], collide: 0, color: "#a08a68"}
      - {kind: poly, points: [[2.8, 19.072599999999998], [5.0, 19.072599999999998], [5.0, 21.0726], [3.6, 21.4726]], y: [-1.6, 1.6], collide: 0, color: "#8f7a5a"}
      - {kind: rod, from: [-3.2, -1.9, 15.4726], to: [-3.2, -1.9, 16.2726], radius: 0.25, collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [3.2, -1.9, 15.4726], to: [3.2, -1.9, 16.2726], radius: 0.25, collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [4.9, -1.0, 15.6726], to: [4.9, -1.0, 16.8726], radius: 0.3, collide: 0, color: "#8f8a80"}   # the rod's eye
  - id: ww0
    shape: part
    mount: wagon
    pos: [-3.2, 0, 15.4726]
    density: 7800
    friction: 0.9
    color: "#d8ceba"
    pieces:
      - {kind: disc, center: [-3.2, 15.4726], radius: 1.8, y: [-1.5, -0.5], collide: 0}   # front wheel
      - {kind: disc, center: [-3.2, 15.4726], radius: 1.8, y: [0.5, 1.5], collide: 0}     # back wheel
      - {kind: rod, from: [-3.2, -0.3, 15.4726], to: [-3.2, 0.3, 15.4726], radius: 1.8, capsule: true, collide: 2}   # (their tread on the rim, a round contact)
      - {kind: disc, center: [-3.2, 15.4726], radius: 0.5, y: [-1.7, 1.7], collide: 0, color: "#8f8a80"}   # the axle
  - id: ww1
    shape: part
    mount: wagon
    pos: [3.2, 0, 15.4726]
    density: 7800
    friction: 0.9
    color: "#d8ceba"
    pieces:
      - {kind: disc, center: [3.2, 15.4726], radius: 1.8, y: [-1.5, -0.5], collide: 0}   # front wheel
      - {kind: disc, center: [3.2, 15.4726], radius: 1.8, y: [0.5, 1.5], collide: 0}     # back wheel
      - {kind: rod, from: [3.2, -0.3, 15.4726], to: [3.2, 0.3, 15.4726], radius: 1.8, capsule: true, collide: 2}   # (their tread on the rim, a round contact)
      - {kind: disc, center: [3.2, 15.4726], radius: 0.5, y: [-1.7, 1.7], collide: 0, color: "#8f8a80"}   # the axle
  - id: rod
    shape: part
    mount: wagon
    pos: [4.9, -1.0, 15.6726]
    mass: 0.05
    color: "#8f8a80"
    pieces:
      - {kind: rod, from: [4.9, -1.0, 15.6726], to: [17.0, -1.0, 15.6726], radius: 0.22, collide: 0}   # the rod to the indicator
  - id: dial
    shape: part
    pos: [17.0, 0, 12.6726]
    mass: 0.1
    color: "#55504a"
    pieces:
      - {kind: rod, from: [17.0, -1.0, 12.6726], to: [17.0, -1.0, 15.6726], radius: 0.25, collide: 0, color: "#8f8a80"}   # the arm up to the rod
      - {kind: poly, points: [[16.65, 12.6726], [17.0, 12.0726], [17.35, 12.6726], [17.1, 16.6726], [16.9, 16.6726]], y: [-1.7, -1.4], collide: 0}   # the pointer
      - {kind: disc, center: [17.0, 12.6726], radius: 0.6, y: [-1.8, 0.2], collide: 0, color: "#8f8a80"}
  - id: frame
    shape: part
    pos: [0, 0, 0]
    fixed: true
    color: "#cfc6b4"
    pieces:
      - {kind: disc, center: [17.0, 12.6726], radius: 5.4, y: [0.4, 1.4], collide: 0, color: "#efe9da"}   # the indicator's face
      - {kind: disc, center: [17.0, 12.6726], radius: 5.8, inner: 5.4, y: [0.0, 1.6], collide: 0, color: "#8f8a80"}
      - {kind: rod, from: [21.3, 0.4, 12.6726], to: [21.9, 0.4, 12.6726], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [21.1535, 0.4, 13.7855], to: [21.733, 0.4, 13.9408], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [20.7239, 0.4, 14.8226], to: [21.2435, 0.4, 15.1226], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [20.0406, 0.4, 15.7132], to: [20.4648, 0.4, 16.1374], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [19.15, 0.4, 16.3965], to: [19.45, 0.4, 16.9161], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [18.1129, 0.4, 16.8261], to: [18.2682, 0.4, 17.4056], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [17.0, 0.4, 16.9726], to: [17.0, 0.4, 17.5726], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [15.8871, 0.4, 16.8261], to: [15.7318, 0.4, 17.4056], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [14.85, 0.4, 16.3965], to: [14.55, 0.4, 16.9161], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [13.9594, 0.4, 15.7132], to: [13.5352, 0.4, 16.1374], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [13.2761, 0.4, 14.8226], to: [12.7565, 0.4, 15.1226], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [12.8465, 0.4, 13.7855], to: [12.267, 0.4, 13.9408], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [12.7, 0.4, 12.6726], to: [12.1, 0.4, 12.6726], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [12.8465, 0.4, 11.5597], to: [12.267, 0.4, 11.4044], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [13.2761, 0.4, 10.5226], to: [12.7565, 0.4, 10.2226], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [13.9594, 0.4, 9.632], to: [13.5352, 0.4, 9.2078], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [14.85, 0.4, 8.9487], to: [14.55, 0.4, 8.4291], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [15.8871, 0.4, 8.5191], to: [15.7318, 0.4, 7.9396], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [17.0, 0.4, 8.3726], to: [17.0, 0.4, 7.7726], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [18.1129, 0.4, 8.5191], to: [18.2682, 0.4, 7.9396], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [19.15, 0.4, 8.9487], to: [19.45, 0.4, 8.4291], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [20.0406, 0.4, 9.632], to: [20.4648, 0.4, 9.2078], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [20.7239, 0.4, 10.5226], to: [21.2435, 0.4, 10.2226], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: rod, from: [21.1535, 0.4, 11.5597], to: [21.733, 0.4, 11.4044], radius: 0.08, collide: 0, color: "#55504a"}
      - {kind: poly, points: [[23.4, -15], [25.2, -15], [25.2, 23.6726], [23.4, 23.6726]], y: [-1.5, 1.5], collide: 0}   # the right-hand post
      - {kind: rod, from: [17.0, 1.0, 12.6726], to: [24, 1.0, 12.6726], radius: 0.45, collide: 0, color: "#8f8a80"}   # the indicator's spindle, into the post
      - {kind: poly, points: [[11.0, 6.2726], [23.4, 6.2726], [23.4, 7.0726], [11.0, 7.0726]], y: [-2.0, 2.0], collide: 0}   # the indicator's shelf
      - {kind: poly, points: [[-21, -2.4], [26, -2.4], [26, -1.0], [-21, -1.0]], y: [-6.2, -5.2], collide: 0}   # the long rail, in front
      - {kind: poly, points: [[-15.5, -15], [-13.5, -15], [-7.0, -2.4], [-9.0, -2.4]], y: [-6.2, -5.2], collide: 0}   # the legs
      - {kind: poly, points: [[6.0, -15], [8.0, -15], [1.6, -2.4], [-0.4, -2.4]], y: [-6.2, -5.2], collide: 0}
      - {kind: poly, points: [[17.0, -15], [19.0, -15], [15.0, -2.4], [13.0, -2.4]], y: [-6.2, -5.2], collide: 0}
      - {kind: poly, points: [[10.5, 6.2726], [12.0, 6.2726], [16.4, -1.0], [14.9, -1.0]], y: [-2.0, 2.0], collide: 0}   # the shelf's strut
      - {kind: rod, from: [0, -5.2, 0], to: [0, 3, 0], radius: 0.7, collide: 0, color: "#8f8a80"}   # the wheel's shaft
      - {kind: rod, from: [-4.6, -4.0, 4.0], to: [-22, -4.0, 12.8], radius: 0.25, collide: 0, color: "#6b5a44"}   # the band, to the drive
      - {kind: rod, from: [-1.0, -4.0, -4.9], to: [-22, -4.0, 5.2], radius: 0.25, collide: 0, color: "#6b5a44"}
pins:
  - {id: p_arm, a: rod, b: dial, at: [17.0, -1.0, 15.6726]}   # the rod's end on the indicator's arm
joints:
  - {id: j_w, type: hinge, body: wheel, axis: [0, 1, 0], damping: 0.01}   # the one driven joint: the large wheel; + : its top runs to the right
  - {id: j_x, type: slide, body: cart_x, axis: [1, 0, 0], damping: 0.5}   # the wagon, endwise
  - {id: j_z, type: slide, body: cart_z, axis: [0, 0, 1], range: [-1.0, 1.0], damping: 0.5}   # the wagon, up and down: its weight on the rim
  - {id: j_p, type: hinge, body: wagon, axis: [0, 1, 0], range: [-0.3, 0.3], damping: 0.05}   # the wagon, free to pitch: both axles bear
  - {id: j_a0, type: hinge, body: ww0, axis: [0, 1, 0], frictionloss: 0.05, damping: 0.0001}   # the axles: their friction is all the wagon gives
  - {id: j_a1, type: hinge, body: ww1, axis: [0, 1, 0], frictionloss: 0.05, damping: 0.0001}
  - {id: j_r, type: hinge, body: rod, axis: [0, 1, 0], damping: 0.0005}
  - {id: j_d, type: hinge, body: dial, axis: [0, 1, 0], stiffness: 0.5, damping: 0.01}   # the indicator, against its spiral spring
contact: {solref: [0.002, 1.0], solimp: [0.95, 0.99, 0.001], margin: 0}
driver: {joint: j_w, kind: velocity, rpm: 20, kv: 5, max_torque: 20}
checks:
  - {type: ratio, out: j_a0, in: j_w, expect: -7.7778, tol: 0.12, settle_s: 2, window_s: 5.5}   # the wagon's wheels rolling on the rim
  - {type: position, joint: j_d, min: 0.42, max: 0.6, settle_s: 2.5, window_s: 5}   # the pointer, standing at one reading
  - {type: penetration, max: 0.001, settle_s: 0.5}
camera: {target: [2.0, 0, -5.0], position: [2.0, -136.0, 2.0], fov: 34}
display:
  output: j_d
  labels: {j_w: "Large wheel (driver)", j_d: "Indicator", j_x: "Wagon, endwise", j_a0: "Wagon's wheels"}

