ShiboSoftwareDev/usb-pd-dc-motor-controller

USB‑PD–powered 2A brushed-DC motor controller combining dual USB‑C ports, ESP32‑C3 control, CH224K PD negotiation, DRV8876 H‑bridge drive, protection/filtering, status RGB LED, and motor output.

Version
1.0.0
License
unset
Stars
0

Files

README.md

# USB-PD DC Motor Controller

A four-layer tscircuit board for one bidirectional brushed DC motor. The design follows the product-level USB-control approach of the [Pololu Jrk G2](https://www.pololu.com/docs/0J73/all), implemented around TI's [DRV8876](https://www.ti.com/product/DRV8876).

## Features

- Separate USB-C DATA and USB-C POWER connectors.
- ESP32-C3 native USB device interface.
- CH224K negotiates a 15 V USB-PD motor supply.
- DRV8876 PH/EN drive, direction control, current feedback, sleep, and fault reporting.
- Hardware motor-current trip set to about 2.0 A: `3.0 V / (1.5 kΩ × 1000 µA/A)`.
- Resettable 2 A input fuse, SS54 reverse-current block, 16 V bidirectional TVS, and 100 µF + 20 µF motor-rail storage.
- ESD-protected USB data, USB-C CC pull-downs, reset/boot buttons, RGB status LED, motor screw terminal, and four grounded mounting holes.
- 82 mm × 55 mm, four copper layers, 1.6 mm board.

The DATA connector powers the controller logic. The POWER connector powers only the motor rail after successful 15 V PD negotiation. Both connectors are required for normal USB-controlled operation.

## MCU signals

| ESP32-C3 pin | Function |
|---|---|
| GPIO18 / GPIO19 | USB D− / D+ |
| GPIO1 | Motor PWM/enable |
| GPIO2 | Motor direction |
| GPIO3 | Driver fault input |
| GPIO0 | Analog motor-current feedback |
| GPIO10 | Driver sleep/enable |
| GPIO7 | USB-PD power-good input |
| GPIO4 / GPIO5 / GPIO6 | RGB status LED |

## Verification

- `tsci build index.circuit.tsx`: pass, zero circuit/PCB error objects, 119 routed traces, no jumpers.
- `tsci check netlist`: 0 errors, 0 warnings.
- `tsci check source`: 0 errors, 0 warnings.
- `tsci check placement`: pass; placement summary reports no placement issues and 0 DRC errors.
- `tsci check shorts dist/index/circuit.json --mode gerber --layer all`: no shorts detected.
- Every populated component carries a JLCPCB/LCSC supplier code; all codes were live-stock checked on 2026-09-28.

The tscircuit checks validate the generated design data, not real-world thermal or EMC performance. Perform current-limited bring-up and load/temperature testing before production deployment.