Negative current sensing in VNH5019 Motor Driver Carrier?

i want implement a current controller in simulink for a 12V brushed dc motor, my test bed has this VNH5019 Motor Driver Carrier. As from the description , i can get the voltage value and need to convert it to current. With the microcontroller in between will end up with only positive values. IS there any work around, or am i completey wrong.
Thankyou for your time

Hello.

You are right, the CS pin only reports the magnitude of current being drawn. To determine the direction of current flow, you will have to know what your system is doing with the INA and INB pins, which control the direction of rotation of the motor.

In case it was not clear how to get current from the voltage at the CS pin: that voltage is roughly equal to 140mV per amp of output current. So, a reading of 0.7V would be (700mV)/(140mV/A) = 5A. However, please note that the VNH5019 cannot effectively measure very small currents. (The current sense resistor on our VNH5019 carrier allows for currents of over 30A to be measured, which makes it better suited for measuring large currents instead of smaller ones.) It is more useful for qualitative assessments like determining if the motor is stalled. If you want to measure small currents with more precision, you might consider using one of our separate current sensors.

-Jon

ah got it, so i can conclude positive current flow in clockwise rotation and negative flow in anti clockwise direction?

You can arbitrarily pick which direction of rotation you assign as positive or negative. Current will always flow from VIN through the motor to GND. When the motor driver switches the motor’s direction of rotation, it is reversing the polarity of the supplied power across the motor terminals like shown in this blog post.

-Jon