Skip to content

Issues with encoder on pins 2 and 3 #47

@dakoner

Description

@dakoner

Hi,
I'm using ros_arduino_bridge with the Pololu 19:1 CPR motor encoders: https://www.pololu.com/product/2822
The motors and encoders are attached to an Arduino Nano or UNO.

I am consistently seeing the encoder counts on pins 2/3 downscaled by a factor of 40 (for example, while rotating the wheel 1 full revolution, the wheel on A4/A5 reports the right value and the . I read up on the other issues (#29), and noticed that some motor boards use pins 2/3 and so there is a way to make the ISR use another pair of pins. However, I am just using an unshielded Nano or UNO. Either way, I also tried pins 3/5 with the ISR code and the #defines changed as suggested in issue 29- when I do that, I get no readings at all.

To control for variables, I've tried swapping the motors (problem remains on pins 2/3). I've inspected the encoder wave forms, everything looks correct.

Are there other options, such as using PORTB, or mechanisms to debug why the (apparently correct) encoder pin changes aren't leading ot the right encoder counts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions