|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Best way to measure period between pulses? Counters and FPGA
We have a digital optical sensor, and we want to measure the time between between pulses. Once we get the time, we would then calculate the rotational speed of a wheel.
I thought the Counter class did this for us using the FPGA? Using the GearTooth class (which extends Counter), for some reason we're getting very poor resolution from getPeriod(). GearTooth geartooth = new GearTooth(1); rpm = ??? / geartooth.getPeriod(); Our RPM steps up and down in increments of 375 RPM! You might ask how many pulses per revolution we have, but should that even matter? I was under the impression that the resolution should be dependent on the precision of the timing device? Ironically, we did the math, and the resolution of 375 RPM is what we would get if we polled the Counter every 20ms, and calculated the period by dividing 20ms by the number of pulses received. What am I missing here? Do I need to explicitly set up the Counter to use the FPGA / Timers / etc? Or is this all a ruse, and the Counter doesn't measure time between pulses at all, but polls every 20ms instead? Has anyone successfully calculated a wheel speed by measuring time between pulses using the FPGA via the Counter/GearTooth class? |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|