BTS7960 current sensing

Good day fellows,
I am using a BTS7960 motor driver with a dc motor. I got the motor running. All I care for now is the current measurement. According to the datasheet you are supposed to put a resistor from pin R_IS or L_IS to ground and measure the voltage, which is proportinal to the current. When I measure the voltage drop with analogRead I get sequences of around 3 values, then a couple 0 and so on. Did anybody work with the BTS7960 and used the current sensing?

Thanks.

What value of Ris are you using? For a 1k Ris value you'd expect 120mV per amp

Do you have any analog filtering on the current sense? If you give the driver a PWM input, analogRead() won't work very well unless you filter out the PWM frequency.

Here's a circuit I've used on VNH2SP30, BTS5120 and other similar devices:
Current Sense Filter.jpg

R6 is the current sense resistor, R5 and the capacitor form the filter.

Current Sense Filter.jpg

Thanks for the idea with the filter. So the Is Pin from the bts7960 is using pwm to output the voltage?

The pin samples the current in the high-side driver, so it gets modulated just like the high side
driver. If you low-pass filter you'll get the average current, if you don't then you'll get readings
that vary between zero and the peak current.

Thanks a lot. Works good now.
Again thanks