Go to Post In 2001 instead of staring at the field at the game I turned around and watched the people watch the field. All I could see was a mass of people from all corners of the world, eyes lit up, gears turning in their heads. That, to me, is FIRST in action. - Jessica Boucher [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
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 03-02-2012, 19:53
CRLS97 CRLS97 is offline
Registered User
FRC #0097
 
Join Date: Jan 2011
Location: Cambridge
Posts: 28
CRLS97 is an unknown quantity at this point
Question Encoder Trouble

Hey CD,

I've worked with an encoder last year without any troubles, but I can't seem to figure out what's wrong this year.

I have the 8-slot cRio reconfigured and modules swapped (from last years positions) to what they should be as noted by FIRST. I tested with the new ribbon cable and the old thick cable (from cRio to digital sidecar).

Our robot is near-fully functional. All the PWM signals work great. Analog works, etc. The trouble is the digital inputs and it's not just the specific one on the bot because I tried with a couple. I wired up an encoder (two of them actually and I'm 101% sure the wiring was correct (I checked multiple times and then with the help of a mentor used an oscilloscope to make sure the encoders were functional as well). Even tried hooking up our old robots encoders to the sidecar and still no luck-

Our code gave no feedback from the encoders. They were initialized properly and started properly so I'm sure nothing is wrong with code. Then I tried the FRC LabVIEW Motor with encoder example and ran it. Motor outputs are fine but the encoder gave feedback this time. However, what happened is that it went from 0 to 0.003 something and back to 0, continually oscillating between the two whenever there was an output to the motor (and the shaft was actually spinning). At the bottom of the example the encoder alarm is always: "stopped" rather than moving.

Does anyone have any clue to what may be wrong or what I'm doing wrong? The digital sidecar is plugged into module 2 of the cRio, recognized as Digital Module 1 in LabVIEW. Any help is greatly appreciated
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2012, 20:46
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,579
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Encoder Trouble

Quote:
Originally Posted by CRLS97 View Post
However, what happened is that it went from 0 to 0.003 something and back to 0, continually oscillating between the two whenever there was an output to the motor (and the shaft was actually spinning). At the bottom of the example the encoder alarm is always: "stopped" rather than moving.
This sounds like it isn't reading one of the channels, but is reading the other channel.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2012, 20:52
CRLS97 CRLS97 is offline
Registered User
FRC #0097
 
Join Date: Jan 2011
Location: Cambridge
Posts: 28
CRLS97 is an unknown quantity at this point
Re: Encoder Trouble

Quote:
Originally Posted by Joe Ross View Post
This sounds like it isn't reading one of the channels, but is reading the other channel.
I really have a feeling it might be the cRio / digital sidecar or some other wiring problem between the cRio and sidecar. I tried it on different channels and made the code adjustments and no luck with that either and again I'm sure its not the wiring of the encoder to the channels.

Before leaving, I tried a limit switch and did not see any response to pushing it, in the FRC PC Dashboard for GPIO state with the robot enabled.
Reply With Quote
  #4   Spotlight this post!  
Unread 03-02-2012, 21:10
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Encoder Trouble

Quote:
Originally Posted by CRLS97 View Post
I wired up an encoder (two of them actually and I'm 101% sure the wiring was correct (I checked multiple times and then with the help of a mentor used an oscilloscope to make sure the encoders were functional as well).
Congratulations on going that far with your troubleshooting.

Quote:
Then I tried the FRC LabVIEW Motor with encoder example and ran it. Motor outputs are fine but the encoder gave feedback this time. However, what happened is that it went from 0 to 0.003 something and back to 0, continually oscillating between the two whenever there was an output to the motor (and the shaft was actually spinning). At the bottom of the example the encoder alarm is always: "stopped" rather than moving.
Can you tell us exactly how your encoder is wired? It sounds like at least one of the phases isn't getting through to the Digital Sidecar.
Reply With Quote
  #5   Spotlight this post!  
Unread 03-02-2012, 22:43
CRLS97 CRLS97 is offline
Registered User
FRC #0097
 
Join Date: Jan 2011
Location: Cambridge
Posts: 28
CRLS97 is an unknown quantity at this point
Re: Encoder Trouble

Cable 1:
Encoder | DIO Channel 5
+5v ------- +5v
Gnd ------- Gnd
Ch. A ------ Sig

Cable 2:
Encoder | DIO Channel 6
Ch. B ------- Sig

A snippet of begin.vi-

http://i44.tinypic.com/35i53s5.jpg
Reply With Quote
  #6   Spotlight this post!  
Unread 09-02-2012, 03:05
seg9585's Avatar
seg9585 seg9585 is offline
Registered User
AKA: Eric
FRC #4276 (Surf City Vikings)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Boeing (Seal Beach, CA)
Posts: 520
seg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond repute
Re: Encoder Trouble

Just curious -- have you tried running with one single encoder (A and B inputs) plugged in at a time, and no other digital inputs? How are you attempting to read the output data -- in an Indicator within Periodic Task VI, or maybe on the Dashboard?
__________________
My FIRST legacy:

Team 204 Student 2001, 2002 (Voorhees, NJ)
Team 1493 College Mentor 2006 - 2008 (Troy, NY)
Team 2150 Intern/Professional Mentor 2007, 2009 (Palos Verdes)
Team 4123 Lead Engineering Mentor 2012 (Bellflower, CA)
Team 4276 Engineering Mentor 2012-2016 (Huntington Beach, CA)
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 22:25.

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