Rotary Encoder to Digital Potentiometer matching???
Nov 19, 2008 at 2:38 PM Thread Starter Post #1 of 14

accurate_dB

Banned
Joined
Oct 1, 2008
Posts
74
Likes
0
How do you match rotary encoder specs with a digital potentiometer?

I saw that several encoder manufacturers use somewhat different terminologies for their product. Furthermore the digital encoder
manufacturers use even more different terminologies.

For example:
Panasonic P12418-ND specs
16 pulse per revolution (PPR)
Single Pole Switch (SPST)
32 Detents
Output signal: Phase A and Phase B
Rating: 1mA, 10VDC (at each bit)

Analog Device AD8402AN10-ND specs
8bit Dual channel digital potentiometer
Resistance: 10kOhm
Interface: SPI, 3-wire serial
Taps: 256
Voltage-Supply: 2.7V~5.5V

Would these two match to work together without too much additional parts?


I found another couple of digital potentiometers:
AD5228BUJZ10RL7CT-ND
AD7376


I read about these being used for DIY DS1802.
 
Nov 19, 2008 at 8:34 PM Post #3 of 14
Ok. Please correct me if I'm heading in the wrong direction.

Basically I've read that if the rotary encoder is turned clockwise
then the terminal A (of the encoder) leads terminal B by 90 degrees.
I'll have to assume that for counter clockwise B leads A.
So given the time duration (bounce time) of the push button digital potentiometer, the encoder can be used to set the digital potentiometer
to increment by 1 (clockwise) or decrement by 1 (counterclockwise)
if the encoder period/4 is shorter than the bounce time.

I take 90 degrees to be 360/4 or (encoder period)/4.

Is this correct?
 
Nov 19, 2008 at 8:59 PM Post #4 of 14
AD5228 bounce time is 10ms.

EVE-VCGJL016B at 60 r/min
T1 = 4msec min. (start of rotation to first detent)
T2 = 2.5msec min. (last detent to the next detent)
T3 = 2.5msec min. (last detent to the next detent)
T4 = 2.5msec min. (last detent to the next detent)
T1 through T4 completes 1 cycle.
The above according to the spec sheet from Panasonic at Digikey.

In 1 period 11.5ms, which means... I think that as long as you turn the encoder slow enough the bounce time will expire such that at the next detent the encoder rotation can trigger the next increment.

60 r/min is pretty fast I think.
 
Nov 19, 2008 at 9:11 PM Post #5 of 14
I think I said it backwards.

There is a timing requirement for the encoder to set the digital potentiometer.
I guess the user have to be trained to skip every other detent before the bounce time expires.

So at the right speed of rotation the encoder might work.

Maybe this is more trouble than its worth.
 
Nov 19, 2008 at 9:55 PM Post #6 of 14
I found this somewhere while searching:

"Signals A and B of the rotary encoder pass through a quadrature decoder (LS7084 from LSI Computer Systems, LSI CSI - Design and Production of Full Custom and Standard Integrated Circuits), which translates the phase difference between A and B of the rotary encoder into a compatible output, and , that the AD5220 can accept. The AD5220 from Analog Devices (Analog Devices, Inc.: Converters Amplifiers Processors MEMS A/D Converters Analog to Digital Video Converter Temperature Sensors Analog Device RF Amplifiers Differential Amplifiers Digital Signal Processing Thermal Management D to A Converters Microc) is a 128- step, pushbutton digital potentiometer. It operates with a negative-edge-triggered clock, CLK, and an increment/decrement direction signal, . When B leads A (clockwise), the quadrature decoder provides the AD5220 with a logic-high . When A leads B (counterclockwise), the quadrature decoder provides the AD5220 with a logic-low . The quadrature decoder also produces a clock in synchronism with its output, which also connects directly to the AD5220. You linearly vary the clock's pulse width by adjusting RBIAS."
 
Nov 20, 2008 at 1:14 AM Post #7 of 14
Why don't you use a DS1802? It can take any pushbutton switch or any pulse rotary switch - check out the implementation in the balanced amp in my sig (and numerous other references on the web too!). Wonderful chip, the DS1802.
smily_headphones1.gif
 
Nov 20, 2008 at 3:03 AM Post #8 of 14
I'm not sure how you expect this to work, no digital pot is going to read the phase information directly. The output of the encoder is indeed two square waves at 90 degrees, but I'm not sure how you intend to connect that directly and get the behaviour you want. It might work if you skip over every other position or something, but it'd hardly be reliable or easy to use.

As mentioned you can probably set up some discrete logic or use a quadrature decoder to control a pot with increment/decrement inputs, but most these days are SPI-only.
 
Nov 20, 2008 at 3:24 AM Post #9 of 14
Quote:

