Hello People of Pololu,
I am programming an Arduino Uno with the Dual TB9051FTG Motor Shield using PWM control. Everything seems to be operating well except the current sense at Analog 0, M1OCM. I see that the Motor 1 current monitor output specifies approximately 500 mV/A per amp. While running a DC motor (Pololu item #: 4753) at 150mA under PWM control, the actual reading at Analog 0 is highly erratic, ranging from a value of 0 to 70. The erratic current sense readings also occur while running the provided Arduino program from Pololu [dual-tb9051ftg-motor-shield] on Github with current readings ranging from 60 to 110.
Wondering what may be the cause of the erratic current sense readings?
There are a few different causes of your erratic readings that are discussed in the product page description under the “Current sensing” header. First, the current-sense feedback voltage is only active while the corresponding H-bridge is driving; it is inactive (low) when the driver is braking or the motor outputs are high impedance (floating). If the driver is braking (such as whenever your PWM signal is low), current will continue to circulate through the motor, but the voltage on the OCM pin will not accurately reflect the motor current.
Additionally, like most motor drivers with integrated current sense, the accuracy can be especially poor at low currents. The TB9051FTG datasheet has more information about the driver’s current sense circuit.
If you need more consistent and accurate current sensing for your system, you might consider adding one of our Hall effect current sensors in-line with your motor