Go to Post This is an engineering competition. Do some. - JVN [more]
Home
Go Back   Chief Delphi > Technical > Motors
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 07-02-2009, 16:51
MBernstein MBernstein is offline
Registered User
FRC #2888
 
Join Date: Jan 2009
Location: Beaver Country Day School
Posts: 2
MBernstein is an unknown quantity at this point
Optical encoder not returning values

Our optical encoder is only returning 0.
We would like an example source code for getting the number of rotations.
Also the LEDs inside do not light up...should they be?
We have it connected to the Digital I/O of the digital side car.
  #2   Spotlight this post!  
Unread 07-02-2009, 18:24
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Optical encoder not returning values

Just for a test, I connected a USdigital quad encoder to the crio using the included example encoder code and it worked great. Does that help? OK some LEDs are infrared so you wouldn't see anything but if you have connected 5V before and seen the led light... then of course the answer is yes. The USdigital encoder light is encased so I don't see light from mine.

Steve

Last edited by Steve_Alaniz : 07-02-2009 at 18:26. Reason: additional comment
  #3   Spotlight this post!  
Unread 09-02-2009, 12:09
whitetiger0990's Avatar
whitetiger0990 whitetiger0990 is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Earth
Posts: 157
whitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of lightwhitetiger0990 is a glorious beacon of light
Re: Optical encoder not returning values

There is an example here:

C:\Program Files\National Instruments\LabVIEW 8.5\examples\FRC\Digital\Encoder Example

Make sure you have it wired correctly.
__________________
print$q=chr(ord($q)+$1)while("7443-0201-8465130105-12-03135-82482113-06-7672-070208-0613-70"=~/(-?\d\d)/g);
  #4   Spotlight this post!  
Unread 09-02-2009, 12:10
MrForbes's Avatar
MrForbes MrForbes is offline
Registered User
AKA: Jim
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Sierra Vista AZ
Posts: 6,027
MrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond reputeMrForbes has a reputation beyond repute
Re: Optical encoder not returning values

If you want to see if an IR LED is lighting up, look at it with a digital camera
  #5   Spotlight this post!  
Unread 09-02-2009, 12:35
TheOtherGuy's Avatar
TheOtherGuy TheOtherGuy is offline
Unregistered User
AKA: Kevin Forbes
FRC #4183 (Bit Buckets)
Team Role: Engineer
 
Join Date: Jul 2006
Rookie Year: 2006
Location: Tucson, AZ
Posts: 408
TheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond reputeTheOtherGuy has a reputation beyond repute
Re: Optical encoder not returning values

Quote:
Originally Posted by MBernstein View Post
Our optical encoder is only returning 0.
We would like an example source code for getting the number of rotations.
Also the LEDs inside do not light up...should they be?
We have it connected to the Digital I/O of the digital side car.
Have you wired it correctly? There should be a +5, A, G, and B on the encoder.
PWM 1 - black to G, red to +5, white to A
PWM 2 - black to G, red to +5, white to B

The second PWM cable doesn't really need the ground and power connected. Since you didn't provide enough information, are you sure you connected both the A and B channels and selected the right ones in LabView? (are you using LabView or C++?)
__________________
  #6   Spotlight this post!  
Unread 09-02-2009, 12:49
Jetweb Jetweb is offline
is good at making robots find walls
AKA: Jonathan
FRC #0179 (Children of the Swamp!!!)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jupiter, FL
Posts: 213
Jetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to all
Re: Optical encoder not returning values

If you dont see a red light stop altering your code, the sensor is wired incorrectly or it is broken, we have 5 on our robot so i know there is supposed to be a visible red light inside (with the top off of course)
  #7   Spotlight this post!  
Unread 09-02-2009, 20:23
dpc131's Avatar
dpc131 dpc131 is offline
Registered User
AKA: Dan
FRC #0836 (Robobees)
Team Role: Engineer
 
Join Date: Dec 2006
Rookie Year: 2001
Location: Leonardtown, MD
Posts: 21
dpc131 is a jewel in the roughdpc131 is a jewel in the roughdpc131 is a jewel in the rough
Re: Optical encoder not returning values

Quick question for anyone. I just got back to the team and saw that they incorrectly hooked the encoders to the Analog I/O and not digital. I believe that the encoder were over-voltaged. They seem to have failed high, lights illuminates, but no pulse on the O-scope. Anyone have any luck with Overvoltage and still operational?
__________________
Dan Cell
Systems Eng. Mentor

