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/RK09D1130C2P.tsx

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

// Model to the Alps RK09D1130C2P dimension drawing (tech.alpsalpine.com fig
// rk09k_d_422): body 6.8 mm high x 9.8 mm wide; collar/bushing to 11.8 mm;
// shaft dia 6 (0/-0.05) with ONE flat, 4.5 mm across the flat (0/-0.05), flat
// length l1 = 12 mm from the tip; LM1 = 25 mm from the mounting surface (PCB
// top); C0.8 tip chamfer. Shaft axis on the mounting-tab line (footprint y = 3.9).
// The flat faces -Y here; on the real part its angle follows the shaft rotation.
// The EasyEDA C361173 model is ~5 mm short and offset, so it is not used.
const ax = 3.9
export const potModel = renderToJscadPlan(<>
  <jscad.colorize color="#3b3f45"><jscad.cuboid size={[9.8, 11.7, 6.8]} center={[0, ax - .35, 3.4]} /></jscad.colorize>
  <jscad.colorize color="#c9ccd1"><jscad.cylinder radius={4.1} height={1} center={[0, ax, 7.3]} /></jscad.colorize>
  <jscad.colorize color="#c9ccd1"><jscad.cylinder radius={3.5} height={4} center={[0, ax, 9.8]} /></jscad.colorize>
  <jscad.colorize color="#202124"><jscad.subtract>
    <jscad.union>
      <jscad.cylinder radius={3} height={12.4} center={[0, ax, 18]} />
      <jscad.hull>
        <jscad.cylinder radius={3} height={.01} center={[0, ax, 24.2]} />
        <jscad.cylinder radius={2.2} height={.01} center={[0, ax, 25]} />
      </jscad.hull>
    </jscad.union>
    <jscad.cuboid size={[8, 4, 12.2]} center={[0, ax - 1.5 - 2, 19.1]} />
  </jscad.subtract></jscad.colorize>
  {/* Terminal block on the back of the body: the three pins leave the body here. */}
  <jscad.colorize color="#2b2e33"><jscad.cuboid size={[7.6, 2.0, 2.6]} center={[0, -3.25, 1.3]} /></jscad.colorize>
  {[-2.5, 0, 2.5].map(x => <jscad.colorize key={x} color="#d8d8d8"><jscad.cuboid size={[.6, .6, 4.6]} center={[x, -3.1, -.7]} /></jscad.colorize>)}
  {[-4.4, 4.4].map(x => <jscad.colorize key={x} color="#c9ccd1"><jscad.cuboid size={[.4, 1.8, 4]} center={[x, ax, -1]} /></jscad.colorize>)}
</>)

const pinLabels = {
  pin1: ["pin1"],
  pin2: ["pin2"],
  pin3: ["pin3"],
  pin4: ["EH1"],
  pin5: ["EH2"]
} as const

