create-rulecad 0.3.20 → 0.3.21

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/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ print (a hole's diameter, a seat's depth, a part's outline). Each release lists
5
5
  it makes, with its reason. A **fasten** is an entry in an assembly's `"fasten"` list: one screwed joint, naming the
6
6
  screw by thread and head, the parts it passes through and the part it ends in.
7
7
 
8
+ ## 0.3.21: the arm on a 17HS4401 elbow and 12 V
9
+
10
+ ### Changed
11
+
12
+ - `--machine arm` makes the arm with a 17HS4401 at the elbow as at the shoulder, on a 12 V supply (an LRS-50-12), so
13
+ one motor and one driver setting cover both joints. Printed sizes moved in `upper`: the elbow motor's four M3 holes
14
+ and their counterbores from the NEMA 14's 26 mm square to the 17HS4401's 31 mm square. `arm.shoulder_torque` goes
15
+ from 0.2 to 0.22 N m for the heavier elbow motor.
16
+ - The template's `AGENTS.md` tells an agent to mark what the person has `"have": true` and to give the supply they
17
+ will use, since a stepper's torque at speed follows its volts.
18
+
8
19
  ## 0.3.20: the edit commands and belt guides in the agent notes (Frames 4)
9
20
 
10
21
  ### Changed
@@ -16,7 +16,7 @@
16
16
  { "id": "bridge", "object": "bridge", "at": [0, 0, "arm.bridge_low"] },
17
17
  { "id": "b1", "bought": "bearing-6800", "at": [0, 0, "arm.bridge_low + arm.bridge - arm.bearing_width"] },
18
18
  { "id": "upper", "object": "upper" },
19
- { "id": "m2", "motor": { "model": "nema14", "drives": "edrive", "speed": 300, "duty": 0.3, "driver": "d2", "current": 0.5, "microsteps": 8 } },
19
+ { "id": "m2", "motor": { "model": "17HS4401", "drives": "edrive", "speed": 300, "duty": 0.3, "driver": "d2", "current": 0.5, "microsteps": 8 } },
20
20
  { "id": "esun", "object": "sun", "set": { "tip": 11.7 } },
21
21
  { "id": "ecarrier", "object": "speck" }, { "id": "ering", "object": "speck" },
22
22
  { "id": "ep1", "object": "planet" }, { "id": "ep2", "object": "planet" }, { "id": "ep3", "object": "planet" },
@@ -32,7 +32,7 @@
32
32
  { "id": "d1", "bought": "drv8825", "at": [-300, -30, 8] },
33
33
  { "id": "d2", "bought": "drv8825", "at": [-300, 0, 8] },
34
34
  { "id": "shield", "bought": "cnc-shield-v3", "at": [-300, 0, 0] },
35
- { "id": "psu", "bought": "supply-24v", "variant": "LRS-50-24", "at": [-330, 150, 0] }
35
+ { "id": "psu", "bought": "supply-12v", "variant": "LRS-50-12", "at": [-330, 150, 0] }
36
36
  ],
37
37
  "joints": [
38
38
  { "id": "m1_on", "type": "fixed", "parent": "housing.motor", "child": "m1.face" },
@@ -106,7 +106,7 @@
106
106
  { "id": "pen", "from": "servo.connector", "to": "shield.Z", "via": ["forearm.cable", "upper.cable", "base.cable"], "gauge": "awg26", "colour": "brown, red, orange", "conductors": 3, "current": 0.7, "connectors": ["Servo JR 3 pin", "D11, 5 V, GND"], "note": "D11 is the Z limit pin on a V3.00 shield: arm.ino uses it for the servo" },
107
107
  { "id": "home1", "from": "es1.left", "to": "shield.X", "via": ["base.cable"], "gauge": "awg26", "colour": "white, black", "conductors": 2, "connectors": ["Crimped spade", "X limit and GND"] },
108
108
  { "id": "home2", "from": "es2.left", "to": "shield.Y", "via": ["upper.cable", "base.cable"], "gauge": "awg26", "colour": "white, black", "conductors": 2, "connectors": ["Crimped spade", "Y limit and GND"] },
109
- { "id": "power", "from": "psu.terminals", "to": "shield.top", "gauge": "awg22", "colour": "red, black", "conductors": 2, "current": 2, "connectors": ["Ring terminal", "Screw terminal"], "note": "24 V into the shield's motor terminals" }
109
+ { "id": "power", "from": "psu.terminals", "to": "shield.top", "gauge": "awg22", "colour": "red, black", "conductors": 2, "current": 2, "connectors": ["Ring terminal", "Screw terminal"], "note": "12 V into the shield's motor terminals" }
110
110
  ],
