monster motor shield current reading issue

Hi all.

I have a vnh2sp30 monster motor shield to control a dc motor, I have been trying to use the CS pin for motor current measurement but all my trials haven't really gave me much progress regarding that issue.
I was reading a reply to a post regarding reading the monster motor shield reading current issue. I have measured the output voltage on the cs pin by using an voltmeter and it varies on the range of -0 to -2 mv and I'm not understanding why the negative since i connected the probes accordingly. I have tried a 100 uf capacitor connected between my cs pin and my arduino analog pin and still I couldn't read much out of the Arduino by using the analog read. I really hope anyone can assist me regarding to this problem.

herewith attached a snippet of the part in my code that I use to read the current.

[void READ()
{
  Serial.println("read");
  Serial.println(((analogRead(CURRENT_SEN_1 )*11370)/1500)); // milli ampere
}]
Kind Regards
Abdalla
  Serial.println(((analogRead(CURRENT_SEN_1 )*11370)/1500)); // milli ampere

Has no chance of working, as the result of analogRead is an int (16bit), not a long (32 bit).
1023 * 11370 requires at least 24 bits to represent.

Use

  Serial.println(((analogRead(CURRENT_SEN_1 )*11370L)/1500)); // milli ampere

And the arithmetic won't overflow as the multiply operation will upgrade to 32 bits due to the long
constant 11370L

thank you markt , will give it a go and will post my results as it proceeds.
appreciate the effort.

abdoooo:
I have tried a 100 uf capacitor connected between my cs pin and my arduino analog pin and still I couldn't read much

"Between"? The capacitor should be in parallel with the analog pin and ground.

It should look like this...
Current Sense Filter.jpg

And 100uF is going to slow down the response a lot. 1uF is all that's required to filter out the 460MHz PWM frequency

Current Sense Filter.jpg

hello MorganS

I have tried using 1uf capacitor parallel to the original one as displayed in the figure. and use the same line of code i posted initially, i could only see either a 7 or 22 shown on the serial monitor after a lot of zeros. my application would need a actual time current measuring. can you please help me?

Regards
Abdoo

I want to add also that. isn't it strange to get from -0 to -2.1 mv when i measure the voltage coming out from the CS pin, what i understand is that value will be read through the arduino then converted to milli amps or amps. I'm really desperate for help.

Have you changed your code as Mark suggested?

It also helps if you use named constants so it is easier to see how the k-factor of the chip and the 1.5K load resistor are used in the calculation.