|
Re: Best way to measure period between pulses? Counters and FPGA
I need to clarify this post...
I am having problems with how the period is being calculated.
There is a BIG difference between these two approaches:
1) Polling the counter every 20ms and counting how many pulses occurred. Period = 20ms / pulses
2) ACTUALLY measuring the time between two pulses using the FPGA. Period = the measured time
Approach 2 results in a much higher resolution in our application, and the documentation in WPILib is unclear when 1 or 2 is used with Counter/GearTooth objects.
From looking at source more, I'm lead to believe approach 2 ONLY happens if you've specifically setup a 4x Encoder object and you can't do approach 2 at all with a Counter/GearTooth object.
Has anyone else seen otherwise?
__________________
In life, what you give, you keep. What you fail to give, you lose forever...
Last edited by Mr. Lim : 27-01-2013 at 18:18.
|