Interlock line monitor — sense chain and its four states

A safety interlock is a loop of wire threaded through every connector that has to be mated before a high-voltage bus may energise. Unplug one and the loop opens. The monitor has to tell four conditions apart — loop closed, loop open, loop shorted to ground, loop shorted to the supply — and one measurement cannot do it: a difference amplifier across the loop reads nearly zero for closed, for a short to ground and for a short to the supply alike, because in all three the two ends sit at the same potential.

So the chain measures twice. The difference across the loop says whether current is flowing, and the common-mode level says which rail the loop is sitting on. Neither alone separates the four states; together they do, and the worksheet exists to show that they do with margin.

It is here for its shape as much as its circuit: a page of prose around short arithmetic, the same names redefined once per scenario, divider ratios, and a table of computed points plotted against each other.

The rails and the converter this feeds.

Vsupply=5⁢V
Vadc_max=3⁢V
adcbits=12

The loop is driven from the supply through a series resistor and returns through a shunt to ground, so the two ends can be probed either side of the wire that leaves the box.

divider
Rseries=160⁢ohm
Rshunt=910⁢ohm
Rloop=12⁢ohm

Healthy loop: one series circuit, and the drop across the wire itself is what the differential channel is there to see.

Iloop=VsupplyRseries+Rloop+Rshunt=5⁢V160⁢ohm+12⁢ohm+910⁢ohm=4.62107⁢mA
Vdrop=Iloop·Rloop=4.62107⁢mA·12⁢ohm=55.4529⁢mV
Pseries=Iloop2·Rseries=(4.62107⁢mA)2·160⁢ohm=3.41669⁢mW

The differential channel. Gain below unity on purpose: an open loop puts the whole supply across the amplifier's inputs, and the converter takes 3 V.

Rin_n=20⁢kohm
Rfb=10⁢kohm
Rin_p=20⁢kohm
Rgnd=10⁢kohm
Adiff=RfbRin_n=10⁢kohm20⁢kohm=0.5
balanced=RfbRin_n=RgndRin_p=10⁢kohm20⁢kohm=10⁢kohm20⁢kohm=1
fn ch_diff defined

The common-mode channel: the average of the two ends, divided to fit.

Rcm_top=2.2⁢kohm
Rcm_bot=2.2⁢kohm
kcm=Rcm_botRcm_top+Rcm_bot=2.2⁢kohm2.2⁢kohm+2.2⁢kohm=0.5
fn ch_cm defined

An RC on each channel ahead of the converter. The corner sits far above the rate the loop is polled at and far below the switching noise it rejects.

filter
Rfilter=10⁢kohm
Cfilter=1⁢nF
fcorner=12·π·Rfilter·Cfilter=12·π·10⁢kohm·1⁢nF=15.9155⁢kHz
τ=Rfilter·Cfilter=10⁢kohm·1⁢nF=10⁢µs

The four states. Each redefines the same two node voltages and reads both channels through, which is what makes them comparable — the names mean the same thing every time and only the conditions above them change. Nothing mutates: each block is read by the lines below it and by nothing else.

states
  1. Loop closed. Current flows; both ends sit high, a wire's drop apart.
Va=Vsupply−Iloop·Rseries=5⁢V−4.62107⁢mA·160⁢ohm=4.26063⁢V
Vb=Iloop·Rshunt=4.62107⁢mA·910⁢ohm=4.20518⁢V
closeddiff=ch_diff⁡(Va,Vb)=ch_diff⁡(4.26063⁢V,4.20518⁢V)=0.0277264⁢V
closedcm=ch_cm⁡(Va,Vb)=ch_cm⁡(4.26063⁢V,4.20518⁢V)=2.11645⁢V
  1. Loop open. No current: the near end is pulled to the supply through the series resistor and the far end to ground through the shunt.
