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/drawing-sheets.tsx
/**
* Native tscircuit engineering drawings for the printed enclosure (A3).
*
* EnclosureDrawingSheets (BLDC-ENC-01, three sheets) references the fitted case group by
* name, so it is placed in the product model (index.tsx) and appears on the package's
* Drawing tab. The exploded view (BLDC-ENC-02) needs a lifted copy of the parts, which
* would also appear in the 3D model, so it is built separately by drawings.circuit.tsx.
*
* View directions, verified with a marker model in tscircuit 0.0.3133: y-/y+/x-/x+ are
* true views looking along that axis; z+ is the plan seen from above but turned 180
* degrees. That turned plan is exactly the third-angle plan for a principal view taken
* from the rear (y-), so sheet 1 uses the REAR (motor-connector) wall as principal view.
*/
import {assembly} from "tscircuit"
import {buttons,design} from "./dimensions"
const k=design.knob
// Outer footprint (mm) for 1:1 viewports: tscircuit fits geometry inside 1/1.1 of a viewport.
// W is the base across its two mounting flanges (104.4 mm case + 2 x 13 mm); D is the case depth.
const W=104.4+2*design.mount.width, D=103.4
const rowY=buttons.find(b=>b.ref==="SW7")!.y
// Revision D (2026-12-01): BOOT and RESET caps and rims replaced by paperclip pinholes; service caps removed.
// Revision E (2026-12-02): mounting flanges added to the base on the POWER / USB side and the encoder side.
export const drawingMeta={title:"BLDC controller enclosure",dateOfIssue:"2026-12-02",revisionIndex:"E"}
/**
* Section plane in board/CAD coordinates. tscircuit 0.0.3133 builds the drawing scene
* turned 180 degrees about Z relative to its section-plane conversion (the same turn seen
* in the z+ plan), so a requested plane lands at -offset with the kept side swapped.
* Verified on this model: each cut below passes through the feature it names. Remove this
* correction once tscircuit fixes it.
*/
export function cut(axis:"x"|"y",offset:number,keep:"less"|"greater"){
return {axis,offset:-offset,keepSide:keep==="less"?"greater":"less",hatchSpacing:1} as const
}
/** Three-sheet drawing BLDC-ENC-01 for the fitted case group named `group`. */
export function EnclosureDrawingSheets({group,partPrefix=""}:{group:string;partPrefix?:string}){
const g=`.${group}`, p=(n:string)=>`.${partPrefix}${n}`
const meta={...drawingMeta,identificationNumber:"BLDC-ENC-01",numberOfSheets:3}
return <>
<assembly.drawing.page name="enclosure_general_arrangement" displayName="Enclosure / general arrangement" size="iso_a3">
<assembly.drawing.titleblock {...meta} title="BLDC controller enclosure / general arrangement" sheetNumber={1}/>
<assembly.drawing.partview name="REAR_VIEW" displayName="Rear view (motor connectors)" partRef={g} direction="y-" width={1.1*W} height={50} centerX={-120} centerY={-60}>
<assembly.drawing.dimension widthOfView/>
<assembly.drawing.dimension heightOfView/>
</assembly.drawing.partview>
<assembly.drawing.partview name="PLAN_VIEW" displayName="Plan (rear edge down)" partRef={g} direction="z+" width={1.1*W} height={1.1*D} centerX={-120} centerY={30}>
<assembly.drawing.dimension heightOfView/>
</assembly.drawing.partview>
<assembly.drawing.partview name="LEFT_VIEW" displayName="Left view (USB / POWER)" partRef={g} direction="x+" width={1.1*D} height={50} centerX={25} centerY={-60}>
<assembly.drawing.dimension widthOfView/>
</assembly.drawing.partview>
<assembly.drawing.partview name="ISOMETRIC" displayName="Assembled enclosure" partRef={g} direction="isometric" width={130} height={110} centerX={130} centerY={60}/>
</assembly.drawing.page>
{/* A-A and B-B keep the rear half and look toward +y; C-C keeps the right half and
looks toward +x, so each hatched cut face points at the viewer. */}
<assembly.drawing.page name="enclosure_sections" displayName="Enclosure / sections" size="iso_a3">
<assembly.drawing.titleblock {...meta} title="BLDC controller enclosure / sections" sheetNumber={2}/>
<assembly.drawing.partview name="SECTION_A_A" displayName="Section A-A / SPEED knob axis" partRef={g} direction="y+" width={1.1*W} height={50} centerX={-95} centerY={75}
section={cut("y",k.y,"greater")}/>
<assembly.drawing.partview name="SECTION_B_B" displayName="Section B-B / button row and BOOT, RESET pinholes" partRef={g} direction="y+" width={1.1*W} height={50} centerX={-95} centerY={5}
section={cut("y",rowY,"greater")}/>
<assembly.drawing.partview name="SECTION_C_C" displayName="Section C-C / SPEED knob axis" partRef={g} direction="x+" width={1.1*D} height={50} centerX={-95} centerY={-65}
section={cut("x",k.x,"greater")}/>
<assembly.drawing.partview name="SECTION_A_A_ISOMETRIC" displayName="Section A-A / isometric" partRef={g} direction="isometric" width={140} height={115} centerX={115} centerY={65}
section={cut("y",k.y,"greater")}/>
</assembly.drawing.page>
<assembly.drawing.page name="enclosure_printed_parts" displayName="Enclosure / printed parts" size="iso_a3">
<assembly.drawing.titleblock {...meta} title="BLDC controller enclosure / printed parts" sheetNumber={3}/>
<assembly.drawing.partview name="PART_1" displayName="1 / case base / qty 1" partRef={p("CASE_BASE")} direction="isometric" width={120} height={95} centerX={-130} centerY={75}/>
<assembly.drawing.partview name="PART_2" displayName="2 / case lid / qty 1" partRef={p("CASE_LID")} direction="isometric" width={120} height={95} centerX={0} centerY={75}/>
<assembly.drawing.partview name="PART_3" displayName="3 / screen holder / qty 1" partRef={p("SCREEN_HOLDER")} direction="isometric" width={90} height={95} centerX={130} centerY={75}/>
<assembly.drawing.partview name="PART_4" displayName="4 / button cap / qty 5" partRef={p("PLUNGER_SW7")} direction="isometric" width={70} height={80} centerX={-150} centerY={-40}/>
<assembly.drawing.partview name="PART_5" displayName="5 / SPEED knob / qty 1" partRef={p("SPEED_KNOB")} direction="isometric" width={70} height={80} centerX={-70} centerY={-40}/>
<assembly.drawing.partview name="PART_6" displayName="6 / screen door / qty 1" partRef={p("SCREEN_DOOR")} direction="isometric" width={90} height={80} centerX={25} centerY={-40}/>
</assembly.drawing.page>
</>}