The original current sensor logic will use a shunt between the lower HEXFET and ground (low side current sensing). This is fine for 3-phase, DC or Stepper motors, but it will not enable measuring of current on a single, stand alone Half-Bridge.
An alternative way of doing this that fix this issue is to measure the current on it’s way out as indicated below using “high side current sensing”.
In this schematics we introduce the shunt on the PWM Out and take advantage of INA210 being a high side sensor. I connected BEMF to the left side of the shunt due to routing logistics. With a 0.001 Ohm shunt this error should be constant and very small.
High side current sensing is more responsive to changes in the current flow and adds no disturbance to system ground. The main disadvantage is that because the shunt resistor is not at system ground, a differential voltage must be measured which requires the precise matching of the proper differential amplifier. However, this disadvantage is eliminated with the use of a precision current shunt monitors like INA210 or similar.
Transporting the current out proved to be easy as I mounted the shunt opposite the high side HEXFET using it as a path out. The disadvantage is that as the HEXFET heats up so will the shunt. If this becomes an issue I will extend the length and move the shunt to the right. INA210 is mounted opposite the low side HEXFET and will have the same issue, but reading the datasheet it should have max ca 1% temperature drift error. Current sensing is most critical for 3-phase control, but keep in mind that we measure all 3 phases. As adding all three phase currents should give 0 (zero) we have a sensor error indication implemented.