I am trying to use current sensing functionality of Arduino Motor Shield R3, the shield is based on L289. The values that I read seem to be very noisy. I am using Arduino UNO A0 analogRead() function to sense current. To fix this I have tried to use low pass filter between the motor shield and arduino uno.
This helped to fix measurement noise however I have several questions about it:
- Is the noise in the sensing signal caused more by the motor it self of the fact that the motor is driven by PWM? (Note I have already increased PWM frequency of Arduino Uno to to 32kHz.)
- If I would add a low pass filter to the input PWM signal would the current sensing still be noisy? I have tried adding low pass filter to PWM but it did not seem to change current sensing. The low pass filter however affected the motor, it started to run as usual and slowed down almost to stop over time. Maybe I connected the low pass filter for PWM incorrectly.
- Is there actually any advantage of adding a low pass filter for an input PWM signal or is 32kHz PWM fast enough and I should just go with the low pass filter for current sensing?