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.
circuit/system-diagram.tsx
import { systemblock } from "tscircuit"
/** Functional documentation only: these elements create no electrical nets. */
export function BoardSystemDiagrams({ linkToPcb = false } = {}) {
const refs = (...names: string[]) => linkToPcb ? { pcbComponentNames: names } : {}
return <>
<systemblock.page name="bldc_overview" displayName="BLDC controller — system overview" direction="down"
description="Hardware architecture. Motor firmware and protection thresholds still require commissioning. Orange: power; blue: control or measurement.">
<systemblock.component name="supply" displayName="USB-C PD supply" description="External power source" />
<systemblock.component name="computer" displayName="Computer" description="USB data and programming" />
<systemblock.group name="board" displayName="Controller PCB · 91 × 90 mm">
<systemblock.component name="power" displayName="Power input + protection" description="J19 · PD negotiation, fuse, reverse blocking and POWER switch" {...refs("J19","U1","F1","U11","U12","Q7","SW4")} />
<systemblock.component name="logic" displayName="3.3 V logic supply" description="U3 · regulator; data USB can supply logic" {...refs("U3","L1","D5")} />
<systemblock.component name="rp2040" displayName="RP2040 supervisor" description="U5 · commands, USB, screen and sensor readings" {...refs("U5","J1","U6")} />
<systemblock.component name="foc" displayName="MCF8329A" description="U7 · sensorless FOC and gate drive" {...refs("U7")} />
<systemblock.component name="bridge" displayName="Three-phase power stage" description="Q10–Q15 · six MOSFETs; R81 current shunt; C93–C96 bulk capacitors" {...refs("Q10","Q11","Q12","Q13","Q14","Q15","R81","C93","C94","C95","C96")} />
<systemblock.component name="ui" displayName="User controls + display" description="Speed dial, ARM, navigation buttons, J21 plug-in SSD1306 OLED and status LED" {...refs("RV1","SW3","SW5","SW6","SW7","SW8","J21","LED1")} />
<systemblock.component name="monitor" displayName="Monitoring + buzzer" description="TMP102 board temperature; voltage/current readings; audible alerts" {...refs("U13","U2","BZ1","Q8")} />
<systemblock.component name="encoderInput" displayName="J20 encoder / Hall input" description="Protected inputs to U5; one external sensor" {...refs("J20","U14","D9","F2")} />
<systemblock.component name="interlock" displayName="Hardware re-arm interlock" description="U15–U17 · OFF clears permission; a fresh physical ARM press restores it" {...refs("U15","U16","U17","Q9")} />
</systemblock.group>
<systemblock.component name="motor" displayName="BLDC motor" description="External · U/V/W motor leads" />
<systemblock.component name="encoder" displayName="Optional shaft encoder" description="AS5047P external sensor; mechanical mount remains a fit study" />
<systemblock.connection from="supply" to="power" label="USB-C PD" kind="power" />
<systemblock.connection from="power" to="logic" label="Logic input" kind="power" />
<systemblock.connection from="logic" to="rp2040" label="3.3 V" kind="power" />
<systemblock.connection from="power" to="bridge" label="Switched motor supply" kind="power" />
<systemblock.connection from="computer" to="rp2040" label="J1 · USB data" direction="both" />
<systemblock.connection from="rp2040" to="foc" label="I2C / speed / enable; status" direction="both" />
<systemblock.connection from="foc" to="bridge" label="Gate drive / current feedback" direction="both" />
<systemblock.connection from="bridge" to="motor" label="J10–J12 · U / V / W" kind="power" />
<systemblock.connection from="ui" to="rp2040" label="Controls / display" direction="both" />
<systemblock.connection from="monitor" to="rp2040" label="Measurements / buzzer" direction="both" />
<systemblock.connection from="encoder" to="encoderInput" label="A/B/Z or H1/H2/H3" />
<systemblock.connection from="encoderInput" to="rp2040" label="Motion measurement" />
<systemblock.connection from="interlock" to="foc" label="DRVOFF inhibit" />
</systemblock.page>
<systemblock.page name="encoder_feedback" displayName="What the encoder does" direction="right"
description="An encoder reports shaft movement. J20 is the connector, not the encoder. Its readings go to the RP2040; the MCF8329A still commutates sensorlessly.">
<systemblock.component name="shaft" displayName="Motor shaft turns" description="Mechanical rotation" />
<systemblock.component name="externalEncoder" displayName="External shaft encoder" description="A/B pulses show motion and direction; optional Z marks a reference turn" />
<systemblock.group name="feedbackBoard" displayName="On our PCB">
<systemblock.component name="j20" displayName="J20 · JST PH, 5 pins" description="1: 3V3 OUT · 2: GND · 3: A · 4: B · 5: Z" {...refs("J20")} />
<systemblock.component name="conditioning" displayName="U14 · SN74LVC3G17" description="ESD + RC filtering + Schmitt buffers; 0–3.3 V / 0–5 V signal inputs" {...refs("U14","D9","R160","R161","R162","C160","C161","C162")} />
<systemblock.component name="counter" displayName="U5 · RP2040" description="GP20=A · GP21=B · GP7=Z. Counts pulses to measure movement." {...refs("U5")} />
</systemblock.group>
<systemblock.component name="software" displayName="Readings in software" description="Slow manual-spin diagnostic exists. RPM display / high-speed control need firmware." />
<systemblock.connection from="shaft" to="externalEncoder" label="Mechanical coupling" />
<systemblock.connection from="externalEncoder" to="j20" label="Sensor cable" />
<systemblock.connection from="j20" to="conditioning" label="A / B / Z" />
<systemblock.connection from="conditioning" to="counter" label="3.3 V logic" />
<systemblock.connection from="counter" to="software" label="Count + direction" />
</systemblock.page>
<systemblock.page name="power_and_rearm" displayName="POWER OFF → ON: why ARM is required again" direction="right"
description="Intended hardware behavior; switch timing and brownout need bench tests. OFF clears permission. ON alone does not restore it. Release and press ARM again.">
<systemblock.component name="powerSwitch" displayName="SW4 · POWER switch" description="OFF: cuts motor supply and clears re-arm permission" {...refs("SW4")} />
<systemblock.component name="supervisor" displayName="U16 · voltage supervisor" description="Startup / low 3.3 V also clears permission" {...refs("U16")} />
<systemblock.component name="armButton" displayName="SW3 · physical ARM" description="A fresh press generates a clock edge through U17" {...refs("SW3","U17")} />
<systemblock.component name="latch" displayName="U15 · re-arm latch" description="Remembers permission until OFF or low supply resets it" {...refs("U15")} />
<systemblock.component name="gating" displayName="Driver-enable conditions" description="Latch permission + RP2040 enable + valid PD; Q5/Q6/Q9 gating" {...refs("Q5","Q6","Q9")} />
<systemblock.component name="mcuEnable" displayName="RP2040 + PD status" description="Can inhibit the motor independently" {...refs("U5","U1")} />
<systemblock.component name="driver" displayName="U7 · DRVOFF input" description="MCF8329A gate outputs remain disabled unless allowed" {...refs("U7")} />
<systemblock.connection from="powerSwitch" to="latch" label="OFF resets" />
<systemblock.connection from="supervisor" to="latch" label="Low supply resets" />
<systemblock.connection from="armButton" to="latch" label="Fresh press sets" />
<systemblock.connection from="latch" to="gating" label="Permission" />
<systemblock.connection from="mcuEnable" to="gating" label="Other enables" />
<systemblock.connection from="gating" to="driver" label="Enable / inhibit" />
</systemblock.page>
</>
}