main
John Lauer
Advance Board32 through current acceptance and retain unresolved thermal gate
1f15473
"""Derive nominal R0 corners from the existing firmware envelope; no qualification."""
from pathlib import Path
import json,hashlib
root=Path(__file__).resolve().parents[1]
firmware=root/'firmware/load_core.c';code=firmware.read_text()
# Fail if the policy changes; this calculation must be reviewed with it.
for expression in ['s->volts<4.5f','s->volts>24','c->power_limit_w>5','c->power_limit_w*1.10f','fminf(3.0f,c->power_limit_w/s->volts)']:
if expression not in code:raise ValueError('Firmware envelope changed: '+expression)
rows=[]
spec_path=root/'design/spec.json'; spec=json.loads(spec_path.read_text())
datasheet=root/'datasheets/sbr10u45sp5.pdf'
for v in [4.5,5,12,24]:
command=min(3,5/v);guard=5.5/v
rows.append(dict(volts=v,commandCeilingA=command,nominalMeasuredGuardA=guard,diodeBoundW=guard*.42,shuntBoundW=guard*guard*.02*1.005))
for ref,key in [('D1','diodeBoundW'),('RSH1','shuntBoundW')]:
if abs(spec['hot'][ref]['watts']-rows[0][key])>1e-12:
raise ValueError('Selected heat input differs from reviewed operating corner: '+ref)
report=dict(status='nominal-design-corners-not-qualified',firmwareSha256=hashlib.sha256(firmware.read_bytes()).hexdigest(),inputs=dict(powerCommandW=5,powerGuardFactor=1.1,minVoltageV=4.5,maxVoltageV=24,currentCommandCapA=3,diodeForwardBoundV=.55,shuntOhm=.02),rows=rows,limits=['Measured guard does not prove true power without calibrated errors and verified shutdown latency.','The 3 A conductor screen remains; these operating corners do not replace fault/transient analysis.','Independent maximum Q1, diode and shunt heat sources overestimate simultaneous heat; do not describe them as one operating point.','Diode forward-voltage bound inherited from the sourced B540C design; reverify temperature and current conditions before release.'])
report['inputs'].update(diodeForwardBoundV=.42,diodeMpn='SBR10U45SP5-13',shuntToleranceFraction=.005)
report['limits'][-1]='Diode 0.42 V maximum is specified at 8 A and 25 C (DS31371 Rev12-2 p2); applying it at lower current is an engineering assumption, not an all-temperature guarantee. Shunt includes initial +0.5% resistance tolerance only; TCR and measurement error remain unbounded.'
report.update(specSha256=hashlib.sha256(spec_path.read_bytes()).hexdigest(),diodeDatasheetSha256=hashlib.sha256(datasheet.read_bytes()).hexdigest(),selectedSpecHeatMatches=True)
(root/'design/operating-heat-corners.json').write_text(json.dumps(report,indent=2)+'\n')
print(json.dumps(rows,indent=2))