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-controller

In 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/motor.tsx

import { BulkCapacitors } from "./bulk-capacitors"
import { BoardButton, SpeedControl } from "./controls"
import { ServicePads } from "./service-pads"
import { MCF8329A1IREER } from "../imports/MCF8329A1IREER"
import { A_24_243_4 } from "../imports/A_24_243_4/A_24_243_4"
import { AOD2610E } from "../imports/AOD2610E"
import { schAt, pcbRotations, net, Passives, Npn,  BlockTitle, type Passive } from "./helpers"

export const motorPassives: Passive[] = [
  { name: "R85", kind: "R", value: "100k", a: "THROTTLE_IN", b: "GND", x: 29, y: -42 },
  { name: "R86", kind: "R", value: "10k", a: "V3V3", b: "ARM_REQUEST_N", x: -16, y: -39 },
  { name: "C82", kind: "C", value: "100nF", a: "ARM_REQUEST_N", b: "GND", x: -16, y: -43 },
  { name: "R83", kind: "R", value: "47k", a: "PD_OK2_N", b: "PD_INHIBIT_B", x: -17, y: -28 },
  { name: "R84", kind: "R", value: "100k", a: "PD_INHIBIT_B", b: "GND", x: -17, y: -23 },
  { name: "C70", kind: "C", value: "100nF", a: "VMOTOR", b: "GND", x: 0, y: -10, volts: 50, footprint: "0402" },
  { name: "C71", kind: "C", value: "10uF", a: "VMOTOR", b: "GND", x: 6, y: -10, volts: 50, footprint: "1210" },
  { name: "C72", kind: "C", value: "470nF", a: "MCF_CPH", b: "MCF_CPL", x: 12, y: -10, volts: 50, footprint: "0805" },
  { name: "C73", kind: "C", value: "22uF", a: "MCF_GVDD", b: "GND", x: 20, y: -10, volts: 35, footprint: "1210" },
  { name: "C74", kind: "C", value: "1uF", a: "MCF_BSTA", b: "PHASE_U", x: 21, y: -16, volts: 25, footprint: "0805" },
  { name: "C75", kind: "C", value: "1uF", a: "MCF_BSTB", b: "PHASE_V", x: 21, y: -21, volts: 25, footprint: "0805" },
  { name: "C76", kind: "C", value: "1uF", a: "MCF_BSTC", b: "PHASE_W", x: 21, y: -26, volts: 25, footprint: "0805" },
  { name: "C77", kind: "C", value: "1uF", a: "MCF_AVDD", b: "GND", x: 4, y: -27 },
  { name: "C78", kind: "C", value: "1uF", a: "MCF_DVDD", b: "GND", x: 4, y: -22, footprint: "0402" },
  { name: "C79", kind: "C", value: "10uF", a: "V3V3", b: "GND", x: 0, y: -16, volts: 10, footprint: "0805" },
  // VREG bypass: 1.54 mm pad-centre spacing, <1 mm exposed copper. TI specifies
  // close placement; 1.6 mm lets the router's centre-distance check model this.
  // Pin 1 connects to U7.VREG (V3V3) through MCF_REGULATOR_BYPASS in MotorCopper.
  { name: "C80", kind: "C", value: "1uF", a: "V3V3", b: "GND", x: 0, y: -21, volts: 10, footprint: "0402", maxDecouplingTraceLength: 1.6, connections: { pin2: "net.GND" } },
  { name: "R70", kind: "R", value: "10k", a: "MCF_AVDD", b: "MCF_DRVOFF", x: 10, y: -29 },
  { name: "R71", kind: "R", value: "4.7k", a: "MOTOR_ARM", b: "ARM_BASE", x: -7, y: -28 },
  { name: "R72", kind: "R", value: "100k", a: "ARM_BASE", b: "GND", x: -7, y: -33 },
  { name: "R73", kind: "R", value: "10k", a: "MOTOR_SPEED", b: "GND", x: -6, y: -23 },
  { name: "R74", kind: "R", value: "10k", a: "MCF_DIR", b: "GND", x: 14, y: -31, footprint: "0402" },
  { name: "R75", kind: "R", value: "10k", a: "MCF_BRAKE", b: "GND", x: 20, y: -31, footprint: "0402" },
  { name: "R76", kind: "R", value: "10k", a: "V3V3", b: "MOTOR_FAULT_N", x: 9, y: -37 },
  { name: "R77", kind: "R", value: "10k", a: "V3V3", b: "MOTOR_FG", x: 14, y: -37 },
  { name: "R78", kind: "R", value: "4.7k", a: "V3V3", b: "MCF_SDA", x: 4, y: -37 },
  { name: "R79", kind: "R", value: "4.7k", a: "V3V3", b: "MCF_SCL", x: -1, y: -37 },
  { name: "R80", kind: "R", value: "1k", a: "THROTTLE_IN", b: "ADC_THROTTLE", x: 20, y: -37 },
  { name: "C81", kind: "C", value: "10nF", a: "ADC_THROTTLE", b: "GND", x: 25, y: -37 },
  { name: "R81", kind: "R", value: "0.01", a: "LS_RETURN", b: "GND", x: 49, y: -42, footprint: "2512", note: "1 W minimum; sense pads must use Kelvin connections" },
  { name: "R82", kind: "R", value: "100k", a: "MCF_EXTCLK", b: "GND", x: 4, y: -32 },
]

