We are having trouble getting any kind of reading from our encoders. We have them on our Andy Marks transmissions and they don’t give us a reading. I think we have them hooked up right but not sure if it is the wiring or programming. We want to use them to make the transmission shift at a certain RPM.
Perhaps photos and a description of the wiring.
Perhaps code and a description of the programming that isn’t receiving input.
Make sure that the spacing between the encoder and the codewheel is correct. US Digital says that an air gap of .07 inches is ideal. Be sure that the pattern-side of the codewheel is facing down towards the encoder and that the codewheel is snug on the shaft.
Here’s a link to their website with more information.
Hope this helps.
When the encoder is powered it will have a red glow from the LED inside on the chip. You need to remove the cover to see the light. It isn’t very bright, but it is definitely visible. If it is not lit, then your wiring is suspect.
The best way to know if they are working is with a two channel oscilloscope. If you have one, connect each channel on the scope to the A and B channel outputs from the encoder. You should see two square waves 90 degrees out of phase.
-Hugh
We have power to it, the little red light is on but we are not getting any thing back in the programming. Where should the A and B wires be hook up.
A and B go to two digital inputs on the digital sidecar.
In software (labview), you would open the two digital channels as digital inputs, then use To Digital Source to create a digital source, then use the two digital sources to open an Encoder. Once you open the encoder, you have to START them (very easy to forget), then you can GET them whenever you want.
We have A and B hooked up to the digital I/O pins. As far as programming goes, I used the Open Encoder.vi that came with the FRC tools in our Begin.vi. I hooked that to the StartEncoder block, then wired to a To Digital Source. I have the GetEncoder block in my teleop code, and I have a display off the encoder rate node. However, when we run the program and spin the shaft, we get no reading. I will upload a screenshot of the program and/or a photo of our wiring later today when our programming computer is available.
Did you ENABLE the robot? Your Teleop code probably doesn’t run if the robot is DISABLED.
We did enable it using the FRC driver station software. Motors were responding to joystick, everything worked except for the encoder.
Check the encoder A and B wires with a digital multimeter. You should see them transition between 0V and 5V as you touch the encoder. It doesn’t take much to get the voltage to change, since there are 360 pulses per revolution.
If you don’t get any changes on either the A or B, double check that you are getting a bright red light in the encoder. Check the spacing between the disc and the red light, it can’t be too close or too far. Then check if you haven’t accidentally ripped the connector traces our of the encoder. The white plastic connector on the encoder PCB is fragile, and can only take so many connects and disconnects… if not done very carefully.
Try looking at both Rate and Distance in software. If Distance works fine (and counts correctly, up and down) but Rate returns 0, that is a known bug in the encoder library.
The only workarounds are to either write your own code based on the delta of distance and time between iterations, or allocate two encoders (since every other one works).
Another modification I suggest to the default code is to open Robot Main.vi, and look to for where it calls Disabled. Place a call to Teleop after disabled, and wire it in parallel. In Disabled, stop setting the outputs to 0. This will allow you to run your code, and probe the wires and outputs, without enabling the robot.
Hey rockie team 3574 here
So how do you mount the encoders using the base that they come with