Va=Vsupply=5⁢V
Vb=0⁢V
opendiff=ch_diff⁡(Va,Vb)=ch_diff⁡(5⁢V,0⁢V)=2.5⁢V
opencm=ch_cm⁡(Va,Vb)=ch_cm⁡(5⁢V,0⁢V)=1.25⁢V
  1. Short to ground. Both ends are held down, and the series resistor takes the whole supply — which is the dissipation that sizes it.
Va=0⁢V
Vb=0⁢V
gnddiff=ch_diff⁡(Va,Vb)=ch_diff⁡(0⁢V,0⁢V)=0⁢V
gndcm=ch_cm⁡(Va,Vb)=ch_cm⁡(0⁢V,0⁢V)=0⁢V
Ishort=VsupplyRseries=5⁢V160⁢ohm=31.25⁢mA
Pshort=Vsupply2Rseries=(5⁢V)2160⁢ohm=156.25⁢mW
  1. Short to the supply. Both ends are held up, so the differential channel reads what state 1 and state 3 read and only the common mode tells them apart.
Va=Vsupply=5⁢V
Vb=Vsupply=5⁢V
supdiff=ch_diff⁡(Va,Vb)=ch_diff⁡(5⁢V,5⁢V)=0⁢V
supcm=ch_cm⁡(Va,Vb)=ch_cm⁡(5⁢V,5⁢V)=2.5⁢V

The four readings as a table, differential against common mode. A state is a point on this plane, and the design works exactly when no two points are closer together than the converter can resolve.

states=[closeddiffclosedcmopendiffopencmgnddiffgndcmsupdiffsupcm]=[[0.0277264 V, 2.11645 V], [2.5 V, 1.25 V], [0 V, 0 V], [0 V, 2.5 V]]
plot⁡(states)
0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5 V V

Nothing may leave the converter's range at either end.

diffs=[closeddiffopendiffgnddiffsupdiff]=[0.0277264 V, 2.5 V, 0 V, 0 V]
cms=[closedcmopencmgndcmsupcm]=[2.11645 V, 1.25 V, 0 V, 2.5 V]
highest=max⁡([max⁡(diffs)max⁡(cms)])=max⁡([max⁡([0.0277264 V, 2.5 V, 0 V, 0 V])max⁡([2.11645 V, 1.25 V, 0 V, 2.5 V])])=2.5⁢V
lowest=min⁡([min⁡(diffs)min⁡(cms)])=min⁡([min⁡([0.0277264 V, 2.5 V, 0 V, 0 V])min⁡([2.11645 V, 1.25 V, 0 V, 2.5 V])])=0⁢V
withinrange=highest<Vadc_maxandlowest≥0⁢V=2.5⁢V<3⁢Vand0⁢V≥0⁢V=1
headroom=Vadc_max−highest=3⁢V−2.5⁢V=0.5⁢V

The differential channel separates the open loop from everything else; the common-mode channel separates the other three from each other. The tightest of those four gaps is what the design is judged on.

lsb=Vadc_max2adcbits=3⁢V212=0.732422⁢mV
gapopen=|opendiff−closeddiff|=|2.5⁢V−0.0277264⁢V|=2.47227⁢V
gapgnd=|closedcm−gndcm|=|2.11645⁢V−0⁢V|=2.11645⁢V
gapsup=|supcm−closedcm|=|2.5⁢V−2.11645⁢V|=0.383549⁢V
tightest=min⁡([gapopengapgndgapsup])=min⁡([2.47227⁢V2.11645⁢V0.383549⁢V])=0.383549⁢V
counts=tightestlsb=0.383549⁢V0.732422⁢mV=523.672

A hundred converter steps between neighbouring states leaves room for the resistor tolerances and the amplifier's offset, neither of which this worksheet has sized yet.

marginneeded=100
resolved=counts>marginneeded=523.672>100=1
verdict={if within_range and resolved then "four states resolved" else "sense chain needs rework"if withinrangeandresolvedif within_range and resolved then "four states resolved" else "sense chain needs rework"otherwise={if 1 and 1 then "four states resolved" else "sense chain needs rework"if 1and1if 1 and 1 then "four states resolved" else "sense chain needs rework"otherwise="four states resolved"