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/capture-routing-input.mjs

import {Circuit} from '@tscircuit/core'
import {writeFileSync,readFileSync} from 'node:fs'
import Board from '../index.circuit.tsx'
const plan=JSON.parse(readFileSync('circuit/route-plan.json'))
const routingAlgorithm=async input=>{
 writeFileSync('../candidate-input.json',JSON.stringify(input))
 const events=new Map()
 return {on(n,f){events.set(n,f)},start(){events.get('complete')({traces:process.argv.includes('--empty')?[]:structuredClone(plan.traces)})},stop(){}}
}
const c=new Circuit({platform:{partsEngineDisabled:true,schematicDisabled:!process.argv.includes("--schematic")}})
c.add(Board({routingAlgorithm}));await c.renderUntilSettled()
const json=c.getCircuitJson();writeFileSync('../candidate.circuit.json',JSON.stringify(json))
const errors=json.filter(x=>x.type.endsWith('_error'))
writeFileSync('../candidate-errors.json',JSON.stringify(errors,null,2));console.log('Candidate errors',errors.length)
if(errors.length)process.exitCode=1