Team 836 - The Robobee's
  #8   Spotlight this post!  
Unread 09-02-2009, 20:26
Vikesrock's Avatar
Vikesrock Vikesrock is online now
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
Re: Optical encoder not returning values

Both the Analog breakout and Digital Sidecar provide 5V on their power pins so connecting the encoder to the wrong board should not cause a problem.
__________________


2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
  #9   Spotlight this post!  
Unread 09-02-2009, 20:59
MBernstein MBernstein is offline
Registered User
FRC #2888
 
Join Date: Jan 2009
Location: Beaver Country Day School
Posts: 2
MBernstein is an unknown quantity at this point
Thumbs up Re: Optical encoder not returning values

Quote:
Originally Posted by TheOtherGuy View Post
Have you wired it correctly? There should be a +5, A, G, and B on the encoder.
PWM 1 - black to G, red to +5, white to A
PWM 2 - black to G, red to +5, white to B

The second PWM cable doesn't really need the ground and power connected. Since you didn't provide enough information, are you sure you connected both the A and B channels and selected the right ones in LabView? (are you using LabView or C++?)
I believe we do have it wired correctly, as it matches what you state above (we don't use the ground and power on the second PWM cable). Originally we connected it to the analog i/o but then realized it needed to connect to the digital i/o.

We are using C++ and have test code like the following, just to verify the encoder is working correctly:

Encoder encoder(1, 2, true);
while (1) {
count = encoder.Get();
cout << count;
}

We then rotate the middle of the encoder, but the count stays at 0. How should we be using the Encoder class to read values from the encoder?
  #10   Spotlight this post!  
Unread 09-02-2009, 21:50
AustinSchuh AustinSchuh is offline
Registered User
FRC #0971 (Spartan Robotics) #254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 1999
Location: Los Altos, CA
Posts: 803
AustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond reputeAustinSchuh has a reputation beyond repute
Re: Optical encoder not returning values

While I'm not sure it's completely necessary, when I last used them in C++, I called encoder.Start() before I started trying to read anything.
  #11   Spotlight this post!  
Unread 09-02-2009, 22:00
dpc131's Avatar
dpc131 dpc131 is offline
Registered User
AKA: Dan
FRC #0836 (Robobees)
Team Role: Engineer
 
Join Date: Dec 2006
Rookie Year: 2001
Location: Leonardtown, MD
Posts: 21
dpc131 is a jewel in the roughdpc131 is a jewel in the roughdpc131 is a jewel in the rough
Re: Optical encoder not returning values

Wow, long day at work and robotics. Looks like I didn't practice what I preach and read the manual. I saw the 10V stamp on the module and didn't think about the bumper having it's own power supply. Thanks for the catch, and that's one de-merit for me.....now I just need to find out what is actually wrong with it....
__________________
Dan Cell
Systems Eng. Mentor

Team 836 - The Robobee's
  #12   Spotlight this post!  
Unread 09-02-2009, 22:10
Jetweb Jetweb is offline
is good at making robots find walls
AKA: Jonathan
FRC #0179 (Children of the Swamp!!!)
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jupiter, FL
Posts: 213
Jetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to allJetweb is a name known to all
Re: Optical encoder not returning values

Quote:
Wow, long day at work and robotics. Looks like I didn't practice what I preach and read the manual. I saw the 10V stamp on the module and didn't think about the bumper having it's own power supply. Thanks for the catch, and that's one de-merit for me.....now I just need to find out what is actually wrong with it....
Just reminders you probably already know...
Make sure the encoded wheel is 1 un-scratched, and 2 installed to the proper height with the included placement wheel also it will not work without the cover on tightly.
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
optical encoder feedback windriver darkorbit C/C++ 2 17-01-2009 13:34
Optical Encoder Centering Tool Gary Bonner Kit & Additional Hardware 1 05-01-2009 18:19
A nice and cheap optical encoder! (not a question) windell747 Electrical 9 04-05-2008 14:13
AHH! Not returning to FIRST! Can't See Me General Forum 19 07-10-2005 14:07
Rotary Encoder (optical etc.) Gary C Technical Discussion 4 16-01-2005 18:23


All times are GMT -5. The time now is 14:03.

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