Electronics > Projects, Designs, and Technical Stuff
Need a high-quality quadrature encoder
<< < (3/3)
SiliconWizard:
In my implementation, a state change of each of the A/B output raises an interrupt. The debouncing is hardware only (RC filters).
There are several ways of decoding a rotary encoder though (typically x1, x2, x4). See there: https://tutorial.cytron.io/2012/01/17/quadrature-encoder/

I generally use the x4 decoding, which probably makes it a lot more sensitive to mechanical imperfections. I'm pretty sure the problems I ran into were not just contact bouncing, which were properly taken care of with the hardware filtering from what I saw back then.

The decoding mode to select would depend on the native number of pulses per rotation of the encoder and the actual number you're requiring.
For encoders with detents, maybe one should stick to the x1 decoding mode.


joeqsmith:
I've use a few parts from BEI.   
http://www.beisensors.com/index.html

I have a lower cost plastic one, model E203, that uses ball bearings.  It's very smooth.  I'm not sure if they offer it anymore but there is always eBay. 
https://www.ebay.com/itm/BEI-Optical-Encoder-E203-500-10-/172691376977
Kjelt:

--- Quote from: cncjerry on October 28, 2018, 06:36:07 am ---I'm trying to avoid a big complicated mounting. I overbuild everything since I have all that CNC equipment.  This is for my RC-28 project, which since it is a fake, I call the FC-28. 

I coded a cool routine using two pins, two interrupts and one Int routjne for the step and direction pulses and used both the high going and low going edges of both phase lines.  Works so much better than what I've used on arduinos in the past.  I had a hard time finding quadrature encoder drivers for the stm32f4 boards that use the HAL drivers.  As to detents, this routine is so fast you can see the detents in the attached PC running RS-BA1 software.  I ordered one of the $15 Chinese encoders to test.  Can't lose at that price. If that doesn't work i think I will get a US Digital as they look really well made.

Thanks.

PS if anyone wants my quadrature code for the stm32F4 board using HAL send me a PM.

Jerry

--- End quote ---
Maybe I am misinterpreting your post but the STM32F microcontrollers have a hardware quadrature decoder in their timer peripheral  ;)
Navigation
Message Index
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod