Trouble with encoders

General discussion of using Roboclaw motor controllers
Post Reply
FabGk
Posts: 2
Joined: Thu Jun 08, 2017 12:51 am
Trouble with encoders

Post by FabGk »

Hello,

I'm using 2 types of roboclaws: 2*30A V5 with the firmware version v4.1.10, and more recently 2*15A V5D with the firmware version v4.1.23 . I just finished the code that allow me to detect which firmware my roboclaw is using, and select the right way to communicate with it.
I'm using my roboclaws with packet serial, sending commands 38 and 39.

However I have a problem with (quadrature) encoders: it seems that I have to change the wiring with the v4.1.23 to have the same results as the v4.1.10.
I'm sure it is the firmware because I changed the firmware of one v5 from v4.1.10 to v4.1.23, keeping the same wiring.
The problem is that my motor is running one way while the roboclaw is counting the encoder the other way, making the motor going full speed, (because the error and the command don't have the same sign) .

I could make it work by changing the wiring but I would like to keep the same wiring for all of my roboclaw, since I use a lot of roboclaws.
I could update the firmware version of my roboclaws and change the wiring, but don't want to do that since I use a lot of roboclaws.
I see there is an option "swap encoder" but it swap the pairs enc1 and enc2 which is not what I want.

Please, could you confirm that there is a change in the way of counting encoders tics. If so, is there a way to change this in order to keep my wiring?

Thanks!
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Trouble with encoders

Post by Basicmicro Support »

I recommend you update the firmware so all boards are on the same firmware.

This most recvent update changed the analog sampling method to reduce noise. This sensing change required the driving method to be modified which caused the default motor directions to change(at least on some models). This is not something that can be changed by the user through a setting in the current firmware. Currently you can only swap encoders between motor channels through software, not swap the directions of the encoders.

I'm adding this to our todo list(adding motor and encoder reversing options). It may be in the next firmware update.

In your case the only current fix is to either reverse the motor wires, or reverse the encoder A/B wires to bring the motor/encoder directions into line.
FabGk
Posts: 2
Joined: Thu Jun 08, 2017 12:51 am
Re: Trouble with encoders

Post by FabGk »

Acidtech,

Thanks for your reply, this have been helpful,

Bye!

Post Reply