Need a method for Floating point Peak Current Detector for Over Current protection

Hello everyone,
I’m working on a battery-based power converter where 4 battery packs (~48–50 V each) are connected in series.

To implement over-current protection, I’m planning to sense the switch current using a simple shunt resistor, placed at the source of the low-side MOSFET, as shown in the figure.

Because the batteries are stacked in series, the shunt resistor is floating:

  • One side of the shunt can be at 0 V / 50 V / 100 V / 150 V

  • The other side is connected to the source of the low-side MOSFET

So the challenge is:

  • The shunt voltage is small (mV level) but riding on a high and varying common-mode voltage

  • I need to detect peak current (both directions)

  • Compare it with a reference peak current

  • Use a fast comparator + latch to generate a hardware fault trip signal (independent of MCU)

I’m looking for practical and robust ways to sense this floating shunt peak current, suitable for fast protection (not just measurement).

Any suggestions on:

  • Architecture choices (isolated amplifier, comparator placement, etc.)

  • Components or reference designs

  • Things to avoid in such a high-dv/dt environment

Thanks in advance!