Go to Post How many FIRSTers would quit if they found it was bad for them? I think most FIRSTaholics are thirteen steppers ;) - phrontist [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 06-02-2008, 21:19
windell747 windell747 is offline
Registered User
FRC #2477
Team Role: Mentor
 
Join Date: Jan 2008
Rookie Year: 2001
Location: Hawaii
Posts: 158
windell747 will become famous soon enoughwindell747 will become famous soon enough
GTS Code

Hi, I'm looking for some sample GTS code that uses interrupts to keep count of teeth. I know that Kevin has posted some encoder code that keeps track of the quadrature for forward and backward directions, however I would like to go the simpler route and use the GTS. Any assistance would be apprecated!

Thanks,
windell
  #2   Spotlight this post!  
Unread 06-02-2008, 22:13
usbcd36's Avatar
usbcd36 usbcd36 is offline
Registered User
AKA: "DOS"
FRC #2399 (The Fighting Unicorns)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Solon, OH
Posts: 151
usbcd36 is a jewel in the roughusbcd36 is a jewel in the roughusbcd36 is a jewel in the rough
Re: GTS Code

Kevin's code can be easily modified to use simple gear tooth sensors instead of quadrature encoders. All you need to do is open the encoder.c file and remove the code that uses the second phase.

You'll probably be using two sensors, so you need to do this to both. Find the functions in encoder.c called Encoder_n_Int_Handler, where n stands for the digital port you're using for that sensor. Modify it to look like so:

Code:
void Encoder_n_Int_Handler(void)
{
		Encoder_n_Count += ENCODER_n_TICK_DELTA;
}
Should be fairly simple to do this.
  #3   Spotlight this post!  
Unread 07-02-2008, 00:00
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,381
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: GTS Code

Here is another alternative to what usbcd36 said. We are not using quadrature encoders with our drive system but we are using a gear tooth sensor. The following code is what we used for one side to determine if we need to increment or decrement the counter.
Code:
if(pwm13 < 118)   
	{
		Encoder_3_Count -= ENCODER_3_TICK_DELTA;
	}
	else if (pwm13 > 136)
	{
		Encoder_3_Count += ENCODER_3_TICK_DELTA;
	}
What we are doing is looking at the PWM value for the drive on that side and if it is outside of a designated window we will then increment or decrement the counter based on the value of the PWM.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #4   Spotlight this post!  
Unread 07-02-2008, 00:07
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 325
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: GTS Code

One problem you are going to run into with that is if you are using your speed controllers with coasting then when you cut power to the motors your wheels will turn, but the values will not go up or down
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
  #5   Spotlight this post!  
Unread 07-02-2008, 00:09
Gamer930's Avatar
Gamer930 Gamer930 is offline
Team 930 and 171 Alumni
AKA: Justin
no team
Team Role: Alumni
 
Join Date: Mar 2002
Rookie Year: 2002
Location: New Berlin, WI
Posts: 388
Gamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to beholdGamer930 is a splendid one to behold
Re: GTS Code

Quote:
Originally Posted by wt200999 View Post
One problem you are going to run into with that is if you are using your speed controllers with coasting then when you cut power to the motors your wheels will turn, but the values will not go up
?? Totally incorrect information ?? (error in your code)

windell747 http://www.chiefdelphi.com/forums/sh...ad.php?t=62915 if you read that I posted my GTS code. . . . Then I posted how to fix the code I posted. . . With some minor changes that could be working for you guys also
__________________
2010 to Present, Scorekeeper/Field Power Volunteer for FRC/FTC/FLL
2005 - 2010, Team 171 College Mentor
2002 - 2005, Team 930 Student
  #6   Spotlight this post!  
Unread 07-02-2008, 00:29
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,381
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: GTS Code

Quote:
Originally Posted by wt200999 View Post
One problem you are going to run into with that is if you are using your speed controllers with coasting then when you cut power to the motors your wheels will turn, but the values will not go up or down
Absolutely correct! That is why we have the coast/break jumpers set to break. We fully understand the possible hole in this code, but without using a quadrature encoder there are very few other alternatives that we can use.
Thanks for the input, if you have any other ideas that might help us, we would love to hear them.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
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
GTS strange behavior iwdu15 Programming 6 01-02-2007 18:46
GTS Counting gnirts Programming 13 21-04-2006 21:15
GTS Code Error (the red light of doom!) Denz Programming 9 07-04-2006 17:39
GTS code Problems caderader Programming 8 13-02-2006 19:23


All times are GMT -5. The time now is 19:15.

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