How can we wire the Gear Tooth sensor?

Hey.
Today I was told by our mentor we need to use the Gear Tooth sensor we received in the 2008 KOP:

http://img340.imageshack.us/img340/5069/sensorw.png

but no one remembers or knows how to wire and program this (we’re using LabVIEW), so I’d appreciate any tips.

Thanks.

The 2008 Sensor Manual is still on the FIRST web site. I found it by going to the Competition Manual page and following the link at the bottom to older documentation. The GTS is detailed on page 2.

To read it in LabVIEW, use a Counter.

Why do you need to use a gear tooth sensor? There might be better ways to do what you want using other sensors provided in this year’s kit.

There’s a pole made out of aluminum and on it are a lot of screws at a constant distance. our “claw”, the part of the robot that hold the tube, moves on that pole. the idea is that the sensor will rest on the claw and move with it, and that way we could count the response we get for every screw on the pole the claw passes, and thus knowing at what height the claw is located at.

When I try opening a Counter in LabVIEW it asks me for some kind of source, where do I get it from?
Edit: yeah, I just saw the “Dig Src” vi. is that what converts a digital input to the source needed?
and anyway, that makes me skeptic, because I tried using the sensor just with a regular digital input and it didn’t work (always gave false value)

If I’m still using the digital input, why would it work now?

The counter operates much faster than the control software (it has dedicated FPGA hardware to handle it). Thus, it never misses counts.

On a related note, an analog potentiometer seems like a better choice. You attach it to a shaft, and it measures the absolute angle of the shaft, which you read from an analog channel.

You found the right thing. The reason you always see “false” on the digital input is that the GTS output is a very short pulse. You probably won’t notice it unless you watch it with an oscilloscope. The FPGA in the cRIO can monitor the signal continuously and increment the counter every time it appears.

I understand know how it works, thank you.
but for some reason it doesn’t work. Here’s how I wired it:

http://img21.imageshack.us/img21/8339/13063838.png

And here’s the LabVIEW code:

http://img577.imageshack.us/img577/5530/picy.png

there was kind of a bug that confirmed some values are passed: we accidentally put the sensor on an aluminum plate that caused it to always pass a positive value, so the counter raised it’s value (quickly, like anticipated).
but when we figured out the mistake we have made we removed the sensor from the plate and now it doesn’t pass any values at all (the counter doesn’t rise)

The Gear Tooth Sensor output is a digital signal. Your code is expecting to see it on DIO 1. That’s the first General Purpose I/O pin on the Digital Sidecar. Your connection drawing indicates that you have wired it to an analog input instead.

Remove it from the Analog Breakout and connect it to the Digital Sidecar.

I think the “bug” you saw was just a coincidence unrelated to the aluminum plate. It would happen if something was touching the DIO pin and causing it to pick up random noise, triggering the counter repeatedly.

I’m so sorry, I’ve made a mistake. This was an old drawing, it is now connected to the first DIO in the sidecar (as it was when I posted the last message)