@rulecad/cad 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/EXAMPLES.md CHANGED
@@ -1395,7 +1395,8 @@ the load can't turn it backwards: the joint holds with the power off.
1395
1395
  "module": { "value": 1, "unit": "mm", "rule": "The gears'" },
1396
1396
  "teeth": { "value": 54, "rule": "The held ring" },
1397
1397
  "post_r": { "value": 37, "unit": "mm", "rule": "Three posts outside the output ring's 33 mm" },
1398
- "post": { "value": 7, "unit": "mm", "rule": "Each post's diameter" },
1398
+ "post": { "value": 7, "unit": "mm", "rule": "Each post's width" },
1399
+ "post_back": { "value": 2, "unit": "mm", "rule": "Each post is this much longer than wide, outward: stiff under the motor's weight and torque" },
1399
1400
  "post_height": { "value": 19.7, "unit": "mm", "rule": "From the plate to under the clips, just over the output ring" },
1400
1401
  "pilot_depth": { "value": 8, "unit": "mm", "rule": "Each post's pilot, deep enough for its clip's screw" }
1401
1402
  }
@@ -1404,7 +1405,8 @@ the load can't turn it backwards: the joint holds with the power off.
1404
1405
 
1405
1406
  ```js projects/home/objects/joint-housing.js
1406
1407
  // A motor plate with the fixed ring standing on it. The motor bolts underneath, its shaft up through the middle.
1407
- // Each post has an M3 pilot from v.fixings: its clip's screw cuts its own thread in it.
1408
+ // Each post has an M3 pilot from v.fixings: its clip's screw cuts its own thread in it. The posts are longer than
1409
+ // they're wide, outward over their own feet: held by a post, the housing carries the motor's weight and torque there.
1408
1410
  import jscad from '@jscad/modeling'
1409
1411
  const { cylinder } = jscad.primitives
1410
1412
  const { translate } = jscad.transforms
@@ -1413,10 +1415,11 @@ export function main (v) {
1413
1415
  const motor = v.motors.motorModel('nema17'), pilot = v.fixings.holeModel('M3', { kind: 'pilot' }).diameter
1414
1416
  const plate = cylinder({ radius: v.rim / 2, height: v.plate, center: [0, 0, v.plate / 2], segments: 96 })
1415
1417
  const ring = translate([0, 0, v.plate], v.gears.internal({ module: v.module, teeth: v.teeth, width: v.width, rim: v.rim }))
1416
- const at = (a) => [v.post_r * Math.cos(a), v.post_r * Math.sin(a)]
1418
+ const at = (a, r = v.post_r) => [r * Math.cos(a), r * Math.sin(a)]
1417
1419
  const angles = [Math.PI / 6, (5 * Math.PI) / 6, (3 * Math.PI) / 2]
1418
1420
  const lobes = angles.map((a) => cylinder({ radius: v.post, height: v.plate, center: [...at(a), v.plate / 2], segments: 32 }))
1419
- const posts = angles.map((a) => cylinder({ radius: v.post / 2, height: v.post_height + v.plate, center: [...at(a), (v.post_height + v.plate) / 2], segments: 32 }))
1421
+ const round = (c) => cylinder({ radius: v.post / 2, height: v.post_height + v.plate, center: [...c, (v.post_height + v.plate) / 2], segments: 32 })
1422
+ const posts = angles.map((a) => jscad.hulls.hull(round(at(a)), round(at(a, v.post_r + v.post_back))))
1420
1423
  const arms = angles.map((a) => jscad.transforms.rotateZ(a, jscad.primitives.cuboid({ size: [v.post_r - v.rim / 2 + 2, v.post, v.plate], center: [(v.post_r + v.rim / 2 - 2) / 2, 0, v.plate / 2] })))
1421
1424
  const pilots = angles.map((a) => cylinder({ radius: pilot / 2, height: v.pilot_depth, center: [...at(a), v.plate + v.post_height - v.pilot_depth / 2], segments: 24 }))
1422
1425
  return v.ops.subtract(v.ops.union(plate, ring, lobes, posts, arms), v.motors.mount(motor, { plate: v.plate, counterbore: true }, v.ops), pilots)
@@ -1642,6 +1645,11 @@ that the gears, under 50% efficient, hold it with the power off. `npx cad check
1642
1645
  motor all the way round and finds no teeth touching, and neither do the output ring's steps. Each clip's `fasten`
1643
1646
  chooses an M3x8 cap, 5 mm into its post's pilot.
1644
1647
 
1648
+ The check also holds the housing where a clip is screwed on below it, hangs the motor's weight and torque on its four
1649
+ screws, and asks that the shaft's tip stay within half the 0.2 mm fit of its seat. Nearly all of that movement is the
1650
+ one post bending and twisting, so each post is 2 mm longer outward than it's wide (`post_back`). It stands on a foot
1651
+ twice its width, so the first layer is no bigger for it.
1652
+
1645
1653
  Ten times over is more margin than the job needs, but the gearbox is the size it is for what the motor could do to it, not
1646
1654
  the arm: stalled against a stop, the 7.44 N m at the output puts 33 MPa on the planets' top teeth (`strength`, the Lewis
1647
1655
  equation, for teeth 8 mm wide), against PLA's 39. Give that a home switch, or a smaller current.
@@ -1872,8 +1880,9 @@ export function main (v) {
1872
1880
  }
1873
1881
  ```
1874
1882
 
1875
- The housing is chapter 11's with its posts longer, and with the bridge in place of the clips. Above each motor's boss is a
1876
- 45° cone up through the plate: a pocket there would have to be bridged.
1883
+ The housing is chapter 11's with taller, round posts (three feet screw it down, so no post has to carry the motor), and
1884
+ with the bridge in place of the clips. Above each motor's boss is a 45° cone up through the plate: a pocket there would
1885
+ have to be bridged.
1877
1886
 
1878
1887
  ```json projects/arm/objects/housing.json
