Go to Post That's some sexy use of aluminium - Bharat Nain [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-2011, 11:34
captainking's Avatar
captainking captainking is offline
Level 85 Programmer
FRC #0168 (MIB)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: North Miami Beach
Posts: 41
captainking is an unknown quantity at this point
Encoder Problems

Hey, we're having some troubles with the Digital Encoder

I believe we have it wired right as the light is coming on, but whenever we run the program, I'm not getting any values for either rate or distance.

I've checked the code and we have the right DIO ports assigned to A and B.

Any ideas?
__________________
Integrity first
Service before self
Excellence in all we do
Reply With Quote
  #2   Spotlight this post!  
Unread 03-02-2011, 11:50
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,112
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 Problems

Quote:
Originally Posted by captainking View Post
Any ideas?
Not without some details from you, no.

"I believe we have it wired right" doesn't let us know if what you believe is true. Tell us how you have it wired and let us decide if there's something amiss.

"I've checked the code" doesn't let us know if the code is correct. Show us the program and let us see if it's doing what you think it should be doing. We can also tell you if what you think it should be doing is actually what it needs to do.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-02-2011, 12:09
captainking's Avatar
captainking captainking is offline
Level 85 Programmer
FRC #0168 (MIB)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: North Miami Beach
Posts: 41
captainking is an unknown quantity at this point
Re: Encoder Problems

Wiring:
5v -> power on dio 4
gnd -> gnd on dio 4
A - signal on dio 4
B -> signal on dio 5

Programming in the pictures

I have DIOs set to 4 for A and 5 for B
Attached Thumbnails
Click image for larger version

Name:	encoder teleop.JPG
Views:	53
Size:	40.6 KB
ID:	9940  Click image for larger version

Name:	encoder begin.JPG
Views:	47
Size:	23.1 KB
ID:	9941  
__________________
Integrity first
Service before self
Excellence in all we do
Reply With Quote
  #4   Spotlight this post!  
Unread 03-02-2011, 12:13
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,557
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 Problems

don't call the encoder config timer and start in telop. It will get called 50 times a second. Put them in begin, instead.
Reply With Quote
  #5   Spotlight this post!  
Unread 03-02-2011, 12:22
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,112
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 Problems

Using controls instead of constants for the channel numbers will work if you're going to run Robot Main. Make sure to use the popup menu to set the current value as the default before you build the project. But I think it's simpler to use constants instead.
Reply With Quote
  #6   Spotlight this post!  
Unread 03-02-2011, 12:38
captainking's Avatar
captainking captainking is offline
Level 85 Programmer
FRC #0168 (MIB)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: North Miami Beach
Posts: 41
captainking is an unknown quantity at this point
Re: Encoder Problems

We changed the controls to constants and moved the timer configure to the begin VI, but it still doesn't work.
__________________
Integrity first
Service before self
Excellence in all we do
Reply With Quote
  #7   Spotlight this post!  
Unread 03-02-2011, 12:56
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,557
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 Problems

On the dashboard, when you spin the encoder, do you see the DIO change states?
Reply With Quote
  #8   Spotlight this post!  
Unread 03-02-2011, 13:11
captainking's Avatar
captainking captainking is offline
Level 85 Programmer
FRC #0168 (MIB)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: North Miami Beach
Posts: 41
captainking is an unknown quantity at this point
Re: Encoder Problems

We see nothing change on the dashboard, but we are using the dashboard on my personal computer, not the classmate
Attached Thumbnails
Click image for larger version

Name:	dashboard encoder.JPG
Views:	21
Size:	69.5 KB
ID:	9944  
__________________
Integrity first
Service before self
Excellence in all we do
Reply With Quote
  #9   Spotlight this post!  
Unread 03-02-2011, 13:29
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,713
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Encoder Problems

Does your code now resemble this example?
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #10   Spotlight this post!  
Unread 04-02-2011, 08:15
Doug Norman's Avatar
Doug Norman Doug Norman is offline
Registered User
no team (National Instruments)
Team Role: Engineer
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Austin, TX
Posts: 134
Doug Norman will become famous soon enoughDoug Norman will become famous soon enough
Re: Encoder Problems

Take a look and get the encoder example working first. Then integrate that code into your robot code. Here are a few steps:
1. From the LabVIEW Getting Started Window, click on "Find FRC Examples".
2. in the Sensors folder of the Example Finder, open the encoder example and get that to work.
3. Back at the Getting Started Window (View>>Getting Started Window if you have VIs open), check out Tutorial 7 - Integrating Examples into Robot Code.
__________________
Doug Norman
National Instruments
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 08:24.

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