2026-09-19
Single-shunt sensing replaces two current-sensing channels with one shunt resistor, at the price that "the current that is measured" and "the current the current loop needs" are not the same quantity: the former is the instantaneous DC bus current at a given switching state and a given instant, the latter is the average value of the phase current over this switching period. The difference is not noise but a deterministic offset uniquely determined by the switching geometry, and its magnitude spans a wide range: on machines with high inductance and a low DC bus voltage it may be only a few tenths of an ampere, while on machines with low inductance and a relatively wide sampling window (dominated by dead time and settling time) it can reach several amperes. Whatever its size, it is independent of current amplitude, synchronized with the sector, and enters the current loop, the observer and the torque directly. Without relying on any particular implementation, this article explains the offset in the order "structural constraints of single-shunt sensing → origin of the offset → offset modeling → direct compensation → simplified compensation → summary".
Notation. To avoid ambiguity, all symbols are collected here first (local first appearances are explained in place). Every time quantity is expressed in "counts", i.e. in timer counts within one switching period. Correspondingly, the current slope is read as "current change per count": is originally a quantity in "amperes/second", and throughout this article it is used as "amperes/count" (the two differ only by the constant factor "how many seconds one count corresponds to", omitted consistently throughout). Time, slope and current are then self-consistent in units, and no additional conversion factors appear in the equations.
Time and counts
Switching states and current slopes
Currents and offsets
Geometric and electrical parameters
Field-oriented control needs three phase currents. The three-shunt and two-shunt schemes place sensing resistors in the lower arms, so what is measured is the phase current itself; the single-shunt scheme places one resistor only in the DC bus path and reconstructs the three phase currents from the fact that "the bus current equals a different phase current in different switching states". The choice between the three topologies is a choice between cost and information:
| Scheme | Hardware | Characteristics |
|---|---|---|
| Three-shunt | 3 shunts, 3 op-amps, 3 ADCs | Synchronous three-phase sampling, ample windows, highest cost |
| Two-shunt | 2 shunts, 2 op-amps, 2 ADCs | Third phase derived from |
| Single-shunt | 1 shunt, 1 op-amp, 1 ADC | Lowest cost, full three-phase reconstruction |
Measurability criterion. Let denote whether the high-side switch of phase is on and the number of conducting phases; define
then the bus current equals that phase current only when :
Among the 24 phase-state combinations (eight switching states times three phases), only 6 satisfy (each of the six non-zero vectors contributes one). A switching period passes through only two of those non-zero vectors, so at most two phases can be measured directly in one period, and the third phase can only be derived from .
Window constraint. The bus current is usable only in those two states, so a single-shunt design must guarantee two sufficiently wide measurable windows in every switching period. At low modulation the active vectors act for very short times and cannot meet the minimum window width; in practice this is solved by phase shifting (pulse shifting): the two active vectors are each pulled towards the two ends of the period and their action time is enlarged, while the central zero vector is compressed and distributed to the two ends, so that the originally unusable short stretch becomes a usable window. Once the windows are fixed, the sampling instant is in principle taken at the window centre (equivalent to the centre of the active-vector segment), and a minimum window width is enforced, so that the maximum output duty cycle is limited to a value below 1.
What phase shifting really does is borrow volt-seconds; it is not a mere rearrangement of time. To bring the measurable segment up to the minimum window, the action time of a non-zero vector is lengthened, and the extra volt-seconds must be deducted elsewhere, usually in the interval corresponding to the other half period (or in the zero vector). Therefore:
This is most visible at low modulation: as the commanded voltage approaches zero, the ideal waveform should be nearly a flat line; after phase shifting, each half period contains a lengthened interval, and their current responses run in opposite directions and cancel within the period — the average value is still that very small commanded value, while the instantaneous value deviates noticeably in both the positive and the negative direction. In other words, at low modulation the fluctuation of the phase current is caused mainly by the need "to be able to sample", not by the "wanted voltage".
The starting point of this article must be stressed here: the sampling instant is determined by the modulation pattern (the window must avoid switching transients and must fall inside a measurable state), not by "where the period average of the current happens to lie". As long as single-shunt sensing is used, this mismatch between sampling point and average value exists by nature — it is structural, cannot be removed by layout, shielding or filtering, and can only be modeled and compensated.
Window width has one more consequence: the window lower bound is set by the dead time and the sampling settling time (sampling must wait until the switching transient has decayed). The higher the switching frequency, or the longer the required settling time (a low-inductance motor has a large current slope and is more sensitive to the sampling instant), the larger the share of the switching period the window occupies and the further the sampling point moves from the average current — which directly determines the order of magnitude of the offset discussed below.
Write the phase current of one period as two parts:
Sampling yields , while control needs the average value of this period. The difference
falls into two categories:
In practice the trend term usually need not be "eliminated", because the existing current-loop delay compensation (angle compensation referenced to the sampling instant) is already tuned in the sampling-instant convention. The sound compensation convention is therefore: keep the existing sampling-instant convention and remove only the ripple at the sampling point, so that after compensation
(an equality under the assumption that the fundamental is linear within one period.)
(1) At low modulation the fluctuation comes mainly from phase shifting, not from the "wanted voltage". This deserves separate treatment, because it explains why the phase current still fluctuates noticeably when the commanded voltage is almost zero.
(2) Sign of the ramps and its relation to the two windows. The direction of each ramp is set by the switching state of that segment:
The two measurable windows correspond exactly to these two states, so the switching-state slopes at the two windows are opposite in sign and equal in magnitude (both equal ; each also carries the same slowly varying term, so the actual slopes are only approximately equal in magnitude); and since the sampling point lies at the centre of the lengthened segment, what is sampled is the midpoint of that ramp rather than the period average. The relation between the offsets of the two windows follows:
Whether this integral is zero, that is whether the two windows happen to give the same correction, is decided entirely by the relative positions of the two windows within the period — by how far phase shifting lengthens each of the two segments and where the sampling points land — and not simply by the magnitude of the commanded voltage;
The offset has three properties that decide its importance and how it should be verified:
( gives the upper bound; the actual scaling factor also depends on where the sampling point falls inside the segment.) The key point is that the expression contains no phase current: , and enter only the period-average slope and do not change the ripple shape, so under the same operating point the load level cannot change its absolute value. Strictly this is a conclusion of the present model — in reality the dead-time equivalent drop jumps with the polarity of each phase current and the inductance varies with saturation, so the safer statement is that it does not vary randomly with load, not that it is identical for every load. The expression also shows that its span can be wide: with high inductance, a low DC bus voltage and a narrow window it is only a few tenths of an ampere; on a machine with low inductance (large current slope) and a relatively wide sampling window (lower bound set by dead time and settling time, occupying a large share of the period), several amperes is entirely normal. Its harm therefore runs in two directions: at light load it is a large relative error (when the phase current is only a few amperes the offset may amount to tens of percent), and that is exactly the region where sensorless FOC depends most on current accuracy at low speed and light load; on a low-inductance machine it is at the same time a large absolute error, present at any load;
Second-order offset: the sampling point off the segment centre. Besides the dominant term above, the sampling point itself may deviate from the centre of the vector segment it lies in. In implementations the window width is often twice the sampling settling time; in that case "take the segment centre" and "take the segment start plus one delay" give the same point, and under symmetric modulation this offset is exactly 0. An offset appears only when the segment is too short and the sampling point is pushed towards a segment boundary. It is proportional to the slope of the measured phase there (the only-conducting / only-non-conducting states give , see §b(2)); its magnitude is comparable to the dominant term, and it is a reference quantity to keep but not to treat as the dominant term.
The route of this section: first the slope model of the phase current, then which quantities cancel within the period (which is why the model reduces to "switching states only"), then the sampling geometry, and finally the three combined into the offset model.
(1) Slope model of the phase current. The phase current satisfies
where is the back-EMF, the equivalent drop of dead time and of device and switch on-state voltage drops, and the phase inductance. Define the slope scale
then the phase-current slope within one switching state can be written as
depends only on the switching state:
| State ABC (1 = high side on) | ||||
|---|---|---|---|---|
| 000 (zero vector) | 0 | 0 | 0 | 0 |
| 100 | 1 | |||
| 110 | 2 | |||
| 010 | 1 | |||
| 011 | 2 | |||
| 001 | 1 | |||
| 101 | 2 | |||
| 111 (zero vector) | 3 | 0 | 0 | 0 |
The table implies an identity:
that is, **the sum of over the three phases is identically 0**. It carries two meanings: first, "phase " and "phase " are two sides of the same fact; second, the error of the derived third phase current is exactly minus the sum of the errors of the other two (because the third phase value is ) — at low modulation with approximately symmetric windows, the offset of the third phase is about twice that of the other two and of opposite sign.
(2) Cancellation of the period invariants. The most convenient step in the modeling. Split the slope into a period average and a zero-mean part:
With , then
(verified by substituting and ; the identity holds for any slope.) That is: the compensation depends only on the voltage differences between switching states, i.e. on the ripple shape. There are in fact two separate cancellations here, and merging them is a common source of confusion:
The engineering consequence: the model needs no online identification of the back-EMF, no computation of , and no borrowing of the dead-time compensation drop; errors in those quantities do not leak into the compensation either.
(3) Sampling geometry. Under center-aligned PWM, each phase turns on in the up-counting part of every period at one compare value and off in the down-counting part at another compare value. If a phase turns on in the up-counting half period at count and off in the down-counting half period at count (both with the valley at 0 and the peak at ), the high-level interval of that phase is ; rewritten with the , used below, that is — the on-segments of the two half periods meet at the peak. This interval notation is the common premise of the three closed-form groups below. The number of conducting high-side phases therefore changes in steps with the count. Cutting one period into segments by switching state gives a finite number of segments (no more than 8 under typical 7-segment modulation). The two sampling windows fall in the two measurable segments:
Denote the two sampling instants by and . If the counter runs from 0 at the valley to the half-period count at the peak, the whole period is counts, and the offset of the sampling instant relative to the period midpoint is most conveniently expressed by a single scalar :
it captures both "earlier or later" and "by how much" ( meaning later).
(4) Offset model. Combining (1), (2) and (3), the correction for the measured phase at sampling instant is
the right-hand side contains the ripple only, which is (2)'s conclusion made concrete. More useful in practice is the form normalized by , because the normalized quantity is determined only by the integral of :
A different notation is used here: is the accumulation of , which differs from the earlier in the convention by a common factor only — gives , so the "division by " is already done inside , which is also why scales the magnitude proportionally without affecting sign or shape. is in counts (time counts) and is independent of voltage, inductance and current magnitude — only switching-state information is left in the model. Each of the two sampling windows substitutes its own .
The most intuitive form of compensation evaluates that integral literally: cut one period into intervals by switching state and accumulate the first and second integrals segment by segment:
where is the first integral in the current convention defined above, and is the duration of segment ( rather than is used, to avoid confusion with the sampling-instant offset ).
The implementation must maintain two rolling state variables (the current first integral and the accumulated second integral), update the switching state and slope at every breakpoint, and record the first integral at the moment the sampling point is crossed. In other words, the period must first be split into an ordered interval table and then walked segment by segment.
This route is accurate enough (it is the direct discretization of the offset model), but its cost is proportional to the number of intervals:
The "direct method" is therefore correct in principle but usually unacceptable in real time, which naturally raises the question: since the slope is piecewise constant, can the integral be obtained without segment-by-segment accumulation? The answer is yes — which leads to the simplified compensation.
The simplification has three levels, each cheaper than the last.
First level: reduce the double integral to single integrals. What is needed is the period average of , which is itself the double integral of ; accumulating it segment by segment is exactly the cost of the "direct method". Because is piecewise constant, integration by parts reduces it in one step to two single integrals:
Denote the three single-integral quantities
then , . Substituting them into (note ):
That is: the whole procedure needs only three single-integral quantities (the area, its moment with respect to time, and the area up to the sampling instant), no double integral at all and no per-interval accumulation.
**Second level: turn per-phase integration into a three-phase combination by means of .** Since , and the three are all integrals of , each of them can be written in the same form:
is the measured phase's share and is the sum over the three phases — this step works only because happens to be exactly the sum of the three. The physical meaning is clear: the bus-current path of the measured phase corresponds to (factor 3 minus 1), the three-phase sum represents the "common background", and only their difference is this phase's offset. So no matter how many segments the period is cut into, all that is needed is three quantities per phase, and the computational cost is completely decoupled from the number of intervals.
Third level: all three quantities have elementary closed forms. Let a phase turn on in the up-counting half period at count and off in the down-counting half period at , and define
(these are the "counts already on in the up-counting half period" and the "counts still on in the down-counting half period", to be clamped to ). Then, with ,
the first two follow directly from the definitions; the "hinge" form of the third comes from two cases: for (sampling point in the up-counting half period) there is only the term, while for (in the down-counting half period) it is — merging the two gives that expression, with no branch, no lookup table and no need to decide which segment the sampling point falls in. And because
the sampling instant enters the computation only as the scalar .
The simplified compensation algorithm is therefore only three steps: (1) compute the three sets of from the phase compare values; (2) compute , and for each phase and combine them as above into for each of the two windows of the measured phase; (3) multiply by and scale it into a current value with the present scale.
Combining the three steps into one expression: let the measured phase be , let run over the three phases, and let the sampling-instant offset of the -th window be ; then
where is the half-period count and the whole-period count; is the turn-on count of a phase in the up-counting half period and the turn-off count in the down-counting half period, from which and are obtained by subtracting from and clamping; is the measured phase and runs over the three phases; identifies the two sampling windows and is the offset of that window's sampling instant relative to the period midpoint; are in turn the conduction area, the time moment of the conduction area, and the conduction area up to the sampling instant; is the three-phase difference of these three quantities (three times the measured phase minus the sum of the three phases); is the normalized correction, in time counts; is the current slope scale; is the correction finally added to the sampled current of phase .
Steps (1) and (2) must be done for each of the three phases (the sum in step (3) is exactly why all three phase data sets must be available at the same time), while step (3) is done once for each of the two measured phases: each window substitutes its own and measured phase, giving two corrections that are added to the corresponding two phase currents; the third phase is derived from and its correction is naturally minus the sum of the other two. A dimensional self-check comes for free: and are both in counts (time), so is in time, and multiplying by the current slope lands exactly on current — which is the fundamental reason why scales the magnitude proportionally without affecting sign or shape.
The whole procedure has no interval table, no sorting and no per-segment loop; the cost changes from "proportional to the number of intervals" to a fixed small group of multiply-accumulates plus one constant division (the denominators and depend only on the modulation parameters and can be precomputed).
Two general points for implementation:
The essence of single-shunt sensing offset compensation is to restore "the bus current at a given switching state and a given instant" to "the average phase current of this period". The whole argument compresses into four statements:
One last piece of engineering experience deserves separate emphasis: the absolute value of this correction may be very small or as large as several amperes (depending on , and the window width), but it is always a sector-synchronized deterministic step rather than random noise — so acceptance must not rest on how "clean" the phase-current waveform looks. The reliable criteria are the sector-synchronized 6th harmonic on (compared before and after compensation), or an A/B test with compensation switched on and off at the same operating point; and note that the corrections of the two windows are computed independently and are generally not equal (their difference equals the integral of that zero-mean ramp between the two sampling instants), so "one phase hardly changed" does not prove the compensation has failed.
This article was compiled with AI assistance and proofread by a human.