Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Curious about rotary encoder pulses and detents

572 views
Skip to first unread message

Peabody

unread,
Nov 27, 2017, 2:04:59 PM11/27/17
to
Last year I worked on a project which used a Bourns quadrature rotary encoder
from the PEC11R series. It had 18 detents per revolution and 18 pulses per
revolution - just a basic two-switch incremental encoder. At each detent
both switches are open, and between any two detents both switches go through
a full close/open cycle. But I noticed that the data sheet:

http://www.bourns.com/docs/Product-Datasheets/PEC11R.pdf

says that this encoder also comes with 12 and 24 pulses per revolution, and
either of those can have 12 or 24 detents. So you could have 12 pulses with
24 detents, or 24 pulses with 12 detents.

I would like to understand why one would use an encoder where the pulses and
detents don't match. I can see that having fewer pulses than detents would
still allow the full number of effective pulses since you could just process
each half-pulse as an increment or decrement, with perhaps some additional
complexity in the software. But I'm having trouble understanding why you
would use one of those in preference to a 12/12 or 24/24. And I'm
particularly puzzled by the idea of having more full pulses than detents -
two full pulses per detent.

I assume Bourns wouldn't offer these non-matching options if there were no
use for them, so could someone explain what use cases there would be for
them?

Jim Thompson

unread,
Nov 27, 2017, 3:46:07 PM11/27/17
to
Study the _relative_phases_ for CW and CCW rotation. A proper decoder
has two outputs... one pulse per "detent" and a "0" or a "1" depending
on CW or CCW.

...Jim Thompson
--
| James E.Thompson | mens |
| Analog Innovations | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| STV, Queen Creek, AZ 85142 Skype: skypeanalog | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |

It's what you learn, after you know it all, that counts.

John Larkin

unread,
Nov 27, 2017, 4:20:54 PM11/27/17
to
On Mon, 27 Nov 2017 13:04:53 -0600, Peabody
<waybackNO...@yahoo.com> wrote:

>Last year I worked on a project which used a Bourns quadrature rotary encoder
>from the PEC11R series. It had 18 detents per revolution and 18 pulses per
>revolution - just a basic two-switch incremental encoder. At each detent
>both switches are open, and between any two detents both switches go through
>a full close/open cycle. But I noticed that the data sheet:
>
>http://www.bourns.com/docs/Product-Datasheets/PEC11R.pdf
>
>says that this encoder also comes with 12 and 24 pulses per revolution, and
>either of those can have 12 or 24 detents. So you could have 12 pulses with
>24 detents, or 24 pulses with 12 detents.
>
>I would like to understand why one would use an encoder where the pulses and
>detents don't match. I can see that having fewer pulses than detents would
>still allow the full number of effective pulses since you could just process
>each half-pulse as an increment or decrement, with perhaps some additional
>complexity in the software. But I'm having trouble understanding why you
>would use one of those in preference to a 12/12 or 24/24. And I'm
>particularly puzzled by the idea of having more full pulses than detents -
>two full pulses per detent.

Possibly to save power. The pullup/pulldown resistors could be low
values but not use current if both switches are open at detents.




>
>I assume Bourns wouldn't offer these non-matching options if there were no
>use for them, so could someone explain what use cases there would be for
>them?

--

John Larkin Highland Technology, Inc
picosecond timing precision measurement

jlarkin att highlandtechnology dott com
http://www.highlandtechnology.com

Lasse Langwadt Christensen

unread,
Nov 27, 2017, 5:04:40 PM11/27/17
to
a proper encoder has two outputs in quadrature and a simplistic decoder that uses one signal as clock and the other as direction rather that decoding quadrature is why sometimes when you turn a knob it jumps in counts and sometimes i the wrong direction if you don't turn it just right

John Larkin

unread,
Nov 27, 2017, 5:45:46 PM11/27/17
to
A good decode algorithm always gets it right. It can dither one count
at the transitions, as the switch bounces... that's all.

My Tek DPO2024 scope misses about 10% of the knob detents, just
ignores them. Three clicks clockwise then three CCW should get you
back where you started, but often doesn't.

Piece-o-junk. I'll get a Rigol next.

John Larkin

unread,
Nov 27, 2017, 6:10:12 PM11/27/17
to
Rigol has a special on now. Buy the 4-ch 350 MHz scope, and get the
upgrade to 500 MHz and some serial decode stuff for free.

Seems like a sort of always-on special maybe.

Dave Platt

unread,
Nov 27, 2017, 7:20:52 PM11/27/17
to
In article <e35p1dp0bncusv807...@4ax.com>,
John Larkin <jjlarkin@highland_snip_technology.com> wrote:

>A good decode algorithm always gets it right. It can dither one count
>at the transitions, as the switch bounces... that's all.

It's a great application for a simple lookup table.

The approach I've used takes as input the two quadrature bits from the
current sampling, the two from the previous sampling, and one bit of
stored state ("I was going up" or "I was going down"). The output is
one new bit of state to store, and a three-way "increment, decrement,
no change" delta for the accumulator.

With this approach it can dither back and forth across a quadrature
boundary (as frequently as "every sampling time"), without the
accumulator value changing. Only when there are two successive
quadrature transitions in the same direction will the accumulator
change.

Easy to do in even a very simple low-speed microcontroller, or in a
tiny little PLD if anybody's still making those.


Peabody

unread,
Nov 27, 2017, 9:06:56 PM11/27/17
to
Dave Platt says...

> It's a great application for a simple lookup table.

Yes, but I was asking whether there is ever a reason to
select an encoder which has different pulses and detents per
revolution. So far, nobody has mentioned one.

bitrex

unread,
Nov 27, 2017, 9:12:34 PM11/27/17
to
On 11/27/2017 07:20 PM, Dave Platt wrote:

> Easy to do in even a very simple low-speed microcontroller, or in a
> tiny little PLD if anybody's still making those.

These look cool:

<http://www.silego.com/products/greenpak.html>

Peabody

unread,
Nov 27, 2017, 9:17:02 PM11/27/17
to
John Larkin says...

> My Tek DPO2024 scope misses about 10% of the knob
> detents, just ignores them. Three clicks clockwise then
> three CCW should get you back where you started, but
> often doesn't.

> Piece-o-junk. I'll get a Rigol next.

Well if it's any consolation to you, I have the same problem
with my DSO150 Shell scope kit. I figure - if you can get
bad encoder servicing routines for $21, why pay hundreds of
dollars more for the same thing. :-)


bitrex

unread,
Nov 27, 2017, 9:17:26 PM11/27/17
to
I would hope so; for the scopes without digital channels the price jump
from the 2 channel 350MHz model to the 4 channel is wacky.

The DS4032 seems to be the price/performance sweet spot

whit3rd

unread,
Nov 27, 2017, 9:22:04 PM11/27/17
to
On Monday, November 27, 2017 at 4:20:52 PM UTC-8, Dave Platt wrote:
> In article <e35p1dp0bncusv807...@4ax.com>,
> John Larkin <jjlarkin@highland_snip_technology.com> wrote:
>
> >A good decode algorithm always gets it right. It can dither one count
> >at the transitions, as the switch bounces... that's all.
>
> It's a great application for a simple lookup table.

I kinda like decoding it by ... feeding a stepper motor. An old-school
mouse or trackball makes a good remote control for a variety of gotta-make-adjustment
gizmos. Just amplify the outputs and it drives the motor.

John Larkin

unread,
Nov 28, 2017, 1:37:47 PM11/28/17
to
You can usually get the 4-channel 500 MHz scope for very close to $4K.
I just ordered one.
0 new messages