|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Determining pulse width for the GTS?
im pretty sure that this is a fairly simple topic... but i cant figure it out.
What i am looking at is Kevin's encoder code and trying to determine the interrupt routines i would need to measure a pulse width from the Gear Tooth Sensor. This is kind of important because i need to know direction, and looking at the specs for the GTS i can see that a CW tick has a pulse width of 45 us, and CCW has 90 us. I know how i would detect a tick, but how would i detect the pulse width? EDIT: some new realizations by me tell me that the PWM pins can be configured as inputs for measuring signals like this... Last edited by Uberbots : 27-01-2007 at 16:34. |
|
#2
|
||||
|
||||
|
Re: Determining pulse width for the GTS?
Billy,
Use an interrupt pin that interrupts on both rising and falling edges and read a timer (like Timer 3) to measure time. Hint: This problem is exactly the same as using an ultrasonic transducer... There have been a lot of code fragments posted about using that device in the past. Regards, Mike |
|
#3
|
|||||
|
|||||
|
Re: Determining pulse width for the GTS?
Sorry, that was last year. This year's Gear Tooth Sensor uses a different Allegro part and doesn't give the direction information.
|
|
#4
|
||||
|
||||
|
Re: Determining pulse width for the GTS?
@Alan Anderson:
I know that... but i am holding the 2006 sensor in my hand right now. |
|
#5
|
||||
|
||||
|
Re: Determining pulse width for the GTS?
Forgive me if I'm telling you things you already know, but the 2006 GTS is not legal for use in competition this year. If you're just doing this for your own purposes, what Mike Betts said is correct. You attach the GTS to an interrupt, and then use a software timer to measure the time between the rising and falling edges of the pulses.
|
|
#6
|
||||
|
||||
|
Re: Determining pulse width for the GTS?
Quote:
Quote:
-Kevin |
|
#7
|
||||
|
||||
|
Re: Determining pulse width for the GTS?
what is the use of the GTS if it cant return direction?
oh well... either way we determined that it wasn't worth trying to use these sensors so we have some encoders arriving tomorrow... which should help a lot. The GTS idea was a half-thought-out idea for determining the angle of an arm, but after some thought we determined 6 degree precision wasn't enough. Thanks for the help, though |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How the GTS works? | Bomberofdoom | Programming | 6 | 25-01-2007 21:46 |
| Width of KOP U-brackets for frame? | tjanson | Technical Discussion | 6 | 23-12-2006 19:22 |
| Measuring a Pulse Width | MikeDubreuil | Programming | 22 | 21-07-2005 10:22 |
| Width of the Ball Holders | stuy694 | Rules/Strategy | 2 | 10-01-2004 18:11 |
| Width of the Ball Release | Jeff Waegelin | General Forum | 1 | 10-01-2004 17:02 |