Originally Posted by doobooloo /img/forum/go_quote.gif
Why don't you use a DS1802? It can take any pushbutton switch or any pulse rotary switch - check out the implementation in the balanced amp in my sig (and numerous other references on the web too!). Wonderful chip, the DS1802.
smily_headphones1.gif



I do so want to use the DS1802 in my next project (after the DAC I working on) and your project is my inspiration.
 
Nov 20, 2008 at 3:45 PM Post #10 of 14
Thanks for the inputs. I did not find that info in the DS1802 spec sheet the first time around. I'll have to check again.

I did think about the logic circuit that will be needed to interface rotary encoders to push button type digital potentiometers.
I have here the theory:
c: old value A
d: old value B
/c: c bar
/d: d bar
/A: A bar
/B: B bar

The flip flops or 2 bit registers will be edge triggered and asynchronous.
1 register for c, d and 1 register for A, B

clock = (c*/A + /c*A) + (d*/B + /d*B)
Y or push up = (logic 4 Up)
Z or push down = (logic 4 Down)

Rotary clock wise
State | A | B
============
1 | 1 | 0
2 | 1 | 1
3 | 0 | 1
4 | 0 | 0

Rotary counter-clock wise
State | A | B
============
1 | 1 | 0
2 | 0 | 0
3 | 0 | 1
4 | 1 | 1

Y = c/dAB + cd/AB + /cd/A/B + /c/dA/B

Z = c/d/A/B + /c/d/AB + /cdAB + cdA/B

Please help me double check this work.

Regards.

I simplified the logic while thinking about this...

clock = (c xor A) + (d xor B)

Y = (c XnOR B)*(d xor A)
Z = (d XnOR A)*(c xor B)

Thats 1 or gate, 4 xor gates, 4 nand gates.
CD4030B (XOR)
CD4011BE (NAND)

1 or gate can be made from nand gates.
/H nand /J = H + J
H nand 1 = /H
J nand 1 = /J

registers or flipflops
CD4015B

Please check my work.
 
Nov 20, 2008 at 4:26 PM Post #11 of 14
Quote:

Originally Posted by cobaltmute /img/forum/go_quote.gif
I do so want to use the DS1802 in my next project (after the DAC I working on) and your project is my inspiration.


I have some samples of that chip and I like the 'sound' (or lack of problems with sound) when using it.

it needs a switch closure up/down interface and that's all.

my ugly prototype:

2729122577_f3fa479b22_o.jpg


2729122005_80f2955aca_o.jpg



there are rotary encoders that generate pulses in the 'left' and 'right' direction which is exactly what you need for the 1802.

I have not figured out which ones from digikey (etc) are the right ones, but I did see threads about it which had some part # refs in them (but the links were all broken) ;(

don't do the grey code stuff. I think the simpler way is to use 'native' up/down rot encoders. they do exist.

let me know when you find one so I can order one or two, too
smily_headphones1.gif
wink.gif


the chip also needs 'centering' on a DC level (they use a bridge of R's which some people object to). it also 'only' has 2v input range (about) and so you may have to scale audio into the chip and then amp it (expand it) out of it. that kind of annoys me, too (if I'm running pro level audio, I cannot directly use this chip and I have to lower my level and then boost it again; I don't have to do that with *real* pots).

the other thing is that the chip has no memory or ability to save last position. and given that it has no user feedback (leds) to show current position, its kind of a limited chip...
 
Nov 20, 2008 at 10:18 PM Post #12 of 14
It's going to be a month or so until I really start to consider be able to look at using that the chip in something.

As for the lack of memory, that is no worse than using a ALPS pot with switch. They lose their memory every time they are turned off as well.
biggrin.gif


And I have to find it again, but I did have the Digikey part to work with this instead of buttons.
 
Nov 21, 2008 at 12:57 AM Post #13 of 14
Something like these might do the trick, they are available here for what seems a reasonable price.

Not sure about your logic, I may take a look at it at a later time but it's some work to just draw it out so I can make sense of it. The truth table is pretty straightforward, so it shouldn't be hard to figure out. If you have access to an faster clock, the circuit can probably work without the 'old state' registers using feedback instead.
 
Nov 22, 2008 at 6:52 PM Post #14 of 14
So far I found the DS1802 to be most flexible.
DS1802 is already stereo with balancing built in and logarithmic.

Below is the matching set of decoder and digital potentiometers.

For LS7083:
DS1802 (log)
AD5228 (single)
X9571 (single)

For LS7084:
X9C303 (log)(single)

As for the rotary encoder I found the EVE-VCGJL016B (P12418-ND)
to be potential candidate.
 

Users who are viewing this thread

Back
Top