MustafaMulla29/rp2040-bldc-motor-controller-new

A USB‑C PD–powered RP2040 BLDC motor controller PCB with 3.3 V logic, MCT8329A sensorless commutation, three MOSFET half-bridges, protected power switching, USB data, controls, and motor connectors.

Version
0.3.82
License
unset
Stars
0

circuit/power-switch.tsx

import { TPS1H100AQPWPRQ1 } from "../imports/TPS1H100AQPWPRQ1"
import { JS202011JCQN } from "../imports/JS202011JCQN"
import { SS54 } from "../imports/SS54"
import { BZT52C4V7 } from "../imports/BZT52C4V7"
import { schAt, net, Passives, type Passive } from "./helpers"

// TI TPS1H100-Q1: Fig. 45 and the 470 uF inrush example, Fig. 48.
// OFF removes motor power and clamps ARM. USB logic remains available.
const parts: Passive[] = [
  {name:"R140",kind:"R",value:"10k",a:"PD_LOAD",b:"POWER_ON_LEVEL",x:0,y:0},
  {name:"R141",kind:"R",value:"22k",a:"POWER_ON_LEVEL",b:"GND",x:0,y:0},
  {name:"R142",kind:"R",value:"1.5k",a:"POWER_CURRENT_LIMIT",b:"GND",x:0,y:0},
  {name:"R143",kind:"R",value:"10k",a:"VMOTOR",b:"GND",x:0,y:0},
  {name:"R144",kind:"R",value:"100k",a:"POWER_SWITCH_EN",b:"GND",x:0,y:0},
  {name:"C140",kind:"C",value:"100nF",a:"PD_LOAD",b:"GND",x:0,y:0,footprint:"0402",volts:50},
  {name:"C141",kind:"C",value:"1uF",a:"PD_LOAD",b:"GND",x:0,y:0,footprint:"0805",volts:50},
]
export function PowerSwitch() {
  return <>
    <JS202011JCQN name="SW4" {...schAt("SW4",0,0)} noConnect={["pin7"]}
      connections={{pin1:net("GND"),pin2:net("POWER_SWITCH_EN"),pin3:net("POWER_ON_LEVEL"),
        pin5:net("GND"),pin6:net("ARM_BASE")}} />
    <TPS1H100AQPWPRQ1 name="U11" {...schAt("U11",0,0)} noConnect={["pin1","pin4","pin11","pin14"]}
      connections={{pin2:net("GND"),pin3:net("POWER_SWITCH_EN"),
        pin5:net("VMOTOR"),pin6:net("VMOTOR"),pin7:net("VMOTOR"),
        pin8:net("PD_LOAD"),pin9:net("PD_LOAD"),pin10:net("PD_LOAD"),
        pin12:net("GND"),pin13:net("POWER_CURRENT_LIMIT"),pin15:net("GND")}} />
    {/* Transient motor energy returns to the local TVS through D6, including OFF.
        U12/Q7 block return current into USB. This is not a sustained braking load. */}
    <SS54 name="D6" variant="schottky" {...schAt("D6",0,0)}
      connections={{anode:net("VMOTOR"),cathode:net("PD_LOAD")}} />
    <BZT52C4V7 name="D7" variant="zener" {...schAt("D7",0,0)}
      connections={{pin1:net("POWER_ON_LEVEL"),pin2:net("GND")}} />
    <Passives parts={parts} sx={0} sy={0} />
  </>
}