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

dist/index.js

import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
import { Microcontroller_RP2040 } from '@tscircuit/common';
import objPath from '././assets/WJ500V_5_08_04P_14_00A-da39a3ee.obj';
import stepPath from '././assets/WJ500V_5_08_04P_14_00A-6a37b78f.step';

const logicTrace = { thickness: "0.15mm" };
const powerTrace = { thickness: "0.8mm" };
const groundTrace = { thickness: "0.3mm" };
const motorTrace = { thickness: "1mm" };
const schematicSheets = {
    controller: "controller",
    programming: "controller_programming",
    motorDriver: "motor_driver",
    motorPower: "motor_power",
};
const schematicSections = {
    driverCore: "motor_driver_core",
    motorOutputs: "motor_driver_outputs",
    pdNegotiation: "motor_power_pd_negotiation",
    pdFiltering: "motor_power_filtering",
};

/**
 * @tscircuit/common owns the RP2040 controller, clock, debug, and programming
 * sub-sections, so they remain one reusable controller subsystem here.
 */
const ControllerSections = () => (jsx(Microcontroller_RP2040, { name: "MCU", autorouter: "auto_local", autorouterVersion: "beta_pipeline7", autorouterEffortLevel: "10x", schAutoLayoutEnabled: true, schSheetName: schematicSheets.controller, pcbX: -9.5, schX: -3.1, schY: 8.5 }));

