|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#31
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
This post clarified pretty much everything we're seeing. We WERE hitting the 6.525us timing resolution per edge. That corresponded (coincidentally) with the resolution of 375 RPM we were seeing, at our desired speed. There'll be a more detailed post, or even a whitepaper once we've sorted everything out, but we've got a really neat solution together involving SetSemiPeriod(true), a mostly white disc with a single small black sector, and an averaging window that holds about 10ms worth of reads at our slowest speed. |
|
#32
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
|
|
#33
|
|||||
|
|||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
|
|
#34
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
|
|
#35
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
I'd also appreciate any clarification on what you mean by moving down a layer. Other than switching to LabView, is there some other action that can be taken? I thought the FPGA code was handled by the cRIO imaging tool and no modifications to the FPGA programming are allowed. Is this your understanding as well? I am not sure if your comment implies more is available. |
|
#36
|
|||
|
|||
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
In general we try to make everything the same. Quote:
The layer that most people write their code is only in the "User Code" layer. The layer below that is the "WPILib" layer. That is the layer that I mean that you need to edit if you want this functionality in that language. You may even be able to call into the FPGA interface layer directly from your user code if you call it at a time that it won't be overwritten by WPILib. |
|
#37
|
||||||
|
||||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
The things I've found are SPI, DMA, and CAN periodic status. Someone else filed a bug about digital input interrupts only being partially implemented. For SPI, I attached an implementation that works for me in the tracker. |
|
#38
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
Quote:
I'll happily work with the key java developers on the above. |
|
#39
|
||||||
|
||||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
I figure that if there isn't a bug filed, you can't complain about it not being fixed. Last edited by Joe Ross : 01-02-2013 at 13:01. |
|
#40
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Hey, kinda a thread hijack, but this seemed like the best place to ask. We're using a photo-eye based encoder on our team (due to issues mounting traditional shaft encoders) and are having issues with GetPeriod() when we drop below 20 rps where it returns infinity about half of the time, and the correct speed the rest of the time. GetPeriod() apparently returns infinity only if the counter is "stalled". Does anyone know what this means, or if there's a way around it? Overriding GetPeriod doesn't work, as m_counter is private, not protected. I'm guessing that the FPGA has some kind of threshold where if it doesn't see an edge it assumes the wheel has stopped. Is there any way of modifying that, maybe giving it a large tolerance?
|
|
#41
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
The is a function you can use to set what the FPGA sees as stopped. its the setMinRate function.
|
|
#42
|
||||||
|
||||||
|
Re: Best way to measure period between pulses? Counters and FPGA
In the Encoder class it's called setMinRate, in the Counter class it's called setMaxPeriod.
|
|
#43
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Quote:
Quote:
I imagine that we don't want to use the stalled feature at all. Is there a downside to setting the max period to a high value? e.g. 6 seconds period is equivalent to 10 RPM. This would seem safe at any reasonably low speeds. Is there any functionality trade off to setting a high max period? |
|
#44
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
Doesn't that mean it wouldn't be able to tell if the wheel is actually stopped?
|
|
#45
|
||||
|
||||
|
Re: Best way to measure period between pulses? Counters and FPGA
If you look at the code the only reason it has that function is to not have a divide by 0 error. In the get period function, it uses that bool in order to not make it divide by 0.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|