Go to Post Everyone needs to start working with what they are given, and start appreciating FIRST, not complaining about what they think FIRST is doing wrong. - Marygrace [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
  #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: 22
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
 


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:48.

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