Digital rotary encoder

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi,

I'm putting together a pre-amp and would like to build the volume- and balance-control with a digital controlled potentiometer.
The plan is:
A digital optical encoder is used to provide an Atmel µ-controller with input. I found a nice one, named "Grayhill 62AD11-02-020C".
The Atmel in his place sends data to a PGA2311 (digital controlled analog pot).
datasheet Grayhill series62

Has anyone ever build something alike? Any tips, warnigs, alternatives?

Thanks for the input.
 
1k is a typical number for flash, 1 mil. for EEPROM. At least with the pic its nonsense to write the balance information into flash - with most PICs not possible i think.

As you see in my code, i don´t use balance (but its not the big problem to make code for this funktion), but i write the volume setting to the EEPROM, so the chip remembers when powered up next time the old volume setting. This is writen every time the user changed the volume and then leave it unchanged a moment. I did not reach the million until now...
 
Control question. Just out of the blue, instead of using a rotary encoder which has somewhat a weird feel to it (I'm referencing to the non stop relative action, and also to the non linearity of the encoder after a year or two of abuse), why not use a log pot with one of the A/D Converter pin of the microcontroller. Something like the ATmega16. This would have the advantage of having a good tracking, very nice sound control through digital pots and better than average feel. The pot only needs to be fed 5V and the microcontroller will convert the value between 0 at 0V (pot full ccw) and 1024 at 5V (pot full cw). Since the PGA only requires 8 bits, you could always dump the two least significant bits and obtain a straight value from 0 to 256.

For an even better volume control, you could always unse a linear pot and calculate the log value with a true log function in the microcontroller...

As for balance and other controls, you could use that rotary encoder on a separate line. This would allow the volume to be adjusted anytime.

I'm not even close to starting on my preamp which will have this idea implemented (must finish the speakers, the gainclone and all those other projects first) but If someone has ideas in this general direction that would be interesting. (not trying to hijack your thread rho, just trying to pitch ideas in)

Hope this helps!
Sébastien
 
and also to the non linearity of the encoder after a year or two of abuse
????????????????????????

do we talk about the same kind of device?

I started using a MC and no ADC anymore because of the disadvantages of pot+ADC. The first volume control i made with ADC0804 and relais like in alephp1.0

The disadvantage is the unstable ADC, what makes the volume change at the lower bits. Also a pot is sensitive to vibration - very important in case you play at real volume levels. Also its possible to tune volume with very high resolution, as you have you dB range one 2800° instead of 270° for a normal pot.

Also there is no need for motor pot in case you implement a remote control with a incremental encoder.
 
As I mentioned in my previous post, I've not actually done it, I'm merely suggesting it. I searched and did not find any similar solution on the web so I figured there might be something wrong with it or nobody ever considered it a good idea.

The non linearity I experience are from a Klipsh Pro Media 5.1 Control pod. If you turn the volume too fast or too slowly, it will behave very weirdly. Sometimes, I hover around 20 and want to get it to 25 and end up at 50+ in a fraction of second and back to 0 the next... anyway, I find it suboptimal.

For the vibrations, if we simply put a heavier button on the shaft, it should reduce the problem. Also you could lower the refresh rate of the A/D Converter. If it takes a read every 50ms or so, vibrations should not be recorded. By dumping the two lower bits, you could minimize the vibration effects also.

The remote control point is valid though... with the rotary encoder, it is easier to implement. As for precision, this is dependant on your needs, I don't need more than these 300d, but I reckon it could be useful. Although you're still limited with the 256 steps of the digital pot... this is less than 1 per degree of rotation...

Sébastien
 
The non linearity I experience are from a Klipsh Pro Media 5.1 Control pod. If you turn the volume too fast or too slowly, it will behave very weirdly. Sometimes, I hover around 20 and want to get it to 25 and end up at 50+ in a fraction of second and back to 0 the next... anyway, I find it suboptimal.

software problem. The software needs to sort out errors coming from the encoder. It all depends on how long you optimize your firmware to be stable in extrem situation like fast turns at encoder. I did not know Klipsch has worse firmware coders than me...

By dumping the two lower bits, you could minimize the vibration effects also.

Take a look at the alephp 1.0 manual - 2 LSB are dumped. But 6 bit resolution is not really enough (for me) and the 3rd isn´stable everytime also... Ok you can live with this. I desiced to use the 8 Bit relays version as it tastes best for me - at the moment. http://home.tu-clausthal.de/~tpa/relais/index.html

This is also the version i recive much more emails and requests for preprogrammed MCs...
 
software problem. The software needs to sort out errors coming from the encoder. It all depends on how long you optimize your firmware to be stable in extrem situation like fast turns at encoder. I did not know Klipsch has worse firmware coders than me...

Well you know where to look for your next job :D

But 6 bit resolution is not really enough (for me) and the 3rd isn´stable everytime also...

Actually the atmel offers 10 bit A/D so I was implying a loss of 2 bits so to get an 8 bit signal... clearly dropping to 6 bits might be a bit far fetched.

There are plenty - Apox, some people in this board build VCs - every modern car radio i know - www.schuro.de - http://www.mhennessy.f9.co.uk/preamp/ - older PGA threads like http://www.diyaudio.com/forums/show...?threadid=10817

I meant a potentiometer control... all those use rotary encoders if I'm not mistaken.

I would order from you but then again, I'm a DIYer so, sorry about the lost business, I really hold to the point of doing it myself.

Thanks for the reply!
Sébastien
 
I meant a potentiometer control... all those use rotary encoders if I'm not mistaken.
sorry, so i missunderstood you. I thought reverse way.

I would order from you but then again, I'm a DIYer so, sorry about the lost business, I really hold to the point of doing it myself.

Its no business for me. I don´t earn money with this. The code is published and everyone is free to use it. For those DIYers who don´t have acess to a programmer, i offer to send them programmed chips - for what the chip costs me + all shipping costs and envelope, international letter 10€ für one PIC.

I don´t sell the other parts, they are cheap at you local dealer. Will be not more than additional a PGA free sample and < 10€ parts, or little more for the realys version as 8 or 16 relays do cost some money (about 2€ each at schuro)

In fact i only made this project because i try to diy as much as possible and the Apox was to expensive and complex to my taste.

Also everyone is welcome to help at the next code revision.
 
till said:
1k is a typical number for flash, 1 mil. for EEPROM. At least with the pic its nonsense to write the balance information into flash - with most PICs not possible i think.

As you see in my code, i don´t use balance (but its not the big problem to make code for this funktion), but i write the volume setting to the EEPROM, so the chip remembers when powered up next time the old volume setting. This is writen every time the user changed the volume and then leave it unchanged a moment. I did not reach the million until now...


Cool. Knowing I don't fiddle with the balance controls that much, there wouldn't be any problem writing the settings into the E².
 
I don't have that much time to work on the project for the next couple of weeks. But it sure is nice to know the idea behind it works well and should be no real problem to implement.

Thanks for all the info. :up:
If you feel you have more usefull things to tell about this: Keep posting.:)
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.