EP4 Encoder

The encoders i am trying are:

  • E4P-360-236-D-H-T-3
  • E4P-250-250-D-D-D-B

I seem to be having a software issue when it comes to encoders listed above. I have a series of problems that occur when debugging.

 1. The values from the encoder are increasing or decreasing based on   whether the robot is enabled or not
 2. The values from the encoder are all 0
 3. The values of the encoder continuously decrease but stop decreasing when the motors are spinning

My team has ruled out any wiring issues.

We are programming in C++ via Windriver. All software is up to date. We are using the encoder class the the WPILib. I start the encoder in the robot init. Reset it upon entering tel-op. I retrieve the values via GetRaw(), Get(), GetDistance(), and GetDirection

Please let me know if anyone has had this problem and/or knows of a solution. Thanks!

A run away encoder. hmmm thats a new one.
Could there be something wrong with the way it is attached and maybe its continuing to spin with what ever momentum it picked up?

We have tried multiple of the same types of encoders all to no avail

Don’t reset it. You’ll always read zero if you don’t let it count.

I will try that thanks

I got rid of the reset but i am still having problems :confused:

Does it matter where on the digital sidecar it is plugged into? I have been using ports 5 and 6. Experimented with 1 and 2 with the same results

When you put the code wheel on the shaft, make sure you install it correctly. The side with the pattern goes toward the sensors on the encoder circuit board. It should fit the shaft very tightly so it’s not going to slip. And you need to put it at the proper height off the board. Too far and it won’t be read properly. Too close and you risk damaging the code wheel as it scrapes on the mounting screws.

If you were programming in LabVIEW, you could try the Motor With Encoder example to verify the proper wiring. Since you’re using C++, that’s not an easy option. Can you tell us exactly how the encoder is connected? Where does each wire go? You say the team has ruled out wiring issues, but that doesn’t mean the team is correct. :slight_smile:

I’m pretty sure the encoder is installed correctly. As for wiring the first wring plugging into the encoder is orange and plugged into a PWM cable for the Digital sidecar. The second wire is blue hooked up to the signal wire of the PWM cable. The third wire is brown and connected to the ground part of the PWM. The fourth wire is yellow and hooked up to a standalone wire connected to the signal port of another slot on the digital sidecar. The PWM is connected to slot 5. The standalone signal wire is slot 7. I have made sure the code matches up with the port numbers they are plugged into