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.
docs/oled154-design.md
# ER-OLED015-2W display and enclosure design
> The current main project includes the newer [30 November power-margin revision](oled-power-margin-revision.md). Its current BOM and calculations supersede the historical component values and margin figures below.
This is the accepted 1.54-inch display design promoted into the main controller. It remains an engineering prototype, without manufacturing signoff. The external encoder, J20 position, speed dial, side POWER lever and 91 × 90 mm board outline stay in their original positions.
The BuyDisplay ER-OLED015-2W uses native I²C (SSD1309, address 0x3C). No I²C-to-SPI bridge is used. Its glass is 42.04 × 27.22 × 1.45 mm, with a 35.052 × 17.516 mm active area. The manufacturer's 36 ± 0.5 mm stock flex is modeled at its nominal length; no extension cable is invented. Original drawings are in `docs/oled154-reference`.
## Screen door — 30 November 2026 (supersedes the lid-mounted retainer below)
The panel, its pocket and its rear retainer now sit in a removable screen door in the lid, held by two M2 × 4 screws from the top into M2 × 3 lid inserts. The lid is closed first and the stock flex is mated to J21 from above through the door opening. The door and lid are relieved in front of the glass edge so the flex, which leaves between the two glass sheets, is no longer creased at its bond. Details, assembly order and open checks are in [the enclosure notes](../enclosure/README.md). Where the sections below say the retainer fastens into the lid or that no fastener is on the top face, read "screen door" and "two door screws".
## Mechanical arrangement
The glass surface is 0.8 mm below the existing flat roof. The original 5.8 mm PCB supports, 2.4 mm base floor, mounting hardware and 28.6 mm exterior height are retained. The panel is offset 7 mm left of the case centre so its folded connector clears the unchanged rear motor sockets. The active area is centred in a shallow chamfered opening; no fastener passes through the top face near the display.
A locating pocket and ledge are integral to the lid. Two 1 × 16 mm compliant strips support the inactive glass edges at the front; matching strips bear against the thin rear frame. The installed strip thickness is 0.20 mm, not a specified uncompressed foam thickness. Compression, creep and glass loading require a physical sample.
Two M2 × 4 screws enter upward through the rear frame into M2 × 3 blind lid inserts. Fit the inserts before the glass. With the PCB removed, seat the panel and padding, attach the retainer, then mate the ribbon and install the PCB/base. Do not pull an assembled lid away with the ribbon still connected. Tool access is checked with the PCB removed; a repeatable ribbon installation/disconnection procedure remains to be proven physically.
ARM, UP, DOWN, OK, BACK, RESET and BOOT share one row at y=27.5 mm. ARM is amber; navigation and service caps are dark grey. RESET and BOOT sit slightly below protective rims but remain finger-operable (superseded on 1 December 2026 by paperclip pinholes; see `../enclosure/README.md`). The enclosure has no fine engraved text; `panel-sticker.svg` provides 1:1 artwork and a magenta cutting guide. Print at 100% and check the stated sheet dimensions before cutting.
## Original base and mounting hardware restored
The original flat floor at z=-6.6 leaves **5.8 mm** below the PCB. Its thickness is **2.4 mm**, the exterior underside remains at z=-9 and case height stays **28.6 mm**. The raised-floor experiment and pin-relief pockets are removed. The original floor gives 2.05 mm clearance below the allowance-expanded motor socket leads; no leads are trimmed.
Four original **M3 × 5.7 mm inserts and M3 × 8 mm PCB screws** are retained with the original 4.2 mm pilot and 7.0 mm boss diameters. Insert tops remain at z=-1.1 and bottoms at -6.8. Their blind holes end at -7.7, leaving 0.9 mm below each insert and 1.3 mm plastic to the underside. Screw tips end at -7.2, retaining 0.5 mm bottom clearance and full 5.7 mm engagement. The complete screw and bore-floor solids are checked independently. M2 inserts/screws and case-closure seats remain unchanged. Printed pilot fit, insert retention and tightening force still require a sample.
J20 remains in its original PCB position. The opening is 28.4 mm wide × 9.4 mm high (z=-0.6–8.8), replacing the original 17 × 19.45 mm opening (z=-6.45–13). The extra width admits side grip. Top clearance above the modeled housing falls from 6.73 to 2.53 mm. Two 8 mm distal finger probes and two 12 mm exterior pad envelopes clear the enclosure, PCB and nearby components. The continuous insertion/removal envelope passes with 0.5 mm housing allowance. A base tongue covers the cavity below the connector. These are geometry checks, not proof of easy unplugging or comfortable grip; test a real PHR-5 plug in a print and pull the housing rather than wires.
The eight large top cooling slots are removed. Existing underside slots and the four buzzer sound openings remain. Loaded thermal testing at the intended motor current, duty cycle and ambient temperature is required before deciding that the removed slots are unnecessary. Motor-driver thermal limits depend on losses, loading and thermal paths; see [TI, Understanding Motor Driver Current Ratings](https://www.ti.com/lit/an/slva505a/slva505a.pdf). This is a closed-top visual/fit trial, not a sealed or thermally qualified enclosure.
## 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. `enclosure/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.
## Electrical changes — updated 27 November 2026
The promoted circuit uses separate logic and display supplies, an isolated 3300 µF logic reservoir, upstream power-fault detection, a resettable TCA9538 expander at 0x70, and a TCA9517 I²C isolator. U18 remains TLV61046A; its feedback divider is now 4.02 kΩ / 274 Ω (0.1%). J21 is the Molex 5034802400 / C122434 dual-contact candidate.
Firmware preloads the active-low power request OFF, checks the expander state, initializes the display and only then enables the boost. Faults require fresh initialization. The diagnostic uses the common DISPLAY OFF / boost-disable helper. The supervisor can disable boost without running firmware; physical rail timing still needs oscilloscope measurements.
See [the current shutdown/connector review](oled-shutdown-trial.md) for exact connections, calculations, source documents and open qualifications. The original TCA9536/0x41 driver must not be used with this revision.
## Outstanding supplier/hardware qualifications
- Molex 5034802400 / C122434 matches the 24 contacts, 0.5 mm pitch, contact length and thickness. The screen’s 12.5 ± 0.2 mm tip width exceeds the connector’s recommended tolerance; physical mating/retention and the conflicting supplier CAD remain unresolved.
- The two nominal 1.5 mm flex bends are clearance studies. The panel drawing does not state a minimum permitted bend radius. Inspect the actual reinforced/bonded root and verify bend life and insertion retention.
- The panel has stock-flex tolerance; the nominal 36 mm path is not a tolerance-qualified assembly. Do not stretch the flex to match the illustration.
- Qualify the converter's voltage under load, inductor saturation/transients, output capacitance after DC bias, supply current, startup/shutdown and brownout sequencing.
- Confirm factory sourcing/assembly acceptance and perform physical printing/fit, enclosure thermal testing and motor bring-up before manufacture. See the validation record below for completed software checks.
## Historical review before the hardware correction — 27 November 2026
The following records the earlier ER-CON24HB-1 / TCA9536 circuit. It is superseded by [the promoted revision](oled-shutdown-trial.md), and is retained to explain why the hardware changed.
The document/netlist review is complete; physical qualification is not. Details,
source references, an unsent supplier question and oscilloscope test conditions
are recorded in [the review record](oled-power-contact-review.json). No PCB or
enclosure geometry was changed by this review.
BuyDisplay's live ER-OLED015-2W page links **ER-CON24HT-1 (top contact)**. Our
folded assembly uses **ER-CON24HB-1 (bottom contact)**. The page does not establish
approval for the HB variant. Do not simply substitute HT without rechecking
which side of the folded ribbon contacts the connector and its pin numbering.
| Dimension | Panel flex drawing | HB recommended flex drawing |
| --- | --- | --- |
| Contacts / pitch | 24 / 0.5 mm | 24 / 0.5 mm |
| Exposed contact length | 3 ± 0.3 mm | 4 mm |
| Finished tip thickness | 0.30 ± 0.03 mm | 0.30 ± 0.01 mm |
| Tip width | 12.5 ± 0.2 mm | 12.5 ± 0.05 mm |
These differences do not prove a nominal sample will fail, but the stated
tolerance ranges do not establish a reliable mating pair. Obtain exact-pair
supplier confirmation/updated drawings and validate insertion, retention and
all contacts on representative samples. No supplier message has been sent.
**Abrupt power-loss ordering is not enforced by the current circuit.** The
compiled netlist confirms that U20 resets the OLED only; its output is separate
from U18 EN. U21 P0 can remain high without firmware, while U19's logic supply
follows V3V3 with no isolated hold-up or delayed turn-off. The converter's input
UVLO and input/output isolation do not establish VCC-before-VDD ordering.
Panel datasheet section 4.2 specifies display OFF, VCC disable/discharge and a
100 ms delay before VDD removal. It also requires the disabled VCC supply to
float and prohibits pulling either supply directly to ground. The board has
20.1 µF nominal on VCC and 5.9 µF nominal on VDD. The existing 157 kΩ feedback
divider alone gives a 3.16 s nominal RC constant; actual OLED loading, capacitor
derating and IC paths determine the real discharge. This calculation is not a
measured or simulated shutdown waveform.
The recommended correction is early hardware inhibition of the boost together
with isolated logic hold-up/delayed VDD removal sized against the measured VCC
discharge and required delay. Reset alone, firmware delay or an unqualified
capacitor increase is insufficient. Verify both rails under last-source unplug,
brownout and processor/bus failure before marking shutdown qualified.
All **17 focused OLED host tests pass**, including runtime PD loss and Ctrl-C.
Those tests establish software behavior; no board, scope or physical cable
sample was available for this review.
## Review outputs
`enclosure/dist` contains the regenerated main-project preview, six STL designs and independent solid/clearance reports. Production builds retain the routed-PCB input guards. A passing mechanical report establishes modeled clearance only; it does not certify ribbon compatibility or electrical operation.
## Historical passive selections before the hardware correction
Exact catalog entries are recorded in `circuit/assembly-parts.json`; catalog listing is not an assembly order or stock guarantee. C183/C187 use [Samsung CL31A106KAHNNNE, C9807](https://www.lcsc.com/product-detail/C9807.html), 10 µF / 25 V X5R 1206. R180 uses [0603WAF9103T5E, C23263](https://www.lcsc.com/product-detail/C23263.html), 910 kΩ / 1%. R181/R182 use [RT0603BRD07147KL, C861129](https://www.lcsc.com/product-detail/C861129.html) and [RT0603BRD0710KL, C95204](https://www.lcsc.com/product-detail/C95204.html), both 0.1%. Existing reviewed 100 nF, 4.7 µF and 1 kΩ choices are reused. Verify effective capacitance under DC bias and supplier availability before ordering.
## Historical validation record before the hardware correction
The complete local PCB build (`bun run build:pcb`) passes with zero native PCB errors. The exported PCB geometry is identical to the independently audited PCB-only native build. Physical copper union reports no disconnected nets or floating groups; all 106 power-width/parallel-via paths pass. The JLC geometry preflight has no findings, missing MPNs or undersized silkscreen text. Kelvin isolation, USB reference-plane checks and the existing gate-loop limits pass. No unused single-layer vias remain. This is geometric/software validation, not a current, thermal or factory-acceptance rating.
TypeScript and all 68 firmware tests pass. The six printable designs are watertight single solids. The current modeled assembly passes 11,168 explicit fit checks. The regenerated 3MF contains eleven printable instances; it carries geometry only, without a printer profile. `oled154-validation.json` records hashes and scope.
The schematic placement analyzer retains five heuristic messages: four assume the parallel D1/R4 and D7/R141 networks are series pairs, and one groups C186/C188/C189 merely because they share V3V3. Those three bypass capacitors are intentionally drawn beside their separate boost, logic-regulator and reset functions. J21's former box-width warning was fixed. The PCB placement analyzer reports zero errors and an inward-facing FPC connector advisory: this internal connector is assembled with the PCB/lid accessible, not plugged from a board edge. Native non-45-degree routing advisories remain; copper clearance and continuity were checked separately. No PCB DRC rule or project acceptance limit was relaxed.
The accepted trial was promoted to the main project on 27 November 2026. Production outputs are regenerated and checked before publication.