![]() |
Encoder Problems
Hi can anyone help with encoder code we are using java and can't seem to receive any variables back from them.
Thanks |
Re: Encoder Problems
What type of encoder (model #) are you using?
How have you wired it up to the roboRIO? Can you provide a copy of your code so we can check it? Have you tried following the java encoder code example here?: https://wpilib.screenstepslive.com/s...or-other-shaft |
Re: Encoder Problems
Quote:
|
Re: Encoder Problems
Quote:
-Check wiring -Check the encoder -Hook up a scope to the lines and see if you get the response you expect -Check your code, are you calling on the right variables? Are they changing as expected? Is anything being overwritten or called incorrectly? Perhaps you could share a snippet of your code to help with debugging. |
Re: Encoder Problems
Quote:
What are you using the encoder for? To measure speed, or distance, or both? Drivetrain? Shooter wheelspeed control? What motor controller are you using, and do you have the encoder wired to the roboRIO or to the motor controller (TalonSRX)? |
Re: Encoder Problems
Sorry for the lack of information.
We are trying to use encoders attached to the sonic shifter from AndyMark. Sonic Shifter: http://www.andymark.com/Sonic-Shifte...nicoptions.htm And the encoder being used with the sonic shifter is the am-3132: http://www.andymark.com/product-p/am-3132.htm We have them wired from the encoder into the RoboRio's DIO ports. Each encoder requires two ports because they each have 2 signal channels (A and B). Code:
package org.usfirst.frc.team5712.robot; |
Re: Encoder Problems
This looks suspicious:
Code:
// Encoder encoderLeft, encoderRight, |
Yea, I agree with Alan. This code shouldn't even compile.
Code:
//Encoder encoderLeft, encoderRight |
Re: Encoder Problems
We had commented sections of the encoder code that were not working. Before I pasted the code on here I attempted to un-comment everything, but it seems I forgot a couple lines.
Sorry everybody. |
Re: Encoder Problems
Even when the code was un-commented we still were not receiving values. I edited the code, so it should be able to compile now.
|
Re: Encoder Problems
The E4T encoder has a very specific installation process, especially when interfacing with the AndyMark gearbox. I would make sure that the disk for the encoder is the correct distance away from the sensor (by using the spacing tool), as I've seen incorrect installations return no values.
|
If you put a meter between find and channel A and B, you should be able to see the logic levels change as the wheel turns.
If you can measure this, the encoder is working properly and its either a wiring or code problem. If you don't get fluctuating values on the meter, then its likely that the disk within the encoder isn't installed correctly per Pratiks suggestion |
Find = Ground. Autocorrect...
...Put a meter between ground and channel A or B... |
| All times are GMT -5. The time now is 00:53. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi