Go to Post before you post, ask yourself: Is there a good reason to post this? - Jeff Waegelin [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 Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-01-2009, 10:26
petet4 petet4 is offline
Registered User
AKA: Pete Thomas
FRC #0706 (Cyberhawks)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Waukesha, WI.
Posts: 18
petet4 is on a distinguished road
Inputs for the Encoder

Hi all, I have a quick question and if it is documented somewhere I have not been able to find it.

The question is can any of the digital inputs be used for reading the encoder? I have a USdigital encoder connected to digital inputs 10 & 11 in slot 4 and use the GetEncoder() function and it would read 0 or 1 while turning the encoder. The direction would work if I recall bit no increment or decrement of counts. Both encoder outputs were verified with a scope. After a bit of pondering I changed the wiring to use digital inputs 8 & 9 and then all works.

We are using Wind River with the C function call.

In summary are there specific inputs that are required to be used for various sensors, i.e. encoders?

Thanks,
-pete
  #2   Spotlight this post!  
Unread 19-01-2009, 10:35
jee7s jee7s is offline
Texan FIRSTer, ex-frc2789, ex-frc41
AKA: Jeffrey Erickson
FRC #6357
 
Join Date: Nov 2007
Rookie Year: 1997
Location: Dripping Springs, TX
Posts: 313
jee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond reputejee7s has a reputation beyond repute
Re: Inputs for the Encoder

(I'm assuming you are using C++ for this...)

There are no specific inputs for the encoders. You specify the input module and channel in the constructor when you declare the encoder object. That declaration routes the channels to the appropriate part of the FPGA, which handles your counting and rate calculation.

-Jeff Erickson, FRC 41
  #3   Spotlight this post!  
Unread 19-01-2009, 13:26
petet4 petet4 is offline
Registered User
AKA: Pete Thomas
FRC #0706 (Cyberhawks)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2008
Location: Waukesha, WI.
Posts: 18
petet4 is on a distinguished road
Re: Inputs for the Encoder

The example was using C and the C libs, have not tried with C++. The digital inputs were defined in the function call.

if these are defined as 8 & 9 then everthing works,

static const UINT32 ENC_A = 10;
static const UINT32 ENC_B = 11;

In the Initialize function..
StartEncoder(ENC_A, ENC_B);

then in the OperatorControl function is
enc = GetEncoder(ENC_A, ENC_B);

GetEncoder() only returns a 0 or 1 for inputs 10&11 but if the inputs are moved to 8&9 and the code changed to reflect the input change all works.

I think there still might be some issues that need to worked out either in the WPIlibs (C) or in the hardware.

Will try with C++ and see is using inputs 10&11 still have issues

jee7s, Thanks for the above reply,

-pete
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Analog Inputs as Digital (on the OI) Guy Davidson Control System 16 10-03-2008 17:17
Using Custom Inputs on the Controller Board schenkin Programming 10 27-01-2005 10:26
How do the Analog Inputs work? JBotAlan Electrical 3 07-01-2005 00:11
Choosing an Encoder for the Drive-train MikeDubreuil Electrical 11 21-10-2004 00:50
how to add steps in the provided encoder program for the edu Zaramel2002 Programming 3 11-02-2004 08:35


All times are GMT -5. The time now is 08:09.

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