I use current sensor to prevent too high current in DC motor. Logic is powered by STM32F103C8T6 and it gets output values with ADC. This scheme (differential amplifier on Rail-to-Rail op amp) gives proper values with laboratory power supply if I connected it short-circuit with current sensor. Also current sensor works as expected with DC motor and motor driver MD13S which can be controlled with buttons in both direction, but if the logic GND of motor driver is connected to the GND of STM which supply the current sensor, this current sensor works only in 1 direction, in other it does not work at all the output value is equal 3.3 V or 0 V. Same situation if I use PWM (1000 Hz) to control motor with MD13S.
So why current sensor does not work in both direction if its GND and GND motor driver are shared?

