![]() |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
Quote:
Cheers, -Joe |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
The FPGA does not like to divide without using up a bunch of gates, where and the RT CPU with an FPU has no problem doing this. This is an optimization where all the addition and synchronization is done in hardware where it needs to be done, but the divide operation to get the actual average period is pushed to the driver. If you want "Method 1", you have to do it the way Ken Streeter described. If you want "Method 2", you must use the FPGA. Cheers, -Joe |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
Quote:
Quote:
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
Similarly, with a 250 CPR sensor such as 1519 used in 2012, our computed RPM values are discretized at units of 12RPM. Measuring wheel speed to the nearest multiple of 12RPM was fine for our wheel shooter last year. Measuring to the nearest 375RPM might be troublesome. |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
|
Re: Best way to measure period between pulses? Counters and FPGA
1 Attachment(s)
Quote:
How is this implemented under the hood in FPGA? Is there a ring buffer in the FPGA which the FPGA populates with the 6.525us_resolution_timestamp for each rising edge it detects (assuming it's not in semi-period mode), and then when requested retrieves the elapsed time between the N+1 most recent samples in the ring (which the cRIO CPU then divides by N)? Quote:
EDIT: @all: I attached a small Excel app that computes the RPM jitter caused by the 6.525us timing resolution of the edge detections. There will be additional jitter due to manufacturing tolerances in the physical locations of the edges in the sensor, but I've not included those here. Note how large the jitter is with a 360 PPR sensor at 5000 RPM with averaging set to 1. If you set the averaging to 120 (1/3 revolution) you can reduce the jitter dramatically, at the cost of some phase lag in the signal. If you make a 1 PPR sensor with averaging set to 1 you'll be able to get an updated reading every 12ms at 5000 RPM with very low jitter. |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
The I/O is 6.525 us from sample to sample. The timer used has a 1 us resolution. So the actual resolution is 6..7 us. However, the error is not cumulative across the average. Regardless of the number of samples averaged, the error is less than 7.525 us. Quote:
Cheers, -Joe |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
Our 2012 robot (with a 4-line handmade aluminum and gaffers tape disc) averaged 12 samples (three whole rotations) to get a perfect signal with ~2.5rpm minimum step. If I set the graph to autosize I could see the controller oscillate between exactly one step above or below the target speed, when steady state. |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
It's not in the 2012 C++ WPILib source rev3111 timer.cpp |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
Quote:
Cheers, -Joe |
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
|
| All times are GMT -5. The time now is 21:45. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi