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.

imports/SK_22D03_G080.tsx

import type { ChipProps } from "@tscircuit/props"
import { jscad, renderToJscadPlan } from "jscad-fiber/headless"
// Coloured GLB exported from switchModel by scripts/export-part-models.tsx (a JSCAD
// cadModel renders in one colour because tscircuit unions its pieces).
import switchGlb from "../assets/models/sk-22d03-g080.glb"

// SK-22D03-G080 right-angle DPDT slide switch, 8.0 mm lever (C55166127).
// Body 8.38 x 6.86 x 4.7 mm; lever 2.0 x 2.0 mm, 8.0 mm beyond the body face (-Y),
// drawn in the pin-1 (OFF) position. EasyEDA has no model for this part, so this
// simplified model follows the footprint drawing and the same-series G040 model.
export const switchModel = renderToJscadPlan(<>
  <jscad.colorize color="#c9ccd1"><jscad.cuboid size={[8.38, 6.86, 4.7]} center={[0, 0, 2.35]} /></jscad.colorize>
  <jscad.colorize color="#1e1e1e"><jscad.cuboid size={[2.03, 8.0, 2.0]} center={[-1.015, -7.43, 2.7]} /></jscad.colorize>
  <jscad.colorize color="#1e1e1e"><jscad.cuboid size={[4.4, .4, 2.6]} center={[0, -3.63, 2.7]} /></jscad.colorize>
  {[-2, 0, 2].flatMap(x => [-1.25, 1.25].map(y => <jscad.colorize key={`${x}:${y}`} color="#d8d8d8"><jscad.cuboid size={[.5, .5, 3.4]} center={[x, y, -1.5]} /></jscad.colorize>))}
  {[-4.1, 4.1].map(x => <jscad.colorize key={x} color="#d8d8d8"><jscad.cuboid size={[.3, 1.2, 3.4]} center={[x, 0, -1.5]} /></jscad.colorize>)}
</>)

const pinLabels = {
  pin1: ["pin1"],
  pin2: ["pin2"],
  pin3: ["pin3"],
  pin4: ["pin4"],
  pin5: ["pin5"],
  pin6: ["pin6"],
  pin7: ["pin7"],
  pin8: ["pin8"]
} as const

export const SK_22D03_G080 = (props: ChipProps<typeof pinLabels>) => {
  return (
    <chip
      pinLabels={pinLabels}
      symbol={
        <symbol>
          <schematicpath points={[{"x":-0.48,"y":0.08},{"x":-0.48,"y":0.28},{"x":-0.32,"y":0.28},{"x":-0.32,"y":0.14},{"x":-0.08,"y":0.14},{"x":-0.08,"y":0.28},{"x":0.08,"y":0.28},{"x":0.08,"y":0.08},{"x":-0.48,"y":0.08}]} strokeColor="#880000" />
          <schematicpath points={[{"x":-0.4,"y":0.6},{"x":-0.4,"y":0.28},{"x":-0.38,"y":0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":-0.4,"y":0.28},{"x":-0.42,"y":0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":0,"y":0.28},{"x":-0.02,"y":0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":0,"y":0.6},{"x":0,"y":0.28},{"x":0.02,"y":0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":0.4,"y":0.28},{"x":0.38,"y":0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":0.4,"y":0.6},{"x":0.4,"y":0.28},{"x":0.42,"y":0.38}]} strokeColor="#880000" />
          <port name="pin1" pinNumber={1} aliases={["1"]} direction="up" schX={-0.4} schY={0.8} schStemLength={0.2} />
          <port name="pin2" pinNumber={2} aliases={["2"]} direction="up" schX={0} schY={0.8} schStemLength={0.2} />
          <port name="pin3" pinNumber={3} aliases={["3"]} direction="up" schX={0.4} schY={0.8} schStemLength={0.2} />
          <schematicpath points={[{"x":-0.48,"y":-0.08},{"x":-0.48,"y":-0.28},{"x":-0.32,"y":-0.28},{"x":-0.32,"y":-0.14},{"x":-0.08,"y":-0.14},{"x":-0.08,"y":-0.28},{"x":0.08,"y":-0.28},{"x":0.08,"y":-0.08},{"x":-0.48,"y":-0.08}]} strokeColor="#880000" />
          <schematicpath points={[{"x":-0.4,"y":-0.6},{"x":-0.4,"y":-0.28},{"x":-0.38,"y":-0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":-0.4,"y":-0.28},{"x":-0.42,"y":-0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":0,"y":-0.28},{"x":-0.02,"y":-0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":0,"y":-0.6},{"x":0,"y":-0.28},{"x":0.02,"y":-0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":0.4,"y":-0.28},{"x":0.38,"y":-0.38}]} strokeColor="#880000" />
          <schematicpath points={[{"x":0.4,"y":-0.6},{"x":0.4,"y":-0.28},{"x":0.42,"y":-0.38}]} strokeColor="#880000" />
          <port name="pin4" pinNumber={4} aliases={["4"]} direction="down" schX={-0.4} schY={-0.8} schStemLength={0.2} />
          <port name="pin5" pinNumber={5} aliases={["5"]} direction="down" schX={0} schY={-0.8} schStemLength={0.2} />
          <port name="pin6" pinNumber={6} aliases={["6"]} direction="down" schX={0.4} schY={-0.8} schStemLength={0.2} />
          <schematicrect schX={0} schY={0} width={1.2} height={0.8} strokeWidth={0.02} color="#880000" />
          <port name="pin7" pinNumber={7} aliases={["7"]} direction="left" schX={-0.8} schY={0} schStemLength={0.2} />
          <port name="pin8" pinNumber={8} aliases={["8"]} direction="right" schX={0.8} schY={0} schStemLength={0.2} />
          <schematictext schX={0} schY={1.02} text="{NAME}" fontSize={0.2} anchor="bottom_center" />
        </symbol>
      }
      supplierPartNumbers={{
  "jlcpcb": [
    "C55166127"
  ]
}}
      manufacturerPartNumber="SK-22D03-G080"
      footprint={<footprint>
        <platedhole  portHints={["pin8"]} pcbX="4.099941mm" pcbY="-0mm" holeWidth="0.5999988mm" holeHeight="1.5999968mm" outerWidth="1.1999976mm" outerHeight="2.1999956mm" shape="pill" />
<platedhole  portHints={["pin7"]} pcbX="-4.099941mm" pcbY="-0mm" holeWidth="0.5999988mm" holeHeight="1.5999968mm" outerWidth="1.1999976mm" outerHeight="2.1999956mm" shape="pill" />
<platedhole  portHints={["pin6"]} pcbX="2.000123mm" pcbY="1.249934mm" outerDiameter="1.5999968mm" holeDiameter="0.999998mm" shape="circle" />
<platedhole  portHints={["pin5"]} pcbX="0.000127mm" pcbY="1.249934mm" outerDiameter="1.5999968mm" holeDiameter="0.999998mm" shape="circle" />
<platedhole  portHints={["pin4"]} pcbX="-1.999869mm" pcbY="1.249934mm" outerDiameter="1.5999968mm" holeDiameter="0.999998mm" shape="circle" />
<platedhole  portHints={["pin3"]} pcbX="2.000123mm" pcbY="-1.249934mm" outerDiameter="1.5999968mm" holeDiameter="0.999998mm" shape="circle" />
<platedhole  portHints={["pin2"]} pcbX="0.000127mm" pcbY="-1.249934mm" outerDiameter="1.5999968mm" holeDiameter="0.999998mm" shape="circle" />
<platedhole  portHints={["pin1"]} pcbX="-1.999869mm" pcbY="-1.249934mm" outerDiameter="1.5999968mm" holeDiameter="0.999998mm" shape="circle" />
<silkscreenpath route={[{"x":0.017957799999976487,"y":-11.428984000000128},{"x":-2.032126999999946,"y":-11.428984000000128},{"x":-2.032126999999946,"y":-3.4290000000000873}]} />
<silkscreenpath route={[{"x":0.017957799999976487,"y":-3.4290000000000873},{"x":0.017957799999976487,"y":-11.428984000000128}]} />
<silkscreenpath route={[{"x":0.004343400000152542,"y":-3.4290000000000873},{"x":0.004343400000152542,"y":-7.4289920000001075}]} />
<silkscreenpath route={[{"x":-4.191101599999911,"y":3.42899999999986},{"x":-4.191101599999911,"y":1.2261341999999331}]} />
<silkscreenpath route={[{"x":4.190898400000151,"y":1.2261341999999331},{"x":4.190898400000151,"y":3.42899999999986},{"x":-4.191101599999911,"y":3.42899999999986}]} />
<silkscreenpath route={[{"x":-4.191101599999911,"y":-1.2261342000000468},{"x":-4.191101599999911,"y":-3.4290000000000873},{"x":4.190898400000151,"y":-3.4290000000000873},{"x":4.190898400000151,"y":-1.2261342000000468}]} />
<silkscreentext text="{NAME}" pcbX="-0.000127mm" pcbY="4.4544mm" anchorAlignment="center" fontSize="1mm" />
<fabricationnotepath route={[{"x":-2.032126999999946,"y":-3.4290000000000873},{"x":-2.032126999999946,"y":-11.430000000000064},{"x":-0.00012700000002041634,"y":-11.430000000000064},{"x":-0.00012700000002041634,"y":-3.4290000000000873},{"x":-2.032126999999946,"y":-3.4290000000000873}]} strokeWidth="0mm" isFilled hasStroke={false} />
<courtyardoutline outline={[{"x":-4.568127000000004,"y":3.7043999999998505},{"x":4.567872999999963,"y":3.7043999999998505},{"x":4.567872999999963,"y":-11.680000000000177},{"x":-4.568127000000004,"y":-11.680000000000177},{"x":-4.568127000000004,"y":3.7043999999998505}]} />
      </footprint>}
      
      cadModel={{ modelOriginPosition: { x: 0, y: 0, z: 0 }, glbUrl: switchGlb }}
      {...props}
    />
  )
}