const pinLabels$4 = {
    pin1: ["nSleep"],
    pin2: ["AOUT1"],
    pin3: ["AISEN"],
    pin4: ["AOUT2"],
    pin5: ["BOUT2"],
    pin6: ["BISEN"],
    pin7: ["BOUT1"],
    pin8: ["nFault"],
    pin9: ["BIN1"],
    pin10: ["BIN2"],
    pin11: ["TRQ"],
    pin12: ["VM"],
    pin13: ["GND1"],
    pin14: ["MODE"],
    pin15: ["AIN2"],
    pin16: ["AIN1"],
    pin17: ["GND2"],
};
const DRV8847PWPR = (props) => {
    return (jsx("chip", { pinLabels: pinLabels$4, pinAttributes: {
            VM: { requiresPower: true },
            GND1: { requiresGround: true },
            GND2: { requiresGround: true },
            nFault: { canUseOpenDrain: true, needsExternalPullup: true },
            nSleep: { needsExternalPulldown: true },
        }, supplierPartNumbers: {
            jlcpcb: ["C544361"],
        }, manufacturerPartNumber: "DRV8847PWPR", footprint: jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin1"], pcbX: "-2.275078mm", pcbY: "-2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin2"], pcbX: "-1.625092mm", pcbY: "-2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin3"], pcbX: "-0.975106mm", pcbY: "-2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin4"], pcbX: "-0.324866mm", pcbY: "-2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin5"], pcbX: "0.32512mm", pcbY: "-2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin6"], pcbX: "0.975106mm", pcbY: "-2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin7"], pcbX: "1.625092mm", pcbY: "-2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin8"], pcbX: "2.275078mm", pcbY: "-2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin16"], pcbX: "-2.275078mm", pcbY: "2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin15"], pcbX: "-1.625092mm", pcbY: "2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin14"], pcbX: "-0.975106mm", pcbY: "2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin13"], pcbX: "-0.324866mm", pcbY: "2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin12"], pcbX: "0.32512mm", pcbY: "2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin11"], pcbX: "0.975106mm", pcbY: "2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin10"], pcbX: "1.625092mm", pcbY: "2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin9"], pcbX: "2.275078mm", pcbY: "2.850007mm", width: "0.350012mm", height: "1.2999974mm", radius: "0.175006mm", shape: "pill" }), jsx("smtpad", { portHints: ["pin17"], pcbX: "0mm", pcbY: "0mm", width: "2.7399996mm", height: "2.7399996mm", shape: "rect" }), jsx("platedhole", { portHints: ["pin17"], pcbX: "0.500126mm", pcbY: "0.499872mm", outerDiameter: "0.6096mm", holeDiameter: "0.3048mm", shape: "circle" }), jsx("platedhole", { portHints: ["pin17"], pcbX: "-0.499872mm", pcbY: "0.499872mm", outerDiameter: "0.6096mm", holeDiameter: "0.3048mm", shape: "circle" }), jsx("platedhole", { portHints: ["pin17"], pcbX: "-0.499872mm", pcbY: "-0.500126mm", outerDiameter: "0.6096mm", holeDiameter: "0.3048mm", shape: "circle" }), jsx("platedhole", { portHints: ["pin17"], pcbX: "0.500126mm", pcbY: "-0.500126mm", outerDiameter: "0.6096mm", holeDiameter: "0.3048mm", shape: "circle" }), jsx("silkscreenpath", { route: [
                        { x: 2.499994999999899, y: 2.100910200000044 },
                        { x: 2.499994999999899, y: -2.1009101999999302 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.5400000000000773, y: -2.1397722000000385 },
                        { x: -2.5400000000000773, y: -0.3810000000000855 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.5400000000000773, y: 2.1397722000000385 },
                        { x: -2.5400000000000773, y: 0.3809999999999718 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 1.9337273999999525, y: -2.1999955999999656 },
                        { x: 1.9664425999999366, y: -2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 1.2837413999998262, y: -2.1999955999999656 },
                        { x: 1.3164565999998104, y: -2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 0.6337554000000409, y: -2.1999955999999656 },
                        { x: 0.6664706000000251, y: -2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -0.01623060000008536, y: -2.1999955999999656 },
                        { x: 0.01648459999989882, y: -2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -0.6664706000000251, y: -2.1999955999999656 },
                        { x: -0.6335014000000001, y: -2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -1.316456599999924, y: -2.1999955999999656 },
                        { x: -1.2837413999999399, y: -2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -1.9664426000000503, y: -2.1999955999999656 },
                        { x: -1.9337274000000662, y: -2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 1.9337273999999525, y: 2.1999955999999656 },
                        { x: 1.9664425999999366, y: 2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 1.2837413999998262, y: 2.1999955999999656 },
                        { x: 1.3164565999998104, y: 2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 0.6337554000000409, y: 2.1999955999999656 },
                        { x: 0.6664706000000251, y: 2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -0.01623060000008536, y: 2.1999955999999656 },
                        { x: 0.01648459999989882, y: 2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -0.6664706000000251, y: 2.1999955999999656 },
                        { x: -0.6335014000000001, y: 2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -1.316456599999924, y: 2.1999955999999656 },
                        { x: -1.2837413999999399, y: 2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -1.9664426000000503, y: 2.1999955999999656 },
                        { x: -1.9337274000000662, y: 2.1999955999999656 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -1.8818860000001223, y: -1.6509999999999536 },
                        { x: -1.887001010512563, y: -1.6898523621364347 },
                        { x: -1.9019974625363147, y: -1.7260570000000826 },
                        { x: -1.9258533726489304, y: -1.7571466273510623 },
                        { x: -1.9569430000000239, y: -1.781002537463678 },
                        { x: -1.993147637863558, y: -1.7959989894875434 },
                        { x: -2.032000000000039, y: -1.8011139999998704 },
                        { x: -2.070852362136634, y: -1.7959989894875434 },
                        { x: -2.107057000000168, y: -1.781002537463678 },
                        { x: -2.138146627351034, y: -1.7571466273510623 },
                        { x: -2.16200253746365, y: -1.7260570000000826 },
                        { x: -2.176998989487629, y: -1.6898523621364347 },
                        { x: -2.1821140000000696, y: -1.6509999999999536 },
                        { x: -2.176998989487629, y: -1.6121476378633588 },
                        { x: -2.16200253746365, y: -1.5759429999998247 },
                        { x: -2.138146627351034, y: -1.5448533726489586 },
                        { x: -2.107057000000168, y: -1.520997462536343 },
                        { x: -2.070852362136634, y: -1.5060010105123638 },
                        { x: -2.032000000000039, y: -1.5008860000000368 },
                        { x: -1.993147637863558, y: -1.5060010105123638 },
                        { x: -1.9569430000000239, y: -1.520997462536343 },
                        { x: -1.9258533726489304, y: -1.5448533726489586 },
                        { x: -1.9019974625363147, y: -1.5759429999998247 },
                        { x: -1.887001010512563, y: -1.6121476378633588 },
                        { x: -1.8818860000001223, y: -1.6509999999999536 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.7487879999999905, y: -2.8595319999999447 },
                        { x: -2.753903010512545, y: -2.898384362136426 },
                        { x: -2.7688994625364103, y: -2.93458899999996 },
                        { x: -2.792755372649026, y: -2.9656786273510534 },
                        { x: -2.8238450000000057, y: -2.989534537463669 },
                        { x: -2.860049637863426, y: -3.004530989487421 },
                        { x: -2.8989020000001346, y: -3.0096459999998615 },
                        { x: -2.937754362136502, y: -3.004530989487421 },
                        { x: -2.973959000000036, y: -2.989534537463669 },
                        { x: -3.0050486273511297, y: -2.9656786273510534 },
                        { x: -3.0289045374637453, y: -2.93458899999996 },
                        { x: -3.043900989487497, y: -2.898384362136426 },
                        { x: -3.0490159999999378, y: -2.8595319999999447 },
                        { x: -3.043900989487497, y: -2.82067963786335 },
                        { x: -3.0289045374637453, y: -2.7844749999999294 },
                        { x: -3.0050486273511297, y: -2.753385372648836 },
                        { x: -2.973959000000036, y: -2.7295294625362203 },
                        { x: -2.937754362136502, y: -2.7145330105124685 },
                        { x: -2.8989020000001346, y: -2.709417999999914 },
                        { x: -2.860049637863426, y: -2.7145330105124685 },
                        { x: -2.8238450000000057, y: -2.7295294625362203 },
                        { x: -2.792755372649026, y: -2.753385372648836 },
                        { x: -2.7688994625364103, y: -2.7844749999999294 },
                        { x: -2.753903010512545, y: -2.82067963786335 },
                        { x: -2.7487879999999905, y: -2.8595319999999447 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.5400000000000773, y: -0.3810000000000855 },
                        { x: -2.7639461811234014, y: -0.308235474856815 },
                        { x: -2.902352532708619, y: -0.11773547485677227 },
                        { x: -2.902352532708619, y: 0.11773547485688596 },
                        { x: -2.7639461811234014, y: 0.3082354748569287 },
                        { x: -2.5400000000000773, y: 0.3809999999999718 },
                    ] }), jsx("silkscreentext", { text: "{NAME}", pcbX: "-0.2794mm", pcbY: "4.3274mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [
                        { x: -3.298000000000002, y: 3.5774000000000115 },
                        { x: 2.7392000000000962, y: 3.5774000000000115 },
                        { x: 2.7392000000000962, y: -3.983799999999974 },
                        { x: -3.298000000000002, y: -3.983799999999974 },
                        { x: -3.298000000000002, y: 3.5774000000000115 },
                    ] })] }), cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C50506.obj?uuid=534f03d8fe164fbab551f91e5a792e30",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C50506.step?uuid=534f03d8fe164fbab551f91e5a792e30",
            pcbRotationOffset: 90,
            modelOriginPosition: { x: 0, y: 0, z: -0.019205 },
        }, ...props }));
};

const pinLabels$3 = {
    pin1: ["gate"],
    pin2: ["source"],
    pin3: ["drain"],
};
const BSS84 = (props) => (jsx("chip", { pinLabels: pinLabels$3, footprint: "sot23", supplierPartNumbers: { jlcpcb: ["C85202"] }, manufacturerPartNumber: "BSS84-7-F", ...props }));

const MotorDriverController = () => (jsx(Fragment, { children: jsx(DRV8847PWPR, { name: "DRIVER", pcbX: 9.5, pcbY: -2.5, schX: -5.5, schY: 0, schWidth: 3.8, schHeight: 4.6, schMarginLeft: 1, schMarginRight: 1, schPinArrangement: {
            leftSide: {
                pins: [2, 3, 4, 7, 6, 5],
                direction: "top-to-bottom",
            },
            rightSide: {
                pins: [16, 15, 9, 10, 1, 8],
                direction: "top-to-bottom",
            },
            topSide: {
                pins: [12],
                direction: "left-to-right",
            },
            bottomSide: {
                pins: [13, 17],
                direction: "left-to-right",
            },
        }, schPinStyle: {
            pin7: { marginTop: 0.45 },
            pin9: { marginTop: 0.45 },
            pin1: { marginTop: 0.45 },
        }, schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.driverCore }) }));
const MotorDriverPassives = () => (jsxs(Fragment, { children: [jsx("capacitor", { name: "C_VM_BULK", capacitance: "10uF", footprint: "1206", supplierPartNumbers: { jlcpcb: ["C77093"] }, manufacturerPartNumber: "GRM31CR71E106KA12L", pcbX: 14.5, pcbY: 5, maxDecouplingTraceLength: 7.5, schX: -1.2, schY: -3.5, schMarginX: 0.15, schMarginY: 0.25, schOrientation: "vertical", schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.driverCore }), jsx("capacitor", { name: "C_VM_HF", capacitance: "100nF", footprint: "0603", supplierPartNumbers: { jlcpcb: ["C14663"] }, pcbX: 7.8, pcbY: 4.2, maxDecouplingTraceLength: 5.5, schX: -1.2, schY: -1.5, schMarginX: 0.15, schMarginY: 0.25, schOrientation: "vertical", schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.driverCore }), jsx("resistor", { name: "R_ISEN_A", resistance: "0.15", footprint: "2512", supplierPartNumbers: { jlcpcb: ["C2903485"] }, manufacturerPartNumber: "HoJLR2512-3W-150mR-1%", pcbX: 6, pcbY: -10.5, schX: -10, schY: 1.5, schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.driverCore }), jsx("resistor", { name: "R_ISEN_B", resistance: "0.15", footprint: "2512", supplierPartNumbers: { jlcpcb: ["C2903485"] }, manufacturerPartNumber: "HoJLR2512-3W-150mR-1%", pcbX: 14, pcbY: -10.5, schX: -10, schY: -1.5, schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.driverCore }), jsx("resistor", { name: "R_SLEEP_PD", resistance: "100k", footprint: "0402", supplierPartNumbers: { jlcpcb: ["C25741"] }, pcbX: 4.5, pcbY: -5, schX: -8, schY: -4.5, schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.driverCore }), jsx("resistor", { name: "R_FAULT_PU", resistance: "10k", footprint: "0402", supplierPartNumbers: { jlcpcb: ["C25744"] }, manufacturerPartNumber: "0402WGF1002TCE", pcbX: 2.5, pcbY: -4.5, schX: -8, schY: -7, schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.driverCore }), jsx(BSS84, { name: "Q_PD_ENABLE", pcbX: 3.7, pcbY: -2, schX: -12, schY: -3, schWidth: 1.6, schHeight: 1.8, schPinArrangement: {
                leftSide: { pins: [1], direction: "top-to-bottom" },
                rightSide: { pins: [2, 3], direction: "top-to-bottom" },
            }, schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.driverCore }), jsx("resistor", { name: "R_PD_ENABLE_PU", resistance: "100k", footprint: "0402", supplierPartNumbers: { jlcpcb: ["C25741"] }, pcbX: 3, pcbY: 0.5, schX: -10, schY: -3, schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.driverCore })] }));
const MotorDriverControlTraces = () => (jsxs(Fragment, { children: [jsx("trace", { name: "DRIVER_AIN1", from: ".MCU > .U1 > .GPIO18", to: ".DRIVER > .AIN1", ...logicTrace }), jsx("trace", { name: "DRIVER_AIN2", from: ".MCU > .U1 > .GPIO19", to: ".DRIVER > .AIN2", ...logicTrace }), jsx("trace", { name: "DRIVER_BIN1", from: ".MCU > .U1 > .GPIO20", to: ".DRIVER > .BIN1", ...logicTrace }), jsx("trace", { name: "DRIVER_BIN2", from: ".MCU > .U1 > .GPIO21", to: ".DRIVER > .BIN2", routingPhaseIndex: -1, ...logicTrace }), jsx("trace", { name: "DRIVER_SLEEP", from: ".MCU > .U1 > .GPIO22", to: ".Q_PD_ENABLE > .source", ...logicTrace }), jsx("trace", { name: "DRIVER_FAULT", 
            // Reserve the complete MCU/pull-up/driver fault route before power routing.
            routingPhaseIndex: -2, from: ".MCU > .U1 > .GPIO23", to: ".DRIVER > .nFault", thickness: "0.1mm" })] }));
const MotorDriverPowerTraces = () => (jsxs(Fragment, { children: [jsx("trace", { name: "VM_BULK", from: ".DRIVER > .VM", to: ".C_VM_BULK > .pin1", schDisplayLabel: "VMOTOR", ...powerTrace }), jsx("trace", { name: "VM_HF", from: ".DRIVER > .VM", to: ".C_VM_HF > .pin1", ...powerTrace })] }));
const MotorDriverPrimaryGroundTraces = () => (jsxs(Fragment, { children: [jsx("trace", { name: "BOARD_GND_JOIN", from: ".DRIVER > .GND2", to: "net.GND", ...powerTrace }), jsx("trace", { name: "COMMON_GND", from: ".DRIVER > .GND2", to: ".MCU > .U1 > .GND", ...groundTrace }), jsx("trace", { name: "DRIVER_GND_JOIN", from: ".DRIVER > .GND1", to: ".DRIVER > .GND2", ...groundTrace })] }));
const MotorDriverGroundTraces = () => (jsxs(Fragment, { children: [jsx("trace", { name: "ISEN_A_GND", from: ".R_ISEN_A > .pin2", to: "net.GND", ...groundTrace }), jsx("trace", { name: "ISEN_B_GND", from: ".R_ISEN_B > .pin2", to: "net.GND", ...groundTrace }), jsx("trace", { name: "VM_BULK_GND", from: ".C_VM_BULK > .pin2", to: "net.GND", ...groundTrace }), jsx("trace", { name: "VM_HF_GND", from: ".C_VM_HF > .pin2", to: "net.GND", ...groundTrace }), jsx("trace", { name: "SLEEP_PULLDOWN_GND", from: ".R_SLEEP_PD > .pin2", to: "net.GND", ...logicTrace })] }));
const MotorDriverSenseAndControlTraces = () => (jsxs(Fragment, { children: [jsx("via", { name: "ISEN_B_ESCAPE", pcbX: 10.275, pcbY: -4.5, holeDiameter: "0.3mm", outerDiameter: "0.45mm", fromLayer: "top", toLayer: "bottom", connectsTo: [".DRIVER > .BISEN", ".R_ISEN_B > .pin1", ".ISEN_B_ESCAPE > .top", ".ISEN_B_ESCAPE > .bottom"] }), jsx("trace", { name: "ISEN_B_ESCAPE_TRACE", from: ".DRIVER > .BISEN", to: ".ISEN_B_ESCAPE > .top", thickness: "0.2mm", pcbPath: [".ISEN_B_ESCAPE > .top"] }), jsx("trace", { name: "ISEN_A", from: ".DRIVER > .AISEN", to: ".R_ISEN_A > .pin1", schDisplayLabel: "A_ISEN", ...powerTrace }), jsx("trace", { name: "ISEN_B", from: ".ISEN_B_ESCAPE > .bottom", to: ".R_ISEN_B > .pin1", schDisplayLabel: "B_ISEN", ...powerTrace }), jsx("trace", { name: "DRIVER_MODE", from: ".DRIVER > .MODE", to: "net.GND", ...logicTrace }), jsx("trace", { name: "DRIVER_TRQ", from: ".DRIVER > .TRQ", to: "net.GND", ...logicTrace }), jsx("trace", { name: "PD_ENABLE_OUTPUT", from: ".Q_PD_ENABLE > .drain", to: ".DRIVER > .nSleep", ...logicTrace }), jsx("trace", { name: "PD_ENABLE_GATE", from: ".Q_PD_ENABLE > .gate", to: ".U_PD > .PG", schDisplayLabel: "PD_GOOD", ...logicTrace }), jsx("trace", { name: "PD_ENABLE_GATE_PULLUP", from: ".R_PD_ENABLE_PU > .pin1", to: ".Q_PD_ENABLE > .gate", ...logicTrace }), jsx("trace", { name: "PD_ENABLE_PULLUP_SUPPLY", from: ".R_PD_ENABLE_PU > .pin2", to: ".U_PD > .VDD", ...logicTrace }), jsx("trace", { name: "SLEEP_PULLDOWN", from: ".R_SLEEP_PD > .pin1", to: ".DRIVER > .nSleep", schDisplayLabel: "nSLEEP", ...logicTrace }), jsx("trace", { name: "FAULT_PULLUP", routingPhaseIndex: -2, from: ".R_FAULT_PU > .pin1", to: ".DRIVER > .nFault", schDisplayLabel: "nFAULT", thickness: "0.1mm" }), jsx("trace", { name: "FAULT_PULLUP_3V3", from: ".R_FAULT_PU > .pin2", to: ".MCU > .L_AVDD > .pin1", schDisplayLabel: "V3V3", ...logicTrace })] }));

const pinLabels$2 = {
    pin1: ["A_PLUS"],
    pin2: ["A_MINUS"],
    pin3: ["B_PLUS"],
    pin4: ["B_MINUS"],
};
const WJ500V_5_08_04P_14_00A = (props) => {
    return (jsx("chip", { pinLabels: pinLabels$2, supplierPartNumbers: {
            jlcpcb: ["C42377749"],
        }, manufacturerPartNumber: "WJ500V-5.08-04P-14-00A", footprint: jsxs("footprint", { children: [jsx("platedhole", { portHints: ["pin1"], pcbX: "-7.62mm", pcbY: "0mm", outerDiameter: "1.999996mm", holeDiameter: "1.3000228mm", shape: "circle" }), jsx("platedhole", { portHints: ["pin2"], pcbX: "-2.54mm", pcbY: "0mm", outerDiameter: "1.999996mm", holeDiameter: "1.3000228mm", shape: "circle" }), jsx("platedhole", { portHints: ["pin3"], pcbX: "2.54mm", pcbY: "0mm", outerDiameter: "1.999996mm", holeDiameter: "1.3000228mm", shape: "circle" }), jsx("platedhole", { portHints: ["pin4"], pcbX: "7.62mm", pcbY: "0mm", outerDiameter: "1.999996mm", holeDiameter: "1.3000228mm", shape: "circle" }), jsx("silkscreenpath", { route: [
                        { x: 5.1061365999999, y: -5.499861999999894 },
                        { x: 10.186136599999827, y: -5.499861999999894 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 5.123662599999989, y: -4.530979000000002 },
                        { x: 10.186136599999827, y: -4.530979000000002 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 5.0599593999999115, y: 3.100120800000127 },
                        { x: 10.186136599999827, y: 3.100120800000127 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 5.1061365999999, y: 4.477638999999954 },
                        { x: 10.186136599999827, y: 4.477638999999954 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 10.186136599999827, y: -5.522340999999869 },
                        { x: 10.186136599999827, y: 4.477638999999954 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 5.1061365999999, y: -5.499861999999894 },
                        { x: -10.13386340000011, y: -5.499861999999894 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 5.0599593999999115, y: 3.100120800000127 },
                        { x: -10.180040600000098, y: 3.100120800000127 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 5.1061365999999, y: 4.500118000000043 },
                        { x: -10.13386340000011, y: 4.500118000000043 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -10.13386340000011, y: -5.532246999999984 },
                        { x: -10.13386340000011, y: 4.467733000000067 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 5.123662599999989, y: -4.530979000000002 },
                        { x: -10.11633740000002, y: -4.530979000000002 },
                    ] }), jsx("silkscreentext", { text: "{NAME}", pcbX: "0.2413mm", pcbY: "5.710938mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [
                        { x: -10.537000000000148, y: 4.960937999999942 },
                        { x: 11.019600000000082, y: 4.960937999999942 },
                        { x: 11.019600000000082, y: -5.851462000000083 },
                        { x: -10.537000000000148, y: -5.851462000000083 },
                        { x: -10.537000000000148, y: 4.960937999999942 },
                    ] })] }), cadModel: {
            objUrl: objPath,
            stepUrl: stepPath,
            pcbRotationOffset: 180,
            modelOriginPosition: {
                x: -49400000047050696e-21,
                y: 0,
                z: 0.17999199999999993,
            },
        }, ...props }));
};

