![]() |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
Quote:
|
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
Guess I'll figure out our lowest speed tonight and our loop time and determine the lowest count encoder we can use. |
Re: High speed encoder with slotted / flat end... can't find one.
In terms of precision and how wpilib implements them, are getRate and getPeriod comparable?
|
Re: High speed encoder with slotted / flat end... can't find one.
You can configure getRate to tell the FPGA to average a certain number of samples - This is NOT done in the Get Encoder VI, but in a different VI (Counter Set Averaging). You can also set the maximum time between pulses before the counter declares the encoder to be stopped. I believe it sets the time to 0 in that case, which the VI that reads the FPGA register then uses to determine the "Stopped" boolean output, but I don't have the VI in front of me.
We set it to 12 (using a hand made 4-line encoder) and there was very little if any noise. We don't even filter the output and it looks very clean. My current laptop doesn't have WPIlib on it, so I can't read the exact documentation. On a semi-related note, make sure to use Up/Down mode for the counter, and not Semi-Period mode. Semi-Period mode measures the time of either the logical high or logical low pulse (not the time between rising or falling edges), as to read a sensor which outputs a PWM signal, so differences between black and white line size will cause measurement errors in Semi-Period mode (I know the documentation conflicts on this, I have observed this behavior and know it to be true). Edit: All of this applies to LabVIEW. I have not read through any of the other WPIlib's. |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
Code:
/** |
Re: High speed encoder with slotted / flat end... can't find one.
If using getPeriod or getRate, would the optimal precision be the smallest amount that still guarantees a new data point per cycle of the control loop? Or is this difference likely negligible when compared to other errors in the system?
|
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
|
Re: High speed encoder with slotted / flat end... can't find one.
Regardless what method you use the read the encoder, it should be mounted so that free play between the encoder and the flywheel is minimized.
|
Re: High speed encoder with slotted / flat end... can't find one.
5 Attachment(s)
Quote:
|
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
Ether - the method you described of calculating our own rate is the own we switched to when we threw out the getrate because of noisy returns with our high-count counters. Now that I'm comparing the two I wonder which would be more accurate: a 512 count encoder using our own rate calculation, which will potentially lose accuracy based on when the last count happened, or a low encoder count method using the FPGA... how precise is the FPGA's internal timer? |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
There are two (Actually three, only two are exposed) sets of Encoder VI's in LabVIEW: -Encoder (what most people use for Encoders, can be set to 1x,2x,4x decoding, set number of distance per count, etc.) -Counter (what Encoder internally uses for 1x or 2x encoding, can be set in many more ways than Encoder, can set averaging) -There is another module which is not exposed which handles Encoder 4x decoding, it is like Counter but uses a different set of FPGA modules. The FPGA has 8 Counter and 4 Encoder4x modules which can be used. Counter can do 1x or 2x quadrature or single wire, as well as Gear Tooth and PWM input handling. Encoder4x can do 4x quadrature decoding. I have been talking about Counter as the Encoder VI's, since we use Counters directly for our shooter controller. |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
" and set a max and minimum that limits the amount of change from reading to reading " The kalman limits the amount of change from reading to reading when noise is introduced. I looked at the labview's definition of coerce and it looks like it is more like the priority averager I showed earlier... from what I can tell. (I do not use labview, so these terms are unfamiliar to me). |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
well that's the question... what exactly did you use? We used GetDistance() which is virtually GetRaw(). I did not see the need for critical sections, so I'd be curious to see how you did this. |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
|
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
And we use WindRiver... so now I'm wondering if we really did get some averaging features in the WindRiver builds. |
| All times are GMT -5. The time now is 05:55. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi