Go to Post Creatively solving problems is part of the fun. Continuous improvement and sustainment of [old] programs is also important. - tim-tim [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 38 votes, 5.00 average. Display Modes
  #16   Spotlight this post!  
Unread 08-03-2015, 22:01
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by tStano View Post
How would you use the voltmeter to tell whats wrong with the encoder? Just to see that it is indeed getting power and common?
That's a start.

Quote:
The pulses on the output channels will probably be much too fast to be read without an oscilliscope, unless the encoder has really low resolution
Or unless you rotate it by hand, very very slowly... in which case you should see the signal waveform (especially with an analog voltmeter).


  #17   Spotlight this post!  
Unread 09-03-2015, 00:39
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by tStano View Post
How would you use the voltmeter to tell whats wrong with the encoder? Just to see that it is indeed getting power and common? The pulses on the output channels will probably be much too fast to be read without an oscilliscope, unless the encoder has really low resolution I suppose. Carry on.
Many multimeters have a "Hz" setting that can be a quick check for encoder output channels, including this one that was offered in First Choice. Spin encoder by hand to test frequency of your outputs (faster spin = higher frequency).

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 ), 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.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"

Last edited by The Lucas : 09-03-2015 at 00:54.
  #18   Spotlight this post!  
Unread 09-03-2015, 14:07
xNovax's Avatar
xNovax xNovax is offline
Registered User
AKA: Aaron
FRC #3710 (Cyber Falcons)
Team Role: Programmer
 
Join Date: Oct 2014
Rookie Year: 2013
Location: Kingston, Ontario
Posts: 11
xNovax is an unknown quantity at this point
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by The Lucas View Post
Many multimeters have a "Hz" setting that can be a quick check for encoder output channels, including this one that was offered in First Choice. Spin encoder by hand to test frequency of your outputs (faster spin = higher frequency).

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 ), 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.
Thank you very much for the reply. I will make sure to look for anything in the DIO slots, test the voltage of our DIO slots, and I will see if our multimeter has a Hz mode. I will post back after my meeting tonight to follow up.
  #19   Spotlight this post!  
Unread 12-03-2015, 21:33
jbernardis jbernardis is offline
Registered User
FRC #1403
 
Join Date: Sep 2014
Location: United States
Posts: 7
jbernardis is an unknown quantity at this point
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by xNovax View Post
Beep test (Sorry I don't know the technical term)
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.
  #20   Spotlight this post!  
Unread 13-03-2015, 14:16
E Dawg E Dawg is offline
... is not done with FRC yet.
AKA: Ethan
FRC #0159 (Alpine Robotics)
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2012
Location: Fort Collins, CO
Posts: 267
E Dawg has much to be proud ofE Dawg has much to be proud ofE Dawg has much to be proud ofE Dawg has much to be proud ofE Dawg has much to be proud ofE Dawg has much to be proud ofE Dawg has much to be proud ofE Dawg has much to be proud ofE Dawg has much to be proud of
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.
  #21   Spotlight this post!  
Unread 23-03-2015, 17:19
Hoover's Avatar
Hoover Hoover is offline
Registered User
no team (None)
 
Join Date: Mar 2013
Rookie Year: 2013
Location: New Jersey
Posts: 116
Hoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to all
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.
  #22   Spotlight this post!  
Unread 23-03-2015, 22:37
ozrien's Avatar
ozrien ozrien is offline
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 549
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
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?
  #23   Spotlight this post!  
Unread 24-03-2015, 06:50
Hoover's Avatar
Hoover Hoover is offline
Registered User
no team (None)
 
Join Date: Mar 2013
Rookie Year: 2013
Location: New Jersey
Posts: 116
Hoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to all
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.
  #24   Spotlight this post!  
Unread 24-03-2015, 14:56
Hoover's Avatar
Hoover Hoover is offline
Registered User
no team (None)
 
Join Date: Mar 2013
Rookie Year: 2013
Location: New Jersey
Posts: 116
Hoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to all
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.
  #25   Spotlight this post!  
Unread 24-03-2015, 15:17
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by Hoover View Post
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?
Yes.

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.


  #26   Spotlight this post!  
Unread 24-03-2015, 16:01
Hoover's Avatar
Hoover Hoover is offline
Registered User
no team (None)
 
Join Date: Mar 2013
Rookie Year: 2013
Location: New Jersey
Posts: 116
Hoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to all
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.
  #27   Spotlight this post!  
Unread 24-03-2015, 16:17
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by Hoover View Post
Yeah... speaking of voltage, we are not getting any voltage on the power pin for DIO on the roboRio.
Well, the encoder surely is not going to provide a signal without power.

That's why I always urge simple troubleshooting with a voltmeter before spending a lot of time swapping out parts.


  #28   Spotlight this post!  
Unread 24-03-2015, 16:44
Hoover's Avatar
Hoover Hoover is offline
Registered User
no team (None)
 
Join Date: Mar 2013
Rookie Year: 2013
Location: New Jersey
Posts: 116
Hoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to allHoover is a name known to all
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
  #29   Spotlight this post!  
Unread 24-03-2015, 16:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by Hoover View Post
We get 3.3 volts from power to signal pins. We get no voltage from the power to ground pin.
Where and how are you measuring this? At the RIO DIO with no cable attached?


  #30   Spotlight this post!  
Unread 24-03-2015, 16:56
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,284
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by Hoover View Post
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.
Quote:
Originally Posted by Ether View Post
Well, the encoder surely is not going to provide a signal without power.

That's why I always urge simple troubleshooting with a voltmeter before spending a lot of time swapping out parts.


Now that you know why you aren't getting anything from the encoder, it is time to move upstream, and figure out why you aren't getting any power on the DIO pins.

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:
Originally Posted by Hoover View Post
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.
Define Normal

Quote:
Originally Posted by Hoover View Post
Meanwhile our team is learning to play manually... not bad either
My only concern with this approach is that if the issue is something like a 5V short from debris in the controller, then that debris could move, causing different, potentially worse symptoms.
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)

Last edited by JamesBrown : 24-03-2015 at 17:06.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:27.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi