Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Encoder Problems (http://www.chiefdelphi.com/forums/showthread.php?t=90825)

captainking 03-02-2011 11:34

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?

Alan Anderson 03-02-2011 11:50

Re: Encoder Problems
 
Quote:

Originally Posted by captainking (Post 1014869)
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.

captainking 03-02-2011 12:09

Re: Encoder Problems
 
2 Attachment(s)
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

Joe Ross 03-02-2011 12:13

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.

Alan Anderson 03-02-2011 12:22

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.

captainking 03-02-2011 12:38

Re: Encoder Problems
 
We changed the controls to constants and moved the timer configure to the begin VI, but it still doesn't work.

Joe Ross 03-02-2011 12:56

Re: Encoder Problems
 
On the dashboard, when you spin the encoder, do you see the DIO change states?

captainking 03-02-2011 13:11

Re: Encoder Problems
 
1 Attachment(s)
We see nothing change on the dashboard, but we are using the dashboard on my personal computer, not the classmate

Mark McLeod 03-02-2011 13:29

Re: Encoder Problems
 
Does your code now resemble this example?

Doug Norman 04-02-2011 08:15

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.


All times are GMT -5. The time now is 10:05.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi