OCCRA
Go to Post This thread should surface like this before every new season. It is motivating and inspiring. And jawdropping. - JaneYoung [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-14-2012, 04:27 PM
Matthew Blake's Avatar
Matthew Blake Matthew Blake is offline
Registered User
FRC #3481 (Bronc Botz)
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Helotes, Texas
Posts: 43
Matthew Blake is an unknown quantity at this point
Encoders on Drive Train DON'T WORK.

Hey guys, we have a huge problem.

For the past 2 days we have been having problems with the encoders on our drive train. We only are ever able to get one reading at a time from the encoders (left side works, right side doesn't/right side works, left side doesn't). We have tried replacing the encoders, then the encoder wires, and finally the ds; still no results. We have tested all the points of failures as far as we can tell, and we still have no results.

Because we are able to get a reading from each encoder individually, we know both encoders work.

Because we have switched the wires on both the encoders and on the ds, we know the wires work.

Because we have switched out the ds to a brand new one, we know it works (unless we have extremely bad luck and have two broken sidecars).

If anyone has any input or has ever encountered this problem before, help would be appreciated!
__________________
FTC Team 4008: 2009-2012
FTC Team 4602: 2010-2012
FRC Team 3481: 2010-2012
  #2   Spotlight this post!  
Unread 04-14-2012, 04:47 PM
MichaelBick MichaelBick is offline
Mechanical Director, Drive Captain
FRC #1836 (Milken Knights)
Team Role: Mechanical
 
Join Date: Oct 2011
Rookie Year: 2010
Location: Los Angeles
Posts: 609
MichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant futureMichaelBick has a brilliant future
Re: Encoders on Drive Train DON'T WORK.

Talk to AdamHeard. They had some problems with the encoders on their swerve, depending on the resolution of the encoders.
__________________
Team 1836 - The Milken Knights
2013 LA Regional Champions with 1717 and 973
2012 LA Regional Finalists with 294 and 973
To follow Team 1836 on Facebook, go to http://www.facebook.com/MilkenKnights
To go to our website, go to http://milkenknights.com/index.html
  #3   Spotlight this post!  
Unread 04-14-2012, 05:12 PM
remulasce's Avatar
remulasce remulasce is offline
Code Associate
FRC #0597 (Wolverines)
Team Role: College Student
 
Join Date: Jan 2010
Rookie Year: 2007
Location: LA
Posts: 113
remulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to beholdremulasce is a splendid one to behold
Re: Encoders on Drive Train DON'T WORK.

Can you post your code? Are you able to control which side you get the correct reading from, and how?
__________________
Studying CS:Games at USC. Minoring in the FRC Game Manual.

Student 294: 2007-2011
Mentor 597: 2013-

2008 FTC World Champions
2010 FRC World Champions
  #4   Spotlight this post!  
Unread 04-14-2012, 05:21 PM
VKP's Avatar
VKP VKP is offline
VKP
AKA: Vivek Paramasivam
FRC #1899 (Saints Robotics)
Team Role: Leadership
 
Join Date: Feb 2011
Rookie Year: 2009
Location: Bellevue, Washington
Posts: 64
VKP is an unknown quantity at this point
Re: Encoders on Drive Train DON'T WORK.

If you haven't already, check to make sure that the discs in all of the encoders are of the same resolution.
__________________
Vivek

Treasurer, Senior Build Officer, Saints Robotics 1899
Seattle Olympic Regional Chairman's Award 2011
Seattle Olympic Regional Winner 2011 (Thanks 2990 & 3393)
Seattle Olympic Regional Best Website Award 2011
  #5   Spotlight this post!  
Unread 04-14-2012, 05:34 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,041
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: Encoders on Drive Train DON'T WORK.

Quote:
Originally Posted by Matthew Blake View Post
...
What type of encoders are you using?

Where are the encoders mounted?

What language are you using?

Are you trying to measure speed or position?

Are you using 1x, 2x, or 4x decoding?

If you are trying to measure speed, what method are you using?




Last edited by Ether : 04-14-2012 at 06:03 PM.
  #6   Spotlight this post!  
Unread 04-14-2012, 06:16 PM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Itinerant Programmer
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 7,270
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Encoders on Drive Train DON'T WORK.

Another thing to look for with the Kit encoders is extra play in the encoder shaft. If the shaft can be push/pulled even a little bit, then the encoder discs can shift into and out of range to disrupt your readings.
__________________
Deduction is limited by knowledge, and knowledge is limited by preconceptions
  #7   Spotlight this post!  
Unread 04-14-2012, 06:27 PM
Hawiian Cadder's Avatar
Hawiian Cadder Hawiian Cadder is offline
Registered User
AKA: Isaak
FRC #0159 (Alpine Robotics)
Team Role: CAD
 
Join Date: Feb 2010
Rookie Year: 2003
Location: Fort Colins Colorado
Posts: 573
Hawiian Cadder is a name known to allHawiian Cadder is a name known to allHawiian Cadder is a name known to allHawiian Cadder is a name known to allHawiian Cadder is a name known to allHawiian Cadder is a name known to all
Re: Encoders on Drive Train DON'T WORK.

Do they work if one set is run backwards and the other is run forwards or vice verse, I have heard of problems resulting in reading two encoders at the same time in code, but I don't know much about that. We used S-6 encoders from US digital this year after off season prototyping to remedy any encoder woes, they are bulletproof and work extremely well.
  #8   Spotlight this post!  
Unread 04-14-2012, 07:08 PM
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 249
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: Encoders on Drive Train DON'T WORK.

Quote:
Originally Posted by Ether View Post
What type of encoders are you using?
Where are the encoders mounted?
What language are you using?
Are you trying to measure speed or position?
Are you using 1x, 2x, or 4x decoding?
If you are trying to measure speed, what method are you using?

We are using US Digital... I asked Matt to get the model numbers...
The ones giving failure are mounted on the drive... its yer basic tank drive.

We are assuming 4x as we had success with that for last years robot... Unfortunately I'm the software guy and do not know for certain what encoders we have yet... (awaiting reply from Matt)

We are using wind-river c++ the GetRate() method in WPI library... I am confident the software works because we use the same exact code for our last years robot with proper read back.


In regards of what method we are using... We have another encoder problem that I was thinking of posting, but it may be related.

I have attached two dumps which show two different methods of capturing the rate... one of which is the GetRate() which uses the GetPeriod technique. The second pw2... is using the GetDistance() where it gets the delta each 10ms iteration (The t= shows the time per iteration). And that then is divided by the time where both show units of RPS. I've verified that both techniques work properly on the other robot (I can attach this dump if you want to see). Anyhow, there is another anomoly that this dump presents where every 2 iterations the pulses fail to update... I'm surprised how well GetRate() kept the average. I believe the GetDistance technique show a real problem... as even with the GetRate() the faster speeds looked choppy. I want to try the 1x 2x speeds to see if that will solve it.
Attached Files
File Type: txt RateDump1.txt (28.7 KB, 10 views)
File Type: txt RateDump2.txt (12.1 KB, 5 views)
  #9   Spotlight this post!  
Unread 04-14-2012, 07:12 PM
slijin's Avatar
slijin slijin is offline
Pockets
AKA: Samuel Lijin
FRC #0694 (StuyPulse)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York City
Posts: 537
slijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to beholdslijin is a splendid one to behold
Re: Encoders on Drive Train DON'T WORK.

Quote:
Originally Posted by Matthew Blake View Post
We have tried replacing the encoders, then the encoder wires, and finally the ds; still no results. We have tested all the points of failures as far as we can tell, and we still have no results.
Just to clarify, "ds" here refers to the digital sidecar here, right? (In my experience, DS is used for the Driver Station and DSC for the digital sidecar). It's probably not your problem, but was your ribbon cable checked and fixed correspondingly?

Quote:
Originally Posted by Matthew Blake View Post
Because we are able to get a reading from each encoder individually, we know both encoders work.
What, if anything, did you change to switch which encoder you can read data from?

Quote:
Originally Posted by JamesTerm View Post
We are using US Digital... I asked Matt to get the model numbers...
The ones giving failure are mounted on the drive... its yer basic tank drive.
Were they the ones received in the KoP this year or from AM FIRST choice? If the answer is yes to either, then you're using the E4P encoder with a 360 CPR wheel.

Quote:
Originally Posted by JamesTerm View Post
In regards of what method we are using... We have another encoder problem that I was thinking of posting, but it may be related.
There has been a wealth of discussion on this topic and how to filter encoder data to return a more stable rate. I would suggest doing a forum search and comparing your results with those that others have documented. I doubt it's related to the problem that this thread was created to discuss, as this is a widely documented issue that is commonly expected of encoders, whereas the one that you're experiencing hints of a connection problem.
__________________

2010-12 CT Chairman's
2011 Galileo 5th seed
2010 NY Regional Winners

Last edited by slijin : 04-14-2012 at 07:17 PM.
  #10   Spotlight this post!  
Unread 04-14-2012, 07:12 PM
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,016
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Encoders on Drive Train DON'T WORK.

Is your digital sidecar fully powered?

We had a very similar problem, but with PWM outputs in the offseason - we could power one side of the 2011 robot or the other side, but it would fail if we tried to drive all 4 drive motors. It turns out the DS can draw enough power from the data cable to power up to 3 PWM outputs, but once you try for 4 it fails. Once we figured out the power problem, everything worked. Maybe this failure mode applies to the digital inputs too?
  #11   Spotlight this post!  
Unread 04-14-2012, 07:45 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,041
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: Encoders on Drive Train DON'T WORK.

Quote:
Originally Posted by JamesTerm View Post
We are assuming 4x ... We are using wind-river c++ the GetRate() method in WPI library.
In years past, 4X with GetRate() was not recommended. Too noisy. I've heard that this year, the C++ WPILib added averaging to GetRate() to attempt to reduce the noise. Does anyone know if this works well?

Also, does anyone know: has the GetRate() FPGA bug definitely been fixed in this year's image?


  #12   Spotlight this post!  
Unread 04-14-2012, 08:03 PM
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 249
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: Encoders on Drive Train DON'T WORK.

Quote:
Originally Posted by Ether View Post
In years past, 4X with GetRate() was not recommended. Too noisy. I've heard that this year, the C++ WPILib added averaging to GetRate() to attempt to reduce the noise. Does anyone know if this works well?

Also, does anyone know: has the GetRate() FPGA bug definitely been fixed in this year's image?


In regards to the 2011 bug last year:
I worked with Joe H. personally on this bug, during the 2012 beta period... I also traced the source code history on it as well when I fell victim to it in 2011... I've verified it as fixed. That particular bug would yield NAN (division by zero), and I used the work around for it, then disabled work-around when I verified the 2012 image.

The irony is that GetRate() worked better for this choppy problem, but at higher speeds it would have a distinct 30-40 radian skip between the numbers like 300.30 10x 330.2 3x 300.10x (around 47 rps). I've found that I could work-around this problem by using the kalman filter.

If someone can point me to the best link where others are talking about the current choppiness this year... that would be greatly appreciated. (I'm a bit search engine challenged).
  #13   Spotlight this post!  
Unread 04-14-2012, 08:10 PM
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 249
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: Encoders on Drive Train DON'T WORK.

Quote:
Originally Posted by slijin View Post
Were they the ones received in the KoP this year or from AM FIRST choice? If the answer is yes to either, then you're using the E4P encoder with a 360 CPR wheel.


There has been a wealth of discussion on this topic and how to filter encoder data to return a more stable rate. I would suggest doing a forum search and comparing your results with those that others have documented. I doubt it's related to the problem that this thread was created to discuss, as this is a widely documented issue that is commonly expected of encoders, whereas the one that you're experiencing hints of a connection problem.

I believe they are from the KoP... I know that the power wheel encoder is indeed the 360 CPR... as I use (1/360) when I set the pulse distance to get RPS units.

Thanks for the tip on the other discussions... I'll definately want to check them out... but I should reiterate something... I do the same identical test with last years robot and this years with the same exact code. I simply turn the wheel by hand, and last years robot was very smooth numbers. There has got to be some explanation. I'll try to find what you are talking about as well.
  #14   Spotlight this post!  
Unread 04-14-2012, 08:28 PM
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 6,041
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: Encoders on Drive Train DON'T WORK.

Quote:
Originally Posted by JamesTerm View Post
at higher speeds it would have a distinct 30-40 radian skip between the numbers like 300.30 10x 330.2 3x 300.10x (around 47 rps).
Code:
360		CPR encoder
4		4X decoding
1440		counts per rev
47		rev/sec
67,680		counts/sec
Note the 67,680 counts per sec. I'm told the FPGA is only good for 40,000 counts/sec, but I don't know if that's per channel or for both channels of an encoder.


  #15   Spotlight this post!  
Unread 04-14-2012, 08:47 PM
JamesTerm's Avatar
JamesTerm JamesTerm is offline
Terminator
AKA: James Killian
FRC #3481 (Bronc Botz)
Team Role: Engineer
 
Join Date: May 2011
Rookie Year: 2010
Location: San Antonio, Texas
Posts: 249
JamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to beholdJamesTerm is a splendid one to behold
Re: Encoders on Drive Train DON'T WORK.

Quote:
Originally Posted by Ether View Post
Code:
360		CPR encoder
4		4X decoding
1440		counts per rev
47		rev/sec
67,680		counts/sec
Note the 67,680 counts per sec. I'm told the FPGA is only good for 40,000 counts/sec, but I don't know if that's per channel or for both channels of an encoder.


http://www.usdigital.com/first

This link shows 166 rps...

For the E4P, the maximum output frequency is 60 kHz (60,000 cycles per second). A 360 CPR encoder produces 360 pulses on each channel per revolution. To solve for how fast the encoder's shaft must turn per second to reach the maximum output frequency, divide the maximum frequency by the pulses per revolution. 60,000 / 360 = 166 revolutions per second. To convert to RPM multiply by 60 (10,000 RPM).
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 06:37 PM.

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


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