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-controllerIn 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.
enclosure/export-print-files.ts
import {copyFile,mkdir,readFile,writeFile} from "node:fs/promises"
import {createHash} from "node:crypto"
import {resolve} from "node:path"
const root=import.meta.dir
const read=(p:string)=>readFile(resolve(root,p))
const checks=JSON.parse((await read("dist/mechanical-verification.json")).toString())
if(checks.status!=="PASS")throw Error("Mechanical verification must pass before exporting print files")
const out=resolve(root,"../assets/enclosure");await mkdir(out,{recursive:true})
const files:Record<string,string>={}
for(const name of ["base","lid","button-plunger","speed-knob","screen-holder","screen-door"]){
const filename=`${name}.stl`;const bytes=await read(`dist/${filename}`)
await copyFile(resolve(root,"dist",filename),resolve(out,filename))
files[filename]=createHash("sha256").update(bytes).digest("hex")
}
await writeFile(resolve(out,"provenance.json"),JSON.stringify({
pcbSha256:JSON.parse((await read("dist/build-report.json")).toString()).pcbSha256,
files,quantity:{base:1,lid:1,"button-plunger":5,"speed-knob":1,"screen-holder":1,"screen-door":1},
modeledChecks:checks.checkCount,physicalFitValidated:false,
},null,2)+"\n")
console.log("Exported six STL designs, 3MF print set and panel sticker artwork")
for(const name of ["bldc-enclosure.3mf","panel-sticker.svg","panel-sticker-art.svg"]) await copyFile(resolve(root,"dist",name),resolve(out,name))