MustafaMulla29/rp2040-bldc-motor-controller-new

A USB‑C PD–powered RP2040 BLDC motor controller PCB with 3.3 V logic, MCT8329A sensorless commutation, three MOSFET half-bridges, protected power switching, USB data, controls, and motor connectors.

Version
0.3.82
License
unset
Stars
0

imports/DMP4015SSS_13.tsx

import { Fragment } from "react"
import type { ChipProps } from "@tscircuit/props"

const pinLabels = {
  pin1: ["S1"],
  pin2: ["S2"],
  pin3: ["S3"],
  pin4: ["G"],
  pin5: ["D4"],
  pin6: ["D3"],
  pin7: ["D2"],
  pin8: ["D1"]
} as const

// MOSFET gate is the control input; drain/source are passive switched terminals, not fixed supply pins.
const pinAttributes = {
  pin1: { isPassive: true },
  pin2: { isPassive: true },
  pin3: { isPassive: true },
  pin4: { isInput: true, mustBeConnected: true },
  pin5: { isPassive: true },
  pin6: { isPassive: true },
  pin7: { isPassive: true },
  pin8: { isPassive: true },
} as const

export const DMP4015SSS_13 = ({ sourceOnLeft = false, ...props }: ChipProps<typeof pinLabels> & { sourceOnLeft?: boolean }) => {
  // P-channel enhancement MOSFET, including its drain-to-source body diode.
  // All eight package pins stay distinct electrically. Parallel source/drain
  // pins share a schematic terminal, as in the manufacturer's circuit symbol.
  const mirror = sourceOnLeft ? -1 : 1
  const point = ({ x, y }: { x: number; y: number }) => ({ x: -y * mirror, y: x - 0.1 })
  const paths = [
    { points: [[0.02,0],[-0.1,-0.04],[-0.1,0.04],[0.02,0]], fill: true },
    { points: [[0.3,-0.04],[0.24,0.06],[0.36,0.06],[0.3,-0.04]], fill: true },
    { points: [[-0.1,0.14],[0.1,0.14],[0.1,0.2],[0.3,0.2],[0.3,0.06]] },
    { points: [[-0.1,0],[0.1,0],[0.1,-0.2],[0.3,-0.2],[0.3,-0.04]] },
    { points: [[0.1,-0.14],[-0.1,-0.14]] },
    { points: [[-0.14,0.18],[-0.14,-0.18]] },
    { points: [[-0.1,0.18],[-0.1,0.1]] },
    { points: [[-0.1,-0.04],[-0.1,0.04]] },
    { points: [[-0.1,-0.18],[-0.1,-0.1]] },
    { points: [[0.38,-0.04],[0.22,-0.04]] },
  ]
  return (
    <chip
      pinLabels={pinLabels}
      pinAttributes={pinAttributes}
      symbol={<symbol>
        <schematictext text="{NAME}" schX={0} schY={0.7} fontSize={0.18} anchor="center" />
        <schematictext text="DMP4015SSS-13" schX={0} schY={0.45} fontSize={0.13} anchor="center" />
        {paths.map((p, i) => <Fragment key={i}><schematicpath
          points={p.points.map(([x,y]) => point({x,y}))} strokeColor="#880000"
          isFilled={p.fill ?? false} fillColor="#880000" /></Fragment>)}
        {Object.entries(pinLabels).map(([name, aliases], i) => {
          const terminal = i < 3 ? {x:0.1,y:-0.4} : i === 3 ? {x:-0.3,y:0} : {x:0.1,y:0.4}
          const direction = i === 3 ? "down" : (i < 3) === (mirror === 1) ? "right" : "left"
          const p = point(terminal)
          return <Fragment key={name}><port name={aliases[0]} pinNumber={i + 1} aliases={[name]}
            direction={direction} schX={p.x} schY={p.y} schStemLength={i === 3 ? 0.16 : 0.2} /></Fragment>
        })}
      </symbol>}
      supplierPartNumbers={{
  "jlcpcb": [
    "C508210"
  ]
}}
      manufacturerPartNumber="DMP4015SSS-13"
      footprint={<footprint>
        <smtpad portHints={["pin1"]} pcbX="-1.905mm" pcbY="-2.699004mm" width="0.5739892mm" height="1.8880074mm" radius="0.2869946mm" shape="pill" />
<smtpad portHints={["pin2"]} pcbX="-0.635mm" pcbY="-2.699004mm" width="0.5739892mm" height="1.8880074mm" radius="0.2869946mm" shape="pill" />
<smtpad portHints={["pin3"]} pcbX="0.635mm" pcbY="-2.699004mm" width="0.5739892mm" height="1.8880074mm" radius="0.2869946mm" shape="pill" />
<smtpad portHints={["pin4"]} pcbX="1.905mm" pcbY="-2.699004mm" width="0.5739892mm" height="1.8880074mm" radius="0.2869946mm" shape="pill" />
<smtpad portHints={["pin8"]} pcbX="-1.905mm" pcbY="2.699004mm" width="0.5739892mm" height="1.8880074mm" radius="0.2869946mm" shape="pill" />
<smtpad portHints={["pin7"]} pcbX="-0.635mm" pcbY="2.699004mm" width="0.5739892mm" height="1.8880074mm" radius="0.2869946mm" shape="pill" />
<smtpad portHints={["pin6"]} pcbX="0.635mm" pcbY="2.699004mm" width="0.5739892mm" height="1.8880074mm" radius="0.2869946mm" shape="pill" />
<smtpad portHints={["pin5"]} pcbX="1.905mm" pcbY="2.699004mm" width="0.5739892mm" height="1.8880074mm" radius="0.2869946mm" shape="pill" />
<silkscreenpath route={[{"x":-2.4999950000001263,"y":-1.9999959999998964},{"x":-2.4999950000001263,"y":-0.6349999999999909}]} />
<silkscreenpath route={[{"x":-2.4999950000001263,"y":1.99999600000001},{"x":-2.4999950000001263,"y":0.6349999999999909}]} />
<silkscreenpath route={[{"x":2.499994999999899,"y":1.99999600000001},{"x":2.499994999999899,"y":-1.9999959999998964}]} />
<silkscreenpath route={[{"x":2.4214327999998204,"y":-1.9999959999998964},{"x":2.499994999999899,"y":-1.9999959999998964}]} />
<silkscreenpath route={[{"x":1.1514327999999523,"y":-1.9999959999998964},{"x":1.3885672000000113,"y":-1.9999959999998964}]} />
<silkscreenpath route={[{"x":-0.11856720000002952,"y":-1.9999959999998964},{"x":0.11856720000002952,"y":-1.9999959999998964}]} />
<silkscreenpath route={[{"x":-1.388567200000125,"y":-1.9999959999998964},{"x":-1.151432800000066,"y":-1.9999959999998964}]} />
<silkscreenpath route={[{"x":-2.4999950000001263,"y":-1.9999959999998964},{"x":-2.421432800000048,"y":-1.9999959999998964}]} />
<silkscreenpath route={[{"x":2.4214327999998204,"y":1.99999600000001},{"x":2.499994999999899,"y":1.99999600000001}]} />
<silkscreenpath route={[{"x":1.1514327999999523,"y":1.99999600000001},{"x":1.3885672000000113,"y":1.99999600000001}]} />
<silkscreenpath route={[{"x":-0.11856720000002952,"y":1.99999600000001},{"x":0.11856720000002952,"y":1.99999600000001}]} />
<silkscreenpath route={[{"x":-1.388567200000125,"y":1.99999600000001},{"x":-1.151432800000066,"y":1.99999600000001}]} />
<silkscreenpath route={[{"x":-2.4999950000001263,"y":1.99999600000001},{"x":-2.421432800000048,"y":1.99999600000001}]} />
<silkscreenpath route={[{"x":-2.4999950000001263,"y":-0.6349999999999909},{"x":-2.499360000000138,"y":0.6349999999999909}]} />
<silkscreencircle pcbX="-1.905mm" pcbY="-1.27mm" radius="0.150114mm" />
<silkscreencircle pcbX="-2.794mm" pcbY="-2.54mm" radius="0.150114mm" />
<silkscreentext text="{NAME}" pcbX="-0.2286mm" pcbY="4.3528mm" anchorAlignment="center" fontSize="1mm" />
<courtyardoutline outline={[{"x":-3.1964000000000397,"y":3.6027999999998883},{"x":2.7392000000000962,"y":3.6027999999998883},{"x":2.7392000000000962,"y":-3.856800000000021},{"x":-3.1964000000000397,"y":-3.856800000000021},{"x":-3.1964000000000397,"y":3.6027999999998883}]} />
      </footprint>}
      cadModel={{
        objUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C508210.obj?uuid=3936dbd423424b148317d27cdee29b93",
        stepUrl: "https://modelcdn.tscircuit.com/easyeda_models/assets/C508210.step?uuid=3936dbd423424b148317d27cdee29b93",
        pcbRotationOffset: 270,
        modelOriginPosition: { x: -0.000012700000070253736, y: -0.000012700000070253736, z: -0.049425 },
      }}
      {...props}
      schRotation={0}
    />
  )
}