Packet Motor Encoder Read Invalid

Questions about using encoders with the Roboclaw product line
Post Reply
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Packet Motor Encoder Read Invalid

Post by Basicmicro Support »

FIrst you need to get the encoders workign correctly in Motion Studio.

1. Check that the encoders are counting in the correct direction. Open PWM Settings and move the slider UP. The encoder count should increase(positive). Move the slider down from center and the encoder should count down(negative).

2. Move the motor at full power(slider all the way up) and note the speed. Do the same in reverse(all the way down). Are the values for the maximum speeds close to the same.

If your motor direction relative to the encoders is wrong the autotuner will do eactly what you described. Assume you fix the direction and tune the motors and test that they are running correctly in Motion studio then we can start looking at your packet serial programs. I assume you are eithe rusing an arduino or using Python on the PC? Please confirm.
iHaa
Posts: 2
Joined: Tue Dec 11, 2018 10:23 pm
Re: Packet Motor Encoder Read Invalid

Post by iHaa »

Just piggybacking on this thread since I've got a similar issue.

I am unable to get valid readings on my Arduino Mega.

As per my research, I've got everything set up properly - correct readings in Basic Micro Motion Studio, updated firmware and Arduino libraries.

I could only get it to work once (after updating Roboclaw's firmware to 4.1.27 and updating my Arduino libraries, and after a day, it stopped working). It also works when the USB from the Roboclaw 2x30A is connected to my PC.


Is there a fix to this yet?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Packet Motor Encoder Read Invalid

Post by Basicmicro Support »

iHaa, It sounds like your problem is not the same. The previous poster had a problem reading encoders at all(in Motion Studio as well).

Based on your post you do not have that problem(you say it works in Motion studio). If you can see the encoder readings in Motion studio then the problem is in your communciation between the Arduino and the Roboclaw. Since it was working before and now is not you need to check your wiring. Make sure other commands work(as a start make sure the readversion command returns the versions string).

Make sure you are using the latest Roboclaw arduino library from our website(not a resellers website).

Provide the arduino code you are using to read the encoder values(a simplified version please, just the code you need to read and display the encoder values).

Post Reply