export function MotorControl() {
  return <>
    <BlockTitle x={16} y={2}>05 / MCF8329A sensorless field-oriented control</BlockTitle>
    <MCF8329A1IREER name="U7" {...schAt("U7", 16, -15)} noConnect={["GCTRL", "pin33"]}
      connections={{ DGND: net("GND"), VREG: net("V3V3"), GND: net("GND"), PVDD: net("VMOTOR"), CPL: net("MCF_CPL"), CPH: net("MCF_CPH"), GVDD: net("MCF_GVDD"),
        BSTA: net("MCF_BSTA"), SHA: net("PHASE_U"), GHA: net("GHA"), GLA: net("GLA"),
        BSTB: net("MCF_BSTB"), SHB: net("PHASE_V"), GHB: net("GHB"), GLB: net("GLB"),
        BSTC: net("MCF_BSTC"), SHC: net("PHASE_W"), GHC: net("GHC"), GLC: net("GLC"),
        LSS: net("LS_RETURN"), SP: net("LS_RETURN"), SN: net("GND"), DRVOFF: net("MCF_DRVOFF"), AGND: net("GND"), AVDD: net("MCF_AVDD"),
        pin27: net("MOTOR_SPEED"), FG: net("MOTOR_FG"), SDA: net("MCF_SDA"), SCL: net("MCF_SCL"), DIR: net("MCF_DIR"), EXT_CLK: net("MCF_EXTCLK"),
        BRAKE: net("MCF_BRAKE"), nFAULT: net("MOTOR_FAULT_N"), DVDD: net("MCF_DVDD"), EP: net("GND") }} />
    <Npn name="Q6" base="PD_INHIBIT_B" collector="ARM_BASE" x={-13} y={-33} sx={31} sy={-3} />
    <Npn name="Q5" base="ARM_BASE" collector="MCF_DRVOFF" x={-1} y={-29} sx={31} sy={-8} />
    <SpeedControl />
    <BoardButton name="SW3" signal="ARM_REQUEST_N" referenceY={-5.4} />
    <ServicePads bank="J5" />
    <ServicePads bank="J6" />
    <Passives parts={motorPassives} sx={4} sy={-39} />
  </>
}

export function MotorBridge() {
  return <>
    <BlockTitle x={59} y={65}>06 / Three half bridges and motor leads</BlockTitle>
    {(["U", "V", "W"] as const).map((phase, i) => {
      const letter = ["A", "B", "C"][i]
      const y = 8 - i * 17
      const sy = 51 - i * 24
      const high = `GH${letter}_GATE`, low = `GL${letter}_GATE`
      return <group key={phase} name={`phase_${phase}`} pcbX={0} pcbY={0} schX={0} schY={0}>
        <AOD2610E name={`Q${10 + i * 2}`} {...schAt(`Q${10 + i * 2}`, 53, sy)} connections={{ G: net(high), D: net("VMOTOR"), S: net(`PHASE_${phase}`) }} />
        <AOD2610E name={`Q${11 + i * 2}`} {...schAt(`Q${11 + i * 2}`, 53, sy - 10)} connections={{ G: net(low), D: net(`PHASE_${phase}`), S: net("LS_RETURN") }} />
        <resistor name={`R${90 + i * 4}`} pcbRotation={pcbRotations[`R${90 + i * 4}`] ?? 0} resistance="10" footprint="0603" {...schAt(`R${90 + i * 4}`, 44, sy)}
          connections={{ pin1: net(`GH${letter}`), pin2: net(high) }} />
        <resistor name={`R${91 + i * 4}`} pcbRotation={pcbRotations[`R${91 + i * 4}`] ?? 0} schRotation={i === 1 ? 90 : -90} resistance="100k" footprint="0603" {...schAt(`R${91 + i * 4}`, 64, sy)}
          connections={{ pin1: net(high), pin2: net(`PHASE_${phase}`) }} />
        <resistor name={`R${92 + i * 4}`} pcbRotation={pcbRotations[`R${92 + i * 4}`] ?? 0} resistance="10" footprint="0603" {...schAt(`R${92 + i * 4}`, 44, sy - 10)}
          connections={{ pin1: net(`GL${letter}`), pin2: net(low) }} />
        <resistor name={`R${93 + i * 4}`} pcbRotation={pcbRotations[`R${93 + i * 4}`] ?? 0} resistance="100k" footprint="0603" {...schAt(`R${93 + i * 4}`, 64, sy - 10)}
          connections={{ pin1: net(low), pin2: net("LS_RETURN") }} />
        {/* One insulated female socket per phase; both solder legs are the same contact. */}
        <A_24_243_4 name={`J${10+i}`} {...schAt(`J${10+i}`, 18, 7-i*3)} allowOffBoard
          connections={{ pin1: net(`PHASE_${phase}`), pin2: net(`PHASE_${phase}`) }} />
        <capacitor name={`C${90+i}`} capacitance="1uF" schRotation={-90} pcbRotation={180} maxVoltageRating={50} footprint="0805" {...schAt(`C${90+i}`, 73, sy + 3)}
          connections={{ pin1: net("VMOTOR"), pin2: net("GND") }} />
      </group>
    })}
    <BulkCapacitors />
    <ServicePads bank="J7" />
  </>
}