const MotorOutputConnectors = () => (jsx(WJ500V_5_08_04P_14_00A, { name: "J1", pcbPinLabels: {
        pin1: "A+",
        pin2: "A-",
        pin3: "B+",
        pin4: "B-",
    }, pcbX: 26.5, pcbY: 1, pcbRotation: 90, schX: 9, schY: -1.5, schPinArrangement: {
        leftSide: { pins: [1, 2, 3, 4], direction: "top-to-bottom" },
    }, schSheetName: schematicSheets.motorDriver, schSectionName: schematicSections.motorOutputs }));
const MotorOutputTraces = () => (jsxs(Fragment, { children: [jsx("autoroutingphase", { phaseIndex: -1, minTraceToPadEdgeClearance: "0.2mm" }), jsx("trace", { name: "MOTOR_A_PLUS", routingPhaseIndex: -1, from: ".DRIVER > .AOUT1", to: ".J1 > .pin1", schDisplayLabel: "A+", ...motorTrace }), jsx("trace", { name: "MOTOR_A_MINUS", routingPhaseIndex: -1.5, from: ".DRIVER > .AOUT2", to: ".J1 > .pin2", schDisplayLabel: "A-", ...motorTrace }), jsx("trace", { name: "MOTOR_B_PLUS", routingPhaseIndex: -1, from: ".DRIVER > .BOUT1", to: ".J1 > .pin3", schDisplayLabel: "B+", ...motorTrace }), jsx("trace", { name: "MOTOR_B_MINUS", routingPhaseIndex: -1, from: ".DRIVER > .BOUT2", to: ".J1 > .pin4", schDisplayLabel: "B-", ...motorTrace })] }));

const MotorPowerFilteringComponents = () => (jsxs(Fragment, { children: [jsx("fuse", { name: "F_MOTOR_VBUS", currentRating: "2A", voltageRating: "30V", footprint: "1812", supplierPartNumbers: { jlcpcb: ["C960026"] }, manufacturerPartNumber: "BSMD1812-200-30V", pcbX: 19, pcbY: 20, schX: -3, schY: -7.5, schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdFiltering }), jsx("capacitor", { name: "C_PD_VBUS", capacitance: "10uF", footprint: "1206", supplierPartNumbers: { jlcpcb: ["C77093"] }, manufacturerPartNumber: "GRM31CR71E106KA12L", pcbX: 21.5, pcbY: 15, pcbRotation: 270, maxDecouplingTraceLength: 10, schX: 3, schY: -7.5, schOrientation: "vertical", schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdFiltering }), jsx("capacitor", { name: "C_MOTOR_BULK", capacitance: "220uF", footprint: "electrolytic_p2.5mm_id0.8mm_od1.6mm_d6.3mm", supplierPartNumbers: { jlcpcb: ["C43340"] }, manufacturerPartNumber: "KS227M016E07RR0VH2FP0", pcbX: 27.5, pcbY: 15.6, pcbRotation: 90, schX: 6, schY: -7.5, schOrientation: "vertical", schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdFiltering }), jsx("diode", { name: "D_MOTOR_TVS", footprint: "smb", supplierPartNumbers: { jlcpcb: ["C9019"] }, manufacturerPartNumber: "SMBJ11CA", pcbX: 11.5, pcbY: 11, schX: 9, schY: -7.5, schOrientation: "vertical", schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdFiltering })] }));
const MotorPowerFilteringSupplyTrace = () => (jsxs(Fragment, { children: [jsx("trace", { name: "MOTOR_VBUS_FUSE_INPUT", from: ".J_MOTOR_USB > .A4B9", to: ".F_MOTOR_VBUS > .pin1", ...powerTrace }), jsx("trace", { name: "MOTOR_VBUS_CAP", from: ".F_MOTOR_VBUS > .pin2", to: ".C_PD_VBUS > .pin1", schDisplayLabel: "VMOTOR_PROTECTED", ...powerTrace }), jsx("trace", { name: "MOTOR_VBUS_BULK", from: ".F_MOTOR_VBUS > .pin2", to: ".C_MOTOR_BULK > .pin1", ...powerTrace }), jsx("trace", { name: "MOTOR_VBUS_TVS", from: ".F_MOTOR_VBUS > .pin2", to: ".D_MOTOR_TVS > .cathode", ...powerTrace })] }));
const MotorPowerFilteringGroundTrace = () => (jsxs(Fragment, { children: [jsx("trace", { name: "PD_VBUS_CAP_GND", from: ".C_PD_VBUS > .pin2", to: "net.GND", ...groundTrace }), jsx("trace", { name: "MOTOR_BULK_GND", from: ".C_MOTOR_BULK > .pin2", to: "net.GND", ...groundTrace }), jsx("trace", { name: "MOTOR_TVS_GND", from: ".D_MOTOR_TVS > .anode", to: "net.GND", ...groundTrace })] }));

const pinLabels$1 = {
    pin1: ["VDD"],
    pin2: ["CFG2"],
    pin3: ["CFG3"],
    pin4: ["DP"],
    pin5: ["DM"],
    pin6: ["CC2"],
    pin7: ["CC1"],
    pin8: ["VBUS"],
    pin9: ["CFG1"],
    pin10: ["PG"],
    pin11: ["GND"],
};
const CH224K = (props) => {
    return (jsx("chip", { pinLabels: pinLabels$1, pinAttributes: {
            VDD: { requiresPower: true },
            GND: { requiresGround: true },
        }, supplierPartNumbers: {
            jlcpcb: ["C970725"],
        }, manufacturerPartNumber: "CH224K", footprint: jsxs("footprint", { children: [jsx("smtpad", { portHints: ["pin10"], pcbX: "-1.999996mm", pcbY: "2.999867mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin9"], pcbX: "-0.999998mm", pcbY: "3.000121mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin8"], pcbX: "-0mm", pcbY: "3.000121mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin7"], pcbX: "0.999998mm", pcbY: "3.000121mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin6"], pcbX: "1.999996mm", pcbY: "2.999867mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin5"], pcbX: "1.999996mm", pcbY: "-3.000121mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin4"], pcbX: "0.999998mm", pcbY: "-3.000121mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin3"], pcbX: "-0mm", pcbY: "-3.000121mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin2"], pcbX: "-0.999998mm", pcbY: "-3.000121mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin1"], pcbX: "-1.999996mm", pcbY: "-3.000121mm", width: "0.5999988mm", height: "1.499997mm", shape: "rect" }), jsx("smtpad", { portHints: ["pin11"], pcbX: "-0mm", pcbY: "0.000127mm", width: "3.2999934mm", height: "2.0999958mm", shape: "rect" }), jsx("silkscreenpath", { route: [
                        { x: -2.4600916000000552, y: 0.5400039999999535 },
                        { x: -2.5000711999999794, y: 0.5800089999999045 },
                        { x: -2.5000711999999794, y: 0.8199882000000116 },
                        { x: -2.5000711999999794, y: 1.9499580000000378 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.5000711999999794, y: -0.48003460000006726 },
                        { x: -2.400045999999975, y: -0.48003460000006726 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.5000711999999794, y: -1.9500087999999778 },
                        { x: -2.5000711999999794, y: -0.48003460000006726 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: 2.499918799999932, y: -1.9500087999999778 },
                        { x: 2.499918799999932, y: 1.9499580000000378 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.5000711999999794, y: 1.9499580000000378 },
                        { x: 2.499918799999932, y: 1.9499580000000378 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.5000711999999794, y: -1.9500087999999778 },
                        { x: 2.499918799999932, y: -1.9500087999999778 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -1.9200622000000749, y: 0 },
                        { x: -1.948065706108082, y: 0.21401308169981803 },
                        { x: -2.063987168701715, y: 0.3960790312980862 },
                        { x: -2.2460531183000967, y: 0.5120004938919465 },
                        { x: -2.4600662000000284, y: 0.5400039999999535 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -2.4000714000001153, y: -0.48000920000004044 },
                        { x: -2.1600667999999814, y: -0.41570016125035636 },
                        { x: -1.984371238749759, y: -0.2400046000001339 },
                        { x: -1.9200622000000749, y: 0 },
                    ] }), jsx("silkscreenpath", { route: [
                        { x: -1.6357600000000048, y: -1.2602210000000014 },
                        { x: -1.645444766097171, y: -1.3337841019132384 },
                        { x: -1.6738390635840688, y: -1.4023339999999962 },
                        { x: -1.7190078680105216, y: -1.4611991319895878 },
                        { x: -1.7778730000001133, y: -1.506367936415927 },
                        { x: -1.8464228980867574, y: -1.5347622339028248 },
                        { x: -1.9199859999999944, y: -1.5444470000001047 },
                        { x: -1.9935491019132314, y: -1.5347622339028248 },
                        { x: -2.0620989999999892, y: -1.506367936415927 },
                        { x: -2.120964131989581, y: -1.4611991319895878 },
                        { x: -2.16613293641592, y: -1.4023339999999962 },
                        { x: -2.1945272339030453, y: -1.3337841019132384 },
                        { x: -2.2042120000000978, y: -1.2602210000000014 },
                        { x: -2.1945272339030453, y: -1.1866578980867644 },
                        { x: -2.16613293641592, y: -1.1181080000000065 },
                        { x: -2.120964131989581, y: -1.0592428680105286 },
                        { x: -2.0620989999999892, y: -1.0140740635840757 },
                        { x: -1.9935491019132314, y: -0.9856797660971779 },
                        { x: -1.9199859999999944, y: -0.9759950000000117 },
                        { x: -1.8464228980867574, y: -0.9856797660971779 },
                        { x: -1.7778730000001133, y: -1.0140740635840757 },
                        { x: -1.7190078680105216, y: -1.0592428680105286 },
                        { x: -1.6738390635840688, y: -1.1181080000000065 },
                        { x: -1.645444766097171, y: -1.1866578980867644 },
                        { x: -1.6357600000000048, y: -1.2602210000000014 },
                    ] }), jsx("silkscreentext", { text: "{NAME}", pcbX: "-0.006604mm", pcbY: "4.761613mm", anchorAlignment: "center", fontSize: "1mm" }), jsx("courtyardoutline", { outline: [
                        { x: -2.7585040000000163, y: 4.011613000000011 },
                        { x: 2.7452959999999393, y: 4.011613000000011 },
                        { x: 2.7452959999999393, y: -4.209987000000069 },
                        { x: -2.7585040000000163, y: -4.209987000000069 },
                        { x: -2.7585040000000163, y: 4.011613000000011 },
                    ] })] }), cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C970725.obj?uuid=c37139ac11be40009679f32869d9459d",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C970725.step?uuid=c37139ac11be40009679f32869d9459d",
            pcbRotationOffset: 0,
            modelOriginPosition: { x: 0.000063500000123895, y: 0, z: -0.81 },
        }, ...props }));
};

const pinLabels = {
    pin1: ["EH1"],
    pin2: ["EH2"],
    pin3: ["EH3"],
    pin4: ["EH4"],
    pin5: ["A1B12"],
    pin6: ["A4B9"],
    pin7: ["B8"],
    pin8: ["A5"],
    pin9: ["B7"],
    pin10: ["A6"],
    pin11: ["A7"],
    pin12: ["B6"],
    pin13: ["A8"],
    pin14: ["B5"],
    pin15: ["B4A9"],
    pin16: ["B1A12"],
};
const TYPE_C_16PIN_2MD_073_ = (props) => {
    return (jsx("connector", { pinLabels: pinLabels, standard: "usb_c", supplierPartNumbers: {
            jlcpcb: ["C2765186"],
        }, manufacturerPartNumber: "TYPE_C_16PIN_2MD_073_", footprint: "usbcmidmount", cadModel: {
            objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C2765186.obj?uuid=4ee8413127e64716b804db03d4b340ae",
            stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C2765186.step?uuid=4ee8413127e64716b804db03d4b340ae",
            pcbRotationOffset: 0,
            modelOriginPosition: {
                x: -12699999956566899e-21,
                y: 1.5749970500000927,
                z: -1.6800018,
            },
        }, ...props }));
};

const MotorPowerPdControllers = () => (jsxs(Fragment, { children: [jsx(TYPE_C_16PIN_2MD_073_, { name: "J_MOTOR_USB", noConnect: ["B8", "A8"], pcbX: 20.5, pcbY: 28, pcbRotation: 180, schX: 5.5, schY: 0, schWidth: 3, schHeight: 5, schPinArrangement: {
                leftSide: {
                    pins: [1, 3, 5, 6, 8, 10, 11, 13],
                    direction: "top-to-bottom",
                },
                rightSide: {
                    pins: [2, 4, 16, 15, 14, 12, 9, 7],
                    direction: "top-to-bottom",
                },
            }, schPinStyle: {
                pin5: { marginTop: 0.4 },
                pin8: { marginTop: 0.4 },
                pin16: { marginTop: 0.4 },
                pin14: { marginTop: 0.4 },
            }, schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdNegotiation }), jsx(CH224K, { name: "U_PD", noConnect: ["CFG2", "CFG3"], pcbX: 11.5, pcbY: 20, pcbRotation: 90, schX: -5, schY: 0, schWidth: 2.6, schHeight: 3.6, schMarginRight: 1, schPinArrangement: {
                leftSide: {
                    pins: [4, 5, 6, 7],
                    direction: "top-to-bottom",
                },
                rightSide: {
                    pins: [10, 9, 8],
                    direction: "top-to-bottom",
                },
                topSide: {
                    pins: [1, 2, 3],
                    direction: "left-to-right",
                },
                bottomSide: {
                    pins: [11],
                    direction: "left-to-right",
                },
            }, schPinStyle: {
                pin6: { marginTop: 0.4 },
                pin8: { marginTop: 0.4 },
                pin2: { marginLeft: 0.3 },
            }, schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdNegotiation })] }));
const MotorPowerPdPassives = () => (jsxs(Fragment, { children: [jsx("capacitor", { name: "C_PD_VDD", capacitance: "1uF", footprint: "0603", supplierPartNumbers: { jlcpcb: ["C15849"] }, pcbX: 16, pcbY: 15.8, maxDecouplingTraceLength: 10, schX: -7.8, schY: 0, schOrientation: "vertical", schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdNegotiation }), jsx("resistor", { name: "R_PD_VDD", resistance: "1k", footprint: "0603", supplierPartNumbers: { jlcpcb: ["C21190"] }, pcbX: 8.5, pcbY: 26, schX: 0, schY: 3, schMarginX: 0.25, schMarginY: 0.2, schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdNegotiation }), jsx("resistor", { name: "R_PD_VBUS", resistance: "10k", footprint: "0603", supplierPartNumbers: { jlcpcb: ["C25804"] }, pcbX: 17.5, pcbY: 23, schX: 1.5, schY: 0.75, schMarginX: 0.25, schMarginY: 0.2, schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdNegotiation }), jsx("resistor", { name: "R_PD_CFG1", resistance: "6.8k", footprint: "0603", supplierPartNumbers: { jlcpcb: ["C23212"] }, pcbX: 9.5, pcbY: 16, schX: -1.5, schY: -2.5, schMarginX: 0.25, schMarginY: 0.2, schSheetName: schematicSheets.motorPower, schSectionName: schematicSections.pdNegotiation })] }));
const MotorPowerPdInputTraces = () => (jsxs(Fragment, { children: [jsx("trace", { name: "MOTOR_VBUS_JOIN", from: ".J_MOTOR_USB > .A4B9", to: ".J_MOTOR_USB > .B4A9", ...powerTrace }), jsx("trace", { name: "MOTOR_VBUS_VM", from: ".F_MOTOR_VBUS > .pin2", to: ".DRIVER > .VM", schDisplayLabel: "VMOTOR_PROTECTED", ...powerTrace })] }));
const MotorPowerPdProtocolTraces = () => (jsxs(Fragment, { children: [jsx("trace", { name: "PD_VDD_FEED", from: ".J_MOTOR_USB > .A4B9", to: ".R_PD_VDD > .pin1", ...logicTrace }), jsx("trace", { name: "PD_VBUS_SENSE_FEED", from: ".J_MOTOR_USB > .A4B9", to: ".R_PD_VBUS > .pin1", ...logicTrace }), jsx("trace", { name: "PD_VDD_INPUT", from: ".R_PD_VDD > .pin2", to: ".U_PD > .VDD", schDisplayLabel: "PD_VDD", ...logicTrace }), jsx("trace", { name: "PD_VBUS_INPUT", from: ".R_PD_VBUS > .pin2", to: ".U_PD > .VBUS", schDisplayLabel: "PD_VBUS", ...logicTrace }), jsx("trace", { name: "PD_VDD_DECOUPLE", from: ".U_PD > .VDD", to: ".C_PD_VDD > .pin1", ...logicTrace }), jsx("trace", { name: "PD_CFG1", from: ".U_PD > .CFG1", to: ".R_PD_CFG1 > .pin1", schDisplayLabel: "CFG1", ...logicTrace }), jsx("trace", { name: "PD_CC1", from: ".J_MOTOR_USB > .A5", to: ".U_PD > .CC1", schDisplayLabel: "CC1", ...logicTrace }), jsx("trace", { name: "PD_CC2", from: ".J_MOTOR_USB > .B5", to: ".U_PD > .CC2", schDisplayLabel: "CC2", ...logicTrace }), jsx("trace", { name: "PD_DP_A", from: ".J_MOTOR_USB > .A6", to: ".U_PD > .DP", schDisplayLabel: "USB_D+", ...logicTrace }), jsx("trace", { name: "PD_DP_JOIN", from: ".J_MOTOR_USB > .B6", to: ".J_MOTOR_USB > .A6", ...logicTrace }), jsx("trace", { name: "PD_DM_A", from: ".J_MOTOR_USB > .A7", to: ".U_PD > .DM", schDisplayLabel: "USB_D-", ...logicTrace }), jsx("trace", { name: "PD_DM_JOIN", from: ".J_MOTOR_USB > .B7", to: ".J_MOTOR_USB > .A7", ...logicTrace })] }));
const MotorPowerPdPrimaryGroundTrace = () => (jsx(Fragment, { children: jsx("trace", { name: "MOTOR_USB_GND_A", from: ".J_MOTOR_USB > .A1B12", to: ".DRIVER > .GND2", ...groundTrace }) }));
const MotorPowerPdConnectorGroundTraces = () => (jsxs(Fragment, { children: [jsx("trace", { name: "MOTOR_USB_GND_JOIN", from: ".J_MOTOR_USB > .B1A12", to: ".J_MOTOR_USB > .A1B12", ...groundTrace }), jsx("trace", { name: "MOTOR_USB_SHIELD_1", from: ".J_MOTOR_USB > .EH1", to: ".J_MOTOR_USB > .A1B12", ...groundTrace }), jsx("trace", { name: "MOTOR_USB_SHIELD_2", from: ".J_MOTOR_USB > .EH2", to: ".J_MOTOR_USB > .A1B12", ...groundTrace }), jsx("trace", { name: "MOTOR_USB_SHIELD_3", from: ".J_MOTOR_USB > .EH3", to: ".J_MOTOR_USB > .A1B12", ...groundTrace }), jsx("trace", { name: "MOTOR_USB_SHIELD_4", from: ".J_MOTOR_USB > .EH4", to: ".J_MOTOR_USB > .A1B12", ...groundTrace }), jsx("trace", { name: "PD_GND", from: ".U_PD > .GND", to: ".DRIVER > .GND2", ...groundTrace })] }));
const MotorPowerPdSupportGroundTraces = () => (jsxs(Fragment, { children: [jsx("trace", { name: "PD_VDD_CAP_GND", from: ".C_PD_VDD > .pin2", to: "net.GND", ...logicTrace }), jsx("trace", { name: "PD_CFG1_GND", from: ".R_PD_CFG1 > .pin2", to: ".DRIVER > .GND2", ...logicTrace })] }));

