REV Through Bore Encoder on DIO pins not working

I’ve sent this off to REV support as well but maybe someone in the CD community has an insight.

Was looking to use the Through Bore Encoder on this years FRC robot so I plugged in the supplied cable to the unit and the other end, the one with the Black, Red and White Cable into DIO port 0 of the RoboRio.
Using instructions from here…

I wrote essentially two lines of code into a TimedRobot template.
In robot INIT I made a new encoder
DutyCycleEncoder encoder = new DutyCycleEncoder(0);

In RobotPeriodic wrote the “.isConnected” and .getAbsolutePosition to the smartdashboard.

The functions are all working as the debug session showing the lines of code being executed.

.isConnected always returns false.
I tested this with two different hardware units.

Switch is in the “A” position.

Thanks for pointing out any pitfalls I’m unaware of.
Not sure what to do next.

Sounds like a code problem

Just checking to be sure- the black wire is on the ground pin? (leftmost pin when looking at the roborio from the front)

We also should test the other encoder that we have as well. Those have been bouncing around with the FTC supplies for a while now and I don’t know that they have ever been used or set up. If they have been used, I have no idea if they were set up right or if they were wired properly.

Yep, black wire is on the ground pin and white wire is on Signal pin and red wire in the middle. (Going from memory but 99.9% sure)

Guessing you are using this cable: JST PH 6-pin to 4 Channel PWM Cable - 1m - REV Robotics?

Just to confirm, this is the connector you are using?

You want the switch on the encoder to be in the ‘A’ position.

Assuming this is all so, code issue (or backwards connector to RIO) seems to be most likely.

Yes, that is the cable. Switch is on “A” (again from memory when I checked last night).
Gonna try it connected direct to a SparkMax today.
Just didn’t know if anyone in CD land had one of these hooked up this way right now and it be working.

We used two last year, no problem. We did make our own cable, just because we needed it to be longer. We also use C++ and had our own code on top of the DutyCycle class though.

I mean, it’s gotta be code somehow, I’m just missing it I think. But the code is so simple.
When/If I catch my blunder, I’ll be sure to post.

Maybe try calling .getFrequency() and printing that as well. And, I would advise against constructing this every loop iteration – construct it once and just do the prints in the loop.

I just double checked with a Rev through bore I’ve had for a few years, and its working fine. I wonder if theres a miswire in the connector. On the 6 pin side, what order are the pins? They should be

Black, Green, Yellow, Blue, Whie, Red

Good call. Problem Solved. Mis-wired cable from REV.
On closer examination they have the pigtails ground (black wire) all wired to a common wire, same for power (red wire) all wired to a common. Well, they swapped one of the red and blacks in the bundles so the whole cable is borked.

We found a another cable and all is well.

2 Likes

That’s something that probably should be sent to Rev’s support. Especially with 2 reports within hours of each other.

(Encoder connected to roboRIO doesn"t give me any value - #18 by Thad_House) as well

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