Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Gear Tooth Sensor (http://www.chiefdelphi.com/forums/showthread.php?t=51840)

Phalanx 17-01-2007 00:46

Re: quadrature
 
Quote:

Originally Posted by Andrew Schuetze (Post 558243)
Reading these posts seems to confirm my thoughts that this sensor doesn't provide rotation direction information. CW or CCW This of course does not render this a useless sensor as one is often powering the motor from which sensor data is being generated. Meaning you already know its rotation and just need rotational speed for closed-loop feedback.

Actually the sensor does provide you with rotation direction information, but it is not easy, nor worth while to obtain IMO. You would need to measure the length of the pulse width of the signal. In the sensors datasheet it does say what the lengths of the pulse widths are. They are different for forward moving(CW) and reverse moving(CCW).

Andrew Schuetze 17-01-2007 01:12

Re: quadrature
 
Quote:

Originally Posted by Phalanx (Post 558667)
Actually the sensor does provide you with rotation direction information, but it is not easy, nor worth while to obtain IMO. You would need to measure the length of the pulse width of the signal. In the sensors datasheet it does say what the lengths of the pulse widths are. They are different for forward moving(CW) and reverse moving(CCW).

One of our programming mentors read this and I just can't get my head around how this works if the sprocket teeth are symetrical:confused: Maybe a picture would help. Does the spec sheet have one?

APS

Phalanx 17-01-2007 01:52

Re: Gear Tooth Sensor
 
First here's the datasheet
http://www.allegromicro.com/datafile/0642.pdf

Try to think of it this way......

When the gear is moving forward (CW), as a tooth passes, the digital signal from the GTS goes high (0 to 1 or off to on) and stays high for a specified length of time and then turns off.

When the gear is moving backward(CCW), as a tooth passes, the digital signal from the GTS goes high (0 to 1 or off to on) and stays high for a specified length of time and then turns off.

What is different between the two is the length of the time that the signal remains high. So besides noting the interrupt or the transition from 0 to 1, you would now also need to know the length of time it remained one.

Thus by knowing the time the signal reamained one, based on the datasheet you would know the direction. There is a time range for sensing forward, and a different time range for reverse. Last years sensor was 45microseconds(CW) for forward and 90microseconds(CCW) for reverse.

I hope this helps.

Alan Anderson 17-01-2007 07:11

Re: quadrature
 
Quote:

Originally Posted by Phalanx (Post 558667)
Actually the sensor does provide you with rotation direction information,...

The GTS in the 2006 Kit of Parts did that. The 2007 one does not. The Allegro part on the board is different.

Alan Anderson 17-01-2007 07:19

Re: quadrature
 
Quote:

Originally Posted by gnirts (Post 558613)
How does the entire 'bot move forward with only one motor out of the deadband? I would think it would turn around that wheel.

A well-built four- or six-wheel drivebase will tend to go straight when a forward force is applied to it at any location. Imagine a skateboard -- when you push off with a foot to one side, you still go the way the wheels are pointing.

The PID control was only used for positioning during autonomous, though the code originally also had the ability to use speed control instead of power control for normal operation. I have yet to find a driver who prefers that option.

987HighRoller 17-01-2007 17:40

Re: Gear Tooth Sensor
 
Ok, I'm having problems with the gear tooth sensor. I have the sensor wired up correctly and everything, but when I print the value of the digital port, it stays at 0. I have tried puting a gear in front of it in all sorts of postitions. I've tested the power connection and the connection to the rc and it seems all to be right. Am I missing something? Thanks

Alan Anderson 17-01-2007 21:08

Re: Gear Tooth Sensor
 
Quote:

Originally Posted by 987HighRoller (Post 559101)
Ok, I'm having problems with the gear tooth sensor. I have the sensor wired up correctly and everything, but when I print the value of the digital port, it stays at 0.

I know you said you wired it correctly, but that's still the first place to start. What do you have connected to the six connection points on the sensor?

Have you configured the port as an input? You probably didn't need to do anything special, because the default code sets all digital pins to inputs in User_Initialization().

How exactly are you printing the value? Show us the line of code that you're using.

Once we've determined that you can indeed read the state of the input pin, you're only half finished. Unless you intend to monitor a gear that has only a few teeth going by per second, you will almost certainly need to use interrupts in order to count gear teeth reliably.

Bharat Nain 18-01-2007 00:23

Re: Gear Tooth Sensor
 
Quote:

Originally Posted by Alan Anderson (Post 559318)

How exactly are you printing the value? Show us the line of code that you're using.

I faced that problem with I was playing with encoders last year. If you don't print it out correctly, it will display as zero. Please post the part of your code that prints out the values and make sure you have the code configured correctly. Read and re-read the readme.txt file.

987HighRoller 18-01-2007 17:19

Re: Gear Tooth Sensor
 
this is what it looks like :
Code:

printf("%d\r",rc_dig_in01);
Thanks for all of the help

Bomberofdoom 19-01-2007 01:16

Re: Gear Tooth Sensor
 
Hi, sorry for bumping in, but we just recieved the 2 GTS pieces and we'd like to know how exactly do we use it?(where do we connect, what values to we use, what we need to code or what code to download to make it work etc..)

Phalanx 19-01-2007 12:04

Re: Gear Tooth Sensor
 
Quote:

Originally Posted by Bomberofdoom (Post 560208)
Hi, sorry for bumping in, but we just recieved the 2 GTS pieces and we'd like to know how exactly do we use it?(where do we connect, what values to we use, what we need to code or what code to download to make it work etc..)

Everythng you need to know is in this thread......

First off, download and read Kevin Watsons encoder code and encoder FAQ
http://www.kevin.org/frc/encoder/
http://www.kevin.org/frc/frc_encoder.zip

To make his code work with the gear tooth sensors you need to remove the "Phase B" logic from it.

Second you wire them to digital I/O 1 and digital I/O 2 with a pwm cable. You also need to power them on a 12volt power supply as well.

See the 2007 Sensor Manual for more information.

To wire the sensor...

Take one end of a pwm cable, and solder it to J2, the black wire to GB (ground-black) the red wire to 5R (+5 volts-red) the white wire to SW (signal white). Connect the other end of this pwm to digital I/O 1.

Take a 2nd pwm cable and solder it to J1, the black wire to GB, the white wired to (12W), the red wire is unused. Connect the other end to a 20amp circut on one of your atc breaker panels.

Mount the sensor from .5 to 2.75 mm away from the gear to be measured.

Repeat this for the second one except connect it to digital I/O 2.

As for the code...
Use encoder 1 and encoder 2, disable the others. Then remove the "Phase B" logic in the interrupt handler for encoder 1 and encoder 2.

slloyd 21-01-2007 23:22

2007 Gear Tooth Sensor (GTS) - does indicate direction
 
i just wanted to clear up a misconception, the GTS 2007 does indeed indicate the direction but in a manor different than the 2006.

reading the datasheet for the sensor,

http://www.allegromicro.com/datafile/0642.pdf

we see on page 10 that if the gear rotates past the sensor in a 'pin 1 to pin 4' direction, then the output produces a square wave pattern, about 50% duty cycle.

but

if the same wheel rotates past the same sensor the other direction, now pin 4 to pin 1, that same square wave pattern is produced BUT the signal is inverted!

now... who wants to provide the code for this :p

slloyd

Bomberofdoom 30-01-2007 05:11

Re: Gear Tooth Sensor
 
From what I understood from our mentor, the GTS has 4 holes to insert 4 certain screws that are supposed to "tick" with the gear teeth. Those screws are to be, as you say, .5 to 2.7 mm from the certain geartooth?
And another thing, Kevin mentioned this illustration in his Encodr FAQ:
http://kevin.org/frc/encoder/encoder_isr_latency.pdf
What is this illustration about?
And even furthermore, why are there 6 encoder counts in Kevin's Encoder code(we did understand that the first 2 are to calculate velocity of the gear teeth, the 3rd and 4th for the positioning[in relation to the begining point in each intialization of the RC and everything])?
And could someone please send an exact illustration how to connect the GTS to the geer tooth or a picture of a team's GTS connection?

Alan Anderson 30-01-2007 08:45

Re: Gear Tooth Sensor
 
Quote:

Originally Posted by Bomberofdoom (Post 568018)
From what I understood from our mentor, the GTS has 4 holes to insert 4 certain screws that are supposed to "tick" with the gear teeth.

You understand incorrectly. Have you ever seen the GTS board? Please find it and get familiar with it. Many of your questions can be answered by simply looking at it.

The GTS board has two holes. Those holes are just for mounting the board in place. The actual sensor part is a black block at the edge of the board. Its face should be placed a millimeter or so from the teeth of a rotating steel gear. Nothing on the board touches the gear. It senses the passage of teeth by detecting changes in the magnetic field around the sensor.

Bomberofdoom 30-01-2007 09:42

Re: Gear Tooth Sensor
 
OH, SWEET!!!:D :cool:
So could you answer my other questions related to Kevin's Encoder code?


All times are GMT -5. The time now is 20:48.

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