Skip to content

Wrong Encoder #2

@ghost

Description

You're using the encoder internal to the motor. You'll want to be using the through-bore encoder. Use getAlternateEncoder() instead of getEncoder(). This will disable the limit switches coming in from the through-bore encoder and all should be well.

In drivetrain change the following:

mLeftEncoder = mLeftMaster.getEncoder();
mRightEncoder = mRightMaster.getEncoder();

to

mLeftEncoder = mLeftMaster.getAlternateEncoder(AlternateEncoderType.kQuadrature, 8192);
mRightEncoder = mRightMaster.getAlternateEncoder(AlternateEncoderType.kQuadrature, 8192);

You will also need to make sure the switches on the through-bore encoders are set to quadrature.

Hope this helps.

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