Thread: GTS Counting
View Single Post
  #10   Spotlight this post!  
Unread 28-02-2006, 21:56
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Re: GTS Counting

Quote:
Originally Posted by Astronouth7303
If you really need direction, I recommend going with quadrature.
The position of the axle makes using a GTS much more practical. Right now for getting direction I use a voting system with the two factors being the PWM output of that motor and the accelerometers. But I don't trust those accels, as by default any code that Kevin would write is better than mine. (I pretty much just ported the gyro code and integrate to speed.)

Quote:
The pulses off the GTS are so minuscule that by the time I got to the bottom of my ISR, the pulse had already passed. Just camera or high-priority interrupts could screw up timing.
Wow! I had no idea that pulses would be that short compared to ISR run time length. I was going to time my ISR using a digital out and a oscilloscope before we shipped but didn't get a chance. How many ASM instructions do you go through from the beginning of the service routine to the end of the GTS handler? You could try putting the test for the GTS interrupt as the first one, although others still firing would have an effect I guess (though I thought that interrupts would usually just wait for others of the same priority to finish and then fire right after them). Would triggering an interrupt on both rising and falling edges of a pulse and recording the amount of time in between work? One pulse is about twice as long as the other.

Quote:
This is using PIC C, not EasyC.
Of course. I don't trust EasyAnything.
__________________
'... who are you, then?'
'I am part of that power which eternally
wills evil and eternally works good.'
Goethe, Faust