main
John Lauer Document v85 cooling sensitivity, rotated carrier and review-only native fabrication exports 9fdd7cb
#!/usr/bin/env python3
"""Summarize supplied-parameter studies without changing acceptance inputs."""
import hashlib
import json
from pathlib import Path

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt

ROOT = Path(__file__).resolve().parents[1]
BASE = ROOT / 'checkpoints/package-cooling-v85'
rows = []
for name, resistance, pitch in [('10k-0p2', 10, .2), ('100k-0p2', 100, .2),
                                 ('1000k-0p2', 1000, .2), ('100k-0p1', 100, .1)]:
    path = BASE / ('fields-' + name) / 'fields.json'
    result = json.loads(path.read_text())
    package = result['packageCooling'][0]
    rows.append(dict(study=name, caseToEachPadKPerW=resistance, pitchMm=pitch,
                     stillCaseC=40 + package['still']['caseRiseC'],
                     movingCaseC=40 + package['moving']['caseRiseC'],
                     stillJunctionC=40 + package['still']['junctionRiseC'],
                     movingJunctionC=40 + package['moving']['junctionRiseC'],
                     maxEnergyResidualW=max(abs(package[s]['energyResidualW']) for s in ['still', 'moving']),
                     resultSha256=hashlib.sha256(path.read_bytes()).hexdigest(),
                     source=str(path.relative_to(ROOT))))
summary = dict(status='unqualified-parameter-sensitivity', ambientC=40, sourceW=5.5,
               boardSha256=hashlib.sha256((ROOT/'kicad/adom-custom-electronic-load.kicad_pcb').read_bytes()).hexdigest(),
               thermalAcceptance=False, studies=rows,
               limitations=['Installed airflow, TIM contact and package-to-pad resistances are unqualified.',
                            'Full-power still-air fails the 55 C case ceiling; no fault transient is solved.',
                            'Private combined review build, not the shared Fields release.'])
(BASE/'summary.json').write_text(json.dumps(summary, indent=2)+'\n')
plt.rcParams.update({'figure.facecolor':'#111923','axes.facecolor':'#111923',
                     'text.color':'#e7eff7','axes.labelcolor':'#e7eff7',
                     'xtick.color':'#b5c7d8','ytick.color':'#b5c7d8','font.size':12})
fig, ax = plt.subplots(figsize=(12,6.5))
x = list(range(len(rows)))
ax.plot(x,[r['stillCaseC'] for r in rows], 'o-', color='#ffac75',label='Full power, still air')
ax.plot(x,[r['movingCaseC'] for r in rows], 'o-', color='#58d5c5',label='Assumed forced cooling')
ax.axhline(55,color='#f5788c',linestyle='--',label='55 °C case ceiling')
ax.set_xticks(x,[f"{r['caseToEachPadKPerW']} K/W per lead\n{r['pitchMm']} mm grid" for r in rows])
for i,r in enumerate(rows):
    for key in ['stillCaseC','movingCaseC']:
        ax.annotate(f"{r[key]:.1f} °C",(i,r[key]),xytext=(0,9),textcoords='offset points',ha='center')
ax.set_ylim(45,83);ax.set_ylabel('Calculated MOSFET case temperature');ax.grid(axis='y',alpha=.15)
ax.set_title('Cooling sensitivity · v85 electronic load',loc='left',fontsize=21,pad=25)
ax.legend(loc='center right',facecolor='#172332',labelcolor='#e7eff7',edgecolor='#405367')
fig.text(.125,.045,'5.5 W device · 40 °C ambient · supplied sink/interface values\nParameter study only. Installed airflow and fan-fault shutdown remain unqualified.',fontsize=11)
fig.subplots_adjust(bottom=.23,top=.84)
fig.savefig(ROOT/'aiflow/run/timeline/package-cooling-v85.png',dpi=160)
print(json.dumps(summary,indent=2))