View Full Version : Encoder Problems
captainking
03-02-2011, 11:34
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
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
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
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
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
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
On the dashboard, when you spin the encoder, do you see the DIO change states?
captainking
03-02-2011, 13:11
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
Does your code now resemble this example (http://team358.org/files/programming/ControlSystem2009-/LabVIEW/EncoderExample.jpg)?
Doug Norman
04-02-2011, 08:15
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.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.