MustafaMulla29/rp2040-bldc-motor-controller-new
73×72 mm 4-layer USB‑C PD (5/9/15/20 V) RP2040 controller PCB with protected power switching, MCT8329A sensorless BLDC three-phase MOSFET bridge, USB data/programming, onboard controls, and three motor outputs feeding a 2212 motor through rigid bullet adapters.
- Version
- 0.3.100
- License
- unset
- Stars
- 0
scripts/review-pd-electrical.py
"""Reproducible 5 V DC sensitivity screen, NOT a measured load qualification."""
from pathlib import Path
import hashlib,json,subprocess
ROOT=Path(__file__).resolve().parent.parent
subprocess.run(['bun','scripts/check-pd-config.mjs'],cwd=ROOT,check=True,stdout=subprocess.DEVNULL)
raw=(ROOT/'dist/index/circuit.json').read_bytes();c=json.loads(raw);p={r['name']:r for r in c if r['type']=='source_component'}
for name,mpn in {'U11':'TPS1H100AQPWPRQ1','Q1':'SI7111EDN-T1-GE3','Q2':'SI7111EDN-T1-GE3','Q7':'DMT6009LFG-7','U12':'LM74700QDBVTQ1','D4':'SMBJ22A'}.items():assert p[name]['manufacturer_part_number']==mpn,(name,mpn)
assert p['R13']['resistance']==.02 and p['R142']['resistance']==2000
other=.032+.02+.034
scenarios=[]
for name,source,cable,ron,diode in [('5 V, short cable, room-temperature estimate',5,.1,.120,.020),('5 V, short cable, hot-switch estimate',5,.1,.166*1.2,.029),('Low source, high cable resistance, hot switch',4.75,.25,.166*1.2,.029)]:
motor=.8;logic=.1;drop=(motor+logic)*cable;board=motor*(other+ron)+diode;vm=source-drop-board
scenarios.append({'name':name,'source_V':source,'motor_feed_A':motor,'assumed_logic_input_A':logic,'cable_loop_ohms':cable,'cable_drop_V':drop,'partial_board_drop_V':board,'estimated_VMOTOR_V':vm,'above_driver_4_5V':vm>=4.5,'above_provisional_cutoff_4_65V':vm>=4.65})
r={'board_sha256':hashlib.sha256(raw).hexdigest(),'status':'5V_LOAD_NOT_GUARANTEED','scope':'Static illustrative scenarios, not a full worst-case analysis or operating rating. The 0.1 A logic input is a sensitivity assumption, not the larger current-budget allocation. PCB/connector drops, dynamic startup, component hot increases and motor regeneration are omitted.',
'r142Ohms':2000,'r142Effect':'R142 sets a lower trip limit but does not remove U11 on-resistance or cable drop at this 0.8 A scenario.',
'inputs':{'F1_nominal_cold_ohms':.034,'R13_ohms':.02,'PMOS_pair_ohms_at_2_5V_gate_25C':.032,'U11_25C_low_voltage_max_ohms':.120,'U11_hot_extended_ohms':.166*1.2,'ideal_diode_typical_max_V':[.020,.029]},
'scenarios':scenarios,'physical_test_status':'NOT_RUN: no prototype or measurement instruments used',
'sources':{'pmos':'https://www.vishay.com/docs/67807/si7111edn.pdf','switch':'https://www.ti.com/lit/ds/symlink/tps1h100-q1.pdf','ideal':'https://www.ti.com/lit/ds/symlink/lm74700-q1.pdf','fuse':'https://www.littelfuse.com/products/fuses-overcurrent-protection/fuses/surface-mount-fuses/nano-2-fuses/452/0452003','driver':'https://www.ti.com/lit/ds/symlink/mct8329a.pdf'}}
(ROOT/'dist/pd-electrical-review.json').write_text(json.dumps(r,indent=2)+'\n');print(r['status'],[round(s['estimated_VMOTOR_V'],4) for s in scenarios])