Help with wiring a Planetary Gear Encoder

My team recently bought a swerve drive kit from Andymark fully assembled. We are having trouble wring the encoders for the planetary gear motors. We have the Talon’s completely wired already and are just unsure as to how the encoder is supposed to be wired to the robot.
am-2816a is the encoder on the planetary gear motors on Andymark

Did it come with this cable: JST-XHP-4 to Split Connect 0.1 in. Pins - AndyMark, Inc ?
One end of that connects to the encoder and the other ends connect to roboRIO Digital Inputs.
The code examples probably use DIO 0 and 1.

On the AndyMark website you can see wires go to ground, 5v power, and two DIO signal pins.

Are we only supposed to have one channel output then?

Thank you for your help!

Normally, you would use two Digital Inputs. If you use the cable mentioned above, without any modification, the trick is to put the two two-pin connectors down so that they make the right connections. You will probably wind up putting them at right angles in order to do this.

Here’s a poor diagram of the pins for two Digital Inputs on the roboRIO:
[.][.] Signal
[.][.] +5V
[.][.] GND

You want to put the red/black cable on a +5V (red) and a GND (black), like so:
[.][.] Signal
[R][.] +5V
[B][.] GND

Then, you want to put the yellow/green cable on two of the Signal lines (either way is fine), like so:
[Y][G] Signal
[.][.] +5V
[.][.] GND

Taking these two together, you have:
[Y][G] Signal
[R][.] +5V
[B][.] GND

Now, in the software, you want to set up a quadrature encoder using the two Digital Input pins you used.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.