AnasSarkiz/muse-voice-remote

Muse Voice Remote — bare ESP32-S3R8, 155 TOP JLCPCB parts with real supplier CAD, native 3D assembly and GLB exports. Revised 17 mm case allocation; 0.30 mm via drill /0.45 mm pad. Checked prototype PCB; mechanical, RF and MUSE qualification pending.

Version
1.3.2
License
unset
Stars
0

scripts/seed-power-routing.py

#!/usr/bin/env python3
"""Route compact power loops on top before general-purpose autorouting.

Original supplier land patterns are immutable. Each branch is independently
accepted or rolled back by the exact-geometry helper and native KiCad DRC.
"""
import json, pathlib, subprocess, sys
root=pathlib.Path(__file__).resolve().parents[1]
catalog={p['reference']:p for p in json.loads((root/'docs/component-catalog.json').read_text())}
plans=[
 ('REG_L1','U_REG','L_REG',.4),('REG_L2','U_REG','L_REG',.4),
 ('SYS','U_REG','C_REG_IN',.25),('V3_3','U_REG','C_REG_OUT1',.25),('V3_3','C_REG_OUT1','C_REG_OUT2',.5),
 ('BL_SENSE','U_BACKLIGHT','R_BL_FB',.15),('BL_SW','U_BACKLIGHT','L_BL',.3),('BL_SW','L_BL','D_BL',.5),
 ('BL_INPUT','U_BACKLIGHT','C_BL_IN',.3),('BL_INPUT','C_BL_IN','L_BL',.5),
 ('BL_ANODE_SUPPLY','D_BL','C_BL_OUT',.5),
 ('VBUS_FUSED','U_CHARGE','C_CHG_IN',.4),('SYS','U_CHARGE','C_CHG_OUT',.4),('BAT','U_CHARGE','C_CHG_BAT',.4),
 ('SPK_P','U_AMP','J_SPK',.25),('SPK_N','U_AMP','J_SPK',.25),
 ('SYS','U_AMP','C_AMP1',.3),('SYS','C_AMP1','C_AMP2',.5),
 ('MOTOR_3V0','U_MOTOR_POWER','C_MOTOR',.4),('MOTOR_3V0','C_MOTOR','J_MOTOR',.5),('MOTOR_LOW','Q_MOTOR','J_MOTOR',.5),
 ('RF_3V3','L_ANA','C_RF_BULK',.3),('RF_3V3','C_RF_BULK','C_ANA2',.25),('RF_3V3','U1','C_ANA2',.2),('V3_3','U_MOTOR_POWER','C_MOTOR_IN',.3),
]
logdir=root/'dist/power-routing';logdir.mkdir(exist_ok=True)
results=[]
for i,(net,a,b,width) in enumerate(plans):
 def pin(ref):return '3' if ref=='U1' and net=='RF_3V3' else next(k for k,v in catalog[ref]['padNets'].items() if v==net)
 args=['/usr/bin/python3',str(root/'scripts/route-precise-branch.py'),'--net',net,'--layer','top','--width',str(width),'--start-pad',a,pin(a),'--end-pad',b,pin(b)]
 with (logdir/f'{i:02}-{net}-{a}-{b}.log').open('w') as fd:r=subprocess.run(args,cwd=root,stdout=fd,stderr=subprocess.STDOUT)
 results.append(dict(net=net,start=a,end=b,width_mm=width,exit_code=r.returncode,log=str((logdir/f'{i:02}-{net}-{a}-{b}.log').relative_to(root))))
 print(net,a,b,'accepted' if r.returncode==0 else 'needs inspection',flush=True)
(root/'docs/power-route-seeding.json').write_text(json.dumps(results,indent=2)+'\n')
sys.exit(any(r['exit_code'] for r in results))