|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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;
}
|
|
#3
|
||||
|
||||
|
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;
}
|
|
#4
|
||||
|
||||
|
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
|
|
#5
|
|||||
|
|||||
|
Re: GTS Code
Quote:
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 |
|
#6
|
||||
|
||||
|
Re: GTS Code
Quote:
Thanks for the input, if you have any other ideas that might help us, we would love to hear them. ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |