imrishabh18/rp2040-motor-controller

This circuit incorporates a USB-C Power Delivery (PD) interface with a CH224K controller, a WJ500V-5.08-04P motor output connector, multiple power conditioning components including capacitors, resistors, diodes, and an RP2040 microcontroller, to manage motor control, signal routing, and power management for a USB-powered stepper motor system.

Version
1.0.14
License
unset
Stars
0

index.circuit.tsx

PCBPCB preview for index.circuit.tsx
SchematicSchematic preview for index.circuit.tsx
import { ControllerSections } from "./schematic/ControllerSections";
import {
	MotorDriverController,
	MotorDriverControlTraces,
	MotorDriverGroundTraces,
	MotorDriverPassives,
	MotorDriverPowerTraces,
	MotorDriverPrimaryGroundTraces,
	MotorDriverSenseAndControlTraces,
} from "./schematic/MotorDriverCoreSection";
import {
	MotorOutputConnectors,
	MotorOutputTraces,
} from "./schematic/MotorOutputsSection";
import {
	MotorPowerFilteringComponents,
	MotorPowerFilteringGroundTrace,
	MotorPowerFilteringSupplyTrace,
} from "./schematic/MotorPowerFilteringSection";
import {
	MotorPowerPdConnectorGroundTraces,
	MotorPowerPdControllers,
	MotorPowerPdInputTraces,
	MotorPowerPdPassives,
	MotorPowerPdPrimaryGroundTrace,
	MotorPowerPdProtocolTraces,
	MotorPowerPdSupportGroundTraces,
} from "./schematic/MotorPowerPdNegotiationSection";
import { SchematicSheets } from "./schematic/SchematicSheets";

export default function Rp2040MotorController({
	routingDisabled = false,
}: {
	routingDisabled?: boolean;
} = {}) {
	return (
    <board
      routingDisabled={routingDisabled}
			layers={2}
			outline={[
				{ x: -25, y: -25 },
				{ x: 25, y: -25 },
				{ x: 25, y: 24 },
				{ x: -25, y: 24 },
			]}
			minViaHoleDiameter="0.3mm"
      minViaPadDiameter="0.45mm"
			autorouterEffortLevel="10x"
			autorouterVersion="beta_pipeline7"
			autorouter={{
				local: true,
				groupMode: "subcircuit",
			}}
		>
			<net name="GND" />
			<SchematicSheets />

			<group pcbX={-5.625} pcbY={-8.25}>
				<ControllerSections />
				<MotorDriverController />
				<MotorPowerPdControllers />
				<MotorOutputConnectors />
				<MotorPowerFilteringComponents />
				<MotorPowerPdPassives />
				<MotorDriverPassives />

				<MotorDriverControlTraces />
				<MotorPowerPdInputTraces />
				<MotorPowerFilteringSupplyTrace />
				<MotorPowerPdProtocolTraces />
				<MotorDriverPowerTraces />
				<MotorDriverPrimaryGroundTraces />
				<MotorPowerPdPrimaryGroundTrace />
				<MotorPowerPdConnectorGroundTraces />
				<MotorPowerFilteringGroundTrace />
				<MotorPowerPdSupportGroundTraces />
				<MotorDriverGroundTraces />
				<MotorOutputTraces />
				<MotorDriverSenseAndControlTraces />
			</group>

			<copperpour
				name="GND_TOP"
				layer="top"
				connectsTo="net.GND"
				clearance="0.2mm"
				padMargin="0.2mm"
				traceMargin="0.2mm"
				boardEdgeMargin="0.3mm"
				coveredWithSolderMask
			/>
			<copperpour
				name="GND_BOTTOM"
				layer="bottom"
				connectsTo="net.GND"
				clearance="0.2mm"
				padMargin="0.2mm"
				traceMargin="0.2mm"
				boardEdgeMargin="0.3mm"
				coveredWithSolderMask
			/>

			<group pcbX={-5.625} pcbY={-8.25}>
				<hole diameter="3.2mm" pcbX={-16.375} pcbY={28.75} />
				<hole diameter="3.2mm" pcbX={27.625} pcbY={28.75} />
				<hole diameter="3.2mm" pcbX={-16.375} pcbY={-13.75} />
				<hole diameter="3.2mm" pcbX={27.625} pcbY={-13.75} />

				<silkscreentext
					text="RP2040 STEPPER CONTROLLER"
					fontSize="1.2mm"
					pcbX={5.625}
					pcbY={30.5}
				/>
				<silkscreentext
					text="USB-C PD MOTOR"
					fontSize="0.8mm"
					pcbX={14}
					pcbY={25}
				/>
				<silkscreentext
					text="REQUESTS 9V"
					fontSize="0.8mm"
					pcbX={5}
					pcbY={23}
				/>
				<silkscreentext
					text="STEPPER MOTOR"
					fontSize="0.8mm"
					pcbX={26}
					pcbY={13.5}
				/>
				<silkscreentext text="A+" fontSize="0.8mm" pcbX={26.5} pcbY={-6.6} />
				<silkscreentext text="A-" fontSize="0.8mm" pcbX={26.5} pcbY={-1.5} />
				<silkscreentext text="B+" fontSize="0.8mm" pcbX={26.5} pcbY={3.5} />
				<silkscreentext text="B-" fontSize="0.8mm" pcbX={26.5} pcbY={8.6} />
			</group>
		</board>
	);
}