1879
1888
  {
@@ -2702,12 +2711,12 @@ so an M3x30, the longest sold, reaches its nut on the far one.
2702
2711
  { "a": "b1", "b": "bridge", "seat": "press", "note": "The 6800 in its seat" },
2703
2712
  { "a": "es1", "b": "base", "min": -0.1, "note": "The home switch on its post, 0.1 mm of resting contact allowed" },
2704
2713
  { "a": "es2", "b": "upper", "min": -0.1, "note": "The elbow's home switch on its post" },
2705
- { "a": "es1", "b": "upper", "min": -30, "note": "The arm's flag on the home switch's lever at the end of the range" },
2706
- { "a": "es2", "b": "forearm", "min": -30, "note": "The forearm's flag on the elbow switch's lever" },
2707
- { "a": "horn", "b": "holder", "min": -30, "note": "The horn lifts the shuttle's lug: drawn at rest, the lug doesn't rise here" },
2708
- { "a": "ecarrier", "b": "ering", "min": -1, "note": "Two specks: neither is printed" },
2709
- { "a": "d1", "b": "shield", "fastens": true, "min": -20, "note": "Plugged in" },
2710
- { "a": "d2", "b": "shield", "fastens": true, "min": -20, "note": "Plugged in" }
2714
+ { "a": "es1", "b": "upper", "overlap": "allowed", "note": "The arm's flag on the home switch's lever at the end of the range" },
2715
+ { "a": "es2", "b": "forearm", "overlap": "allowed", "note": "The forearm's flag on the elbow switch's lever" },
2716
+ { "a": "horn", "b": "holder", "overlap": "allowed", "note": "The horn lifts the shuttle's lug: drawn at rest, the lug doesn't rise here" },
2717
+ { "a": "ecarrier", "b": "ering", "overlap": "allowed", "note": "Two specks: neither is printed" },
2718
+ { "a": "d1", "b": "shield", "fastens": true, "overlap": "allowed", "note": "Plugged in" },
2719
+ { "a": "d2", "b": "shield", "fastens": true, "overlap": "allowed", "note": "Plugged in" }
2711
2720
  ],
2712
2721
  "fasten": [
2713
2722
  { "screw": "M3 cap", "through": ["housing"], "into": "base", "at": ["housing.f1", "housing.f2", "housing.f3"], "note": "The housing on the base's three columns" },
@@ -3516,13 +3525,13 @@ The project lists the new objects:
3516
3525
  { "a": "b1", "b": "bridge", "seat": "press", "note": "The 6800 in its seat" },
3517
3526
  { "a": "es1", "b": "base", "min": -0.1, "note": "The home switch on its post, 0.1 mm of resting contact allowed" },
3518
3527
  { "a": "es2", "b": "upper", "min": -0.1, "note": "The elbow's home switch on its post" },
3519
- { "a": "es1", "b": "upper", "min": -30, "note": "The arm's flag on the home switch's lever at the end of the range" },
3520
- { "a": "es2", "b": "forearm", "min": -30, "note": "The forearm's flag on the elbow switch's lever" },
3521
- { "a": "ghorn", "b": "gripper", "min": -30, "note": "The horn presses the fingers' flats: drawn at rest, the fingers don't move here" },
3522
- { "a": "gservo", "b": "gripper", "fastens": true, "min": -0.2, "note": "The servo on its two posts" },
3523
- { "a": "ecarrier", "b": "ering", "min": -1, "note": "Two specks: neither is printed" },
3524
- { "a": "d1", "b": "shield", "fastens": true, "min": -20, "note": "Plugged in" },
3525
- { "a": "d2", "b": "shield", "fastens": true, "min": -20, "note": "Plugged in" }
3528
+ { "a": "es1", "b": "upper", "overlap": "allowed", "note": "The arm's flag on the home switch's lever at the end of the range" },
3529
+ { "a": "es2", "b": "forearm", "overlap": "allowed", "note": "The forearm's flag on the elbow switch's lever" },
3530
+ { "a": "ghorn", "b": "gripper", "overlap": "allowed", "note": "The horn presses the fingers' flats: drawn at rest, the fingers don't move here" },
3531
+ { "a": "gservo", "b": "gripper", "fastens": true, "overlap": "allowed", "note": "The servo on its two posts: the servo's model runs about 1.5 mm into the palm as drawn, so the pair may overlap until the pocket is checked against it" },
3532
+ { "a": "ecarrier", "b": "ering", "overlap": "allowed", "note": "Two specks: neither is printed" },
3533
+ { "a": "d1", "b": "shield", "fastens": true, "overlap": "allowed", "note": "Plugged in" },
3534
+ { "a": "d2", "b": "shield", "fastens": true, "overlap": "allowed", "note": "Plugged in" }
3526
3535
  ],
3527
3536
  "fasten": [
3528
3537
  { "screw": "M3 cap", "through": ["housing"], "into": "base", "at": ["housing.f1", "housing.f2", "housing.f3"], "note": "The housing on the base's three columns" },
@@ -3653,8 +3662,8 @@ The gripper is one flexing print, and an assembly can't show a leaf bending. `gr
3653
3662
  "a": "gservo",
3654
3663
  "b": "palm",
3655
3664
  "fastens": true,
3656
- "min": -0.3,
3657
- "note": "The servo on its two posts, its case and boss down in the pocket"
3665
+ "overlap": "allowed",
3666
+ "note": "The servo on its two posts, its case and boss down in the pocket: the servo's model runs about 1.5 mm into the palm as drawn, so the pair may overlap until the pocket is checked against it"
3658
3667
  },
