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/breakoff-geometry.ts

/** Geometry of the encoder break-off (fabrication only; the controller board itself is unchanged). */
export const controller = { left: -58, right: 33, bottom: -26.5, top: 63.5 } as const
export const encoderSize = { width: 24, height: 38, originToTop: 12.5 } as const
/** Routed slot between the two boards. */
export const slot = 2
/** Encoder hangs below the controller's bottom edge, where no part sits within 3 mm of the edge. */
export const encoderCenterX = 13

const encoderTop = controller.bottom - slot
const encoderBottom = encoderTop - encoderSize.height
const encoderLeft = encoderCenterX - encoderSize.width / 2
const encoderRight = encoderCenterX + encoderSize.width / 2
/** Where the encoder board's own origin (its chip centre) lands, in controller coordinates. */
export const encoderOrigin = { x: encoderCenterX, y: encoderTop - encoderSize.originToTop } as const

/** Two bridges at the encoder's top corners, each perforated so the encoder snaps off. They are clear
 * of the encoder's settings pads and of the keep-out circles of the bulk capacitors C95/C96, which
 * reach the controller's edge at X = 9 and X = 21. */
export const bridge = { width: 3, holeDiameter: 0.5, holePitch: 0.75, holesPerRow: 4 } as const
export const bridges = [
  { x0: encoderLeft, x1: encoderLeft + bridge.width },
  { x0: encoderRight - bridge.width, x1: encoderRight },
] as const

/** One outline for the joined board: controller, the two bridges, encoder. Counter-clockwise. */
export const outline = [
  { x: controller.left, y: controller.top }, { x: controller.left, y: controller.bottom },
  { x: encoderLeft, y: controller.bottom }, { x: encoderLeft, y: encoderBottom },
  { x: encoderRight, y: encoderBottom }, { x: encoderRight, y: controller.bottom },
  { x: controller.right, y: controller.bottom }, { x: controller.right, y: controller.top },
]
/** Routed slot between the bridges, which separates the two boards. */
export const slotBetweenBridges = { x0: bridges[0].x1, x1: bridges[1].x0, y0: encoderTop, y1: controller.bottom } as const
/** Perforations: one row on the encoder edge, one just outside the controller edge. The controller
 * row does not cut into the controller, so a small ridge is left on it and is filed off after snapping. */
export const perforations = bridges.flatMap(({ x0, x1 }) =>
  Array.from({ length: bridge.holesPerRow }, (_, i) => (x0 + x1) / 2 + (i - (bridge.holesPerRow - 1) / 2) * bridge.holePitch)
    .flatMap(x => [{ x, y: controller.bottom - 0.3 }, { x, y: encoderTop }]))
export const bounds = { left: controller.left, right: controller.right, bottom: encoderBottom, top: controller.top } as const