Wrong Encoder Reading with roboclaw.Duty command

Questions about using encoders with the Roboclaw product line
Post Reply
Posts: 5
Joined: Thu May 16, 2019 3:54 am

Wrong Encoder Reading with roboclaw.Duty command

Post by Ellimc » Tue Jun 18, 2019 12:21 am

I tried to controle my robot. Sometime I will need to control it on Force or torque if you prefer. So I was thinking the roboclaw.DutyM1(...) was the right command to do this but when I use it the encoder reading become wrong. It is as if when I send the roboclaw.DutyM1(...) the zero of the encoder just slide to another position...When the duty is low, the motor mouves but the encoder reading do not increase. Then if I put a higher duty to the motor then the encoder start to count.
This problem does not appear when I use the velocity PIV and the position PID... What can I do?
Thank you in advence
Camille :D

User avatar
Basicmicro Support
Posts: 1446
Joined: Thu Feb 26, 2015 9:45 pm

Re: Wrong Encoder Reading with roboclaw.Duty command

Post by Basicmicro Support » Tue Jun 18, 2019 9:52 am

It sounds like something is wrong with your encoder signal. Check the encoder signal on an oscilloscope if you have access to one.

If you are using a motor with the built in hall encoders(eg the really inexpensive encoders) this have a known issue with passing motor noise into the encoder signal line(and 5v power). You can fix this by adding a .01uf cap from each signal line to ground. I also recommend putting a .1uf cap from the 5v connection to ground as well to help prevent noise getting back into the logic circuit of the Robocalw that way.

Post Reply