Go to Post unless your team is incredibly beastly, completely ignore the words "cool factor". Coolness does not outweigh functionality. - Sam N. [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-02-2011, 15:50
Thomas DeSilva's Avatar
Thomas DeSilva Thomas DeSilva is offline
Programming Fury
FRC #1983 (Skunkworks)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Des Moines, WA
Posts: 18
Thomas DeSilva is on a distinguished road
Functional encoder returning 0

We have three US Digital quad encoders on our robot this year. We've implemented the fake encoder workaround for GetRate(), and the two encoders that we need to get rate out of are working fine, but the third, which we only need distance out of, never registers any change. The following code contains the contructors for all of our encoders:
Code:
fakeEncoderA = new Encoder(6,1,6,2,false, fakeEncoderA->k4X);
leftEncoder = new Encoder(4, LEFTMOTORA, 4, LEFTMOTORB, false, leftEncoder->k4X);
//fakeEncoderB = new Encoder(6,3,6,4,false, fakeEncoderB->k4X);
liftEncoder = new Encoder(4, LIFTMOTORA, 4, LIFTMOTORB, false, liftEncoder->k4X);
rightEncoder = new Encoder(4, RIGHTMOTORA, 4, RIGHTMOTORB, false, rightEncoder->k4X);
//fakeEncoderC = new Encoder(6,5,6,6,false, fakeEncoderC->k4X);
//liftEncoder = new Encoder(4, LIFTMOTORA, 4, LIFTMOTORB, false, liftEncoder->k4X);
The lift encoder is the one that doesn't register change. We have verified that the encoder works by plugging it into the left encoder's ports and reading it as the left encoder. We have also verified that the pins that the encoder is plugged into are working by successfully reading the left encoder off of them. The lift encoder still doesn't read if we comment out all of the other encoders, change the order of the constructors and declarations, or change the encoding type to 2X. Also, if none of the encoder constructors are commented out, the console constantly throws an "Assertion Failed" error from line 217 of Encoder.cpp in WPILib. I assumed that was because the FPGA can't handle 6 4X encoders, but changing them to 2X or 1X didn't help. Does anyone know how to solve this problem, or what's causing it?
Reply With Quote
  #2   Spotlight this post!  
Unread 18-02-2011, 16:44
davidalln's Avatar
davidalln davidalln is offline
World's Worst Coder
AKA: David Allen
FRC #2415 (The Westminster Wiredcats)
Team Role: Programmer
 
Join Date: Mar 2009
Rookie Year: 2008
Location: Atlanta, GA
Posts: 108
davidalln is on a distinguished road
Send a message via AIM to davidalln
Re: Functional encoder returning 0

Did you run Encoder->Start() before you try to get values? That's tripped me up before.
__________________
SANTOSH ANDREW DECKER RICK WYNNIE SEAN DEREK MATT
(alamo (semis), p'tree (CHAMPS!), nc (CHAMPS!), newton (quarters))


Best four years of my life. Thanks to everyone who made it happen.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-02-2011, 16:52
Thomas DeSilva's Avatar
Thomas DeSilva Thomas DeSilva is offline
Programming Fury
FRC #1983 (Skunkworks)
Team Role: Mentor
 
Join Date: Feb 2009
Rookie Year: 2009
Location: Des Moines, WA
Posts: 18
Thomas DeSilva is on a distinguished road
Re: Functional encoder returning 0

Well, that's embarassing. So, the lift encoder is now reading, but is there any insight on why I can't run more than four 2X encoders?
Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2011, 21:54
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 357
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: Functional encoder returning 0

The wpi library user's guide talks about how there are only 4 modules in the FPGA on the CRIO that can run more 4x encodings, and they are probbly used to run 2x if you specify that mode.
__________________
Brian K
Team 1225 Robotics Mentor
Reply With Quote
Reply


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 13: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