Go to Post I'm basically only posting this so that future Shaker Robotics kids will see it and tell themselves "never again"... - Chris is me [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
  #1   Spotlight this post!  
Unread 08-03-2015, 19:47
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
[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   Spotlight this post!  
Unread 08-03-2015, 19:53
cjl2625's Avatar
cjl2625 cjl2625 is offline
apel py
AKA: Cory Lynch
FRC #2067 (Apple Pi)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Guilford, CT
Posts: 412
cjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to beholdcjl2625 is a splendid one to behold
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();
Just an idea
__________________
Head Programmer / Driver

Last edited by cjl2625 : 08-03-2015 at 19:57.
  #3   Spotlight this post!  
Unread 08-03-2015, 20:01
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

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   Spotlight this post!  
Unread 08-03-2015, 20:06
Thad House Thad House is offline
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,107
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by xNovax View Post
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.
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.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #5   Spotlight this post!  
Unread 08-03-2015, 20:08
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

We tested the limit switches to make sure they were working before we started messing with other stuff.
  #6   Spotlight this post!  
Unread 08-03-2015, 20:08
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 xNovax View Post
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.
Time to get out the voltmeter.


  #7   Spotlight this post!  
Unread 08-03-2015, 20:08
tStano tStano is offline
Registered User
AKA: Sparks
no team
Team Role: Electrical
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Madison, WI
Posts: 177
tStano will become famous soon enough
Re: [Help] Problems with Encoders and PID Control

A quadrature encoder will do weird things if both channels are not plugged in. Pretty sure it would read zero. Are both channels plugged in to DIO ports?

Also, did you try inintializing the encoder as a digital input and watching the true/false flash?
  #8   Spotlight this post!  
Unread 08-03-2015, 20:10
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 Ether View Post
Time to get out the voltmeter.


We checked the connections in both of the wires we tested with.
  #9   Spotlight this post!  
Unread 08-03-2015, 20:11
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 tStano View Post
A quadrature encoder will do weird things if both channels are not plugged in. Pretty sure it would read zero. Are both channels plugged in to DIO ports?

Also, did you try inintializing the encoder as a digital input and watching the true/false flash?
We made sure that both channels were plugged in, I will try the digital input thing once I have access to the robot.
  #10   Spotlight this post!  
Unread 08-03-2015, 20:15
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 xNovax View Post
We checked the connections in both of the wires we tested with.
How did you check them?


  #11   Spotlight this post!  
Unread 08-03-2015, 20:16
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 Ether View Post
How did you check them?


Beep test (Sorry I don't know the technical term)
  #12   Spotlight this post!  
Unread 08-03-2015, 20:22
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 xNovax View Post
Beep test (Sorry I don't know the technical term)
What's a beep test?


  #13   Spotlight this post!  
Unread 08-03-2015, 20:25
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

Quote:
Originally Posted by Ether View Post
What's a beep test?


It's a continuity test, I believe.
  #14   Spotlight this post!  
Unread 08-03-2015, 20:28
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 E Dawg View Post
It's a continuity test, I believe.
You can't measure volts with a continuity tester.


  #15   Spotlight this post!  
Unread 08-03-2015, 20:59
tStano tStano is offline
Registered User
AKA: Sparks
no team
Team Role: Electrical
 
Join Date: Jan 2014
Rookie Year: 2012
Location: Madison, WI
Posts: 177
tStano will become famous soon enough
Re: [Help] Problems with Encoders and PID Control

Quote:
Originally Posted by Ether View Post
Time to get out the voltmeter.
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.
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:26.

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