|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||||
|
|||||
|
Re: pic: Encoder Graph
No not yet that seems to be the popular suggestion to fix this problem.
how would I go about sampling? I know I would need to pull the raw value. Do I store an initial value and then just add to it then divide it by my time? |
|
#17
|
||||
|
||||
|
Re: pic: Encoder Graph
Quote:
*See posts 23, 24, & 26 of this thread. Last edited by Ether : 30-01-2012 at 08:43. |
|
#18
|
|||
|
|||
|
Re: pic: Encoder Graph
I ran a quick test as well (not graphing the data or anything, just dumping it to the standard output) and found a similar amount of variation. I was using whatever WPILibJ defaults to for encoder decoding (1X? 2X? 4X?).
For what I'm writing, however, manual differentiation (to those who don't know what this means, it's the method Ether wrote in the last post) is easier to implement and completely effective. |
|
#19
|
|||||
|
|||||
|
Re: pic: Encoder Graph
Awesome, thanks this should really help out thanks for anyone who has been testing this along with me.
|
|
#20
|
||||
|
||||
|
Re: pic: Encoder Graph
Just so everyone knows, from the US Digital website, the length of the on pulse for each channel in phase degrees is 180 +/- 16, and the quadrature delay between channels can be 90 +/- 12 degrees for the E4P encoder. If you're in 4x mode and timing the gaps between transitions to get the rate, the data that you got is what I'd expect it to look like based on the specifications!
|
|
#21
|
||||
|
||||
|
Re: pic: Encoder Graph
Quote:
|
|
#22
|
||||||
|
||||||
|
Re: pic: Encoder Graph
That is my understanding, although I haven't seen it documented. If it's 4x, it divides by the the time for the next edge on the opposite input. In 1x, it divides by the time for the same edge on the same input.
|
|
#23
|
||||
|
||||
|
Re: pic: Encoder Graph
Quote:
|
|
#24
|
|||||
|
|||||
|
Re: pic: Encoder Graph
Is it me, or does that seem like an awful lot of pulses per revolution for just controlling its speed. I'd imagine 1/1000 of that data would be more than enough. Or?
|
|
#25
|
||||
|
||||
|
Re: pic: Encoder Graph
Quote:
1440/4 = 360 so it seems like he's running a 360 encoder at 4x. Even at 60rpm that's 29 pulses every 20ms. |
|
#26
|
|||||
|
|||||
|
Re: pic: Encoder Graph
This code gave me a VERY constant RATE on my graph.
Code:
public void getSpeed(){
samples[counter] = Shooter_En.getRaw();
counter++;
Shooter_En.reset();
if(samples[9] > 0){
counter = 0;
for(int i = 0; i <= 9; i++){
sum = sum + samples[i];
}
AVG = sum / 10;
Rate = AVG / 0.48;
sum = 0;
}
}
|
|
#27
|
||||
|
||||
|
Re: pic: Encoder Graph
Quote:
http://www.chiefdelphi.com/forums/sh...9&postcount=27 http://www.chiefdelphi.com/forums/sh...6&postcount=29 |
|
#28
|
||||
|
||||
|
Re: pic: Encoder Graph
What difference does it make? Isn't is just a counter in the FPGA incrementing? For a circuit like that, this rate is nothing. Am I missing something?
|
|
#29
|
||||
|
||||
|
Re: pic: Encoder Graph
Quote:
If it's on a wheel spinning at 5000rpm (like to shooter wheel), then that's 120,000 pulses/sec. cRIO: https://decibel.ni.com/content/message/12523 |
|
#30
|
||||
|
||||
|
Re: pic: Encoder Graph
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|