The INA213 measures load current across the shunt and feeds a proportional signal through R3 into the feedback node. The converter raises V0 by exactly the voltage the shunt and cable will lose, so the load stays at the target. Below: the derivation step by step, a live calculator, how to pick R2 for noise immunity, and how the result behaves when the real cable differs from the design value.
Circuit
How the formula is derived
Five steps take you from the schematic to one clean equation. The trick in step 3 is to keep every term as a conductance (1/R) instead of cross-multiplying. R1 and R3 then collapse into a single parallel resistance, written Rp = R1 ∥ R3.
IN+ is on the load side, so V1 − V0 = −Rsh·I. REF on V0 makes the output ride on V0: it equals V0 at zero current and drops G·Rsh volts below it per amp (0.5 V/A here).
b KCL at the FB node
(V0 − VFB)/R1 + (VINA − VFB)/R3 = VFB/R2
The converter regulates FB to VFB = 0.6 V. Current arrives through R1 from V0 and through R3 from the amplifier, and leaves through R2.
The first term is the setpoint: an ordinary divider with Rp as the upper arm. The second term is the compensation: the amplifier's G·Rsh volts per amp, scaled by the divider ratio α. Rc does not appear. Once R3 is fitted the slope is fixed, so the circuit applies an assumed cable resistance with no limit on current.
The bracket must be zero: the rise per amp equals the loss per amp. Smaller than that and the load still sags (undercompensated). Larger and the load voltage climbs with current (overcompensated). Because α < 1, this needs G·Rsh > Rsh + Rc, i.e. Rsh > Rc/(G − 1) = 4.08 mΩ here. Use two to three times that minimum.
Design current
The plot and table run to 1.5× this value so the overload region is visible. Nothing in the circuit clamps the compensation at the design point.
Parameters
Design recipe — live values
Two targets (setpoint and slope) and three resistors, so R2 is your free choice and the other two follow. The numbers below update with the parameters.
1 Divider ratio from the slope
α = (Rsh + Rc) / (G·Rsh) = —
2 Upper-arm ratio from the setpoint
Rp/R2 = Vtarget/VFB − 1 = —
3 Choose R2, get Rp
Rp = (Rp/R2) × R2 = —
See Noise resistance below for how to choose R2.
4 Split Rp into R3 and R1
R3 = Rp / α = — R1 = Rp / (1 − α) = —
5 Check
V0 at 0 A = —
slope G·Rsh·α = —vs Rsh + Rc =—
After rounding to standard values, recompute both lines with the parts you will actually buy. 1% parts shift the setpoint by tens of millivolts.
Computed network
Noise resistance — choosing R2
Switching noise couples into the FB pin as a small current. The voltage it produces is that current times the impedance seen at FB, which is ZFB = R1 ∥ R2 ∥ R3 = Rp ∥ R2. A smaller R2 lowers ZFB and makes the setpoint harder to disturb. Since Rp = (Rp/R2)·R2 and R1, R3 are fixed multiples of Rp, every resistor scales with R2. The limits come from the amplifier and the feed-forward capacitor.
Candidate values
Low Z ZFB ≤ 2 kΩ, R3 ≥ 10 kΩHigher Z works, more noise pickupR3 < 10 kΩ loads the INA213 output
Limits on how small R2 can go
INA213 output loadR3 is a load on the amplifier. At zero current it carries (Vtarget − 0.6 V)/R3. The datasheet characterises output swing with roughly a 10 kΩ load; heavier loading adds gain error. Keep R3 ≥ 10 kΩ.
Feed-forward capacitorC_f across R1 sets a zero at fz = 1/(2π·R1·C_f). Keep R1·C_f constant: when R2 drops, R1 drops by the same factor and C_f rises by it. The table's C_f column shows the factor relative to R2 = 4.3 kΩ.
Quiescent powerDivider plus R3 current stays below 1 mA for R2 ≥ 1 kΩ. That is negligible for a multi-amp converter and matters only for standby efficiency.
Layout matters more than values
Keep FB shortPlace R1, R2, R3 and C_f at the FB pin. Route the FB trace away from the switch node and inductor.
Quiet ground for R2Return R2 to the controller's analog ground, not a power ground path that carries switching current.
Run the long trace from the INAThe trace from the INA output to R3 can be long, because a low-impedance source drives it. The short side belongs at FB.
Optional RC filterSplit R3 into two halves with a small capacitor to ground at the midpoint. The DC value is unchanged, so the compensation maths stays the same. Put the corner well below the switching frequency.
Topology
Actual cable resistance — three cases
Response
V0 converterLoad, case ALoad, case BLoad, case COut of specUndervoltage warning
Curves carry their cable resistance in milliohms at the right edge. All three start at the same intercept and fan out linearly, because the compensation slope is fixed in hardware while the real drop is not. The vertical marker is the design point; everything to its right is overload.