| Electronics > Projects, Designs, and Technical Stuff |
| Rotary encoder accuracy - mine doesn't seem very good |
| << < (5/5) |
| exuvo:
In my opinion your encoder is just fine, you are just reading it badly. Don't measure the time between the last two transitions, that is way too sensitive to manufacturing errors. Instead measure the amount of transitions in a given time interval. If you have too few transitions in your time interval for decent speed resolution either increase the measurement period or gear up the encoder to produce more transitions. In my robot I use a hardware quadrature decoder and 16bit counter which i read often enough to ensure it has never moved more than half in either direction, otherwise i would not know if it went up or down between the last read. For me this rate is 50Hz, which gives the average speed over the last 20ms with good resilience to encoder step variability and random EMI events as the measurement includes hundreds of steps. This also gives the ability to count revolutions/distance at the same time. If I need to drive the motors really slowly I instead add the last 5 speed readings of the counter, effectively the last 100ms, and use that value with a differently tuned PID loop. |
| ataradov:
I think people here are talking about different things. The goal of this encoder is to determine the position. It is not an RPM sensor. You can't measure the amount of transitions in a time interval, it just does not make sense. You need to read each edge transition. |
| exuvo:
--- Quote from: Corporate666 on March 06, 2019, 06:56:31 am ---I picked up one of those cheap Chinese incremental rotary encoders from Amazon to use for measuring linear speed... --- End quote --- That sounds very much like it is to be used for speed and not position? Either way my method still works fine for both. Just gear up the encoder so that you are not relying on the relative positions between individual transitions and can instead average out the edge to edge differences over a much larger amount of transitions at which point they are no longer noticable. |
| Navigation |
| Message Index |
| Previous page |