shibosoftwaredev/f1c100s-linux-nema17-stepper-controller

A four-layer NEMA 17 motor-controller PCB combining an Allwinner F1C100S Linux computer, USB‑PD/buck power system, W5500 Ethernet, STM32 real-time motion control, DRV8825 stepper driver, protection/temperature/current telemetry, USB interfaces, and local LED/buzzer diagnostics.

Version
0.4.56
License
unset
Stars
0

scripts/shorten-swap-adc.py

"""Replace the provisional north-side ADC detour, restoring untouched SD D0."""
from route_geometry import *
p=json.loads(Path('routing/swap-progress-physical.json').read_text())
seed=json.loads(Path('routing/swap-adc-bridge.json').read_text())
old=json.loads(Path('routing/review-emitted-physical.json').read_text())
remove={'N166','N47'}
p['wires']=[w for w in p['wires'] if w['net'] not in remove]
p['vias']=[v for v in p['vias'] if v['net'] not in remove]
north=[(12.9,10.41),(12.9,11.8),(13.2,12.1)]
bridge=[(13.2,12.1),(11.762553666852048,11.990151079329802)]
for w in seed['wires']:
    if w['net']=='N166' and w['points'] not in [[list(a) for a in north],[list(a) for a in bridge]]:p['wires'].append(w)
p['vias'] += [v for v in seed['vias'] if v['net']=='N166' and math.dist((v['x'],v['y']),(13.2,12.1))>.001 and math.dist((v['x'],v['y']),(11.762553666852048,11.990151079329802))>.001]
p['wires'] += [w for w in old['wires'] if w['net']=='N47']
p['vias'] += [v for v in old['vias'] if v['net']=='N47']
p['wires'].append(dict(net='N166',layer='top',width=.15,points=[(12.9,10.41),(13.4,10.41),(13.4,8.7),(13.1,8.7)]))
p['vias'].append(dict(net='N166',x=13.1,y=8.7))
Path('routing/swap-short-adc.json').write_text(json.dumps(p,indent=2)+'\n')