3659
3668
  {
3660
3669
  "a": "gservo",
@@ -3665,25 +3674,27 @@ The gripper is one flexing print, and an assembly can't show a leaf bending. `gr
3665
3674
  {
3666
3675
  "a": "ghorn",
3667
3676
  "b": "upper",
3668
- "min": -0.25,
3669
- "note": "The horn's tip on the finger's flat"
3677
+ "overlap": "allowed",
3678
+ "max": 0.25,
3679
+ "note": "The horn's tip on the finger's flat, pressing it about 1 mm in as drawn (the leaf bends): touching, at most 0.25 mm apart"
3670
3680
  },
3671
3681
  {
3672
3682
  "a": "ghorn",
3673
3683
  "b": "lower",
3674
- "min": -0.25,
3675
- "note": "The horn's tip on the finger's flat"
3684
+ "overlap": "allowed",
3685
+ "max": 0.25,
3686
+ "note": "The horn's tip on the finger's flat, pressing it about 1 mm in as drawn (the leaf bends): touching, at most 0.25 mm apart"
3676
3687
  },
3677
3688
  {
3678
3689
  "a": "upper",
3679
3690
  "b": "palm",
3680
- "min": -2,
3691
+ "overlap": "allowed",
3681
3692
  "note": "The leaf's root runs into its arm: the fingers slide here as a check, the leaf really bends"
3682
3693
  },
3683
3694
  {
3684
3695
  "a": "lower",
3685
3696
  "b": "palm",
3686
- "min": -2,
3697
+ "overlap": "allowed",
3687
3698
  "note": "The leaf's root runs into its arm"
3688
3699
  }
3689
3700
  ],
@@ -3730,7 +3741,7 @@ The gripper is one flexing print, and an assembly can't show a leaf bending. `gr
3730
3741
  }
