ArduinoGeneral

DFROBOT DC Motor Driver HAT - Possible bug in the encoder driver?

userHead Account cancelled 2020-08-19 12:28:31 1256 Views2 Replies

Hello community,

I am controlling a DC motor using the DC Motor HAT for Raspberry Pi (wiki link):
https://wiki.dfrobot.com/DC_Motor_Drive ... KU_DFR0592

I am able to control the motor successfully and read the encoder feedback. The issue happens when controlling the motors in the CCW direction. The encoder reading becomes unreliable and the speed reading jump high and low, while the actual motor is physically spinning smoothly.

For instance, I've been using the demo project provided on Github and plotting the speed and duty data for Motor 1.
https://github.com/DFRobot/DFRobot_Rasp ... or_Demo.py

Motor 1 spinning in the CW direction. As you notice the speed and duty ramp up and then down without issue.

Motor 1 spinning in the CCW direction. In this direction the speed reading is very unreliable. I measured with an oscilloscope the encoder signals to the HAT board connector and they looked fine.

Has anybody seen this issue before? It happens on both motors (1 & 2) and on other SKU_DFR0592 boards I've purchased. To me this looks like an issue with the STM32 reading the encoder signals. Is there a firmware update that can help solve this problem?

Thanks for your help!

2020-09-28 16:04:32 Thanks for sharing userHeadPic lup.a.c.exi