![]() |
Re: [Help] Problems with Encoders and PID Control
Quote:
Quote:
|
Re: [Help] Problems with Encoders and PID Control
Quote:
Aaron, As others have suggested, checking the voltage supplied to the encoder (as close as you can get the probe to the actual +5 pin on the encoder) is a good start. From some of the symptoms you describe, I suspect you may have a short on the 5v rail of your RoboRIO. There are several more convenient indicators (other than a voltmeter) that will tell you if a short has occurred. These indicators include Red Power Led on the RIO and the RoboRIO webdash. A limit switch does not require 5v power so it is not a good proxy for an encoder in a test. If you do have a short, look for any obvious swarf (metal shavings) that could be causing it. If you can't find any foreign metal shorts, then it is time to unplug everything (one by one) from 5v until it goes away. Inspect the wire with the short to find the source. One of the sneakier causes of a short is the frame violating the insulation of those 3 wire cables. I had a swarf short issue this year that took me a while to resolve the night before bag. Here is a brief summary (highlights on my mistakes) with some dead ends and hours of bot drive time removed. I first noticed the navX MXP board 3.3v LED was off. I removed the navX, expecting to find metal under the board (last time it was the 4-40 lock nut that holds the navX shield on :rolleyes: ), but no short there. Grabbed the multimeter, the 3.3v pin on the MXP tested normal. Confused (I thought the navX used 3.3v input, it uses 5V), I eventually tested the 5V on the MXP. It was 0v, and I was wondering why the MXP 5v pin was not working but the rest of the RIO had 5v (I assumed, but it did not). I slowly connected a massive amount of swarf in the DIO ports (some perfectly coiled around 5v and ground) and then noticed the Red Power LED on the RIO. It is easy to develop tunnel vision when you think you know the cause of the issue, when you need to step back take a look at the bigger picture and test your assumptions along with basic fuctionality. |
Re: [Help] Problems with Encoders and PID Control
Quote:
|
Re: [Help] Problems with Encoders and PID Control
Quote:
Our team learned this the hard way. |
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.
|
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. |
Re: [Help] Problems with Encoders and PID Control
You probably already checked but...
Is the encoder getting power (3.3 or 5v?). Don't just inspect the wiring, probe the contact with a voltmeter and measure. Then do the same thing with quadA and quadB. They should drive high then drive low as you rotate the shaft. Basically it should square wave as you turn. What kind of encoder? |
Re: [Help] Problems with Encoders and PID Control
Hi ozrien,
We use Vex shaft encoders. http://www.vexrobotics.com/276-2156.html To test the encoder, we fired up our test robot (uses a cRio) and got valid values from it when turning it by hand. I wasn't surprised by this because if we try 3 encoders and none of them work there is very little chance they are all bad. Next, today's session, I will try it again on our current robot. If it works then the encoder is intermittent possibly due to wiring issues (see below). If it doesn't, we will write a test program for it that tests only the encoder. The best case scenario is that it is our software bug because that will be the easiest to find and fix. If none of this works on the roboRio, how do we test if we are getting output to the digital pins? Can that be done with a volt meter? If we don't see any with our simple program then what? That would seem a fairly serious problem with the hardware. If the roboRio is compromised, we don't have another. Secondly, we use these adapter cable for the encoder. I hate doing it this way and I really wish the encoder came with female ends. This gives multiple points of failure. If these are intermittent they could even be our problem. The alternative is to cut and solder microwires and we've always avoided this. We went all last year with this setup with no problem but it is still worrisome. http://www.vexrobotics.com/vex/produ.../276-2395.html In any case I will report back what we find. |
Re: [Help] Problems with Encoders and PID Control
Were in pretty deep here.
We tried the encoder on the cRio again to verify it works. We tried a new encoder as well and that works. We wrote a program that only reads an encoder. We tried that on different ports. (java) m_encoder = new Encoder(2, 3, true); ... m_encoder.get()... always returns 0. We verified the Encoder class no longer needs .start(); We tried re-running the latest firmware on the roboRio. This did not help. Where is the old firmware for the roboRio? We'd like to try that. |
Re: [Help] Problems with Encoders and PID Control
Quote:
If you have a cheap analog voltmeter use that instead of digital. Just set the voltmeter for the 12 volt scale and measure the voltage between the A channel and ground. Turn the encoder shaft very slowly and you should see the needle go from zero to some positive value. Repeat for B channel. PS it goes without saying (I hope) that the encoder must be powered. |
Re: [Help] Problems with Encoders and PID Control
Yeah... speaking of voltage, we are not getting any voltage on the power pin for DIO on the roboRio.
Any switch we have works because we don't require voltage. We think this is where we are at. |
Re: [Help] Problems with Encoders and PID Control
Quote:
That's why I always urge simple troubleshooting with a voltmeter before spending a lot of time swapping out parts. |
Re: [Help] Problems with Encoders and PID Control
We know about the 'brownout condition' of the roboRio but we don't think it is in that state as the power light is normal.
We get 3.3 volts from power to signal pins. We get no voltage from the power to ground pin. We have a tournament on Friday. We will try to learn as much about it there. Meanwhile our team is learning to play manually... not bad either |
Re: [Help] Problems with Encoders and PID Control
Quote:
|
Re: [Help] Problems with Encoders and PID Control
Quote:
Quote:
WHat color is your power LED? Red? If so you probably have a short from 5V to GND Start by unplugging everything, and visually inspect all of the slots to ensure no debris is present. Verify the Power LED is Green, and measure the voltage on the DIO +5V pins again. If you have power now, start looking for your short. Take each connector, one at a time, and verify there is no continuity between pins 2 and 3 on the connector. If there is no continuity, plug it back in and verify that you still have 5V power. If there is continuity, or when you plug it in you lose power, then inspect the cable, and device to find and fix the short. Edit- Apparently I was slow replying. Quote:
Quote:
|
| All times are GMT -5. The time now is 06:30. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi