VEX Encoder for FRC bot

#1

So, we’re trying to use an encoder for autonomous, since it’s more precise and reliable. Unfortunately, we’re trying to use a VEX Shaft Encoder, which is not exactly easy.
We’ve McGyvered a male-to-male adapter, so we can actually plug the Encoder up, and I’ve written code as though it were any old encoder.
I get no information from this encoder.
If anyone has experience getting a VEX encoder to work with the roborio, we could use some advice.

For clarification purposes:

  • We are only plugging in one of the two plugs on the VEX Encoder, since we only had enough spare wiring to McGyver one adapter.
  • We have no assurance that our McGyvered adapter actually works, although we don’t have any reason to think it doesn’t either (apart from it being a Frankenstein of wiring)
  • I am coding using python
  • The actual lines of code I wrote are as follows:

RobotInit:

self.encoder = wpilib.Encoder(0,1,False)

AutonomousInit:

self.encoder.reset()

AutonomousPeriodic:

count = self.encoder.get()
print(count)
  • The code is only printing “0”

We’re not out of luck if we can’t get this to work, but it’d make our drivers’, our pit crew’s, and my lives much easier. Anyone have any ideas??

0 Likes

#2

Can’t really help with the python, but I have some questions about the wiring.

When you say you only used one “plug” from each encoder, do you mean that you only connected one of the inputs? If you do that, you can’t read what direction the wheel is traveling, only its speed. I imagine the standard encoder class in python is for a quadrature encoder (with two wires). If you want to only measure speed, I would try looking for some sort of counter or tachometer class.

0 Likes

#3

I am also interested in using VEX EDR encoders on FRC robots. I’m talking about these: https://www.vexrobotics.com/276-2156.html

I seem to recall that 33 used these on follower wheels on their 2014 'bot. But that was a different control system…

Is there anyone out there who can shed some light on this topic?
Can they be plugged into the DIO ports on the roborio?
How was your experience using them?
Do they skip counts a lot on a drivetrain?
What about at high speed (like on a shooter wheel)?

0 Likes

#4

I’m not trying to judge but why not use a VEX Mag Encoder? They are made for the Talons and have easy documented code to get them to work.

0 Likes