Files
hexapod-robot/2026-current/hardware/main-pcb-2026-11-13/README.md
T
mangavalkandClaude Opus 5.5 91b5b99fd5 2026: OpenSCAD robot and remote, physical joint limits, model in Unity
hardware/openscad/ rebuilds the broken Fusion models as OpenSCAD:
body (top/bottom plate, standoffs, battery bay, switch), legs (coxa
bracket, femur link, tibia, horn adapters, TPU socks, servo cables),
the whole robot, and the remote (shell, lid, Nextion 3.5", JH-D400X-R4
sticks, 18650 UPS board, IMU, Teensy 4.0, USB-C breakout). Every part
was checked by slicing against the original STEP solids; the original's
bugs are fixed and listed in PLANNING.md.

The robot now uses a hexagon leg layout (corner legs 60 deg round from
the mid legs; the corner coxa brackets need turning on their splines).
Physical limits from a collision sweep of the model are in Config.h:
per-leg coxa limits and LEG_CLEARANCE_MM 56 (a leg is 55.2 mm wide at
the joints); the sim API exports them (version 7). sim_smoke passes.

Unity loads the model (export_unity.py -> Resources/OpenScadModel,
OpenScadModel.cs builds a new rig in place of the old scene's robot).
The PCB model's mounting holes now use the exact EasyEDA grid. README
shows renders of both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 12:14:32 +01:00

105 lines
6.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Main PCB (2026-11-13)
The PCB mounted inside the robot body, with the Teensy 3.6 peeking through
the hole in the top body. Teensy 3.6 carrier that distributes six servo
connectors (one per leg), an nRF24L01 radio, an MPU6050 IMU, a TO-252
regulator, a status LED and a 2-pin battery input.
## Files in this folder
| File | What it is |
|------|------------|
| `PCB_test_2026-11-13.json` | EasyEDA PCB source (editor v6.5.61). The authoritative board. |
| `OBJ_test.obj` + `.mtl` | EasyEDA 3D OBJ export. Just a slab shape with the four mounting holes; no components. Keep it because it round-trips with the EasyEDA source — but prefer `main-pcb.scad` for anything readable. |
| `main-pcb.scad` | Readable, parametric OpenSCAD model. Real board outline, 4 M3 mounting holes, and every major component as its own module on the correct side (see "Which side"). Component bodies have real-world dimensions; each module's local origin is the centre of its pad group so placements come straight from the pad bbox centres extracted from the EasyEDA JSON — no eyeballed positions. |
| `20190524_234512.jpg` | Photo of the **bottom** side: nRF24, IMU, 7805, ZENER, BATT JST and the six servo headers (JP1–JP6). |
| `20190524_234518.jpg` | Photo of the **top** side: Teensy 3.6 raised above the PCB on tall pin headers, USB powered, green POWER LED lit. |
| `top.png` | EasyEDA render of the **top** side (shows "Hexapod v1" title, spider silk, Teensy footprint, POWER + 510 Ω SMDs). |
| `bottom.png` | EasyEDA render of the **bottom** side (shows JP1–JP7 labels, NRF24L01, MPU, ZENER, 7805 footprints). This is the authoritative source for silkscreen names. |
## Which side each component is on
- **Top:** Teensy 3.6 (on 2×24 tall pin headers so it clears the IMU/radio underneath and pokes through the hole in the top body), POWER LED and its 511 Ω series resistor.
- **Bottom:** nRF24L01+ module (antenna hanging off the −Y board edge), GY-521 (MPU6050) IMU sitting directly under the Teensy, 7805 regulator, ZENER, 2-pin JST battery input, and the six servo headers JP1–JP6.
## Understanding the EasyEDA JSON
The JSON is EasyEDA's native PCB format: a `shape` array of tilde-separated
primitives. Here the board has **88** shape entries:
| Kind | Count | Field layout (after first `~`) |
|------|-------|--------------------------------|
| `TRACK` | 54 | width, layer, net, `x y x y …`, id, locked |
| `COPPERAREA` | 2 | id, layer, net, SVG path, … (one VCC pour, one GND pour) |
| `TEXT` | 9 | type, x, y, size, rotation, layer, …, string, path |
| `SVGNODE` | 1 | JSON of an SVG path (the 3D model placeholder) |
| `LIB` | 14 | x, y, `` package`NAME` ``, rotation, … (components) |
| `HOLE` | 4 | x, y, diameter (mm), id, locked |
| `VIA` | 4 | x, y, diameter, net, drill, id, locked |
**Layers** (`layers` key) follow EasyEDA's standard numbering: 1 TopLayer,
2 BottomLayer, 3/4 silk, 5/6 paste mask, 7/8 solder mask, 10 BoardOutline,
11 Multi-Layer, 13/14 assembly, 19 3DModel, Hole, DRCError.
### Units
Positions (and most sizes) are in **10-mil units = 0.254 mm**. The user
clearly laid out on a 1 mm grid: every component's x-offset from the
EasyEDA origin (4000, 3000) divides cleanly by 39.3700787 (10 mm per
10-mil unit). Hole and via **diameters** in this export are in millimetres
directly, which is standard EasyEDA practice.
### Coordinate frame
EasyEDA: +X right, +Y **down**, origin at `(4000, 3000)` (also the
top-left mounting hole). This OBJ export keeps the same X but flips Y to
negative.
`main-pcb.scad` uses +X right, +Y **up**, origin at the board's
**bottom-left corner**, so dimensions read the way you'd expect in CAD.
The conversion applied is:
```
x_mm = (x_eda - 3980.315) * 0.254
y_mm = (3330.7087 - y_eda) * 0.254
```
## Board summary
- Outline: 46.0 × 89.0 mm, black soldermask, 1.6 mm FR4 (the OBJ's 2.54 mm
"slab" is just the export; the physical board is standard).
- Four M3 clearance holes (⌀ 4 mm) at (5.00, 5.04), (40.78, 5.04),
(5.00, 84.00), (40.78, 84.00): hole grid 35.78 × 78.96 mm, centred at
(22.89, 44.52), slightly off the board centre (23, 44.5).
- Component placements (pad-group centres from the EasyEDA JSON — these
are the exact (x, y) the SCAD uses). All in mm from the board's
bottom-left corner.
| Component | Side | (x, y) mm | Notes |
|-----------|------|-----------|-------|
| Teensy 3.6 | top | (22.62, 44.79) | centre of 2×24 pin pattern; long axis along Y; USB at +Y, SD at −Y; raised 11 mm on tall headers |
| POWER LED (1206) | top | (33.00, 83.00) | |
| 510 Ω series resistor (2010) | top | (32.55, 78.72) | |
| "Hexapod v1" title silk | top | (6, 80.9) | top-silk text |
| nRF24L01+ | bottom | (28.00, 8.00) | header centre; module body + PCB antenna extend −Y and hang off the board edge |
| GY-521 (MPU6050) | bottom | (19.22, 44.73) | centre of 1×8 header; board extends +X; sits under the Teensy |
| 7805 regulator | bottom | (23.00, 79.00) | EasyEDA uses a `TO252` footprint but the physical board has a **through-hole 7805 in TO-220** bent flat into those pads |
| ZENER | bottom | (22.00, 67.00) | horizontal between its two pads |
| JP7 (2-pin JST, battery) | bottom | (15.00, 9.00) | |
| JP1 (5-pin JST-PH, servos) | bottom | ( 9.00, 69.00) | left column, top |
| JP2 | bottom | ( 9.00, 43.00) | left column, middle |
| JP3 | bottom | ( 9.00, 20.00) | left column, bottom |
| JP4 | bottom | (38.00, 69.00) | right column, top |
| JP5 | bottom | (38.00, 44.00) | right column, middle |
| JP6 | bottom | (38.00, 20.00) | right column, bottom |
Servo headers are 5-pin JST-PH footprints at **2.0 mm pitch** (total
span 8 mm), not 2.54 mm pin headers.
## Viewing
- OBJ: any 3D viewer (Fusion 360 will import it; `OBJ_test.mtl` sets a
dull-yellow material).
- SCAD: open `main-pcb.scad` in OpenSCAD; toggle `SHOW_COMPONENTS` and
`EXPLODE` to see parts lifted off the board.