MustafaMulla29/rp2040-bldc-motor-controller
Hardware assembly metadata and PCB geometry for a controller board with a snap-off rotary-encoder section, plus four parallel 150 µF/50 V bulk electrolytic capacitors filtering the motor supply.
- Version
- 2.0.40
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone MustafaMulla29/rp2040-bldc-motor-controller # download the package files into ./rp2040-bldc-motor-controller
tsci add MustafaMulla29/rp2040-bldc-motor-controller # add it to your project as @tsci/MustafaMulla29.rp2040-bldc-motor-controllerIn a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.
enclosure/README.md
# 1.54-inch OLED enclosure — original base and hardware
Open `http://127.0.0.1:4188/` (`PORT=4188 bun serve.ts`). This is the main-project enclosure, promoted from the accepted trial.
The original 5.8 mm PCB supports and 2.4 mm flat base floor are restored. The exterior underside is z=-9, the floor surface is z=-6.6 and total case height is **28.6 mm**. The experimental raised floor and six pin-relief pockets have been removed. The original floor provides 2.05 mm clearance beneath the longest modeled solder tails after dimensional allowances. The roof, board, screen, encoder and control positions stay fixed.
## Original hardware retained
| Use | Quantity | Hardware |
| --- | ---: | --- |
| PCB inserts | 4 | Original M3 × 5.7 mm inserts, 4.6 mm OD |
| PCB screws | 4 | Original M3 × 8 mm, head envelope ≤5.6 mm diameter × 3 mm high |
| Case closure | 4 each | Original M2 × 3 mm inserts and M2 × 4 mm screws |
| Display retainer | 2 each | Original M2 × 3 mm inserts and M2 × 4 mm screws |
| Screen door | 2 each | Same M2 × 3 mm inserts and M2 × 4 mm screws, fitted from the top |
The original 4.2 mm PCB insert pilot diameter and 7 mm support diameter are restored. Insert tops sit 0.3 mm below the support surface. The blind bore ends at z=-7.7, leaving 1.3 mm plastic below it and 0.9 mm below the insert. M3 × 8 screws engage the full 5.7 mm insert and retain 0.5 mm clearance at the blind-hole bottom. No replacement hardware is required. Printed pilot fit and insert retention still need a sample.
Use **Base & posts** to see the original base and insert bores separately from the PCB/lid.
## Screen door — 30 November 2026
The display, its locating pocket, the 0.6 mm window ledge and the two blind retainer inserts are now in a separate **screen door** that drops into the lid from above. The lid itself only has a bevelled opening and two insert bosses. This fixes two assembly problems of the lid-mounted display:
- **Mating the flex.** The PCB screws enter from the top, so the board is fixed to the base before the lid goes on. With the display in the lid, the stock 36 mm flex let the lid sit only about 11 mm above closed, with J21 hidden under the display. The lid now closes first and the flex is mated through the 51 × 32 mm opening, with J21 directly below.
- **Flex crease at the glass edge.** The datasheet side view shows the flex bonded between the two glass sheets, about 0.7 mm above the rear face. The old pocket wall faced the glass edge 0.25 mm away at that height. The door and the lid are now relieved for 4 mm in front of the glass edge across the flex width, so the modeled flex leaves straight for 1.4 mm and bends at 2 mm radius.
Geometry: the door outline widens by 1 mm over a 45° seat (roof underside to mid-thickness), so it lowers straight in and cannot pass through. Two 1 mm tabs overlap the lid at (-51.3, 62.3) and (11.8, 37.5) mm; each sits in a 1 mm lid recess above a Ø5.4 mm insert boss. Screws are M2 × 4 pan head into M2 × 3 inserts, 2.9 mm engaged; heads stand 1.3 mm above the lid. Sites were chosen clear of the SPEED knob, the buttons and the J11 motor terminal; no hooks are used, so the door also separates in a straight line.
Assembly order: fit the two lid inserts from the top; screw the PCB to the base; close the lid with its four M2 screws; fit glass, pads and retainer to the door on the bench; mate the flex to J21 through the opening and close the latch; lower the door and fasten its two screws; press on the SPEED knob. To open: knob (optional), two door screws, lift the door, unplug the flex, then the lid.
Status: modeled only. A reduced set of 72 solid checks passes and the updated `verify.py` runs with only the already-recorded connector-CAD failure, but that run used stand-in component heights because the published package lacks `assembly/` and `reference-models/`. Rerun `enclosure:build` and `enclosure:verify` in the full workspace, then `enclosure:export`. The released STL/3MF files in `assets/enclosure` are still the previous one-piece lid. The baked flex in `assets/connected-system.glb` still follows the earlier path. Printed fit of the seat, the 1 mm tabs and lid steps, insert retention and actual flex routing need a first print with a real panel. The top sticker needs a cut line around the door.
## Mounting flanges — 2 December 2026
The base now has a mounting flange on two opposite sides: the POWER / USB side and the encoder side. This follows review feedback that the case had no flanges. The pattern is the one used on Hammond's 1591 flanged boxes: a flange on two opposite ends with four screw holes in all.
- Each flange is the floor plate carried on 13 mm past the side wall, 2.4 mm thick and flush with the underside, so the base still prints flat without supports. The base is now 130.4 × 103.4 mm; the lid, the top face and every control stay where they were.
- Four 4.5 mm holes, two per flange, at X = -71.2 and 46.2 mm, Y = -26 and 63 mm (board coordinates): a 117.4 × 89 mm pattern. They take M4 or No. 8 pan-head screws with a washer up to 9 mm. The plate is too thin to countersink.
- The holes sit near the corners, clear of the USB opening, the POWER thumb pocket and the encoder opening. A 9 mm washer is 3.5 mm from the USB opening along the wall and 2 mm from the side wall.
- The flange top is 5 mm below the USB opening, 6.6 mm below the POWER pocket and 6 mm below the encoder opening, so cables and fingers work above it, as they would above a desk.
`verify.py` adds 42 checks for the flanges (screw passage, washer support, head clearance to lid and base, edge distances, clearance to the side openings). In the sandbox run they all pass; the run's only failure is the connector-CAD item already recorded above, and it again used stand-in component heights.
Drawings BLDC-ENC-01 and BLDC-ENC-02 are at revision E, 2 December 2026; the general arrangement shows the 130.4 mm overall width.
Modelled only. Not printed. The hole size and the 2.4 mm plate are a first choice: do not over-tighten the screws, and check stiffness on a first print. The print files in `assets/enclosure` are still the earlier set without flanges. `export-3mf.py` places the base and lid further apart for the wider base.
## BOOT and RESET pinholes — 1 December 2026
BOOT (SW1) and RESET (SW2) no longer have caps or raised rims. Each sits behind a 2 mm hole in the lid and is pressed with a straightened paperclip, the way a router's reset button is. This follows review feedback that asked for the common pattern for rarely used buttons. The board is unchanged.
- Each hole has a 0.5 mm, 45° lead-in at the top face (3 mm across) and passes through a solid 6 mm guide under the roof.
- The guide ends at z=11.3, 1 mm above the switch plunger (z=10.3), so it steers the wire onto the plunger without touching it. With the lid seated 0.15 mm low the gap is still 0.85 mm.
- A 0.9 mm wire leaning as far as the hole allows stays 0.43 mm inside the edge of the 3.2 mm plunger, with the plunger fully pressed.
- The lid top is flat at z=19.6: the two 1.1 mm rims are gone. The two service caps are no longer printed, so the print set is ten pieces, not twelve.
- Labels: RESET and BOOT are printed in smaller lettering just above each hole. The SERVICE word and its bracket are removed.
To load firmware onto a board that does not respond: hold BOOT with one paperclip, tap RESET with a second one, then release BOOT. Holding BOOT while the board is first powered does the same with one hand.
Drawings BLDC-ENC-01 (three sheets) and BLDC-ENC-02 (exploded view) went to revision D, 1 December 2026, for this change (now revision E, see above); section B-B on sheet 2 cuts through both pinholes and their guides.
Modelled only. `verify.py` adds a paperclip path, guide clearance and landing check for each hole. Not printed or tried: a printed 2 mm hole usually comes out a little under size, so check that the wire passes before closing the case.
## Shared USB access recess — 27 November 2026
The enclosure replaces the two 11 mm USB slots and their centre divider with one **26.5 × 8.4 mm** throat. A **1 mm-deep sloped entrance** opens to 28.5 × 10.4 mm at the exterior. The lower wall is a continuous base tongue; the existing PCB, port centres, 5.8 mm supports, M3 hardware and 28.6 mm case height are unchanged. Both base and lid STL files must be updated together.
The previous clearance check incorrectly used 10.4 mm-wide bodies. `verify_usb.py` now loads the actual exported 12 × 6 mm overmold meshes. Shells and strain reliefs use conservative measured outer bounds because their GLB meshes contain open seams. The report checks fitted bodies, continuous 25 mm straight withdrawal paths with 0.2 mm allowance per side, simultaneous fit, PCB/component clearance and external top/bottom grip envelopes. It retains 0.5 mm nominal between the two bodies (0.1 mm after the per-body allowances). Both bodies previously intersected the case by 11.4105 mm³; the new geometry has zero nominal body/case intersection.
These cable models are representative, not a specified purchased cable. The unchanged 12.5 mm socket spacing does not support arbitrary bulky overmolds. Confirm the chosen cables and first print before claiming easy plugging/unplugging. A wider opening alone cannot increase the spacing between the cable heads.
Use **USB ports** in the preview, then toggle **Show USB cables** to inspect the empty recess or fitted plugs.
## Diagonal display-retainer mounts — 27 November 2026
With the flex exit at the bottom, the two mounting ears are now **upper-left and lower-right**. The left screw/insert moves from (-43.5, 39) to (-43.5, 61) mm; the right stays at (4.5, 39) mm. The lid has matching blind bosses. The lower-left screw hole and boss are removed. M2 × 4 underside screws, M2 × 3 inserts, padded side rails, panel height and stock ribbon path remain unchanged. The upper-right alternative was rejected because its screw head overlaps the J11 motor-terminal clearance envelope.
The regenerated assembly passes the existing glass, component, holder/lid, screw and underside-tool-access checks. Native accessory assembly records change only the left insert and screw position. These are clearance checks; printed-frame stiffness, screw torque and glass/pad loading still require a sample. Use the updated lid and holder together.
## Encoder access
The fixed J20 connector uses a 28.4 × 9.4 mm side opening. Its upper edge drops from z=13 to z=8.8, leaving 2.53 mm above the nominal mating housing. Side grip space replaces the oversized top/bottom gap. The area below z=-0.6 mm is closed by the base tongue. The continuous plug withdrawal envelope, 0.5 mm housing allowance, two 8 mm distal finger envelopes and 12 mm exterior finger-pad envelopes pass CAD checks. These probes establish modeled access only; a real plug/print is needed to confirm comfortable grip and removal force. Pull the plug housing, not the wires.
The screen remains 0.8 mm below the roof, now in the removable screen door, with its retainer screws entering from underneath the door. Use **Screen holder** or **Lid underside** to inspect it. The exploded view shows parts after unplugging the ribbon, not flex motion.
The eight lid cooling slots are removed; the underside slots and four buzzer sound slots remain. Loaded thermal testing is still required. See `../docs/oled154-design.md` for the remaining ribbon, connector and electrical qualifications.
Print quantities: base ×1, lid ×1, screen door ×1, button cap ×5, speed knob ×1, screen holder ×1. Panel lettering is currently omitted from the 3D assembly and enclosure preview, so hiding the lid leaves no floating label artwork. The separate 2D artwork is retained for future printing: 104.4 × 103.4 mm at 100%; magenta lines are cutting guides, not printed artwork. The 3MF contains geometry without a printer profile. These are prototype parts, not manufacturing-approved files.