jgeorge
02-02-2006, 12:36
Hi all,
I am using Grayhill 63K64 because I have a high speed shaft, 2000rpm, and wanted the ball bearing version of encoder. I am running it directly from the encoder to the 2006 RC input (no flip flop to buffer B phase) using two 3' servo cables. I am also using Kevin's latest version of encoder code (BTW, thanks Kevin, it is good stuff). The interrupt stuff is as is. In the slow loop, I read the encoder counts, do a delta between readings to get velocity at 26.2ms rate, and try to make decisions. Everything compiles and counts except.....
Every time I start the RC, I am never sure if the encoder will count a magnitude off by 4 times or not. For example, when measuring the rotation of spinning beam, I sometimes read vel of 16 ticks/loop or 64 ticks/loop for the same PWM setting to the motor. It appears random, possible related to software changes, but I have not isolated it to whether it is due to my changes or inherent in my hardware setup.
What I mean by random is that with one version, but multiple resets, it appears error repeats itself, always 16 or always 64. When I rewrite code and download, it could change but between resets, the new factor sticks. I do not know why main line coding should affect it because counter is in interrupt. Unless it is because I am using printf statement and the serial drivers (Kevin's, not IFI's) is using interrupts and is higher priority than the encoder interrupt and interfering somehow. I am only printing out about 25 chars every 26.2ms at 115K baud.
I also tried reversing the input 1 and input 11 signals, no luck. I tried moving to encoder 3 (pin 3 and 13, no luck). I have not tried short cable.
Any ideas?
Thanks in advance.
Jacob
I am using Grayhill 63K64 because I have a high speed shaft, 2000rpm, and wanted the ball bearing version of encoder. I am running it directly from the encoder to the 2006 RC input (no flip flop to buffer B phase) using two 3' servo cables. I am also using Kevin's latest version of encoder code (BTW, thanks Kevin, it is good stuff). The interrupt stuff is as is. In the slow loop, I read the encoder counts, do a delta between readings to get velocity at 26.2ms rate, and try to make decisions. Everything compiles and counts except.....
Every time I start the RC, I am never sure if the encoder will count a magnitude off by 4 times or not. For example, when measuring the rotation of spinning beam, I sometimes read vel of 16 ticks/loop or 64 ticks/loop for the same PWM setting to the motor. It appears random, possible related to software changes, but I have not isolated it to whether it is due to my changes or inherent in my hardware setup.
What I mean by random is that with one version, but multiple resets, it appears error repeats itself, always 16 or always 64. When I rewrite code and download, it could change but between resets, the new factor sticks. I do not know why main line coding should affect it because counter is in interrupt. Unless it is because I am using printf statement and the serial drivers (Kevin's, not IFI's) is using interrupts and is higher priority than the encoder interrupt and interfering somehow. I am only printing out about 25 chars every 26.2ms at 115K baud.
I also tried reversing the input 1 and input 11 signals, no luck. I tried moving to encoder 3 (pin 3 and 13, no luck). I have not tried short cable.
Any ideas?
Thanks in advance.
Jacob