|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
[Help] Problems with Encoders and PID Control
I have run into an issue with an encoder on my teams robot, the encoder was working fine at the beginning of the day but as the day went on the encoder stopped working. Now we cannot get any encoders to work on the robot. Here is what we have tried: Replace the encoder with a new one, change the wire connection to the encoder, changing the DIO port for the encoder, triple checking our code, testing the DIO ports with a limit switch(successful) and power cycling the robot and our drive station.
I have become stumped with what is causing the issue. My mentors seem to think that it is something to do with software but I have checked the code multiple times. Here is our code: https://github.com/Cyberfalcons/robot2015 Here is the class where the encoder is being used: https://github.com/Cyberfalcons/robo...nElevator.java Any help is greatly appreciated! |
|
#2
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
I once had a similar problem where I couldn't get a reading out of our lift encoder. It turned out that the limit switch at the bottom was constantly on, so the encoder kept getting reset to zero.
I see this in your code, which looked similar to what I was doing: Code:
else if (getBottom() == true) {
resetEncoder();
Last edited by cjl2625 : 08-03-2015 at 19:57. |
|
#3
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
That should only cause problems if we try to go down when the limit switch is engaged. We have tried hand spinning an encoder that is not attached to any subsystems and it still does not read anything but 0.
|
|
#4
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
Remember all DIOs return true if nothing is attached to them. So if the limit switch came unplugged or went bad, the encoder would be constantly resetting. So if you were trying to test the encoders but had all other DIOs unplugged, the encoder would constantly be getting reset, unless you commented out the reset code.
|
|
#5
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
We tested the limit switches to make sure they were working before we started messing with other stuff.
|
|
#6
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
Quote:
|
|
#7
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
We checked the connections in both of the wires we tested with.
|
|
#8
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
How did you check them?
|
|
#9
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
Beep test (Sorry I don't know the technical term)
|
|
#10
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
What's a beep test?
|
|
#11
|
|||
|
|||
|
Re: [Help] Problems with Encoders and PID Control
|
|
#12
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
You can't measure volts with a continuity tester.
|
|
#13
|
|||
|
|||
|
Re: [Help] Problems with Encoders and PID Control
A simple continuity test is not enough for a cable. You also need to check the cable for short circuits - a cable with a short can and often does show continuity on each wire.
Our team learned this the hard way. |
|
#14
|
|||
|
|||
|
Re: [Help] Problems with Encoders and PID Control
Make sure that there are no electrical issues anywhere else on the bot, as well. That has caused issues for us even though it wasn't directly connected to the sensor.
Last edited by E Dawg : 13-03-2015 at 14:18. |
|
#15
|
||||
|
||||
|
Re: [Help] Problems with Encoders and PID Control
This is rather urgent...
Did you ever find the problem with this? This started happening to us and it is wasting all our enbagging time. We tried 3 different encoders We have verified they are spinning We tried different digital ports We rolled back code to where we knew it worked. We recently updated the firmware to the roborio as required. Other than that, we should be in the same state we were when it was working. The problem sounds so similar to the one described in this thread I wonder if it is the same problem. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|