Go to Post [This year's game manual contains] 46 new pages of pictures displaying how to attach bumpers, assuring at least 15% of teams almost get it right this time. - PayneTrain [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 22-04-2012, 19:14
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Encoder function calls reporting inf

Quote:
Originally Posted by trilogy2826 View Post
GetRate(): Reports 0(zero) no matter the speed of the encoder physically turning

GetPeriod(): Reports inf no matter the speed of the encoder physically turning. This is odd because this function is necessary for GetDistance() to work according to the encoder.c file
Slightly backwards here. GetRate() is the one that requires GetPeriod() to work.

Somewhat hard to debug here, since almost all of the implementation for encoders is in the FPGA, and I haven't seen this before. Still, my hunch is that one of the two encoder lines is not connected/assigned properly. GetDistance() probably works because it is counting off the one good line, but since the other line never fires, a full period is never seen. GetPeriod() returns inf whenever the period is over a certain threshold (side note - if anyone knows what that default threshold is, please tell me. I can't find it in any of the comments).

Also, if that is the problem, most likely when you fix it your distances will double.
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"

Last edited by Radical Pi : 22-04-2012 at 19:16. Reason: add note at the end
Reply With Quote
 


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 17:37.

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