Need a high-quality quadrature encoder - Page 1
Forum section: electronics / projects

author: cncjerry
author_rank: Unknown
timestamp: October 26, 2018, 07:50:56 pm
content: Can someone recommend a high quality quad encoder for my Icom rotary encoder project? I have one but it has detents. I would like it to have a smooth feel with double shaft supports if available. Something that would be equivalent to the encoder in a high-quality receiver.ThanksJerry

author: dmills
author_rank: Super Contributor
timestamp: October 26, 2018, 08:26:36 pm
content: Bourns do some 128 PPR optical encoders that are quite nice ENA1D-B20-L00128 and the like, and you can do the usual tricks to get to 512 counts per rev.5V supply however, and NOT cheap if you buy new ones.Or there are the Broadcom/Avago/HP HEDS stuff, but you will need to supply the bearings and mounts, does give you the option to use flywheels and preload to taste however.Regards, Dan.

author: cncjerry
author_rank: Unknown
timestamp: October 26, 2018, 08:35:39 pm
content: I see some of the bourns that are up in the $55 range that seem decent as well as the Broadcom. Since I am designing the housing I can always add my own support bearing as well but was trying to avoid that as it needs to sit not high off the table.But you bring up a good point, I remember you can pulse multiply the encoders so I don't need 200cpr.Thanks

author: FrankBuss
author_rank: Unknown
timestamp: October 26, 2018, 10:16:57 pm
content: Quote from: cncjerry on October 26, 2018, 08:35:39 pmHow do you do this?Once I bought one of these:https://www.megatron.de/en/products/optical-encoders-manual/optoelectronic-manual-encoder-spe.htmlIt was ridiculously expensive, EUR 99.10 if you buy one, plus EUR 10.50 shipping, but ridiculously good quality

author: LaserSteve
author_rank: Super Contributor
timestamp: October 27, 2018, 03:37:31 pm
content: Take a look at US Digital.Steve

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 27, 2018, 06:40:03 pm
content: You can safely select this Bourns series:https://www.bourns.com/products/encoders/contacting-encoders/product/ECWwhich has been used in quality lab instruments such as Lecroy.Around $4. You don't need anything fancier really.You're right in willing to avoid those with detents. Detents can give a nice "tactile" feel, but unless you select a very expensive encoder, the number of pulses between each detent can vary (usually by one pulse, sometimes a tad more) which can be very annoying to deal with in practice.

author: FrankBuss
author_rank: Unknown
timestamp: October 27, 2018, 08:32:02 pm
content: Quote from: SiliconWizard on October 27, 2018, 06:40:03 pmI've used cheap ALPS encoders and it is not a problem, if you program the firmware right. Some people use one phase output of the quadrature output for an interrupt and then query the other phase. This will fail. If you query it with a constant interrupt of e.g. 1 kHz and then use a statemachine to count, it doesn't matter how much a contact bounces, as long as not both signals bounces at the same time. I've created an Instructable for it with a video, firmware and detailed description how it works:https://www.instructables.com/id/Using-a-Quadrature-Encoder-with-an-ATtiny-2313-and/The ALPS encoders have additional phase transitions at the idle position, but with the tables of the statemachine it is easy to ignore that.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 27, 2018, 10:35:21 pm
content: I'll take a look at your modified state machine.I've used ALPS encoders before though, can't remember the reference but they were pretty decent, and the problem was almost non-existent with them. Other encoders were a lot more finicky (for instance the cheaper RGB-illuminated EC12xxx ones). I'll see if your approach improves things with them. Thanks.

author: cncjerry
author_rank: Unknown
timestamp: October 28, 2018, 06:36:07 am
content: 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

author: bson
author_rank: Unknown
timestamp: October 29, 2018, 04:02:17 am
content: Quote from: FrankBuss on October 27, 2018, 08:32:02 pmIt works, but the non-interrupting output needs to be debounced in hardware. The interrupting one can be debounced in software.

author: SiliconWizard
author_rank: Super Contributor
timestamp: October 29, 2018, 07:38:50 pm
content: 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.

author: joeqsmith
author_rank: Super Contributor
timestamp: October 30, 2018, 09:49:07 am
content: I've use a few parts from BEI.http://www.beisensors.com/index.htmlI 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

author: Kjelt
author_rank: Super Contributor
timestamp: October 30, 2018, 12:24:23 pm
content: Quote from: cncjerry on October 28, 2018, 06:36:07 amMaybe I am misinterpreting your post but the STM32F microcontrollers have a hardware quadrature decoder in their timer peripheral