111
111
  "loads": [
112
112
  { "joint": "out", "torque": "arm.shoulder_torque", "note": "The pen's drag at its reach, the arm's inertia at 500 mm/s², the bias" },
@@ -1,5 +1,6 @@
1
1
  // The upper arm, drawn as it prints: its top face on the bed, the elbow's ring standing on it, the hub's socket opening
2
- // upward. The elbow's NEMA 14 bolts on the bed side, its shaft up through the plate, as chapter 11's housing does.
2
+ // upward. The elbow's 17HS4401, the shoulder's motor, bolts on the bed side, its shaft up through the plate, on the same
3
+ // v.motors mount as the shoulder's housing.
3
4
  // The screws' holes are v.fixings': an M3 clearance hole through the socket's floor for the screw into the spindle,
4
5
  // an M3 pilot in each post for its clip, and the elbow switch's M2 pilots.
5
6
  import jscad from '@jscad/modeling'
@@ -10,7 +11,7 @@ const { hull } = jscad.hulls
10
11
 
11
12
  export function main (v) {
12
13
  const screw = v.fixings.holeModel('M3').diameter, pilot = v.fixings.holeModel('M3', { kind: 'pilot' }).diameter, switchPilot = v.fixings.holeModel('M2', { kind: 'pilot' }).diameter
13
- const motor = v.motors.motorModel('nema14')
14
+ const motor = v.motors.motorModel('17HS4401')
14
15
  const at = (r, a) => [v.long + r * Math.cos(a), r * Math.sin(a)]
15
16
  const posts = [v.p1, v.p2, v.p3].map((a) => a * v.rad)
16
17
  const round = (r, c) => translate([c, 0], circle({ radius: r, segments: v.segments }))
@@ -13,8 +13,8 @@
13
13
  "twist_elbow": {"value": 0.01, "unit": "°", "rule": "The elbow's gear train twisting, the same", "kind": "estimate", "source": "A guess: bench test 15", "checked": "2026-11-09"},
14
14
  "deflection": {"value": 0.02, "unit": "mm", "rule": "The links bending sideways at the pen under its drag, from beam formulas", "kind": "estimate", "source": "0.3 N of drag on the forearm and holder as cantilevers: bench test 17 measures the whole budget at once", "checked": "2026-11-09"},
15
15
  "drag": {"value": 0.3, "unit": "N", "rule": "A pen's drag on paper, about, pulled sideways at the tip", "kind": "estimate", "source": "A hand guess from a pen on a spring scale: measure yours", "checked": "2026-11-09"},
16
- "shoulder_torque": {"value": 0.2, "unit": "N m", "rule": "What the shoulder must do at the task's speed and accel: the pen's drag at 240 mm, the arm's inertia and the bias", "kind": "estimate", "source": "Drag 0.07 N m + inertia about 0.03 N m + the rubber band's bias 0.1 N m", "checked": "2026-11-09"},
17
- "elbow_torque": {"value": 0.08, "unit": "N m", "rule": "What the elbow must do: the pen's drag at 110 mm, the forearm's inertia and the bias", "kind": "estimate", "source": "Drag 0.03 N m + inertia 0.01 N m + the rubber band's bias 0.04 N m", "checked": "2026-11-09"},
16
+ "shoulder_torque": {"value": 0.22, "unit": "N m", "rule": "What the shoulder must do at the task's speed and accel: the pen's drag at 242 mm, the arm's inertia and the bias", "kind": "estimate", "source": "Drag 0.3 N x 0.242 m = 0.073 N m + inertia 0.024 kg m2 (motor.accel's, with the 17HS4401 at the elbow) x 2.07 rad/s2 (500 mm/s2 at 242 mm) = 0.05 N m + the rubber band's bias 0.1 N m", "checked": "2026-11-22"},
17
+ "elbow_torque": {"value": 0.08, "unit": "N m", "rule": "What the elbow must do: the pen's drag at 115 mm, the forearm's inertia and the bias", "kind": "estimate", "source": "Drag 0.3 N x 0.115 m = 0.035 N m + inertia 0.0006 kg m2 (motor.accel's forearm) x 4.35 rad/s2 (500 mm/s2 at 115 mm) = 0.003 N m + the rubber band's bias 0.04 N m, 0.077 N m: the elbow's motor rides on the upper arm, so the change of motor leaves it", "checked": "2026-11-22"},
18
18
  "foot": {"value": 6, "unit": "mm", "rule": "The base plate's thickness", "kind": "default", "source": "Stiff enough for four M5 screws", "checked": "2026-11-09"},
19
19
  "room": {"value": 2, "unit": "mm", "rule": "Air between the shoulder motor's back and the base plate", "kind": "default", "source": "Design", "checked": "2026-11-09"},
20
20
  "motor17": {"value": 40, "unit": "mm", "rule": "The 17HS4401's body length", "kind": "community", "source": "nema17 variant 17HS4401 (https://market.samm.com/17hs4401-nema17-step-motor-en)", "checked": "2026-11-09"},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rulecad",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
4
4
  "description": "Start a rulecad project: npm create rulecad my-designs. A workspace with a soap tray to start from, ready to check, preview, export and share.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -275,6 +275,10 @@ EXAMPLES chapter 12 builds one from start to finish.
275
275
  State why the current is what it is: the torque it needs, the driver's rating without a heat sink, the motor's heat.
276
276
  - **Everything bought is an item.** Motors, drivers, bearings, switches, the supply: `bought` items and `wires` make the
277
277
  shopping list (`cad list`), the wiring sheet (`cad wires`) and the firmware's settings (`cad machine`) from one assembly.
278
+ Ask the person what they already have, and mark those items `"have": true`: `cad list` and the kit then list them as
279
+ in hand, apart from what is to buy. Design for the parts they have before asking them to buy others.
280
+ - **The supply sets the speed.** A stepper's torque at speed is worked out at the volts of the assembly's bought supply
281
+ (24 V where it has none): give the supply they will really use, and report `motor.torque` at that voltage.
278
282
  - Before moving anything: `cad plot` the drawing and watch the preview. It refuses a stroke that leaves the sheet.
279
283
  - **A gait is the same idea for a body.** Give an assembly a `gait` (`legs`, `pattern`, `stride`, `lift`, `period`, `height`, `mass`): the body at the world origin, the hips at z = 0, the feet as anchors. One leg on a stand is a gait of one leg (`"pattern": { "duty": 0.6, "phase": [0] }`). Anchor a round foot at its centre, so the contact rolls with the shin and the height stays true. Report a gait's numbers as they are: quasi-static, the torque from the weight alone, no dynamics.
280
284
  - **Say what the machine weighs.** A robot built from these parts is heavier than the first sizing said it was: list `cad list`'s grams and set the gait's `mass` to that, and report the torque margin at the real mass.