Signed-filter current-sign certificate (source code)

= Signed-filter current-sign certificate
{title2=$|i(t)-\widehat i|\le\epsilon+L_i\sum_j|a_j||t-t_j|$}

A <signed-filter current-sign certificate> guarantees the sign of an actual load current from a filtered estimate whose coefficients can be negative. Such a filter may extrapolate or sharpen a waveform, but its output is not necessarily a convex average of past currents. The sign must hold over the intended switching interval before it can justify <current-polarity dead-time compensation>; the relevant recirculation paths depend on current direction.<Using power MOSFETs in DC motor control applications by Nexperia>[IAN50004, §4.1, Figures 5–6]{ref}

Suppose $\widehat i=\sum_j a_j i(t_j)+\eta$, with $\sum_j a_j=1$, $|\eta|\le\epsilon$ and the Lipschitz bound $|i(t)-i(s)|\le L_i|t-s|$ over all relevant times. Then
$$
i(t)-\widehat i=\sum_j a_j[i(t)-i(t_j)]-\eta,
\qquad
\boxed{|i(t)-\widehat i|\le\epsilon+L_i\sum_j|a_j||t-t_j|.}
$$
The absolute coefficients are essential. To certify an interval, maximize the right-hand side over its times. A positive sign follows if the estimate exceeds that bound; a negative sign follows if it is less than the negative bound. If individual sample errors are bounded by $\epsilon_j$, their contribution is at most $\sum_j|a_j|\epsilon_j$ rather than a signed cancellation.

The generic bound can be conservative because all samples come from the same current history. For the two-tap predictor $\widehat i=2i(0)-i(-T_a)+\eta$ and future time $\delta\ge0$, rewrite the error as
$$
i(\delta)-\widehat i=[i(\delta)-i(0)]-[i(0)-i(-T_a)]-\eta.
$$
This gives the sharper result
$$
\boxed{|i(\delta)-\widehat i|\le\epsilon+L_i(\delta+T_a),}
$$
instead of the direct absolute-weight bound $\epsilon+L_i(3\delta+T_a)$. It is sharp under only a Lipschitz current assumption: a history proportional to $|t|$ changes slope at the central sample and attains the positive error limit. The Lipschitz assumption permits that corner even though a derivative need not exist at the corner itself.

For an original example, take $L_i=5000\,\mathrm{A/s}$, $T_a=6\,\mathrm{\mu s}$, a target interval $0\le t\le2\,\mathrm{\mu s}$, and aggregate estimate error $\epsilon=0.020\,\mathrm A$. The sharper interval bound is $0.060\,\mathrm A$; the direct absolute-weight bound is $0.080\,\mathrm A$. A reading $\widehat i=0.065\,\mathrm A$ therefore certifies at least $0.005\,\mathrm A$ throughout the interval using the sharper proof. A signed timestamp average would misleadingly place the predictor at time $+T_a$; it is an extrapolation, not a measured future sample.

A <current-sign certificate with a curvature bound> can exploit stronger information. For the target time $T_a$ and a twice differentiable current with $|i''|\le M_i$ on $[-T_a,T_a]$,
$$
|i(T_a)-2i(0)+i(-T_a)|\le M_iT_a^2.
$$
Taylor’s theorem, or integrating the second derivative against its triangular weight, proves the inequality. At $T_a=6\,\mathrm{\mu s}$ and stipulated $M_i=10^8\,\mathrm{A/s^2}$, the model error bound is $0.0036\,\mathrm A$ before sample errors. This smaller number is justified only if the curvature bound also covers switching transitions; an affine-ramp fit alone does not establish it.

A proposed validation injects known ramps and waveforms with changing slope, records the actual filter coefficients and sampling times, and checks the resulting enclosures against an independent current trace. Account for sensor saturation, timing uncertainty and the history used by the filter. A sharper mathematical bound and a stronger physical assumption are different ways of obtaining a smaller certificate margin.