imrishabh18/nema-23-stepper-controller
A 4-layer NEMA23 stepper motor controller PCB combining an RP2040, DRV8462 dual-phase driver, USB-C/28V power protection, current/voltage/temperature sensing, alarms, and optional magnetic encoder.
- Version
- 1.4.27
- License
- unset
- Stars
- 1
system-drawing.tsx
import { systemblock } from "tscircuit";
export function SystemDrawing() {
return <>
<systemblock.page name="system-overview" displayName="NEMA 23 stepper controller" direction="right">
<systemblock.group name="usb-ports" displayName="USB-C ports">
<systemblock.component name="pwr" displayName="PWR + DATA" description="J_USB_POWER carries motor power and USB data" />
<systemblock.component name="data" displayName="DATA" description="J_USB carries USB data and 5 V logic power" />
</systemblock.group>
<systemblock.component name="usb-mux" displayName="USB data switch" description="Powered DATA port takes priority" />
<systemblock.component name="logic-supply" displayName="Logic supply" description="Either USB port feeds the 3.3 V rail" />
<systemblock.component name="controller" displayName="RP2040" description="Firmware, motion commands, and telemetry" />
<systemblock.component name="pd" displayName="USB-PD controller" description="CH224A requests 28 V over CC" />
<systemblock.component name="fuse" displayName="Input fuse" description="F1 feeds motor and logic branches" />
<systemblock.component name="motor-supply" displayName="Motor supply protection"
description="TPS26632 eFuse, reverse-current diode, and TVS" />
<systemblock.component name="driver" displayName="DRV8462 stepper driver" description="Regulates current in both motor phases" />
<systemblock.component name="motor-terminal" displayName="Spring clamp" description="Four motor leads on J_MOTOR" />
<systemblock.component name="motor" displayName="NEMA 23 stepper" description="Two-phase bipolar motor" />
<systemblock.connection from="pwr" to="pd" label="CC1 / CC2" direction="both" />
<systemblock.connection from="pwr" to="fuse" label="VBUS" kind="power" />
<systemblock.connection from="fuse" to="motor-supply" label="Fused VBUS" kind="power" />
<systemblock.connection from="fuse" to="logic-supply" label="Fused VBUS" kind="power" />
<systemblock.connection from="data" to="logic-supply" label="5 V" kind="power" />
<systemblock.connection from="pwr" to="usb-mux" label="D+ / D−" direction="both" />
<systemblock.connection from="data" to="usb-mux" label="D+ / D−" direction="both" />
<systemblock.connection from="usb-mux" to="controller" label="USB Full Speed" direction="both" />
<systemblock.connection from="logic-supply" to="controller" label="3.3 V" kind="power" />
<systemblock.connection from="controller" to="driver" label="STEP / DIR / SPI" direction="both" />
<systemblock.connection from="motor-supply" to="driver" label="Protected VM" kind="power" />
<systemblock.connection from="driver" to="motor-terminal" label="A+ / A− / B+ / B−" kind="power" />
<systemblock.connection from="motor-terminal" to="motor" kind="power" />
</systemblock.page>
<systemblock.page name="protection-and-feedback" displayName="Motor protection and feedback" direction="right">
<systemblock.component name="efuse" displayName="TPS26632 eFuse" description="Switches and protects the motor supply" />
<systemblock.component name="vm" displayName="Protected motor rail" description="After D_REVERSE, with TVS and bulk capacitor" />
<systemblock.component name="vm-adc" displayName="INA226 voltage ADC" description="Measures VM through a 20 kΩ / 10 kΩ divider" />
<systemblock.component name="temperature" displayName="TMP102 temperature sensor" description="Reads PCB temperature and signals an alert" />
<systemblock.component name="interlock" displayName="Hardware enable gate" description="Requires firmware ARM and TEMP_OK" />
<systemblock.component name="controller" displayName="RP2040" description="Arms power and reads sensor and fault signals" />
<systemblock.component name="phase-sense" displayName="Phase current sense" description="Two 10 mΩ shunts and INA240 amplifiers" />
<systemblock.component name="encoder" displayName="AS5600 shaft encoder" description="Optional bottom-side sensor, DNP in assembly" />
<systemblock.component name="driver" displayName="DRV8462 stepper driver" description="The hardware gate can inhibit motor drive" />
<systemblock.connection from="efuse" to="vm" label="VSWITCHED" kind="power" />
<systemblock.connection from="vm" to="vm-adc" label="VM sample" />
<systemblock.connection from="vm-adc" to="controller" label="I²C · 0x40" direction="both" />
<systemblock.connection from="temperature" to="controller" label="I²C · 0x48" direction="both" />
<systemblock.connection from="phase-sense" to="controller" label="ADC A / B" />
<systemblock.connection from="encoder" to="controller" label="I²C" direction="both" />
<systemblock.connection from="efuse" to="controller" label="Power fault / arm" direction="both" />
<systemblock.connection from="efuse" to="interlock" label="PGOOD" />
<systemblock.connection from="temperature" to="interlock" label="ALERT" />
<systemblock.connection from="controller" to="interlock" label="ARM" />
<systemblock.connection from="interlock" to="driver" label="ENABLE_SAFE" />
</systemblock.page>
</>;
}