Drift residual after current-source swapping (source code)

= Drift residual after current-source swapping
{title2=$\sqrt{k_1/k_2}$}

A <drift residual after current-source swapping> remains when the current ratio changes between the two source assignments. The <geometric mean> cancellation in <current-source swapping in a resistance ratio measurement> is exact for a fixed multiplicative mismatch; it does not make a time-varying mismatch constant.

Let the true resistance ratio $q$ remain fixed. At the two acquisition times $t_1,t_2$, write $k_i=I_A(t_i)/I_B(t_i)>0$. With opposite source assignments,
$$
r_1=qk_1,\qquad r_2=q/k_2,\qquad
\frac{\widehat q}{q}=\frac{\sqrt{r_1r_2}}q=\sqrt{\frac{k_1}{k_2}}.
$$
For $g(t)=\log k(t)$, the logarithmic error is $[g(t_1)-g(t_2)]/2$. A full-interval bound $|g'(t)|\le\gamma$ therefore gives
$$
\left|\log\frac{\widehat q}{q}\right|\le\frac{\gamma|t_2-t_1|}{2}.
$$
For an original example, a logarithmic source-ratio drift of $0.01\,\mathrm{s^{-1}}$ over a $0.2\,\mathrm s$ acquisition separation produces $\widehat q/q=e^{-0.001}\approx0.9990005$. This is a $0.0999500\%$ underestimate for that drift direction. Shortening the separation reduces this particular residual, provided both readings still follow electrical settling.

A useful original logarithmic variant of an <ABBA measurement sequence> uses source-assignment signs $s=(+1,-1,-1,+1)$ at equally spaced times $0,\Delta,2\Delta,3\Delta$. The four readings obey $\log r_i=\log q+s_i g(t_i)$. Combining them as $\widehat q=(r_1r_2r_3r_4)^{1/4}$ gives
$$
\log\frac{\widehat q}{q}=\frac14\sum_{i=1}^4s_i g(t_i)=0
\quad\text{when }g(t)=a+bt.
$$
Both the constant and linear logarithmic drift terms cancel because the signed time sums vanish. Unequal timing, nonlinear drift and a changing sensor resistance can leave residuals. If $q$ itself varies, the combination includes its geometric average over the acquisitions rather than automatically recovering a single-time value.

The primary RTD guide establishes source interchange in its three-wire circuit; its topology-specific arithmetic averaging is distinct from the separate-branch logarithmic model above.<A Basic Guide to RTD Measurements by Joseph Wu>[§1.4.2, printed p. 6, Figure 1-6 and equations (9)–(12)]{ref} A proposed bench test imposes a slow controlled source-ratio variation, timestamps the readings, and compares a two-reading swap with the balanced four-reading sequence while using stable sensing <resistors>.