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/oled-shutdown-trial.md
# OLED shutdown and connector revision — 27 November 2026
> 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.
The isolated-power trial has been promoted to main at the user’s request on 27 November 2026. It remains an engineering prototype, not a qualified production release. The newer MCF8329A application and commissioning safeguards in main are retained.
## JLC sourcing correction (local, 27 November 2026)
C191 was incorrectly selected without a JLC assembly identifier. It is now Honor GVL0J332M1213 / **C52711639**, 3300 µF / 6.3 V. The JLC catalog lookup returned 128 available parts at the time of review; inventory can change and no stock was reserved. R182 and R185 retain their exact existing manufacturer parts, now mapped to **C705754** and **C137014**. Their stock was not supplied by the catalog lookup and must be checked for the order quantity.
The manufacturer’s recommended C191 pads replace the earlier custom Nichicon lands. The catalog footprint’s 6.0 × 1.75 mm pads differ from the manufacturer’s diameter-12.5 recommendation; the board uses the manufacturer’s 5.7 × 3.0 mm lands with a 4.0 mm inner gap. Pin 1 remains positive. One ground via was moved 0.475 mm away from the wider pad; all component pin-to-net connections remain unchanged.
All 252 populated board components now have JLC identifiers in the compiled source-component records. `check:jlc-sourcing` is included in `build:pcb` to reject missing identifiers. This checks BOM mapping, not catalog stock or full electrical qualification. The native DRC and all eight independent PCB audit groups pass. Existing CLI placement bounding-box advisories and schematic style advisories remain; the actual polygon courtyard check reports no collisions.
The GVL sheet gives the same ±20% initial tolerance and ±30% endurance capacitance change used in the model. Its 20 °C leakage ceiling is 0.2079 mA, within the assumed total 2.5 mA held load. The additional 10% reflow reduction and 14.5 mm mechanical height envelope are conservative project assumptions, not supplier guarantees. Abrupt-power-loss waveforms and the ribbon fit still require physical qualification. The old release records below describe earlier validation and are retained for provenance.
## Main promotion validation
The fresh main PCB build matches the source trial's PCB records exactly. Main's 90 firmware tests, 13 assembly tests, 194 expected pin connections, type check and all eight PCB audit groups pass. The native placement DRC has zero errors; the heuristic C191 bounding-box and schematic style suggestions remain documented below. The fresh enclosure check has the same one unresolved ribbon/connector-CAD interference out of 11,951 checks. All six printable STL geometries are byte-identical to the previous main version; its existing print assets and original provenance are retained. New motor firmware and enclosure controls/inserts remain unchanged.
These results do not certify physical ribbon fit, supply waveforms or assembly procurement. The current release evidence is in `dist/oled-shutdown-release/`. Registry builds now disable supplier auto-fetch, matching `build:pcb`, to retain the authored imports and verified part assignments.
## Validation of the source trial before promotion
- Local `build:pcb`: completed successfully; the built circuit has no embedded errors. Its 7,247 PCB records exactly match the independently checked candidate.
- Native routing check: PASS, 2,205 traces and 888 vias; zero native errors. Source-symbol metadata and trace-angle warnings remain in the report.
- Independent copper checks: zero disconnected nets, floating copper groups or foreign-copper clearance findings. Width, USB-reference geometry, pad-anchor and retained motor-gate routing checks pass.
- Independent component/pin check: 194 expected pin connections pass. This is not an electrical operation test.
- Firmware: all 81 unit tests pass, including OLED initialization, reset and diagnostic-shutdown scenarios.
- Mechanical: 11,951 checks over 252 modeled components; one failed check remains, the nominal ribbon versus supplier connector-CAD interference described below. The capacitor/lid and button-guide conflicts are resolved.
- Main isolation: all 3,934 baseline source files are unchanged.
The figures above describe the source trial, not a fresh main build. Promotion validation is recorded in `dist/oled-shutdown-release/`. The local PCB build is in `dist/pcb/` and main preview is in `enclosure/dist/`. These files are for review, not authorization to manufacture. Physical sequencing, actual ribbon fit, assembly-house footprint acceptance and sourcing remain open.
## What changes
The screen still uses native I²C. There is no SPI bridge. U21 is an I²C GPIO expander used to make the display-power request reset safely; U23 is an I²C bus buffer used to isolate a powered screen from an unpowered MCU.
The panel logic runs from a separate 3 V rail. U19, R185, U22 and C191 charge and isolate that rail. U20 watches the upstream 3.3 V supply while running from the stored energy. On a power fault it resets the panel, resets U21 and disables U23. Reset makes U21's pins inputs; Q16's bias then turns off the boost converter even if the MCU has stopped. U24 prevents startup until the reservoir is charged. Recovery does not restore the old power request: firmware must initialize the panel again.
The TLV61046A provides output isolation in shutdown. Its feedback divider also provides a discharge path. No transistor hard-clamps the panel supply to ground, because the panel's instructions prohibit that. The reset signal sets the controller to display-off; it does not by itself disconnect the high-voltage supply.
| Function | Trial parts |
|---|---|
| Display supply | U18 TLV61046ADBVR, L2 10 µH; R181 4.02 kΩ / R182 274 Ω, both 0.1% |
| Logic supply and charging | U19 TLV70030DDCR; R185 10 Ω, 1 W, 2512 |
| Reverse blocking | U22 LM66100DCKR, CE connected to VOUT for ideal-diode operation |
| Stored energy | C191 Honor GVL0J332M1213, 3300 µF / 6.3 V, JLC C52711639 |
| Upstream fault detector | U20 TPS3808G33DBVR; CT through 100 kΩ to its held supply |
| Reservoir readiness | U24 TPS3808G30DBVR, CT open |
| Resettable power request | U21 TCA9538PWR at 0x70; Q16 MMBT3906LT1G |
| Bus isolation | U23 TCA9517DGKR; A side held, B side upstream |
| Replacement socket candidate | J21 Molex 5034802400, 24 contacts at 0.5 mm pitch plus two solder anchors |
U21 P1–P7 are grounded and must remain inputs. Firmware writes configuration 0xFE only: P0 is the sole output. P0 high or input means OFF; low means ON. Tests cover reset during initialization and during normal operation. The diagnostic uses the same shutdown routine as the driver.
## Calculated power margins and their limits
Run `python3 scripts/check-oled-power-budget.py` for the explicit assumptions and results in `.tscircuit/checks/oled-power-budget.json`.
- The feedback network and reference tolerances give approximately 12.12–12.80 V.
- The Honor GVL 3300 µF reservoir calculation applies −20% initial tolerance, an extra assumed −10% reflow allowance, and −30% endurance change, leaving 1663 µF in the model. GVL does not specify that 10% reflow allowance; hot/cold capacitance and leakage still need measurement. Its specified leakage after two minutes at 20 °C is at most 0.2079 mA (0.01CV), included in the assumed 2.5 mA held-load ceiling.
- At an **assumed, unmeasured 2.5 mA held load**, it provides about 578 ms from the conservative fault-start voltage down to 1.8 V.
- A lumped RC estimate reaches 0.1 V in about 401 ms. Adding 100 ms leaves about 77 ms model margin. This is **not a measurement of the panel's VCC waveform**.
- Worst-case reservoir-ready headroom is only about 17 mV at a 2 mA startup load. Actual startup load and temperature matter; this needs a bench check.
- R185's calculated initial peak is about 0.986 W. Check its pulse capability, temperature derating and the LDO's current-limited startup on hardware.
The screen datasheet contains internal VDD/VCC ESD-diode behavior and requires the display supply to be removed before logic power. Its wording about disabled/floating VCC and its timing diagram reaching 0 V cannot be reduced to this RC model. Supplier interpretation and measured waveforms are still required. C191 does not establish compliance by itself.
## Connector verification
Rechecked on 27 November 2026 against Molex's currently published sales drawing, SD-503480-001 revision J1 (released 10 April 2024; the bundled tape drawing is dated April 2025). The width restriction remains in this revision, note 10. The replacement is still **not qualified for the screen's full specified ribbon-width range**.
| J21 version | Manufacturer part | JLCPCB / LCSC number | Catalog verification |
|---|---|---|---|
| Before promotion | BuyDisplay / EastRising ER-CON24HB-1, bottom contact | No verified C-number | No supplier number in the original import; exact JLC catalog search returned no results |
| Candidate; promoted to main | Molex 5034802400, dual contact | C122434 | `tsci search C122434 --jlcpcb --json` returned manufacturer part 5034802400, 24 pins, 0.5 mm pitch, 0.3 mm FPC, dual contacts |
The catalog result identifies the part; it does not establish current inventory or ribbon compatibility. Its stock field was null. The old socket drawing recommended 4 mm exposed contacts, versus the screen's 3 ± 0.3 mm; the Molex candidate meets that length requirement and supports contacts on either side. Neither fact overrides the width qualification below.
Molex specifies dual contact, so this candidate does not rely on choosing a top-only or bottom-only contact socket. The drawing's insertion depth is **1.58 mm**; the 1.87 mm dimension is the open actuator height.
| Ribbon feature | Screen drawing | Molex drawing | Finding |
|---|---|---|---|
| Positions / pitch | 24 / 0.5 mm | 24 / 0.5 mm | Match |
| Exposed contacts | 3 ± 0.3 mm | 2 mm minimum | Fits the length requirement |
| Total contact-end thickness | 0.30 ± 0.03 mm | 0.30 ± 0.05 mm for this pin count | Within range |
| Stiffener length | 4.5 ± 0.5 mm | 3 mm minimum | Meets minimum |
| Overall FPC width | 12.5 ± 0.2 mm | Recommended 12.5 ± 0.05 mm, with an insertion-check note above 12.52 mm | **Not established across the screen's full tolerance** |
In plain terms, the screen drawing permits ribbon widths from 12.30 to 12.70 mm; the socket's recommended ribbon width is 12.45 to 12.55 mm. The nominal 12.50 mm values agree, but their full allowed ranges do not. This does not prove a particular sample will fail; it prevents an unconditional fit claim. Written approval for this exact pair (including width tolerance) or measured sample mating/continuity tests is still needed. A single successful sample would qualify that sample, not every possible unit across the wider tolerance.
The imported supplier CAD has an apparent 12.0 mm internal slot and intersects the nominal 12.5 mm ribbon model. This conflicts with the manufacturer's recommended FPC width. The CAD might be simplified, but that is not proof of fit. The enclosure checker intentionally reports this interference rather than hiding it. An authoritative mating model or sample is needed. Do not force, trim or modify the screen ribbon to make it fit.
The PCB footprint now matches the candidate socket's 24 signal lands and two anchors; the mechanical ribbon endpoint was updated for the drawing's insertion depth. Pin 1 orientation was checked against the folded-ribbon model. The nominal 1.5 mm bend radius is a layout assumption, **not a manufacturer-approved bend radius**. Molex specifies only 10 mating cycles for this part, so repeated trial insertion is not an endurance test.
## Mechanical and assembly constraints
The capacitor was moved above the button guides. The check retains a conservative 14.5 mm height envelope for the replacement’s 13.5 mm nominal height, plus base dimensions and clearance allowances. That allowance is not a claim about supplier dimensional tolerances. The revised reservoir clears the current lid and controls in those checks. Existing enclosure inserts, control positions and USB access geometry are preserved.
C191 now uses Honor GVL’s recommended diameter-12.5 mm solder lands (PDF page 6): 5.7 × 3.0 mm pads with a 4.0 mm inner gap, positive on pin 1. These differ from the EasyEDA library. R182 and R185 now have verified JLC catalog identifiers for the exact existing manufacturer parts: C705754 and C137014. The local BOM check requires a JLC identifier for every populated PCB component. A catalog identifier does not guarantee stock; recheck availability for the requested assembly quantity. Assembly export tooling also needs its legacy 30-pin display assumptions updated before a production package is prepared.
The CLI placement heuristic reports three C191 bounding-box overlaps. Its envelope combines the capacitor's narrow, long terminal lands with the full body height, filling the empty corners of the actual cross-shaped courtyard. The native courtyard check and independent polygon check use the real outlines. Those three warnings are recorded, not removed from the report. Existing orientation suggestions based on unrouted straight-line connections are also retained. The schematic checker flags the sparse left side of U21 despite the nine pins requiring its full height on the right; its Q16 emitter-to-ground path traverses a bypass capacitor, while the compiled emitter net is OLED_VDD. These heuristics do not change the electrical netlist.
## Required prototype checks
1. With the motor disconnected, measure upstream V3V3, OLED_VDD, OLED_VCC, OLED_RESET_N and OLED_POWER_EN. Check cold startup, normal shutdown, abrupt USB removal, slow input decay, short interruptions and rapid reconnect. Repeat with both USB ports and relevant power-switch states.
2. Confirm boost enable drops on a fault without any firmware response. Confirm it stays off after recovery until fresh initialization. Measure the panel-supply discharge and the required logic hold time against the manufacturer's shutdown requirement, including VCOMH and internal backfeed effects.
3. Measure held-rail current, leakage and startup current across operating temperature. Validate the 2.5 mA hold-load ceiling, readiness threshold margin, R185 temperature and LDO startup. Check boost stability using the actual capacitors under DC bias.
4. Obtain BuyDisplay/Molex confirmation for the exact ribbon/socket pair, or measure and test samples. Check insertion, latch closure, every contact's continuity, pin numbering and withdrawal without stressing the OLED glass. Confirm the permitted static bend radius and service access.
5. Print the holder/lid and test the maximum-height capacitor, ribbon bend, screwdriver access and simultaneous cable fit. Rendering does not establish manufacturing tolerance or insertion force.
## Primary references
- [BuyDisplay ER-OLED015-2 screen](https://www.buydisplay.com/i2c-1-5-inch-oled-display-serial-128x64-module-ssd1309-white-on-black); local screen drawing: `docs/oled154-reference/ER-OLED015-2_Series_Datasheet.pdf`, power sequence on PDF page 16.
- [Molex 5034802400 specifications](https://www.molex.com/en-us/products/part-detail/5034802400) and [sales drawing](https://www.molex.com/content/dam/molex/molex-dot-com/products/automated/en-us/salesdrawingpdf/503/503480/5034802400_sd.pdf).
- [TI TLV61046A](https://www.ti.com/lit/ds/symlink/tlv61046a.pdf), [TPS3808](https://www.ti.com/lit/ds/symlink/tps3808.pdf), [LM66100](https://www.ti.com/lit/ds/symlink/lm66100.pdf), [TCA9538](https://www.ti.com/lit/ds/symlink/tca9538.pdf), [TCA9517](https://www.ti.com/lit/ds/symlink/tca9517.pdf).
- [Honor GVL0J332M1213 / C52711639](https://jlcpcb.com/partdetail/HonorElec-3300uF_20_63V/C52711639), local manufacturer PDF `docs/oled154-reference/jlc-replacement/C52711639.pdf`; [onsemi MMBT3906](https://www.onsemi.com/pdf/datasheet/mmbt3906lt1-d.pdf).