|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: Encoder rate noise
Look at the datasheet for the tolerance specs on symmetry and quadrature delay for this encoder. These also affect the max speed the FPGA can handle. Using 4X decoding with no sampling is likely to be very noisy, given the above-mentioned tolerances on symmetry and quadrature. Free play between the encoder shaft and whatever it engages can exacerbate the noise, especially if using 4X decoding with no sampling. |
|
#17
|
||||||
|
||||||
|
Re: Encoder rate noise
Quote:
1x decoding helps reduce noise beyond just reducing counts to within the limit of the FPGA. It also allows additional digital samples between each count, effectively acting like averaging 4 samples at 4x. It also ignores manufacturing tolerances between the different signals, like Ether mentioned. For the S4 encoder, B lags A by 90 degress +/- 60 degrees (max). |
|
#18
|
||||||
|
||||||
|
Re: Encoder rate noise
Quote:
|
|
#19
|
||||
|
||||
|
Re: Encoder rate noise
Quote:
|
|
#20
|
||||
|
||||
|
Re: Encoder rate noise
Quote:
Last edited by Aren Siekmeier : 18-06-2014 at 16:16. |
|
#21
|
||||
|
||||
|
Re: Encoder rate noise
Quote:
|
|
#22
|
||||||
|
||||||
|
Re: Encoder rate noise
2x uses the rising and falling pulse of channel A (since those are 180 degrees apart).
Last edited by Joe Ross : 18-06-2014 at 16:49. |
|
#23
|
||||||
|
||||||
|
Re: Encoder rate noise
Quote:
|
|
#24
|
||||
|
||||
|
Re: Encoder rate noise
thanks you very much for all of your suggestions. I put the config timer in the begin file and it cleaned up a lot of the noise. what number of samples do you normal avareage
|
|
#25
|
|||||
|
|||||
|
Re: Encoder rate noise
I would still like to know what you refer to as "noise".
|
|
#26
|
||||
|
||||
|
Re: Encoder rate noise
We used a Low Pass filter of 20% to reduce the noise of our drive encoder rates. I've linked to the code below. Key note: The Low Pass filter code I linked needs to be executed as a preallocated clone reentrant because data is stored for more than 1 iteration. Go to vi properties>execution for this setting. You can tune LPFilt to whatever works best.
Context: http://puu.sh/9ADYL/292687bb80.png LPFilt.vi: http://puu.sh/9ADVq/5b0cc41731.png Last edited by Iaquinto.Joe : 19-06-2014 at 11:58. Reason: spelling error |
|
#27
|
|||
|
|||
|
Re: Encoder rate noise
Quote:
Fundamentally, the 1x vs 4x decoding only affects the amount of averaging you can do (by essentially being an average of 4 samples). It also affects how much position resolution you have if you care about that (but exposes you to mechanical inaccuracy as described above). Another difference is simply that there are 12 quadrature decoders in the FPGA... 8 counters (capable of 1x and 2x decoding) and 4 dedicated 4x quadrature decoding units. Bottom line, the FPGA still has to "see" all 4 edges in sequence no matter what the decoding scheme. Of course if you are running anywhere near the digital I/O sampling rate, then the FPGA's built-in rate calculations are so noisy that they are practically useless. In this situation I recommend that you calculate the rate by reading the number of counts that changed in a fixed time period. This will be far more accurate at these high speeds. You can very accurately get the counts in a fixed time period by using the DMA feature of the FPGA to send the encoder count value at exact intervals measured by the FPGA. Last edited by Joe Hershberger : 19-06-2014 at 13:13. |
|
#28
|
||||
|
||||
|
Re: Encoder rate noise
Quote:
Quote:
Quote:
Last edited by Ether : 19-06-2014 at 13:43. |
|
#29
|
|||
|
|||
|
Re: Encoder rate noise
Quote:
Quote:
Quote:
Not that I'm aware of. I don't even know that DMA was implemented at the API level in WPILib for C++ and Java. |
|
#30
|
||||
|
||||
|
Re: Encoder rate noise
Quote:
http://www.chiefdelphi.com/forums/sh...34&postcount=7 Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|