// Alps RK09D1130C2P: vertical, 10 kB, insulated 6 mm shaft with one flat (4.5 mm
// across, 12 mm long from the tip), LM1 = 25 mm, with collar (Alps drawing).
// Same RK09 pin row and 8.8 mm tab spacing as the former RK09K part.
// Mounting pattern corrected against Alps Drawing 2 and the KiCad library
// Potentiometer_Alps_RK09K_Single_Vertical: 8.8 mm tab centers, 7 mm row offset.
export const RK09D1130C2P = (props: ChipProps<typeof pinLabels>) => {
  return (
    <potentiometer
      maxResistance="10k" pinVariant="three_pin"
      pinAttributes={{ pin4: { doNotConnect: true }, pin5: { doNotConnect: true } }}
      pinLabels={pinLabels}
      symbol={
        <symbol>
          {/* Vertical resistive track; electrical wiper exits to the right.
              The two mechanical tabs remain explicitly unconnected. */}
          <schematictext text="{NAME}" schX={0.55} schY={0.9} fontSize={0.22} anchor="left" />
          <schematictext text="10k / RK09D1130C2P" schX={0.55} schY={0.6} fontSize={0.18} anchor="left" />
          <port name="pin5" pinNumber={5} aliases={["EH2","EH"]} direction="left" schX={-1.2} schY={-0.45} schStemLength={0.2} />
          <port name="pin4" pinNumber={4} aliases={["EH1","EH"]} direction="left" schX={-1.2} schY={0.45} schStemLength={0.2} />
          <schematicrect schX={0} schY={0} width={0.3} height={0.9} strokeWidth={0.02} color="#880000" />
          <schematicpath points={[{x:0,y:-0.45},{x:0,y:-0.7}]} strokeColor="#880000" />
          <schematicpath points={[{x:0,y:0.45},{x:0,y:0.7}]} strokeColor="#880000" />
          <schematicpath points={[{x:0.7,y:0},{x:0.16,y:0},{x:0.3,y:0.08},{x:0.16,y:0},{x:0.3,y:-0.08}]} strokeColor="#880000" />
          <port name="pin1" pinNumber={1} aliases={["1"]} direction="down" schX={0} schY={-0.9} schStemLength={0.2} />
          <port name="pin2" pinNumber={2} aliases={["2"]} direction="right" schX={0.9} schY={0} schStemLength={0.2} />
          <port name="pin3" pinNumber={3} aliases={["3"]} direction="up" schX={0} schY={0.9} schStemLength={0.2} />
        </symbol>
      }
      supplierPartNumbers={{
  "jlcpcb": [
    "C361173"
  ]
}}
      manufacturerPartNumber="RK09D1130C2P"
      footprint={<footprint>
        <platedhole  portHints={["pin1"]} pcbX="-2.499868mm" pcbY="-3.09999385mm" outerDiameter="1.6999966mm" holeDiameter="1.1000232mm" shape="circle" />
<platedhole  portHints={["pin2"]} pcbX="0mm" pcbY="-3.09999385mm" outerDiameter="1.6999966mm" holeDiameter="1.1000232mm" shape="circle" />
<platedhole  portHints={["pin3"]} pcbX="2.500122mm" pcbY="-3.09999385mm" outerDiameter="1.6999966mm" holeDiameter="1.1000232mm" shape="circle" />
<platedhole  portHints={["pin4"]} pcbX="4.4mm" pcbY="3.89999215mm" holeWidth="1.9mm" holeHeight="2.2mm" outerWidth="2.5mm" outerHeight="3mm" shape="pill" />
<platedhole  portHints={["pin5"]} pcbX="-4.4mm" pcbY="3.89999215mm" holeWidth="1.9mm" holeHeight="2.2mm" outerWidth="2.5mm" outerHeight="3mm" shape="pill" />
<silkscreenpath route={[{"x":-4.8999902000000475,"y":9.400158950000105},{"x":4.899990199999934,"y":9.400133550000078}]} />
<silkscreenpath route={[{"x":4.899990199999934,"y":9.400133550000078},{"x":4.899990199999934,"y":5.778372950000062}]} />
<silkscreenpath route={[{"x":4.899990199999934,"y":2.0218907500002388},{"x":4.899990199999934,"y":-2.5998678499997823}]} />
<silkscreenpath route={[{"x":-4.8999902000000475,"y":9.400133550000078},{"x":-4.8999902000000475,"y":5.778372950000062}]} />
<silkscreenpath route={[{"x":-4.8999902000000475,"y":2.0218907500002388},{"x":-4.8999902000000475,"y":-2.5998678499997823}]} />
<silkscreenpath route={[{"x":-4.8999902000000475,"y":-2.5998678499997823},{"x":-3.498240399999986,"y":-2.5998678499997823}]} />
<silkscreenpath route={[{"x":-1.5817596000001686,"y":-2.5998678499997823},{"x":-0.9582404000000224,"y":-2.5998678499997823}]} />
<silkscreenpath route={[{"x":0.9582403999999087,"y":-2.5998678499997823},{"x":1.5817596000000549,"y":-2.5998678499997823}]} />
<silkscreenpath route={[{"x":4.899990199999934,"y":-2.5998678499997823},{"x":3.498240399999986,"y":-2.5998678499997823}]} />
<silkscreenpath route={[{"x":-0.2540000000001328,"y":6.877126150000095},{"x":-0.2540000000001328,"y":5.353126150000094},{"x":0.2540000000000191,"y":5.353126150000094},{"x":0.2540000000000191,"y":6.877126150000095}]} />
<silkscreencircle pcbX="0mm" pcbY="3.89999215mm" radius="2.999994mm" />
<silkscreencircle pcbX="-3.302mm" pcbY="7.89312615mm" radius="0.718312mm" />
<silkscreencircle pcbX="3.302mm" pcbY="7.89312615mm" radius="0.718312mm" />
<silkscreencircle pcbX="-3.302mm" pcbY="-0.99687385mm" radius="0.718312mm" />
<silkscreencircle pcbX="3.302mm" pcbY="-0.99687385mm" radius="0.718312mm" />
<silkscreencircle pcbX="-4.2899838mm" pcbY="-3.31000105mm" radius="0.2641854mm" />
<silkscreentext text="{NAME}" pcbX="3.25mm" pcbY="13.2mm" anchorAlignment="center" fontSize="1mm" />
<courtyardrect pcbX={0} pcbY={2.6} width={12.3} height={14.6} />
      </footprint>}
      cadModel={{ modelOriginPosition: { x: 0, y: 0, z: 0 }, glbUrl: potGlb }}
      {...props}
    />
  )
}