Go to Post If full body suits can be made to fit properly, why do we have so many robots with saggy bumper covers? - GaryVoshol [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-01-2007, 15:56
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
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...
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY

Last edited by Uberbots : 27-01-2007 at 16:34.
  #2   Spotlight this post!  
Unread 27-01-2007, 21:57
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
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
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #3   Spotlight this post!  
Unread 27-01-2007, 22:40
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Determining pulse width for the GTS?

Quote:
Originally Posted by Uberbots View Post
...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.
Sorry, that was last year. This year's Gear Tooth Sensor uses a different Allegro part and doesn't give the direction information.
  #4   Spotlight this post!  
Unread 28-01-2007, 12:47
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
Re: Determining pulse width for the GTS?

@Alan Anderson:
I know that... but i am holding the 2006 sensor in my hand right now.
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
  #5   Spotlight this post!  
Unread 28-01-2007, 13:14
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
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.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #6   Spotlight this post!  
Unread 28-01-2007, 18:11
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Determining pulse width for the GTS?

Quote:
Originally Posted by Uberbots View Post
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?
Well, I have good news and I have bad news. Being a glass half-full kinda guy, good news first: I wrote some code last year to do exactly what you describe. Here's a link: http://kevin.org/frc/gts.zip. The bad news is that capturing both edges of the shorter pulse is pretty hard considering the amount of interrupt latency involved. I suspect that you could modify the code to infer that the shorter pulse occured, you just won't be able to measure it.

Quote:
Originally Posted by Uberbots View Post
EDIT: some new realizations by me tell me that the PWM pins can be configured as inputs for measuring signals like this...
Yeah, CCP capture mode would work well, but unfortuanetly the FRC robot controller has non-defeatable output buffers on those pins. If you have a EDU-RC around, PWM 1 through 4 can be configured as an input and map to CCP pins.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #7   Spotlight this post!  
Unread 28-01-2007, 21:12
Uberbots's Avatar
Uberbots Uberbots is offline
Mad Programmer
AKA: Billy Sisson
FRC #1124 (ÜberBots)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Avon
Posts: 739
Uberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond reputeUberbots has a reputation beyond repute
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
__________________
A few of my favorite numbers:
175 176 177 195 230 558 716 1024 1071 1592 1784 1816
RPI 2012
BREAKAWAY
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 03:56.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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