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/preserve-working-clock-trees.py
"""Preserve the unchanged, validated clock trees when reimporting the board."""
from route_geometry import *
baseline=json.loads(Path('reports/v046-original-complete-routes.json').read_text())
trees=[t for t in baseline if t['source_trace_id'] in ['source_trace_18','source_trace_19']]
assert len(trees)==4
# The importer rechecks exact terminal identities, zero vias, and 10 mm total
# length against the current source. This is geometry reuse, not a waiver.
Path('routing/review-clock.json').write_text(json.dumps(trees,indent=2)+'\n')
# This unchanged two-terminal SoC decoupling escape must remain a complete
# native path. Reuse its working 0.12 mm geometry, rather than converting a
# shared-net overlap into two disconnected saved-path records.
pairs=[t for t in baseline if t['source_trace_id']=='source_trace_40']
assert len(pairs)==1
# Preserve the checked 0.30 mm motor-current paths as complete native paths.
# A generic shared-net export may otherwise pick a narrow pad/Kelvin contact
# as a shortcut, even though the full-width outer-layer trunk is present.
authored=json.loads(Path('routing/retained-sense-block.json').read_text())
for name in ['MOTOR_A_SENSED_PLUS','MOTOR_B_SENSED_PLUS']:
chunks=[t for t in authored if t['name']==name]
route=[]
for t in chunks:route.extend(dict(p) for p in t['route'])
for i,p in enumerate(route):
if p['route_type']=='via':p['to_layer']=route[i+1]['layer']
pairs.append({**chunks[0],'route':route})
Path('routing/review-preserved-pairs.json').write_text(json.dumps(pairs,indent=2)+'\n')