シリコンダイオードは、一方向に電流が流れやすい2端子部品です。0.50ミリアンペア(mA)付近にダイオードを近づけ、近くにある2組の電流値を比較してください。ミリアンペアは、電流の単位であるアンペアの1000分の1です。広い方のペアは0.40mAと0.60mA、狭い方のペアは0.49mAと0.51mAです。両端の読み取り値の中間点に戻してください。
各ペアについて、測定された電圧変化を測定された電流変化で割ります。これにより、 有限の弦電圧-電流曲線上の2点間の平均傾斜。非線形曲線は傾斜が変化します。狭い範囲のブラケットでは曲線の範囲が狭くなりますが、電圧差も小さくなります。ごく普通の2つのメーターの誤差でも、その差が隠れてしまう可能性があります。この実験では、記録した間隔が何を解読するかを問うものであり、どちらのブラケットも合否判定の基準にはなりません。
観測は定常直流(DC)で行われ、各設定において電圧と電流が一定に保たれています。インピーダンスは交流信号に対する抵抗を表しますが、これはDC実験です。微小微分とは、ある一点における極限的な傾きのことです。私たちの有限弦はそのような微分ではなく、接合部の温度を厳密に固定するものではありません。接合部とは、ダイオードの内部半導体境界のことです。この記事では、コンピュータ上でテストされた設計とソフトウェアを提供しています。物理的な測定やファームウェアの構築については何も主張していません。
2 つの独立したメーターリターンを使用します
Vishayを1つ使用 1N4148-TAP ダイオード。黒色の帯がカソードを示し、もう一方のリード線がアノードです。現在のメーカー資料には、DO-35(DO-204AHとも呼ばれる)のアキシャルパッケージと、この正確な注文コードが記載されています。10mAで最大1Vの順方向電圧が規定されています。この小電流における電圧、傾斜、またはブラケット分類は保証されていません。
An ohm (Ω) is the unit of resistance; a kilohm (kΩ) is 1000 Ω and a megohm (MΩ) one million Ω. A volt (V) measures voltage. Use Vishay MRS25 MRS25000C3901FCT00、3.90 kΩ ±1%、R1として。制御負荷は MRS25000C1001FCT00、1.00 kΩ ±1%。±1%の許容誤差は、規定された基準条件下で公称値から許容される抵抗値の偏差を表します。ワットは電力の単位であり、1秒間に伝達されるエネルギーです。これらの部品は、データシートの条件で70℃において0.6ワットの定格電力を持ちますが、治具はわずか数ミリワットで動作させます。ここで、ミリワット(mW)は1ワットの1000分の1です。
RIGOL DP832Aのチャンネル1(CH1)を使用し、他の出力はオフにします。出力を無効にし、ゼロから開始して、電流制限を10mA、過電圧保護(OVP)を5.0Vに設定します。プログラムされた電圧5.0V以下に維持してください。これらの設定はバックアップです。ソース設定、電流制限、およびフロントパネルの電流表示は、測定された2つの電圧降下を置き換えるものではありません。
Use two separate battery-operated Fluke 87V MAX デジタルマルチメーター(DMM)数値電圧値を表示する計器。両方とも通常の状態に保つ。 6.000V DCモード電圧入力を使用します。VΩソケットは電圧/抵抗測定を受け付け、COMはメーターの共通リターンソケットです。ここでは、2つのCOMソケットは異なる回路ノードに接続され、電気的に独立している必要があります。
- 電源の正極S+を抵抗R1を通してノードAに接続します。ダイオードの陽極をAに、その縞模様の陰極を電源の負極Nに接続します。
- メーターM1はR1を測定します。赤いVΩリード線をS+に、黒いCOMリード線をAに接続します。その測定値を VR.
- メーターM2は負荷を測定します。赤いVΩリード線をAに、黒いCOMリード線をNに接続します。その測定値を VFCSVとはカンマ区切り値のことで、プレーンテキスト形式のワークシートです。抵抗制御についてもこの列名が保持され、制御負荷電圧を意味します。
各検出ポイントのペアには、必ず同じメーターを使用してください。共通の接地されたオシロスコープのリターン線では、この2つのフローティングバッテリーとメーターの接続を置き換えることはできません。AとNを接続するとダイオードがバイパスされてしまいます。電圧ソケットを常に使用し、電源に電流入力を接続しないでください。

