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.

scripts/validate.mjs

import { spawnSync } from "node:child_process"
import { mkdirSync, writeFileSync } from "node:fs"

const outputDir = ".tscircuit/checks"
mkdirSync(outputDir, { recursive: true })
const checks = [
  ["typecheck", "bun", ["run", "typecheck"]],
  ["saved-routing", "bun", ["scripts/check-saved-routing.mjs"]],
  ["netlist", "./node_modules/.bin/tsci", ["check", "netlist", "scripts/checks.circuit.tsx"]],
  ["schematic-placement", "./node_modules/.bin/tsci", ["check", "schematic-placement", "scripts/checks.circuit.tsx"]],
  ["placement", "./node_modules/.bin/tsci", ["check", "placement", "scripts/checks.circuit.tsx"]],
]
for (const [name, command, args] of checks) {
  const r = spawnSync(command, args, { encoding: "utf8", timeout: 240_000, maxBuffer: 20e6 })
  const output = (r.stdout ?? "") + (r.stderr ?? "")
  writeFileSync(`${outputDir}/${name}.txt`, output)
  const schematicIssues = [...output.matchAll(/<SchematicPlacementIssues>([\s\S]*?)<\/SchematicPlacementIssues>/g)]
    .some(match => match[1].trim().length > 0)
  const failed = r.status !== 0 || Boolean(schematicIssues) || /Errors: [1-9]/.test(output) || /source_failed_to_create_component_error/.test(output)
  console.log(`${name}: ${failed ? "FAIL" : "PASS"} (${outputDir}/${name}.txt)`)
  if (failed) process.exit(1)
}
console.log("Representation checks passed. This is not an electrical or fabrication signoff.")