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/create-schematic-gallery.mjs

import {readFileSync,writeFileSync} from 'node:fs'
const layout=JSON.parse(readFileSync('circuit/schematic-layout.json','utf8'))
const references=JSON.parse(readFileSync('circuit/schematic-references.json','utf8'))
const escape=s=>s.replaceAll('&','&amp;').replaceAll('<','&lt;').replaceAll('"','&quot;')
const links=layout.sheets.map(s=>`<a href="#${s.name}">${s.index+1}. ${escape(s.title)}</a>`).join('')
const cards=layout.sheets.map(s=>{
 const stem=`${String(s.index+1).padStart(2,'0')}-${s.name}`
 const referenceLinks=(references[s.name]??[]).map(r=>`<a href="${escape(r.url)}" target="_blank" rel="noopener noreferrer">${escape(r.title)}</a>`).join(' · ')
 return `<section id="${s.name}"><h2>${s.index+1}. ${escape(s.title)}</h2><p class="references">Arrangement references: ${referenceLinks}</p><a href="${stem}.svg" target="_blank" title="Open full resolution schematic"><img src="${stem}.svg" alt="${escape(s.title)} schematic" loading="lazy"></a></section>`
}).join('')
writeFileSync('.tscircuit/schematics/index.html',`<!doctype html><html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>BLDC controller — schematic review</title><style>*{box-sizing:border-box}body{margin:0;background:#f3f5f8;color:#1b2732;font:15px system-ui}header{padding:30px 32px;background:#fff;border-bottom:1px solid #d6dce2}h1{font-size:25px;margin:0 0 8px}header p{margin:0;color:#536071}nav{position:fixed;width:260px;top:114px;bottom:0;overflow:auto;padding:22px 16px}nav a{display:block;text-decoration:none;color:#174e70;padding:9px 12px;border-radius:6px}nav a:hover{background:#dde7f0}main{margin-left:260px;padding:24px}section{margin-bottom:36px;scroll-margin-top:20px}h2{font-size:18px;font-weight:600}.references{font-size:13px;line-height:1.6;color:#536071}.references a{color:#174e70}img{display:block;width:100%;border:1px solid #ccd3da;background:white;box-shadow:0 2px 8px #0000000d}@media(max-width:850px){nav{position:static;width:auto;columns:2}main{margin:0;padding:16px}}@media print{header,nav,h2,.references{display:none}main{margin:0;padding:0}section{break-after:page;margin:0}img{border:0;box-shadow:none}}</style><header><h1>RP2040 BLDC controller</h1><p>${layout.sheets.length} schematic sheets · Click any sheet to open its full-resolution vector drawing.</p></header><nav>${links}</nav><main>${cards}</main></html>`)
console.log('Wrote .tscircuit/schematics/index.html')