const SchematicSheets = () => (jsxs(Fragment, { children: [jsx("schematicsheet", { name: schematicSheets.controller, displayName: "RP2040 Controller", sheetWidth: "310mm", sheetIndex: 1 }), jsx("schematicsheet", { name: schematicSheets.programming, displayName: "Programming USB-C & QSPI", sheetIndex: 2, children: jsx("schematicsection", { name: "MCU__usb", displayName: "USB-C, QSPI Flash & 3.3V Power" }) }), jsxs("schematicsheet", { name: schematicSheets.motorDriver, displayName: "Stepper Motor Driver", sheetIndex: 3, children: [jsx("schematicsection", { name: schematicSections.driverCore, displayName: "H-Bridge, Power & Control" }), jsx("schematicsection", { name: schematicSections.motorOutputs, displayName: "Stepper Motor Output" })] }), jsxs("schematicsheet", { name: schematicSheets.motorPower, displayName: "USB-C PD Motor Power", sheetIndex: 4, children: [jsx("schematicsection", { name: schematicSections.pdNegotiation, displayName: "USB-C PD Negotiation" }), jsx("schematicsection", { name: schematicSections.pdFiltering, displayName: "Power Filtering" })] })] }));

function Rp2040MotorController({ routingDisabled = false, } = {}) {
    return (jsxs("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",
        }, children: [jsx("net", { name: "GND" }), jsx(SchematicSheets, {}), jsxs("group", { pcbX: -5.625, pcbY: -8.25, children: [jsx(ControllerSections, {}), jsx(MotorDriverController, {}), jsx(MotorPowerPdControllers, {}), jsx(MotorOutputConnectors, {}), jsx(MotorPowerFilteringComponents, {}), jsx(MotorPowerPdPassives, {}), jsx(MotorDriverPassives, {}), jsx(MotorDriverControlTraces, {}), jsx(MotorPowerPdInputTraces, {}), jsx(MotorPowerFilteringSupplyTrace, {}), jsx(MotorPowerPdProtocolTraces, {}), jsx(MotorDriverPowerTraces, {}), jsx(MotorDriverPrimaryGroundTraces, {}), jsx(MotorPowerPdPrimaryGroundTrace, {}), jsx(MotorPowerPdConnectorGroundTraces, {}), jsx(MotorPowerFilteringGroundTrace, {}), jsx(MotorPowerPdSupportGroundTraces, {}), jsx(MotorDriverGroundTraces, {}), jsx(MotorOutputTraces, {}), jsx(MotorDriverSenseAndControlTraces, {})] }), jsx("copperpour", { name: "GND_TOP", layer: "top", connectsTo: "net.GND", clearance: "0.2mm", padMargin: "0.2mm", traceMargin: "0.2mm", boardEdgeMargin: "0.3mm", coveredWithSolderMask: true }), jsx("copperpour", { name: "GND_BOTTOM", layer: "bottom", connectsTo: "net.GND", clearance: "0.2mm", padMargin: "0.2mm", traceMargin: "0.2mm", boardEdgeMargin: "0.3mm", coveredWithSolderMask: true }), jsxs("group", { pcbX: -5.625, pcbY: -8.25, children: [jsx("hole", { diameter: "3.2mm", pcbX: -16.375, pcbY: 28.75 }), jsx("hole", { diameter: "3.2mm", pcbX: 27.625, pcbY: 28.75 }), jsx("hole", { diameter: "3.2mm", pcbX: -16.375, pcbY: -13.75 }), jsx("hole", { diameter: "3.2mm", pcbX: 27.625, pcbY: -13.75 }), jsx("silkscreentext", { text: "RP2040 STEPPER CONTROLLER", fontSize: "1.2mm", pcbX: 5.625, pcbY: 30.5 }), jsx("silkscreentext", { text: "USB-C PD MOTOR", fontSize: "0.8mm", pcbX: 14, pcbY: 25 }), jsx("silkscreentext", { text: "REQUESTS 9V", fontSize: "0.8mm", pcbX: 5, pcbY: 23 }), jsx("silkscreentext", { text: "STEPPER MOTOR", fontSize: "0.8mm", pcbX: 26, pcbY: 13.5 }), jsx("silkscreentext", { text: "A+", fontSize: "0.8mm", pcbX: 26.5, pcbY: -6.6 }), jsx("silkscreentext", { text: "A-", fontSize: "0.8mm", pcbX: 26.5, pcbY: -1.5 }), jsx("silkscreentext", { text: "B+", fontSize: "0.8mm", pcbX: 26.5, pcbY: 3.5 }), jsx("silkscreentext", { text: "B-", fontSize: "0.8mm", pcbX: 26.5, pcbY: 8.6 })] })] }));
}

export { Rp2040MotorController as default };