3731
3742
  ```
3732
3743
 
3733
- The check sees the horn's tips touch the fingers' flats at both poses, and nothing else collide: the horn's swing clears the palm's wedges and its hub's hole, the servo's case sits in its pocket, and the fingers clear the stem. Everything else the assembly says about the arm's own joints doesn't apply here, and the check runs with `--json`. `tool.grip` in this assembly is the 50 g case, passing at 2.3 times over.
3744
+ The check sees the horn's tips touch the fingers' flats at both poses (pressing them about 1 mm in, as the leaves bend), and nothing else collide: the horn's swing clears the palm's wedges and its hub's hole, and the fingers clear the stem. The servo's model runs about 1.5 mm into the palm round its pocket, which its fit allows for now (`"overlap": "allowed"`): the pocket is yet to be checked against the servo itself. Everything else the assembly says about the arm's own joints doesn't apply here, and the check runs with `--json`. `tool.grip` in this assembly is the 50 g case, passing at 2.3 times over.
3734
3745
 
3735
3746
  The closing check moves the fingers as stiff pieces on slides because the kit moves stiff pieces on joints. The real finger's leaf bends and tilts the jaw a little: 1 or 2 degrees of tilt over the 3 mm, which the object's own compliance takes up. Bench test: print it, load it with a 50 g weight on a thread, and watch the jaws.
3736
3747
 
@@ -3993,71 +4004,71 @@ The Z axis is checked by itself, on a fixed frame, because an upright or a drawi
3993
4004
  {
3994
4005
  "a": "zm",
3995
4006
  "b": "screw",
3996
- "min": -100,
4007
+ "overlap": "allowed",
3997
4008
  "note": "Coupled, drawn as one line"
3998
4009
  },
3999
4010
  {
4000
4011
  "a": "rod1",
4001
4012
  "b": "frame",
4002
4013
  "fastens": true,
4003
- "min": -100,
4014
+ "overlap": "allowed",
4004
4015
  "note": "The rod pressed in its holes"
4005
4016
  },
4006
4017
  {
4007
4018
  "a": "rod2",
4008
4019
  "b": "frame",
4009
4020
  "fastens": true,
4010
- "min": -100,
4021
+ "overlap": "allowed",
4011
4022
  "note": "The rod pressed in its holes"
4012
4023
  },
4013
4024
  {
4014
4025
  "a": "lm1",
4015
4026
  "b": "car",
4016
4027
  "fastens": true,
4017
- "min": -100,
4028
+ "overlap": "allowed",
4018
4029
  "note": "The bearing in its pocket"
4019
4030
  },
4020
4031
  {
4021
4032
  "a": "lm2",
4022
4033
  "b": "car",
4023
4034
  "fastens": true,
4024
- "min": -100,
4035
+ "overlap": "allowed",
4025
4036
  "note": "The bearing in its pocket"
4026
4037
  },
4027
4038
  {
4028
4039
  "a": "rod1",
4029
4040
  "b": "car",
4030
- "min": -100,
4041
+ "overlap": "allowed",
4031
4042
  "note": "The rod runs through the carriage's bearing"
4032
4043
  },
4033
4044
  {
4034
4045
  "a": "rod2",
4035
4046
  "b": "car",
4036
- "min": -100,
4047
+ "overlap": "allowed",
4037
4048
  "note": "The rod runs through the carriage's bearing"
4038
4049
  },
4039
4050
  {
4040
4051
  "a": "rod1",
4041
4052
  "b": "lm1",
4042
- "min": -100,
4053
+ "overlap": "allowed",
4043
4054
  "note": "Rod in bearing"
4044
4055
  },
4045
4056
  {
4046
4057
  "a": "rod2",
4047
4058
  "b": "lm2",
4048
- "min": -100,
4059
+ "overlap": "allowed",
4049
4060
  "note": "Rod in bearing"
4050
4061
  },
4051
4062
  {
4052
4063
  "a": "screw",
4053
4064
  "b": "car",
4054
- "min": -100,
4065
+ "overlap": "allowed",
4055
4066
  "note": "The screw through the nut"
4056
4067
  },
4057
4068
  {
4058
4069
  "a": "screw",
4059
4070
  "b": "frame",
4060
- "min": -100,
4071
+ "overlap": "allowed",
4061
4072
  "note": "The screw's end, loose in the bottom bar"
4062
4073
  }
4063
4074
  ],
@@ -4093,7 +4104,7 @@ The Z axis is checked by itself, on a fixed frame, because an upright or a drawi
4093
4104
 
4094
4105
  The kit's `leadscrew` on the motor item turns the motor's torque into the screw's force, and into mm per turn for the steps: 4096 steps a revolution of the 28BYJ-48's shaft (64:1 geared, in the catalogue), and 8 mm a revolution is 512 steps a millimetre, the figure `cad machine` writes (`stepsPerUnit`). The joint's support is unnamed because the kit doesn't count linear bearings as a `support` (a printed clip or a bought ball bearing): `joint.moment` warns it can't check them. By hand: 326 g, the carriage and everything on it, is 0.074 N m of tipping at the tool, which over the rods' 40 mm spacing is 1.85 N each, against an LM8UU's 400 N static rating (a community figure): not the limit.
4095
4106
 
4096
- With an 8 mm lead the screw itself back-drives (`Tr8x8` has a 20° lead angle): the screw doesn't hold the load. The motor's own 64:1 gearbox does, 0.0588 N m of friction against 0.001 N m of back torque: the Z holds unpowered, and `motor.holds` says why. Choosing a 2 mm lead instead would make the screw lock on its own (a 5° lead angle) and lift four times slower still (0.29 mm/s against this one's 1.17 mm/s). The kit gives 1.17 mm/s at the 28BYJ-48's working speed: 43 s across the 50 mm travel. It's a slow axis and honest about it: the gripper's job is to pick something up, not to move quickly while doing it.
4107
+ With an 8 mm lead the screw itself back-drives (`Tr8x8` has a 20° lead angle): the screw doesn't hold the load. The motor's own 64:1 gearbox does, 0.0588 N m of friction against 0.001 N m of back torque: the Z holds unpowered, and `motor.holds` says why. Choosing a 2 mm lead instead would make the screw lock on its own (a 5° lead angle) and lift four times slower still (0.06 mm/s against this one's 0.23 mm/s). The kit gives 0.23 mm/s at the 28BYJ-48's working speed, the 120 steps a second (1.76 rpm) its pull-in torque is measured at: 3.6 minutes across the 50 mm travel. It turns up to five times faster unloaded, but its torque falls away above that rate, so a design that asks for more speed is checked against less torque. It's a slow axis and honest about it: the gripper's job is to pick something up, not to move quickly while doing it.
4097
4108
 
4098
4109
  ### A belt instead of a screw
4099
4110
 
@@ -4215,52 +4226,52 @@ The same frame and carriage can run on a GT2 belt: a 20-tooth pulley on the moto
4215
4226
  "a": "rod1",
4216
4227
  "b": "frame",
4217
4228
  "fastens": true,
4218
- "min": -100,
4229
+ "overlap": "allowed",
4219
4230
  "note": "The rod pressed in its holes"
4220
4231
  },
4221
4232
  {
4222
4233
  "a": "rod2",
4223
4234
  "b": "frame",
4224
4235
  "fastens": true,
4225
- "min": -100,
4236
+ "overlap": "allowed",
4226
4237
  "note": "The rod pressed in its holes"
4227
4238
  },
4228
4239
  {
4229
4240
  "a": "lm1",
4230
4241
  "b": "car",
4231
4242
  "fastens": true,
4232
- "min": -100,
4243
+ "overlap": "allowed",
4233
4244
  "note": "The bearing in its pocket"
4234
4245
  },
4235
4246
  {
4236
4247
  "a": "lm2",
4237
4248
  "b": "car",
4238
4249
  "fastens": true,
4239
- "min": -100,
4250
+ "overlap": "allowed",
4240
4251
  "note": "The bearing in its pocket"
4241
4252
  },
4242
4253
  {
4243
4254
  "a": "rod1",
4244
4255
  "b": "car",
4245
- "min": -100,
4256
+ "overlap": "allowed",
4246
4257
  "note": "The rod runs through the carriage's bearing"
4247
4258
  },
4248
4259
  {
4249
4260
  "a": "rod2",
4250
4261
  "b": "car",
4251
- "min": -100,
4262
+ "overlap": "allowed",
4252
4263
  "note": "The rod runs through the carriage's bearing"
4253
4264
  },
4254
4265
  {
4255
4266
  "a": "rod1",
4256
4267
  "b": "lm1",
4257
- "min": -100,
4268
+ "overlap": "allowed",
4258
4269
  "note": "Rod in bearing"
4259
4270
  },
4260
4271
  {
4261
4272
  "a": "rod2",
4262
4273
  "b": "lm2",
4263
- "min": -100,
4274
+ "overlap": "allowed",
4264
4275
  "note": "Rod in bearing"
4265
4276
  }
4266
4277
  ],
@@ -4350,7 +4361,7 @@ a bench says otherwise.
4350
4361
  | Joint axis | Vertical: gravity never loads a motor | Horizontal: gravity is the load |
4351
4362
  | Task | A pen's drag on paper, 0.3 N | The weight on the foot, 9.9 N on the stand |
4352
4363
  | Worst torque | 0.22 N m at the shoulder | 0.608 N m at the knee, 0.198 N m at the hip |
4353
- | Margin at the motor | 8 times (shoulder, at 0.5 A) | 2.8 times at the knee, 8.5 times at the hip, at the same 0.5 A |
4364
+ | Margin at the motor | 8 times (shoulder, at 0.5 A) | 2.4 times at the knee, 7.5 times at the hip, at the same 0.5 A |
4354
4365
  | What decides the link length | Reach across a sheet, and how far the elbow's error swings | The lever on the foot: the shorter, the less torque |
4355
4366
 
4356
4367
  The same gearbox with a 17HS4401 at the hip and another at the knee: the motor the arm uses at both its joints, and the one on the
@@ -5308,21 +5319,21 @@ Standing, the foot is under the hip with the knee behind it. The gait is a singl
5308
5319
  { "a": "housing", "b": "carriage", "min": 0, "note": "The housing, screwed to the carriage's face" },
5309
5320
  { "a": "bridge", "b": "housing", "min": 0, "note": "The bridge, on the housing's posts" },
5310
5321
  { "a": "b1", "b": "bridge", "seat": "press", "note": "The 6800 in its seat" },
5311
- { "a": "ecarrier", "b": "ering", "min": -1, "note": "Two specks: neither is printed" },
5322
+ { "a": "ecarrier", "b": "ering", "overlap": "allowed", "note": "Two specks: neither is printed" },
5312
5323
  { "a": "lm1", "b": "carriage", "fastens": true, "min": -0.5, "note": "The bushing, pressed in its pocket" },
5313
5324
  { "a": "lm2", "b": "carriage", "fastens": true, "min": -0.5, "note": "The bushing, pressed in its pocket" },
5314
- { "a": "rod1", "b": "lm1", "fastens": true, "min": -1000, "note": "The bushing rides the rod: the carriage is free to rise and is held on the rods" },
5315
- { "a": "rod2", "b": "lm2", "fastens": true, "min": -1000, "note": "The bushing rides the rod" },
5316
- { "a": "rod1", "b": "foot1", "fastens": true, "min": -1000, "note": "The rod in its socket" },
5317
- { "a": "rod2", "b": "foot2", "fastens": true, "min": -1000, "note": "The rod in its socket" },
5318
- { "a": "rod1", "b": "tie", "fastens": true, "min": -1000, "note": "The rod through the tie" },
5319
- { "a": "rod2", "b": "tie", "fastens": true, "min": -1000, "note": "The rod through the tie" },
5320
- { "a": "rod1", "b": "collar1", "fastens": true, "min": -1000, "note": "The stop clamped on the rod" },
5321
- { "a": "rod2", "b": "collar2", "fastens": true, "min": -1000, "note": "The stop clamped on the rod" },
5322
- { "a": "pad", "b": "shin", "min": -2, "note": "The pad on the foot's disc" },
5325
+ { "a": "rod1", "b": "lm1", "fastens": true, "overlap": "allowed", "note": "The bushing rides the rod: the carriage is free to rise and is held on the rods" },
5326
+ { "a": "rod2", "b": "lm2", "fastens": true, "overlap": "allowed", "note": "The bushing rides the rod" },
5327
+ { "a": "rod1", "b": "foot1", "fastens": true, "overlap": "allowed", "note": "The rod in its socket" },
5328
+ { "a": "rod2", "b": "foot2", "fastens": true, "overlap": "allowed", "note": "The rod in its socket" },
5329
+ { "a": "rod1", "b": "tie", "fastens": true, "overlap": "allowed", "note": "The rod through the tie" },
5330
+ { "a": "rod2", "b": "tie", "fastens": true, "overlap": "allowed", "note": "The rod through the tie" },
5331
+ { "a": "rod1", "b": "collar1", "fastens": true, "overlap": "allowed", "note": "The stop clamped on the rod" },
5332
+ { "a": "rod2", "b": "collar2", "fastens": true, "overlap": "allowed", "note": "The stop clamped on the rod" },
5333
+ { "a": "pad", "b": "shin", "overlap": "allowed", "note": "The pad on the foot's disc" },
5323
5334
  { "a": "pad", "b": "scale", "min": -0.5, "note": "The foot stands on the scale" },
5324
- { "a": "d1", "b": "shield", "fastens": true, "min": -20, "note": "Plugged in" },
5325
- { "a": "d2", "b": "shield", "fastens": true, "min": -20, "note": "Plugged in" }
5335
+ { "a": "d1", "b": "shield", "fastens": true, "overlap": "allowed", "note": "Plugged in" },
5336
+ { "a": "d2", "b": "shield", "fastens": true, "overlap": "allowed", "note": "Plugged in" }
5326
5337
  ],
5327
5338
  "wires": [
5328
5339
  { "id": "hip_wire", "from": "m1.connector", "to": "shield.X", "via": ["carriage.cable"], "gauge": "awg24", "colour": "black, red, green, blue", "connectors": ["JST-XH 4 pin", "screw terminal"] },
@@ -5343,7 +5354,7 @@ npx cad animate leg/stand
5343
5354
  The check runs with `--json` here because the stand's warnings, that its figures rest on estimates and that two of the shin's screws want a ball-end key, would otherwise stop the test: run it plain to read it. What it says:
5344
5355
 
5345
5356
  - `gait.clearance` passes: the swing foot lifts 15 mm clear of the scale (asked 12).
5346
- - `motor.torque` through the gait: the hip needs 0.198 N m at the worst of the cycle against 1.682 N m the 17HS4401 gives at 0.5 A through 38:1 at 47%, 8.5 times; the knee 0.608 N m against the same 1.682 N m, 2.8 times. By hand: the 17HS4401 holds 0.4 N m, and moving, 0.4 / √2 = 0.283 N m, flat up to its 12 V corner of 60 × 12 / (2 × 4.2 mH × 1.5 A × 200 steps) = 286 rpm, so all of it at 200 rpm; at 0.5 of its 1.5 A, 0.094 N m; through 38:1 at 47%, 1.682 N m. The supply's 12 V costs nothing here, since 200 rpm is under its corner: only the mass moves the margins. With the NEMA 14 the knee had 1.419 N m for 0.451 N m at 0.75 kg, 3.1 times, and the hip 11.4 times; the 17HS4401 gives the knee more torque, and the 90 g it adds, with the load now counted as what rides the rods, brings both margins down to these. Those figures are the foot's load only, not the leg's own weight in the swing, and the gearbox efficiency is an estimate.
5357
+ - `motor.torque` through the gait: the hip needs 0.198 N m at the worst of the cycle against 1.484 N m the 17HS4401 gives at 0.5 A through 38:1 at 47%, 7.5 times; the knee 0.608 N m against the same 1.484 N m, 2.4 times. By hand: the 17HS4401 holds 0.4 N m, and moving, 0.4 / √2 = 0.283 N m, flat up to its 12 V corner of 60 × 12 / (2 × 2.8 mH × 1.7 A × 200 steps) = 378 rpm, so all of it at 200 rpm; at 0.5 of its 1.7 A, 0.083 N m; through 38:1 at 47%, 1.484 N m. The supply's 12 V costs nothing here, since 200 rpm is under its corner: only the mass moves the margins. With the NEMA 14 the knee had 1.419 N m for 0.451 N m at 0.75 kg, 3.1 times, and the hip 11.4 times; the 17HS4401 gives the knee more torque, and the 90 g it adds, with the load now counted as what rides the rods, brings both margins down to these. Those figures are the foot's load only, not the leg's own weight in the swing, and the gearbox efficiency is an estimate.
5347
5358
  - The drivers and the supply: each DRV8825's trimmer at 0.25 V for 0.5 A a coil (on 0.1 ohm sense resistors: read yours first), and the machine draws 0.22 A at 12 V (2.6 W) from the bench supply's 1.5 A limit, 6.9 times over.
5348
5359
  - `gait.sweep` passes: the leg, moved through the cycle pose by pose, hits nothing, with every planet and the sun turning as they should (the gait moves the motor's shaft that leads each output, and the rest follows).
5349
5360
  - The gears' overlap is zero: the second ring is put in phase at the joint's own zero, wherever its range starts. (A range that left out zero once put the ring 30° out, and every planet into its teeth.)
@@ -5743,8 +5754,8 @@ Eight motors are more than the stand's Uno under a CNC shield can step: its stre
5743
5754
  {"a": "fl_housing", "b": "left", "min": 0},
5744
5755
  {"a": "fl_bridge", "b": "fl_housing", "min": 0},
5745
5756
  {"a": "fl_b1", "b": "fl_bridge", "seat": "press"},
5746
- {"a": "fl_ecarrier", "b": "fl_ering", "min": -1},
5747
- {"a": "fl_pad", "b": "fl_shin", "min": -2},
5757
+ {"a": "fl_ecarrier", "b": "fl_ering", "overlap": "allowed"},
5758
+ {"a": "fl_pad", "b": "fl_shin", "overlap": "allowed"},
5748
5759
  {"a": "fr_m1", "b": "fr_housing", "fastens": true, "min": -0.1},
5749
5760
  {"a": "fr_m1", "b": "fr_sun", "shaft": true},
5750
5761
  {"a": "fr_m2", "b": "fr_esun", "shaft": true},
@@ -5752,8 +5763,8 @@ Eight motors are more than the stand's Uno under a CNC shield can step: its stre
5752
5763
  {"a": "fr_housing", "b": "right", "min": 0},
5753
5764
  {"a": "fr_bridge", "b": "fr_housing", "min": 0},
5754
5765
  {"a": "fr_b1", "b": "fr_bridge", "seat": "press"},
5755
- {"a": "fr_ecarrier", "b": "fr_ering", "min": -1},
5756
- {"a": "fr_pad", "b": "fr_shin", "min": -2},
5766
+ {"a": "fr_ecarrier", "b": "fr_ering", "overlap": "allowed"},
5767
+ {"a": "fr_pad", "b": "fr_shin", "overlap": "allowed"},
5757
5768
  {"a": "bl_m1", "b": "bl_housing", "fastens": true, "min": -0.1},
5758
5769
  {"a": "bl_m1", "b": "bl_sun", "shaft": true},
5759
5770
  {"a": "bl_m2", "b": "bl_esun", "shaft": true},
@@ -5761,8 +5772,8 @@ Eight motors are more than the stand's Uno under a CNC shield can step: its stre
5761
5772
  {"a": "bl_housing", "b": "left", "min": 0},
5762
5773
  {"a": "bl_bridge", "b": "bl_housing", "min": 0},
5763
5774
  {"a": "bl_b1", "b": "bl_bridge", "seat": "press"},
5764
- {"a": "bl_ecarrier", "b": "bl_ering", "min": -1},
5765
- {"a": "bl_pad", "b": "bl_shin", "min": -2},
5775
+ {"a": "bl_ecarrier", "b": "bl_ering", "overlap": "allowed"},
5776
+ {"a": "bl_pad", "b": "bl_shin", "overlap": "allowed"},
5766
5777
  {"a": "br_m1", "b": "br_housing", "fastens": true, "min": -0.1},
5767
5778
  {"a": "br_m1", "b": "br_sun", "shaft": true},
5768
5779
  {"a": "br_m2", "b": "br_esun", "shaft": true},
@@ -5770,8 +5781,8 @@ Eight motors are more than the stand's Uno under a CNC shield can step: its stre
5770
5781
  {"a": "br_housing", "b": "right", "min": 0},
5771
5782
  {"a": "br_bridge", "b": "br_housing", "min": 0},
5772
5783
  {"a": "br_b1", "b": "br_bridge", "seat": "press"},
5773
- {"a": "br_ecarrier", "b": "br_ering", "min": -1},
5774
- {"a": "br_pad", "b": "br_shin", "min": -2}
5784
+ {"a": "br_ecarrier", "b": "br_ering", "overlap": "allowed"},
5785
+ {"a": "br_pad", "b": "br_shin", "overlap": "allowed"}
5775
5786
  ],
5776
5787
  "wires": [
5777
5788
  {"id": "fl_hd_motor", "from": "fl_m1.connector", "to": "fl_board1.top", "gauge": "awg24", "colour": "black, red, green, blue", "connectors": ["JST-XH 4 pin", "screw terminal"]},
@@ -6092,8 +6103,8 @@ Eight motors are more than the stand's Uno under a CNC shield can step: its stre
6092
6103
  {"a": "fl_housing", "b": "left", "min": 0},
6093
6104
  {"a": "fl_bridge", "b": "fl_housing", "min": 0},
6094
6105
  {"a": "fl_b1", "b": "fl_bridge", "seat": "press"},
6095
- {"a": "fl_ecarrier", "b": "fl_ering", "min": -1},
6096
- {"a": "fl_pad", "b": "fl_shin", "min": -2},
6106
+ {"a": "fl_ecarrier", "b": "fl_ering", "overlap": "allowed"},
6107
+ {"a": "fl_pad", "b": "fl_shin", "overlap": "allowed"},
6097
6108
  {"a": "fr_m1", "b": "fr_housing", "fastens": true, "min": -0.1},
6098
6109
  {"a": "fr_m1", "b": "fr_sun", "shaft": true},
6099
6110
  {"a": "fr_m2", "b": "fr_esun", "shaft": true},
@@ -6101,8 +6112,8 @@ Eight motors are more than the stand's Uno under a CNC shield can step: its stre
6101
6112
  {"a": "fr_housing", "b": "right", "min": 0},
6102
6113
  {"a": "fr_bridge", "b": "fr_housing", "min": 0},
6103
6114
  {"a": "fr_b1", "b": "fr_bridge", "seat": "press"},
6104
- {"a": "fr_ecarrier", "b": "fr_ering", "min": -1},
6105
- {"a": "fr_pad", "b": "fr_shin", "min": -2},
6115
+ {"a": "fr_ecarrier", "b": "fr_ering", "overlap": "allowed"},
6116
+ {"a": "fr_pad", "b": "fr_shin", "overlap": "allowed"},
6106
6117
  {"a": "bl_m1", "b": "bl_housing", "fastens": true, "min": -0.1},
6107
6118
  {"a": "bl_m1", "b": "bl_sun", "shaft": true},
6108
6119
  {"a": "bl_m2", "b": "bl_esun", "shaft": true},
@@ -6110,8 +6121,8 @@ Eight motors are more than the stand's Uno under a CNC shield can step: its stre
6110
6121
  {"a": "bl_housing", "b": "left", "min": 0},
6111
6122
  {"a": "bl_bridge", "b": "bl_housing", "min": 0},
6112
6123
  {"a": "bl_b1", "b": "bl_bridge", "seat": "press"},
6113
- {"a": "bl_ecarrier", "b": "bl_ering", "min": -1},
6114
- {"a": "bl_pad", "b": "bl_shin", "min": -2},
6124
+ {"a": "bl_ecarrier", "b": "bl_ering", "overlap": "allowed"},
6125
+ {"a": "bl_pad", "b": "bl_shin", "overlap": "allowed"},
6115
6126
  {"a": "br_m1", "b": "br_housing", "fastens": true, "min": -0.1},
6116
6127
  {"a": "br_m1", "b": "br_sun", "shaft": true},
6117
6128
  {"a": "br_m2", "b": "br_esun", "shaft": true},
@@ -6119,8 +6130,8 @@ Eight motors are more than the stand's Uno under a CNC shield can step: its stre
6119
6130
  {"a": "br_housing", "b": "right", "min": 0},
6120
6131
  {"a": "br_bridge", "b": "br_housing", "min": 0},
6121
6132
  {"a": "br_b1", "b": "br_bridge", "seat": "press"},
6122
- {"a": "br_ecarrier", "b": "br_ering", "min": -1},
6123
- {"a": "br_pad", "b": "br_shin", "min": -2}
6133
+ {"a": "br_ecarrier", "b": "br_ering", "overlap": "allowed"},
6134
+ {"a": "br_pad", "b": "br_shin", "overlap": "allowed"}
6124
6135
  ],
6125
6136
  "wires": [
6126
6137
  {"id": "fl_hd_motor", "from": "fl_m1.connector", "to": "fl_board1.top", "gauge": "awg24", "colour": "black, red, green, blue", "connectors": ["JST-XH 4 pin", "screw terminal"]},
@@ -6171,7 +6182,7 @@ Said plainly, because a gait that passes these checks is not a robot that walks:
6171
6182
  - **Feedback.** The motors are open-loop steppers: a stall or a slip goes unnoticed. A real leg needs at least encoders at the joints and a way to feel the ground, and code that uses them.
6172
6183
  - **Measuring.** Nothing here has been printed. The stand exists to change that: run its leg, write what the scale reads into the ledger with `cad measured`, and start again from what it says.
6173
6184
 
6174
- `npm create rulecad --machine leg` starts a project from the leg and its stand, with the streamer and its sender. The trot streams through the streamer on a simulated Mega 2560 in the kit's tests, every step counted; a measured leg is not done yet.
6185
+ `npm create rulecad -- --machine leg` starts a project from the leg and its stand, with the streamer and its sender. The trot streams through the streamer on a simulated Mega 2560 in the kit's tests, every step counted; a measured leg is not done yet.
6175
6186
 
6176
6187
 
6177
6188
  ## 15. Fixings: a bracket screwed on
@@ -6394,14 +6405,14 @@ Each relation is reckoned as if it held the bracket alone, so the two figures ar
6394
6405
  estimates (the plastic's strength in shear, the nut factor, the friction), and the finding names each one.
6395
6406
 
6396
6407
  `cad list` gives the screws by thread, length and head, with what they weigh and how they are bought, and the two
6397
- prints: the plate 5.9 g and the bracket 11.8 g, 17.7 g and about 20 minutes of printing, and 5 g of fixings.
6408
+ prints: the plate 5.8 g and the bracket 11.6 g, 17.4 g and about 20 minutes of printing, and 5 g of fixings.
6398
6409
  `cad order` gives the steps: the plate first, then the bracket with its four screws, each with its key and torque, the
6399
6410
  insert and the nuts named with them.
6400
6411
 
6401
6412
  ### Strong enough, and small
6402
6413
 
6403
6414
  The design rule is the smallest part that carries its load about twice over. By hand, PLA at 39 MPa along the layers
6404
- (`pla.strength`, a community figure), 2 kg is 19.6 N:
6415
+ (`pla.strength`, from its maker's data sheet), 2 kg is 19.6 N:
6405
6416
 
6406
6417
  | Part | Where it is worst | Load | Stress | Margin |
6407
6418
  |---|---|---|---|---|
@@ -6599,7 +6610,7 @@ An address names a place on a beam: `p1.back@30` is the face of `p1` that looks
6599
6610
  brackets go on.
6600
6611
  - **Feet and caps.** A printed `foot` on each post's end `a`, screwed into the end's bore, which the post's own `ops`
6601
6612
  tap M5 as the foot asks. A printed `end-cap` on each end `b`, pushed on: its pegs go 5 mm into the slots and the bore,
6602
- a press fit (`"min": -5`).
6613
+ a fit that fastens with `"overlap": "allowed"`, as they stand in the beam.
6603
6614
  - **The axis.** A `rods` guide on the top face of `x3`, from 100 to 250 mm along it: two 8 mm rods in printed holders,
6604
6615
  a printed carriage on two LM8UU bearings. A `screw` guide drives it: a printed motor plate before the first holder,
6605
6616
  a NEMA 17 on it, a coupler and an 8 mm lead T8 screw, a 608 bearing for the screw in each holder and the lead nut on
@@ -6657,10 +6668,10 @@ An address names a place on a beam: `p1.back@30` is the face of `p1` that looks
6657
6668
  { "kind": "blind", "a": "y4.a", "b": "p2.top@190" }, { "kind": "blind", "a": "y4.b", "b": "p3.bottom@190" }
6658
6669
  ],
6659
6670
  "fits": [
6660
- { "a": "cap1", "b": "p1", "fastens": true, "min": -5, "note": "An end cap, its pegs pushed 5 mm into the slots and the bore" },
6661
- { "a": "cap2", "b": "p2", "fastens": true, "min": -5, "note": "An end cap, its pegs pushed 5 mm into the slots and the bore" },
6662
- { "a": "cap3", "b": "p3", "fastens": true, "min": -5, "note": "An end cap, its pegs pushed 5 mm into the slots and the bore" },
6663
- { "a": "cap4", "b": "p4", "fastens": true, "min": -5, "note": "An end cap, its pegs pushed 5 mm into the slots and the bore" }
6671
+ { "a": "cap1", "b": "p1", "fastens": true, "overlap": "allowed", "note": "An end cap, its pegs pushed 5 mm into the slots and the bore" },
6672
+ { "a": "cap2", "b": "p2", "fastens": true, "overlap": "allowed", "note": "An end cap, its pegs pushed 5 mm into the slots and the bore" },
6673
+ { "a": "cap3", "b": "p3", "fastens": true, "overlap": "allowed", "note": "An end cap, its pegs pushed 5 mm into the slots and the bore" },
6674
+ { "a": "cap4", "b": "p4", "fastens": true, "overlap": "allowed", "note": "An end cap, its pegs pushed 5 mm into the slots and the bore" }
6664
6675
  ],
6665
6676
  "guides": [
6666
6677
  { "kind": "rods", "on": "x3.top", "from": 100, "length": 150, "nut": "drop-in" },
@@ -6734,7 +6745,8 @@ The bracket is the part its load sizes: thinner, it would bend past its margin.
6734
6745
  rather than what they carry: the carriage by its two bearings' pockets and the nut's bore, the holder by the 608
6735
6746
  bearing pressed into it, the plate by the motor's boss and its four screws, the foot by the counterbore its screw's
6736
6747
  head sinks into. Each is as small as those allow. The margins under 3.06 come from beam formulas or coarse finite
6737
- elements on PLA's 39 MPa (`pla.strength`, a community figure), so each is an estimate, and the finding says so.
6748
+ elements on PLA's strength (`pla.strength`, 39 MPa along its layers, and `pla.strength_z`, 35 across them), so each is
6749
+ an estimate, and the finding says so.
6738
6750
 
6739
6751
  ### Cut, drilled and tapped
6740
6752
 
@@ -6751,7 +6763,7 @@ at its foot, with three access holes on the faces its rails meet. All twelve com
6751
6763
  of metal where one 4000 mm bar would hold them too, with a 3 mm kerf and 10 mm trimmed off each bar's first end,
6752
6764
  leaving 216 mm of offcuts. The first bar is filled: three rails and a post take 999 mm of it, and the last cut takes
6753
6765
  the millimetre left. Then the bought parts (the rods, bearings, coupler, screw, nut and motor), the fasteners by size
6754
- with the packs to buy, and 124 g printed in 17 parts, about 134 minutes of printing. The fasteners, as `cad list` gives them:
6766
+ with the packs to buy, and 122 g printed in 17 parts, about 134 minutes of printing. The fasteners, as `cad list` gives them:
6755
6767
 
6756
6768
  - 12 × M5x12 button, for the blind joins.
6757
6769
  - 16 × M4x10 cap, with 16 of the 18 drop-in nuts, for the brackets, the rod holders and the motor plate.
@@ -6773,7 +6785,7 @@ npx cad plates frame/box
6773
6785
  ```
6774
6786
 
6775
6787
  Every printed part of the frame goes on one plate of the X1C's bed, laid as each prints: the four brackets, the four
6776
- feet and caps, the two rod holders, the carriage, the motor plate and the board plate, 17 parts and 124 g, spaced by
6788
+ feet and caps, the two rod holders, the carriage, the motor plate and the board plate, 17 parts and 122 g, spaced by
6777
6789
  the first layer's rule (0.84 mm). The plate is written as an assembly, `box-base-1`, and checked as one print: no
6778
6790
  overhang past 45°, nothing in mid-air, nothing too near its neighbour on the first layer.
6779
6791