diode-bracket-resolution.svg) · フルサイズのポータブルネットワークグラフィックス(PNG)公称メーター負荷を含む負荷電流を推定する
M1はR1を介して小さな電流を引き込み、その電流はノードAにも流入します。M2はダイオードを通らずにAからNへ電流を引き込みます。M1 とRM2 2つの入力抵抗を表す負荷電流推定値は次のとおりです。
I = V_R × (1/R1 + 1/R_M1) − V_F/R_M2
両方のメーターに公称10 MΩの入力モデルを使用します。例えば、構築された読み取り値VR = 1.950 V および VF = 0.600 V の場合、約 500.135 マイクロアンペア (µA) になります。ここで、マイクロアンペアは 1 アンペアの 100 万分の 1 です。1.950 V を 3900 Ω で割ると単純に 500 µA になります。その差が公称負荷補正値です。
マニュアルでは入力抵抗を公称値としています。最小抵抗値や正確な補正値を保証するものではありません。そのためアナライザーは 各ポイントで±0.5 µAの負荷モデル許容値を選択また、R1 = 3900 ±42.9 Ω、コントロール = 1000 ±11 Ω を使用します。これは、1% の部品公差と選択された 0.1% の治具/熱許容値を含む 1.1% の区間です。これらの追加の許容値は、エンジニアリング上の仮定であり、すべてのメーター入力または取り付け条件に対するメーカー認定の境界ではありません。これらの区間は、実際のセットアップに適していることを前提としています。
最初に提供される分析装置は、これらの固定された検証済みの前提条件を維持します。別途測定された抵抗値については、そのモデルを変更する前に、測定値と温度の不確かさを文書化する必要があります。好ましい結果を得るためだけに許容値を減らしてはいけません。
正常範囲の誤差の下限を維持する
通常の6.000V DCレンジでは、各表示カウントは1ミリボルト(mV)、つまり1ボルトの1000分の1です。記載されている電圧誤差は±(読み値の0.05% + 1カウント)です。0.600Vでは、これは±1.30mVです。詳細な精度は、以下の範囲に適用されます。 校正から2年後、at 摂氏18~28度 また、マニュアルに記載されている湿度および電磁環境条件(相対湿度0~95%を含む)も参照してください。相対湿度は、空気中の水分量を飽和状態を基準とした値です。電磁両立性(EMC)条件は、機器周辺の干渉に関するものであり、ソフトウェアではこれらの条件を検証しません。
高解像度の追加桁は、この絶対カウント寄与を除算しません。マニュアルでは、そのモードを使用する場合、カウント項を乗算します。独立した600mVレンジは精度仕様が異なり、シリコンダイオードの順方向電圧を超える可能性があります。この比較では、通常の6Vレンジを使用してください。
観測された電圧 v に対して、区間 v ± e(v) を形成します。ここで、e(v) = 0.0005 × |v| + 0.001 V です。区間は、明示された仮定の下で下限と上限を持ちます。これは確率や信頼度ではありません。2 つの電圧の端点と R1 の端点のすべての組み合わせで現在の式を評価し、選択した ±0.5 µA の負荷許容値で広げます。この保守的な計算では、異なる観測における誤差を独立に保ちます。共通の物理的な抵抗器は相関関係を生み出す可能性がありますが、このアナライザは相殺を仮定していません。
正確に36行を取得する
ダイオードの取り付け位置、検出ポイント、リード線の配置、および空気の流れは、常に同じにしてください。治具を意図的に加熱しないでください。各設定で少なくとも30秒待機し、5秒後に2つ目の電圧ペアを比較してください。いずれかの測定値が単一測定値の許容誤差を超えて変化した場合は、待機して再度測定してください。最終的に安定したペアを入力し、2ペアのチェック結果をベンチノートに記録してください。 The 30-second wait and manual five-second check are acquisition requirements, not software proof of settling.
補正後の測定電流値を用いて電源電圧を調整してください。アナライザの公称電流マッチング画面は、各ターゲット値の±0.5%です。これは実験ポイントを一致させるものであり、0.5%の絶対電流精度を保証するものではありません。すべての電流間隔を記録してください。電源が電流制限値内に留まる場合、極性が予期しない状態の場合、メーターが過負荷になる場合、または測定値が不安定な場合は、測定を停止し、出力を無効にして配線を確認してください。測定停止後のシートを完成させるために、架空の数値を入力しないでください。
| ダイオードステップ、順番に | C0 | WL | C1 | WH | C2 | NL | C3 | NH | C4 |
|---|---|---|---|---|---|---|---|---|---|
| 目標μA | 500 | 400 | 500 | 600 | 500 | 490 | 500 | 510 | 500 |
この9ステップのシーケンス全体をサイクル1、2、3として繰り返し、27個のダイオード観測を行います。C0~C4は別々のセンターリターンであり、重複した行名ではありません。同じサイクル内でWLとWH、NLとNHをペアにします。サイクルをまたいでペアにしたり、境界を構築する前に観測値を平均化したりしないでください。
すべてのダイオードサイクルが完了したら、出力を無効にし、同じA/N検出ポイントでD1を1.00 kΩのコントロールに置き換えます。L = 400 µA、C = 500 µA、H = 600 µAの順に取得し、コントロールサイクル2と3として繰り返します。これらの9つのコントロール観測で、36行のシートが完成します。ダイオードとコントロールを並列に接続しないでください。
上限電圧の合計は 5.05 V を超えないようにしてください。R1 を下限モデル値の 3857.1 Ω に設定した場合、短絡負荷は最大で約 1.31 mA を消費し、実際のソース境界では R1 は 6.62 mW を消費します。受動ダイオードの境界 V²/(4R) は約 1.66 mW です。これらは定常状態のフィクスチャ計算であり、高速過渡現象や任意のソース障害の認証ではありません。出力をオフにした状態でのみ負荷を取り扱ってください。
Compare signed differences before dividing
The high and low observations supply voltage and current intervals. Subtract their endpoints conservatively:
ΔV = [V_high,low − V_low,high, V_high,high − V_low,low] ΔI = [I_high,low − I_low,high, I_high,high − I_low,low]
ここでΔは差を意味し、新しいメーター範囲を意味するものではありません。下限ΔIエンドポイントが正でない場合、商は保留されます。それ以外の場合は、すべてのΔV/ΔIエンドポイントの組み合わせを計算し、最小値と最大値を保持します。負の下限値を保持します。絶対値を取得してゼロに切り捨てたり、実際の電流をターゲットラベルに置き換えたりすると、未解決の比較が隠蔽されます。
| 構築された量子化例 | 幅広ブラケット | 狭いブラケット |
|---|---|---|
| 記録された終点VF | 0.594/0.605 V | 0.599/0.601 V |
| ΔV間隔 | 8.4005〜13.5995 mV | −0.6000~4.6000 mV |
| ΔI interval | 186.834~212.858µA | 7.001~33.019µA |
| 有限和音間隔 | 39.47〜72.79Ω | −85.70 to 657.04 Ω |
提供された構築例では、正の広い弦が解像される一方、狭い電圧差にはゼロが含まれます。負の下限は、負のダイオード差動抵抗を確立するものではありません。記載されている誤差が、見かけ上の反転を説明できることを示しています。実際のダイオードは、これらの電圧、傾き、または分類を再現する必要はありません。
狭いブラケットを使用しても、必ずしも導関数の推定値が向上するとは限りません。電圧差が小さい分、固定端点誤差によってその効果が打ち消されてしまう可能性があります。広い弦は、より大きな非線形区間を平均化します。どちらの制約も重要です。例における中心のV/I比(約1.2 kΩ)は文脈依存であり、別の量であり、レッスンの合格基準ではありません。nVT/Iモデルや理想係数モデルは、結果を要求するために使用されていません。
コントロールと解像度は別々に読む
このレポートには、すべての生データ、電流間隔、および故障理由が記録されます。すべてのポイントは、指定されたメーター範囲に適合し、正の下限電圧/電流値を持ち、電源電圧の境界を満たし、公称電流の一致を満たす必要があります。15個のダイオード中心電流間隔すべてに重複が必要です。アナライザは、各サイクルの5つの中心の重複も報告します。重複は一貫性を保証するものであり、実際の電流が同一であることを証明するものではありません。
中心電圧ドリフトについては、15 中心電圧の全範囲を使用します。F 読み値に、2 つの極端な読み値の電圧誤差許容値を加えた値。これは、選択した 5 mV の画面に収まる必要があります。グローバル チェックにより、通常は静かなサイクル間の緩やかな変化が隠されるのを防ぎます。同じ電流重複チェックと電圧範囲チェックを、3 つの制御 C 行に個別に適用します。これらの電圧をダイオード電圧と混同しないでください。
すべての制御V/I間隔と各制御L/Hコード間隔は、選択された[989, 1011]Ω制御間隔と重ならなければなりません。これは、低電力における測定/モデルチェーンの一貫性をテストするものです。 Control-interval overlap is not certification of every instrument, part or contact. A failure withholds interpretation rather than adjusting the error model to make the data pass.
中心からの戻り値は多少のドリフトを検出しますが、終点接合部の温度が等しいことを確認したり、平衡自己発熱を排除したり、短時間の擾乱を除外したりすることはできません。安定した温度差、周囲環境の変化、接点、および有限幅の曲率は、動作中の直流コードの制約となります。ソフトウェアはこれらの観測結果を等温抵抗または微小抵抗に変換しません。
各コードは報告する arithmetic_positive, interpretation_supported (NAIST) と positive_slope_resolved解釈の横に条件付きモデルがあります。コントロールが失敗した場合、支持された正の傾きの主張を保留しながら、算術区間を表示したままにすることができます。全体的なパターンは unsupported, neither, wide_only, narrow_only or both. 要約すると、幅は、3つのサイクルすべてがその正の弦を解決する場合にのみサポートされます。 サイクルごとの結果は引き続き表示されます。要約範囲は、3つの区間を囲む全範囲であるハルを使用します。繰り返し処理では、固定誤差をサンプル数の平方根で割ることはありません。
完全なアナライザーを実行します
スタンドアロン実験ZIPをダウンロード(ZIP: diode-bracket-resolution.zip)新しいディレクトリに展開します。これには、完全な Python 3 標準ライブラリアナライザー、ジェネレーター、意味のあるテスト、空の物理 CSV、ラベル付き構築済み CSV、読みやすい手順、およびオリジナルの SVG/PNG が含まれています。正確なヘッダーは次のとおりです。 device,cycle,step,target_ua,series_v,forward_v空白ファイルには、固定キーと空の測定セルが含まれています。
python3 -m unittest -v test_diode_brackets.py python3 diode_brackets.py constructed-example.csv --kind constructed python3 diode_brackets.py physical-blank.csv --kind observed python3 make_constructed.py new-constructed-directory
観測値が入力されるまで、物理ブランクコマンドは失敗する必要があります。ジェネレータは、データが入力された宛先を拒否します。これは、例示曲線を使用して明示的に構築された 1 mV 量子化値を生成します。これらは製造元の許容値やベンチ読み取り値ではありません。物理シートとは別に保管してください。 --kind 申告は義務付けられているが、物理的な取得を証明することはできない。
コマンドラインインターフェース(CLI)、つまりターミナルで使用されるテキストコマンドは、構造化されたレポートであるJavaScript Object Notation(JSON)を書き出す。 終了コード0は有効な報告を意味しますが、サポート対象外または未解決のままとなる可能性があります。 チェック controls_passed, the conditional assumptions and each chord’s flags. Wrong-polarity or out-of-range finite observations produce a valid unsupported report; the out-of-range reading’s voltage interval, derived current and dependent quotient intervals are null because the declared meter model is inapplicable. Valid companion-voltage or voltage-difference diagnostics may remain.
UTF-8 (Unicode Transformation Format, 8-bit) is the plain-text byte format used here. Standard error (stderr) is the terminal’s error-output stream. 終了コード2は、入力形式が不正または不完全であり、標準エラー出力テキストは存在するがJSONは存在しないことを意味します。 duplicated/reordered headers, invalid UTF-8 text encoding, malformed quoting, blank/nonfinite numeric cells, wrong acquisition keys/order/targets, missing/extra rows or fields, or more than 65536 bytes. The parser checks the physical header before dictionaries can collapse duplicate columns. Entered OL これは数値電圧ではありません。順序を修復したり、空の読み取り値をゼロで埋めたり、故障した制御を非表示にしたりしないでください。このプログラムには、計測器/ネットワーク制御やファームウェアは含まれていません。
diode_brackets.pyを完成させてください。
#!/usr/bin/env python3
"""Finite settled-DC diode chords, using a fixed conditional engineering model.
Python 3 standard library; no instrument or network control.
Exit 0: a valid report, possibly unsupported or unresolved.
Exit 2: malformed/incomplete input, stderr only and no JSON.
"""
import argparse
import csv
import io
import itertools
import json
import math
import sys
from pathlib import Path
FIELDS=('device','cycle','step','target_ua','series_v','forward_v')
DIODE_SEQUENCE=(('C0',500),('WL',400),('C1',500),('WH',600),('C2',500),('NL',490),('C3',500),('NH',510),('C4',500))
CONTROL_SEQUENCE=(('L',400),('C',500),('H',600))
SERIES_R=3900.0
SERIES_ERROR=42.9
CONTROL_R=1000.0
CONTROL_ERROR=11.0
METER_INPUT=10000000.0 #Nominal, not a guaranteed minimum resistance.
LOADING_ALLOWANCE=.5e-6 #Chosen engineering allowance, not a maker specification.
EPS_V=1e-12 #Numerical comparison allowance, one picovolt.
EPS_A=1e-15 #Numerical comparison allowance, one femtoampere.
EPS_R=1e-9
CONDITION_SCOPE=('Conditional on the declared meter conditions and chosen R/loading '
'engineering assumptions; not certified thermal/input-conductance coverage.')
def number(value):
if isinstance(value,bool):
raise ValueError('boolean is not a measured number')
try:
x=float(value)
except (TypeError,ValueError,OverflowError):
raise ValueError('blank or nonnumeric cell')
if not math.isfinite(x):
raise ValueError('nonfinite numeric cell')
return x
def expected_rows():
return tuple((device,cycle,step,target)
for device,sequence in [('diode',DIODE_SEQUENCE),('control',CONTROL_SEQUENCE)]
for cycle in (1,2,3) for step,target in sequence)
def normalize_rows(rows):
if not isinstance(rows,(list,tuple)) or len(rows)!=36:
raise ValueError('exactly 36 acquisition rows required')
normalized=[]
for ordinal,(row,expected) in enumerate(zip(rows,expected_rows()),1):
if not isinstance(row,dict) or set(row)!=set(FIELDS):
raise ValueError('row %d has the wrong fields'%ordinal)
device,cycle,step,target=expected
if (row['device'],str(row['cycle']),row['step'])!=(device,str(cycle),step):
raise ValueError('row %d has a wrong/duplicate/out-of-order acquisition key'%ordinal)
if number(row['target_ua'])!=target:
raise ValueError('row %d has the wrong target label'%ordinal)
normalized.append({'device':device,'cycle':cycle,'step':step,'target_ua':target,
'series_v':number(row['series_v']),'forward_v':number(row['forward_v'])})
return normalized
def read_rows(path):
try:
with Path(path).open('rb') as f:
data=f.read(65537)
if len(data)>65536:
raise ValueError('worksheet exceeds 65536 bytes')
parser=csv.reader(io.StringIO(data.decode('utf-8'),newline=''),strict=True)
header=next(parser,None)
#Check the physical header before a dictionary can collapse duplicates.
if header!=list(FIELDS) or len(header)!=len(set(header)):
raise ValueError('need the exact unique ordered CSV header')
rows=[]
for cells in parser:
if len(cells)!=len(FIELDS):
raise ValueError('wrong field count or blank physical record')
rows.append(dict(zip(FIELDS,cells)))
if len(rows)>36:
raise ValueError('worksheet has more than 36 rows')
return normalize_rows(rows)
except (OSError,UnicodeError,csv.Error) as exc:
raise ValueError('cannot read strict UTF-8 CSV: '+str(exc))
def meter_interval(v):
v=number(v)
if abs(v)>6.0+EPS_V:
return None
error=.0005*abs(v)+.001
return [v-error,v+error]
def point_interval(vr,vf):
vr=number(vr);vf=number(vf)
sr=meter_interval(vr);fr=meter_interval(vf)
result={'series_v':vr,'forward_v':vf,'series_interval_v':sr,'forward_interval_v':fr,
'nominal_current_a':None,'current_interval_a':None}
if sr is None or fr is None:
result['fixture_screens']={'meter_range':False,'positive_voltage_bounds':False,
'positive_current_bound':False,'source_voltage_bound':False}
else:
currents=[a*(1/r+1/METER_INPUT)-b/METER_INPUT
for a,r,b in itertools.product(sr,[SERIES_R-SERIES_ERROR,SERIES_R+SERIES_ERROR],fr)]
current=[min(currents)-LOADING_ALLOWANCE,max(currents)+LOADING_ALLOWANCE]
result.update(nominal_current_a=vr*(1/SERIES_R+1/METER_INPUT)-vf/METER_INPUT,
current_interval_a=current)
result['fixture_screens']={'meter_range':True,'positive_voltage_bounds':min(sr[0],fr[0])>EPS_V,
'positive_current_bound':current[0]>EPS_A,
'source_voltage_bound':sr[1]+fr[1]<=5.05+EPS_V}
result['fixture_screens_passed']=all(result['fixture_screens'].values())
result['failed_fixture_screens']=[k for k,v in result['fixture_screens'].items() if not v]
return result
def quotient_interval(numerator,denominator):
if numerator is None or denominator is None or denominator[0]<=EPS_A:
return None
corners=[a/b for a,b in itertools.product(numerator,denominator)]
return [min(corners),max(corners)]
def chord_interval(low,high):
dv=di=None
if low.get('forward_interval_v') is not None and high.get('forward_interval_v') is not None:
dv=[high['forward_interval_v'][0]-low['forward_interval_v'][1],
high['forward_interval_v'][1]-low['forward_interval_v'][0]]
if low.get('current_interval_a') is not None and high.get('current_interval_a') is not None:
di=[high['current_interval_a'][0]-low['current_interval_a'][1],
high['current_interval_a'][1]-low['current_interval_a'][0]]
bounds=quotient_interval(dv,di)
positive=bounds is not None and dv[0]>EPS_V and di[0]>EPS_A
reason=('point interval unavailable' if dv is None or di is None else
'positive current difference unresolved' if di[0]<=EPS_A else
'positive voltage difference unresolved' if dv[0]<=EPS_V else 'positive arithmetic chord')
return {'delta_v_interval':dv,'delta_i_interval_a':di,'interval_ohm':bounds,
'arithmetic_positive':bool(positive),'arithmetic_reason':reason}
def center_checks(points):
available=all(p['current_interval_a'] is not None and p['forward_interval_v'] is not None for p in points)
if not available:
return {'current_overlap':False,'intersection_lower_a':None,'intersection_upper_a':None,
'voltage_range_plus_errors_v':None,'voltage_stable':False}
lower=max(p['current_interval_a'][0] for p in points)
upper=min(p['current_interval_a'][1] for p in points)
low=min(points,key=lambda p:p['forward_v']);high=max(points,key=lambda p:p['forward_v'])
metric=(high['forward_v']-low['forward_v']+
high['forward_interval_v'][1]-high['forward_v']+
low['forward_v']-low['forward_interval_v'][0])
return {'current_overlap':lower<=upper+EPS_A,'intersection_lower_a':lower,'intersection_upper_a':upper,
'voltage_range_plus_errors_v':metric,'voltage_stable':metric<=.005+EPS_V}
def overlaps_control(interval):
return interval is not None and max(interval[0],CONTROL_R-CONTROL_ERROR)<=min(interval[1],CONTROL_R+CONTROL_ERROR)+EPS_R
def assess_controls(points):
lookup={(p['device'],p['cycle'],p['step']):p for p in points}
diode_centers=[p for p in points if p['device']=='diode' and p['step'].startswith('C')]
control_centers=[p for p in points if p['device']=='control' and p['step']=='C']
dc=center_checks(diode_centers);cc=center_checks(control_centers)
local=[dict(cycle=cycle,**center_checks([p for p in diode_centers if p['cycle']==cycle])) for cycle in (1,2,3)]
control_points=[];control_chords=[]
for p in points:
if p['device']=='control':
ratio=quotient_interval(p['forward_interval_v'],p['current_interval_a'])
control_points.append({'cycle':p['cycle'],'step':p['step'],'V_over_I_interval_ohm':ratio,
'overlaps_control':overlaps_control(ratio)})
for cycle in (1,2,3):
c=chord_interval(lookup[('control',cycle,'L')],lookup[('control',cycle,'H')])
control_chords.append(dict(cycle=cycle,overlaps_control=overlaps_control(c['interval_ohm']),**c))
screens={'point_fixture_screens':all(p['fixture_screens_passed'] for p in points),
'nominal_target_matching':all(p['nominal_target_matched'] for p in points),
'diode_center_current_overlap':dc['current_overlap'],'diode_center_voltage_stable':dc['voltage_stable'],
'control_center_current_overlap':cc['current_overlap'],'control_center_voltage_stable':cc['voltage_stable'],
'control_ratios_consistent':all(p['overlaps_control'] for p in control_points),
'control_chords_consistent':all(c['overlaps_control'] for c in control_chords)}
return {'screens':screens,'passed':all(screens.values()),'failed_screens':[k for k,v in screens.items() if not v],
'diode_global_centers':dc,'diode_per_cycle_centers':local,'control_centers':cc,
'control_points':control_points,'control_chords':control_chords}
def pattern(wide,narrow,supported):
if not supported:return 'unsupported'
if wide and narrow:return 'both'
if wide:return 'wide_only'
if narrow:return 'narrow_only'
return 'neither'
def hull(intervals):
if any(x is None for x in intervals):return None
return [min(x[0] for x in intervals),max(x[1] for x in intervals)]
def analyze_rows(rows,kind):
if kind not in ('observed','constructed'):
raise ValueError('kind must be observed or constructed')
rows=normalize_rows(rows);points=[]
for row in rows:
p=point_interval(row['series_v'],row['forward_v']);p.update(row)
target=row['target_ua']*1e-6;nominal=p['nominal_current_a']
p['nominal_target_matched']=nominal is not None and abs(nominal-target)<=.005*target+EPS_A
points.append(p)
controls=assess_controls(points);supported=controls['passed']
lookup={(p['device'],p['cycle'],p['step']):p for p in points};cycles=[]
for cycle in (1,2,3):
c={'cycle':cycle}
for width,lo,hi in [('wide','WL','WH'),('narrow','NL','NH')]:
chord=chord_interval(lookup[('diode',cycle,lo)],lookup[('diode',cycle,hi)])
chord.update(interpretation_supported=supported,conditional_model=CONDITION_SCOPE,
positive_slope_resolved=supported and chord['arithmetic_positive'])
c[width]=chord
c['resolution_pattern']=pattern(c['wide']['positive_slope_resolved'],c['narrow']['positive_slope_resolved'],supported)
cycles.append(c)
summary={}
for width in ('wide','narrow'):
summary[width]={'hull_ohm':hull([c[width]['interval_ohm'] for c in cycles]),
'all_three_positive_slopes_resolved':all(c[width]['positive_slope_resolved'] for c in cycles)}
origin=[quotient_interval(p['forward_interval_v'],p['current_interval_a']) for p in points
if p['device']=='diode' and p['step'].startswith('C')]
model={'qualification':CONDITION_SCOPE,'series_R_ohm':SERIES_R,'series_R_error_ohm':SERIES_ERROR,
'control_R_ohm':CONTROL_R,'control_R_error_ohm':CONTROL_ERROR,'nominal_meter_input_ohm':METER_INPUT,
'chosen_loading_allowance_a':LOADING_ALLOWANCE,'loading_and_extra_R_allowance_not_manufacturer_guarantees':True,
'meter_error_v':'0.0005*abs(reading)+0.001','meter_conditions':'87V MAX normal 6 V; within 2 years after calibration; 18–28°C; 0–95% RH; applicable manual EMC conditions',
'manual_acquisition_conditions_verified_by_software':False,'fixed_errors_divided_by_sqrt_n':False,
'numerical_comparison_allowance_v':EPS_V,'numerical_comparison_allowance_a':EPS_A}
return {'schema':'trickycircuit-diode-brackets-1','valid_report':True,'measurement_kind_declared':kind,
'physical_acquisition_verified':False,'interpretation_supported':supported,'conditional_model':model,
'controls_passed':supported,'controls':controls,'points':points,'cycles':cycles,'summary':summary,
'resolution_pattern':pattern(summary['wide']['all_three_positive_slopes_resolved'],summary['narrow']['all_three_positive_slopes_resolved'],supported),
'summary_pattern_scope':'Each width is positive only if all three cycles support it. No expected pattern is required.',
'center_V_over_I_context_hull_ohm':hull(origin),
'claim_limits':['Finite settled-DC chords only; no AC impedance or isothermal derivative.',
'Center overlap and return screens do not prove identical currents or junction temperatures.',
'A signed interval spanning zero does not establish negative differential resistance.',
'Control overlap is consistency, not certification of every part, contact or instrument.']}
def main(argv=None):
parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('worksheet');parser.add_argument('--kind',required=True,choices=['observed','constructed'])
args=parser.parse_args(argv)
try:
report=analyze_rows(read_rows(args.worksheet),args.kind)
output=json.dumps(report,indent=2,allow_nan=False)
except (ValueError,OSError,OverflowError) as exc:
print('input error: '+str(exc),file=sys.stderr);return 2
print(output);return 0
if __name__=='__main__':sys.exit(main())
完全な構築例ジェネレータ
#!/usr/bin/env python3
"""Generate labelled constructed values, never physical observations. No overwrite."""
import csv
import math
import sys
from pathlib import Path
import diode_brackets as db
def make(destination):
destination=Path(destination)
if destination.exists() and (not destination.is_dir() or any(destination.iterdir())):
raise ValueError('destination must be absent or empty; existing data is not overwritten')
destination.mkdir(parents=True,exist_ok=True)
with (destination/'constructed-example.csv').open('w',newline='') as f:
writer=csv.writer(f);writer.writerow(db.FIELDS)
for device,cycle,step,target in db.expected_rows():
current=target*1e-6
#An illustrative logarithmic curve, not a manufacturer specification.
vf=.600+.02585*math.log(current/.0005) if device=='diode' else current*1000
vf=round(vf,3)
vr=(current+vf/db.METER_INPUT)/(1/db.SERIES_R+1/db.METER_INPUT)
writer.writerow([device,cycle,step,target,format(vr,'.3f'),format(vf,'.3f')])
(destination/'CONSTRUCTED-NOT-MEASURED.txt').write_text(
'Every value is constructed and quantized to 1 mV. No physical observations.\n'
'The logarithmic curve is illustrative, not an acceptance target.\n'
'Run with --kind constructed. Do not copy these values into physical-blank.csv.\n')
if __name__=='__main__':
if len(sys.argv)!=2:
raise SystemExit('usage: python3 make_constructed.py NEW_OR_EMPTY_DIRECTORY')
try:make(sys.argv[1])
except (ValueError,OSError) as exc:
print('input error: '+str(exc),file=sys.stderr);sys.exit(2)
ホストテストを完了する
"""Independent requirement examples. Every numeric fixture is constructed."""
import csv, hashlib, json, math, subprocess, sys, tempfile, unittest
from pathlib import Path
import diode_brackets as db
HEADER=['device','cycle','step','target_ua','series_v','forward_v']
def fixture(style='wide_only'):
"""Build rows from the approved acquisition table, not the parser's function."""
result=[]
seq=[('C0',500),('WL',400),('C1',500),('WH',600),('C2',500),('NL',490),('C3',500),('NH',510),('C4',500)]
for cycle in (1,2,3):
for step,target in seq:
if step.startswith('C'):vf=.600
elif step in ('WL','WH'):
width=.010 if style in ('wide_only','both') else .001
vf=.600+(-width if step=='WL' else width)
else:
width=.005 if style in ('narrow_only','both') else .001
vf=.600+(-width if step=='NL' else width)
current=target*1e-6
vr=(current+vf/1e7)/(1/3900+1/1e7)
result.append(dict(zip(HEADER,['diode',str(cycle),step,str(target),vr,vf])))
for cycle in (1,2,3):
for step,target in [('L',400),('C',500),('H',600)]:
current=target*1e-6;vf=current*1000
vr=(current+vf/1e7)/(1/3900+1/1e7)
result.append(dict(zip(HEADER,['control',str(cycle),step,str(target),vr,vf])))
return result
def write_sheet(path,rows):
with Path(path).open('w',newline='') as f:
w=csv.DictWriter(f,fieldnames=HEADER);w.writeheader();w.writerows(rows)
class ParserTests(unittest.TestCase):
def parse(self,text):
with tempfile.TemporaryDirectory() as d:
p=Path(d)/'x.csv';p.write_bytes(text if isinstance(text,bytes) else text.encode())
return db.read_rows(p)
def test_exact_contract(self):
self.assertEqual(len(db.expected_rows()),36)
self.assertEqual([x[2] for x in db.expected_rows()[:9]],['C0','WL','C1','WH','C2','NL','C3','NH','C4'])
with tempfile.TemporaryDirectory() as d:
p=Path(d)/'x.csv';write_sheet(p,fixture());self.assertEqual(len(db.read_rows(p)),36)
def test_duplicate_header_hidden_nan(self):
with self.assertRaises(ValueError):self.parse('device,cycle,step,target_ua,series_v,series_v,forward_v\ndiode,1,C0,500,nan,1.95,.6\n')
def test_utf8_quotes_and_schema(self):
for text in [b'\xff','device,cycle,step,target_ua,series_v,forward_v\ndiode,1,C0,500,"1.95,.6\n',','.join(reversed(HEADER))+'\n']:
with self.subTest(text=text):
with self.assertRaises(ValueError):self.parse(text)
def test_byte_limit(self):
with self.assertRaises(ValueError):self.parse(b' '*65537)
def test_order_duplicate_row_and_wrong_target(self):
for mode in ['order','duplicate','target','extra','missing','blank','nan']:
with tempfile.TemporaryDirectory() as d:
rows=fixture();p=Path(d)/'x.csv'
if mode=='order':rows[0],rows[1]=rows[1],rows[0]
if mode=='duplicate':rows[1]=dict(rows[0])
if mode=='target':rows[1]['target_ua']='401'
if mode=='extra':rows.append(dict(rows[-1]))
if mode=='missing':rows.pop()
if mode=='blank':rows[0]['series_v']=''
if mode=='nan':rows[0]['forward_v']='nan'
write_sheet(p,rows)
with self.subTest(mode=mode):
with self.assertRaises(ValueError):db.read_rows(p)
class IntervalTests(unittest.TestCase):
def test_meter_count_floor_not_sample_mean(self):
self.assertEqual(db.meter_interval(.600),[.5987,.6013])
def test_loaded_current_and_corners(self):
p=db.point_interval(1.9494737052549505,.6)
self.assertAlmostEqual(p['nominal_current_a'],.0005,places=14)
self.assertAlmostEqual(p['current_interval_a'][0],.0004935601489242878,places=14)
self.assertAlmostEqual(p['current_interval_a'][1],.0005065719739465359,places=14)
def test_signed_chord_is_not_clipped(self):
lo={'forward_interval_v':[.598,.602],'current_interval_a':[.00048,.00049],'forward_v':.600,'nominal_current_a':.000485}
hi={'forward_interval_v':[.599,.603],'current_interval_a':[.00051,.00052],'forward_v':.601,'nominal_current_a':.000515}
r=db.chord_interval(lo,hi)
self.assertLess(r['interval_ohm'][0],0)
self.assertFalse(r['arithmetic_positive'])
def test_nonpositive_denominator_withheld(self):
lo={'forward_interval_v':[.59,.60],'current_interval_a':[.0004,.0006],'forward_v':.595,'nominal_current_a':.0005}
hi={'forward_interval_v':[.60,.61],'current_interval_a':[.0005,.0007],'forward_v':.605,'nominal_current_a':.0006}
self.assertIsNone(db.chord_interval(lo,hi)['interval_ohm'])
def test_wider_endpoint_bounds_do_not_improve_chord(self):
lo={'forward_interval_v':[.590,.592],'current_interval_a':[.00039,.00041],'forward_v':.591,'nominal_current_a':.0004}
hi={'forward_interval_v':[.608,.610],'current_interval_a':[.00059,.00061],'forward_v':.609,'nominal_current_a':.0006}
a=db.chord_interval(lo,hi)['interval_ohm']
lo['forward_interval_v']=[.589,.593];lo['current_interval_a']=[.00038,.00042]
hi['forward_interval_v']=[.607,.611];hi['current_interval_a']=[.00058,.00062]
b=db.chord_interval(lo,hi)['interval_ohm']
self.assertLessEqual(b[0],a[0]);self.assertGreaterEqual(b[1],a[1])
def test_extreme_finite_reading_skips_range_arithmetic(self):
rows=fixture();rows[0]['series_v']=1e308
report=db.analyze_rows(rows,'constructed')
self.assertFalse(report['controls_passed']);self.assertEqual(report['resolution_pattern'],'unsupported')
self.assertIsNone(report['points'][0]['current_interval_a'])
json.dumps(report,allow_nan=False)
def test_model_visible_beside_interpretation(self):
r=db.analyze_rows(fixture(),'constructed')
self.assertIn('engineering',r['conditional_model']['qualification'])
for cycle in r['cycles']:
for width in ['wide','narrow']:
self.assertIn('conditional_model',cycle[width]);self.assertIn('interpretation_supported',cycle[width])
class ControlTests(unittest.TestCase):
def test_all_five_resolution_states(self):
for pattern in ['wide_only','narrow_only','both','neither']:
r=db.analyze_rows(fixture(pattern),'constructed')
self.assertTrue(r['controls_passed'],r['controls']);self.assertEqual(r['resolution_pattern'],pattern)
rows=fixture();rows[0]['forward_v']=-.6
self.assertEqual(db.analyze_rows(rows,'constructed')['resolution_pattern'],'unsupported')
def test_no_averaging_of_fixed_error(self):
r=db.analyze_rows(fixture(),'constructed')
first=r['cycles'][0]['wide']['interval_ohm']
self.assertEqual(r['summary']['wide']['hull_ohm'],first)
def test_slow_global_center_drift(self):
rows=fixture()
for row in rows:
if row['device']=='diode' and row['cycle']=='3' and row['step'].startswith('C'):
row['forward_v']+=.004
row['series_v']=(.0005+row['forward_v']/1e7)/(1/3900+1/1e7)
r=db.analyze_rows(rows,'constructed')
self.assertTrue(all(x['voltage_stable'] for x in r['controls']['diode_per_cycle_centers']))
self.assertFalse(r['controls']['screens']['diode_center_voltage_stable']);self.assertFalse(r['interpretation_supported'])
def test_disjoint_center_currents_are_reported(self):
rows=fixture();row=rows[0];row['series_v']=(.00055+row['forward_v']/1e7)/(1/3900+1/1e7)
r=db.analyze_rows(rows,'constructed')
self.assertFalse(r['controls']['screens']['diode_center_current_overlap'])
def test_separate_control_center_drift(self):
rows=fixture();row=next(r for r in rows if r['device']=='control' and r['cycle']=='3' and r['step']=='C')
row['forward_v']+=.004;row['series_v']=(.0005+row['forward_v']/1e7)/(1/3900+1/1e7)
r=db.analyze_rows(rows,'constructed')
self.assertTrue(r['controls']['screens']['diode_center_voltage_stable'])
self.assertFalse(r['controls']['screens']['control_center_voltage_stable'])
def test_target_mismatch_does_not_become_parser_error(self):
rows=fixture();rows[1]['series_v']+=.100
r=db.analyze_rows(rows,'constructed');self.assertFalse(r['controls_passed'])
self.assertFalse(r['controls']['screens']['nominal_target_matching'])
def test_bad_resistor_control(self):
rows=fixture()
for row in rows:
if row['device']=='control':
current=float(row['target_ua'])*1e-6;row['forward_v']=current*1400
row['series_v']=(current+row['forward_v']/1e7)/(1/3900+1/1e7)
r=db.analyze_rows(rows,'constructed');self.assertFalse(r['controls']['screens']['control_ratios_consistent'])
self.assertFalse(r['interpretation_supported']);self.assertTrue(r['cycles'][0]['wide']['arithmetic_positive'])
self.assertFalse(r['cycles'][0]['wide']['positive_slope_resolved'])
def test_wrong_polarity_and_voltage_bound(self):
for field,value in [('forward_v',-.6),('series_v',4.8),('forward_v',6.1)]:
rows=fixture();rows[0][field]=value;r=db.analyze_rows(rows,'constructed')
self.assertFalse(r['controls_passed']);self.assertEqual(r['resolution_pattern'],'unsupported')
class CLITests(unittest.TestCase):
def call(self,p,*args):
return subprocess.run([sys.executable,str(Path(db.__file__)),str(p),*args],capture_output=True,text=True)
def test_valid_and_unresolved_are_exit_zero(self):
with tempfile.TemporaryDirectory() as d:
p=Path(d)/'x.csv'
for style in ['wide_only','neither']:
write_sheet(p,fixture(style));q=self.call(p,'--kind','constructed')
self.assertEqual(q.returncode,0,q.stderr);self.assertEqual(json.loads(q.stdout)['resolution_pattern'],style)
rows=fixture();rows[0]['forward_v']=-.6;write_sheet(p,rows);q=self.call(p,'--kind','observed')
self.assertEqual(q.returncode,0,q.stderr);self.assertFalse(json.loads(q.stdout)['controls_passed'])
def test_actual_duplicate_header_and_blank_are_no_json(self):
with tempfile.TemporaryDirectory() as d:
p=Path(d)/'x.csv';write_sheet(p,fixture());text=p.read_text()
text=text.replace('series_v,','series_v,series_v,',1).replace('diode,1,C0,500,','diode,1,C0,500,nan,',1)
p.write_text(text);q=self.call(p,'--kind','constructed');self.assertEqual(q.returncode,2);self.assertEqual(q.stdout,'')
rows=fixture();rows[0]['series_v']='';write_sheet(p,rows);q=self.call(p,'--kind','observed')
self.assertEqual(q.returncode,2);self.assertEqual(q.stdout,'')
def test_kind_is_mandatory(self):
with tempfile.TemporaryDirectory() as d:
p=Path(d)/'x.csv';write_sheet(p,fixture())
for args in [(),('--kind','fake')]:
q=self.call(p,*args);self.assertEqual(q.returncode,2);self.assertEqual(q.stdout,'')
class GeneratorTests(unittest.TestCase):
def test_generator_quantizes_and_refuses_overwrite(self):
import make_constructed
with tempfile.TemporaryDirectory() as d:
root=Path(d)/'constructed';make_constructed.make(root)
p=root/'constructed-example.csv';data=p.read_bytes();rows=db.read_rows(p)
self.assertEqual(db.analyze_rows(rows,'constructed')['resolution_pattern'],'wide_only')
raw=list(csv.DictReader(p.read_text().splitlines()))
self.assertTrue(all(len(r['series_v'].split('.')[-1])==3 for r in raw))
with self.assertRaises(ValueError):make_constructed.make(root)
self.assertEqual(p.read_bytes(),data)
if __name__=='__main__':unittest.main()
課題
2つの測定値は0.599Vと0.601Vです。それぞれ約±1.3mVの誤差があります。表示値が増加するというだけで、2mVの正の差によって正の有限弦が成立すると言えるでしょうか?
回答
いいえ。メーカーが許容する差の範囲は約-0.6~4.6mVです。この範囲にはゼロが含まれます。実際の電流順序が正であっても、この範囲内では電圧変化は検出されません。正の表示差だけでは不十分です。同じ測定値を繰り返しても、メーカーの固定誤差をsqrt(N)で割ることはできません。
出典および関連文献
- Vishay 1N4148、文書番号81857 Rev.1.6:正確な注文順序、パッケージ/極性、および規定の試験条件。典型的な曲線は傾きを保証するものではありません。
- ヴィシェイ MRS25:記載された条件下における抵抗値、許容誤差、および定格。
- Fluke 87V MAX ユーザーマニュアル:通常範囲の分解能、精度期間/条件、および公称入力負荷。
- RIGOL DP800の仕様: DP832Aの正確なソースバリアントとプログラミング/保護制限。
- Analog Devices diode chapter局所的な小信号モデルと非線形曲線との区別。
- 温度変化に伴う実際の電流変化を再現する別の実験については、以下を参照してください。 1N4148の順方向電圧を2つの温度で測定する.
リーダーファイル一式(ZIPファイル)をダウンロードしてください。: 編集可能な図面、PNG、ワークシート、コード diode-bracket-width-resolution完全なコードも上記に記載されています。



