Encoder Frustrations – QSD Receiver

2 May

Click Here to see the project from the beginning

I’m presently using one of those cheapy 20 pulse per rotation mechanical rotary encoders from Ebay.

The good news is that they’re cheap, about $1.00 if you shop around. The bad news is that contact bounce becomes worse as they age. I have enough experience ‘debouncing’ these things, with hardware, with software and even with sequence decoding state-machines to know that they eventually wear out and become problematic in some way. That’s the point I’m at now. Time to look at something better.

Some time ago, I purchased a couple of these 100 PPR optical encoders, also on Ebay. They can be had for around $15 if you shop.

Although the next step planned in the radio evolution is to get the TDA7051A voltage controlled audio amplifier going, retrofitting this encoder could jump to front and center as my frustration with the present unit grows.



2 Responses to “Encoder Frustrations – QSD Receiver”

  1. Hans Summers May 2, 2020 at 8:27 am #


    In my opinion if you’re doing any kind of debounce on rotary encoders, whether hardware or software, you’re doing it wrongly. The problem isn’t the rotary encoder being cheap. They can function reliably for years. The problem is the software approach.

    In 2015 I wrote the code for my VFO kit http://qrp-labs.com/vfo and I tried hardware denounce, software denounce, and various Arduino etc libraries. Nothing worked reliably, and at both fast and slow rotation rates. I realized it’s all wrong and I developed, what I subsequently came to know is called a “state machine”.

    Put simply you have four states of the two quadrature outputs. Call them A B C D for example. In the code if you see a transition from B to C (say), then simply ignore any further transitions between states B and C. Only react to C to D or B to A. This completely ignores any noise at the transitions between B and C. Once you see a new transition, now set that one to be ignored. The result is reliable and has no time constants (hardware resistor/capacitor, or software timers). It works for both fast and slow rotation.

    In my strong opinion there’s nothing wrong with low cost rotary encoders. The only reason to pay big $ is if you want optical for some ultra-demanding long life application; or if you want more events per rotation than simple mechanical types can provide.

    I subsequently used the same technique in other projects too such as the QCX 5W CW transceiver http://qrp-labs.com/qcx and with equal level of success.

    There are code examples of this out there. But actually it’s really easy to write yourself too, even easier than trying to do software debounce!

    73 Hans G0UPL

    • w3jdr May 2, 2020 at 8:56 am #

      Hi Hans…thanks for following and replying.

      Yes, I’m very familiar with the gray-code sequence, lookup tables and other methods for encoder ,’debouncing’, The limitation I’ve encountered is that they can ignore bad codes but they can’t fix it, This becomes especially obvious when spinning the knob quickly…you miss steps. The other problem I have with cheapy encoders is low resolution … 20-30 steps per revolution. If you like the smoothness of 50-100 hz per step, you have to spin like crazy to traverse the band. 100 PPR is just about right. At 100 hz/step, a full revolution is 10 khz…just about right. Any more pulses per revolution makes it difficult for the software to keep pace when spinning fast.

      So, as is frequently the case in engineering, optimization is often a tradeoff between cost and acceptable performance.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Dian Kurniawan - YD1OSC

electronic for better life

N6QW ~ The Ham Genius!

For Ham Radio Experimenters

SolderSmoke Daily News

For Ham Radio Experimenters

%d bloggers like this: