Announcement

Collapse
No announcement yet.

Rotary Encoder question...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • tomzarbo
    replied
    Thank you Neil, for spending your time trying to figure this out. I had hopes for it... but I really don't have much of an understanding of the time and effort it takes to really dig into it. Sorry that I lead everyone on a wild goose chase.

    As an excuse, I think that the product information laid out clearly suggested a volume adjusting device of some type. I really thought it was going to pan out.

    But thanks everyone for the effort.
    TomZ

    Leave a comment:


  • silverD
    replied
    Thanks for digging into this Neil. I tried an encoder and a pot and came to a similar conclusion. Keep us posted on the sound quality.

    Leave a comment:


  • neildavis
    replied
    I verified what Tom wrote about pin 2 of the volume encoder--it is a digital output that jumps between 0 and 3.3V at around a 1 second rate when audio is playing. It also pulses at a faster rate for some settings, and sometimes it is a steady "high". Pin 3 is an input--you can pull it up with a 10K resistor. This is *not* what you would expect for a rotary encoder, although it is consistent with the way the keypad is implemented.

    I tried wiring up a potentiometer to these pins, using pin 3 as an input, and put a push button switch in series to simulate the behavior of the other keys. But nothing changed as a result of applying different voltages to that pin. I also looked through the code for references to PortB_11 and PortB_12, which is how those pins are defined in the code that I have for this chip. These pins are defined in the code but I didn't see any code that did anything interesting in the code--just the definitions and the pins show up again in some commented-out sections.

    I'll try a few other things, but right now I would conclude that the "volume encoder interface" isn't implemented in the code. Given that Pin 1 is ground and that Pin 2 is an output, this connector clearly isn't for a standard rotary encoder. There is a technique for using a rotary encoder with one analog input, but it will take some time to test a circuit like that.

    Next up is set up an A/B test to compare the sound going through the device versus bypassing the device. If there is no obvious degradation of the the sound going through the device, I'll keep playing with it.

    Leave a comment:


  • neildavis
    replied
    Originally posted by silverD View Post
    Has your board come in Neil?
    yes--today.

    I have a lot of rotary encoders--I've used them for a number of different projects. I've written my own assembly code and interrupt handlers and I've used the Ardiuno library for the mechanical rotary encoders, so I know what to expect. But I really doubt that those pads have anything to do with a rotary encoder. I'll take a look at the connector on a scope to get a feel for what it is doing, and report back.

    But I also want to test the audio quality of the board as a preamp. If the audio quality is good, I might go ahead and buy the development tools, since it would be nice to be able to change the code. But all that will take me a while--got a lot of other projects lined up.

    Leave a comment:


  • tomzarbo
    replied
    I have a bunch of different encoders if I can be of any assistance... ham-fisted though I am... 3 kinds from Digikey and one kind from Aliexpress.
    TomZ

    Leave a comment:


  • silverD
    replied
    Has your board come in Neil?

    Leave a comment:


  • silverD
    replied
    Yeah it is odd. The image of the board has the pins numbered so you can cross-reference the two. Same pin count on the chip, but different model number that Tom's. Looks like the board part number might be SSM-Q668. The board I have just says Q668 but in a different location.

    Leave a comment:


  • Millstonemike
    replied
    SilverD's schematic shows the encoder pins as 1-2-3 with 3 being ground. If they're laid out on the module that way - with ground at the end - this may have not been designed for a common rotary encoder. The encoders' common pin is in the center of the three contacts.

    Leave a comment:


  • tomzarbo
    replied
    SilverD,

    I know you were basically trying to get the rotary encoder to work, and probably haven't had a chance to play with the board yet; but I'm curious as to what your feelings are on it's general performance. Noise level, sound quality, etc. I haven't used it an awful lot yet but I did hook it up to PE's 320-606 amp board: https://www.parts-express.com/tda749...2x50w--320-606

    And it was quiet on it's output when in use, or paused, something I can't say for some other preamp boards I've messed with. I'm in the midst of finishing up two Bantam table radios; I had planned on using a small video player version of a larger preamp faceplate unit I used in the last bantam table radio I posted awhile back... too noisy, though. Had to scratch that idea. Out of three of the smaller preamp boards I purchased, only one was noise-free, the other two were really noisy. This preamp board seems to be fairly quiet, though.

    I really hope I'm not sending you guys on a wild goose chase with this thing. I really wanted it to have a nice, functioning interface for a good-old-fashioned volume knob, but like Neil said,
    maybe
    they tried to do it, and it just didn't work out... or it will be on a future upgrade.

    At any rate, I think it's a decent little player with a real remote, and it's pretty small... and most importantly, it's very shallow depth-wise. I think a bit under an inch deep -- which helps with packaging in smaller radio sizes, which I have a few on the back burner.

    Thanks for all the help figuring this out so far guys!

    TomZ

    Leave a comment:


  • neildavis
    replied
    Thanks, that helps a lot! I had overlooked those pins, which are unlabeled in the schematic of the AC6901. You are right--they possibly could be used for a rotary encoder, if there was appropriate software to respond to the pulses. The pins could be probably be pulled up by the micro and debounced by the code. So the potential is there. But the fact that there is no connector provided is suspicious.

    Maybe this interface will be supported in a future revision of the product, or maybe they had trouble implementing the design and gave up. It could also be an interface for some other protocol such as I2C or even analog, like the push buttons. No way to know without more information. I'll look at the pins with a scope when I get my board to see if there are any other clues.

    Chrome will translate the text from the article that silverD posted:
    http://sxemy-podnial.net/aiyima-blue...der-s-zapisyu/. There are some comments about grounding that are worth reading if you intend to use this board.

    Leave a comment:


  • silverD
    replied
    I did confirm the encoder pins connect to pins 41 and 42 on the chip and then I found this:
    Click image for larger version

Name:	schematic.jpg
Views:	373
Size:	528.5 KB
ID:	1428302
    Click image for larger version

Name:	labeled board.jpg
Views:	354
Size:	696.6 KB
ID:	1428303
    I haven't been able to get the encoder to work though...

    Leave a comment:


  • Millstonemike
    replied
    Originally posted by neildavis View Post
    I kind of like rotary controls, but I don't like ones with a cheap feel. Most of the cheap mechanical rotary encoders use plastic shafts and collars that don't turn smoothly. And eventually the contacts on the cheaper units get so much "noise" that the encoder doesn't work very well.

    Some of the better mechanical encoders use metal shafts and collars, but there is usually a lot of "play" in that type of bearing. Put on a large "audiophile knob" and you will notice the play.

    The better rotary encoders use optical shutters and opto-sensors to generate the pulses. They have zero de-bounce issues, so the software is simple and reliable and the performance doesn't deteriorate with age. You can also get the optical encoders with stainless steel shafts and collars that are like fine bearings--easily good for over 1,000,000 rotations. However, the prices for optical encoders start at $15 and you can't get a stainless steel shaft encoder for less than $35. But if you are using one of those oversized knobs and want a "precision feel", those expensive optical rotary encoders are the way to go.
    All good info. Made me think of the 60's/70's Marantz units and their smooth, weighty tuning dials.

    I think Tom (and me) would be happy if we can zero in on the type of encoder & parameters that will work with his board. Ensuing projects will determine the quality of encoder appropriate for that project.

    Leave a comment:


  • neildavis
    replied
    I kind of like rotary controls, but I don't like ones with a cheap feel. Most of the cheap mechanical rotary encoders use plastic shafts and collars that don't turn smoothly. And eventually the contacts on the cheaper units get so much "noise" that the encoder doesn't work very well.

    Some of the better mechanical encoders use metal shafts and collars, but there is usually a lot of "play" in that type of bearing. Put on a large "audiophile knob" and you will notice the play.

    The better rotary encoders use optical shutters and opto-sensors to generate the pulses. They have zero de-bounce issues, so the software is simple and reliable and the performance doesn't deteriorate with age. You can also get the optical encoders with stainless steel shafts and collars that are like fine bearings--easily good for over 1,000,000 rotations. However, the prices for optical encoders start at $15 and you can't get a stainless steel shaft encoder for less than $35. But if you are using one of those oversized knobs and want a "precision feel", those expensive optical rotary encoders are the way to go.

    Leave a comment:


  • Millstonemike
    replied
    Originally posted by tomzarbo View Post
    Indulge me in a "thought experiment" if you will...

    Why don't the ever-wise "They" invent a non-rotary encoder type of rotation button-pressing device?

    Here's my thoughts on how it could be made to work:

    Consider this screwdriver: https://www.parts-express.com/10-in-...tchet--360-136
    pic here:

    Click image for larger version  Name:	Screwdriver friction ratchet.JPG Views:	0 Size:	16.1 KB ID:	1427937

    I have one and it's pretty cool, loads the bits rapid-fire without ever needing to touch the bit, which is a cool trick...

    But the coolest part by far is the ratcheting mechanism. There is no click-click-click like normal ratcheting devices, and when you turn the handle, the mechanism grips instantly, either way, no play whatsoever.

    Bear with me here.....

    Imagine a device, like a Potentiometer or Rotary Encoder, but with two of these instantly-engaging 'ratchet' mechanism like this screwdriver has, one going in each direction...

    So... when you turn clockwise, only the one set up to 'grip' on clockwise motion is turning, and
    makes contact/breaks/makes contact
    repeatedly with contacts inside similar to a rotary encoder, possibly a bit more robust to eliminate 'bounce' or whatever... while the other 'ratchet' mechanism would be spinning free unengaged.

    Then when you turn counter-clockwise, (volume down) the other ratchet mechanism engages and makes contact/breaks/makes contact... just like the other side, but making contact with only the "down volume" lead. That would solve the problem of directivity compared to a 'rotary encoder.'

    I know it's a pipe dream and those who actually know how these things work would be able to shoot holes in my idea, but I can't believe it couldn't be made to work well enough given the engineering minds that exist out there in the world. If a rotary encoder can be had for under $2 (but still needs additional circuitry and software) and a good quality potentiometer $5-$50, a device like this couldn't be made to turn a profit?

    Moot point I know, but the way things are going with touchscreens... knobs, and even buttons are quickly going by the wayside.

    "Long Live Knobs!"

    Anyway, sorry for the rant... now back to our regularly-scheduled thread!

    TomZ
    I think the case here is a new technology to acclimate. Once you have a grip on that, you'll see the simplicity of the encoder system. And with an intelligent chip already on your device, the decoding s/w is free after the initial coding (and that implementation is public knowledge). Additional circuitry is 2 pull up resistors and 2 debouncing caps. Fractions of a penny for SMDs.

    Leave a comment:


  • tomzarbo
    replied
    Indulge me in a "thought experiment" if you will...

    Why don't the ever-wise "They" invent a non-rotary encoder type of rotation button-pressing device?

    Here's my thoughts on how it could be made to work:

    Consider this screwdriver: https://www.parts-express.com/10-in-...tchet--360-136
    pic here:

    Click image for larger version

Name:	Screwdriver friction ratchet.JPG
Views:	510
Size:	16.1 KB
ID:	1427937

    I have one and it's pretty cool, loads the bits rapid-fire without ever needing to touch the bit, which is a cool trick...

    But the coolest part by far is the ratcheting mechanism. There is no click-click-click like normal ratcheting devices, and when you turn the handle, the mechanism grips instantly, either way, no play whatsoever.

    Bear with me here.....

    Imagine a device, like a Potentiometer or Rotary Encoder, but with two of these instantly-engaging 'ratchet' mechanism like this screwdriver has, one going in each direction...

    So... when you turn clockwise, only the one set up to 'grip' on clockwise motion is turning, and
    makes contact/breaks/makes contact
    repeatedly with contacts inside similar to a rotary encoder, possibly a bit more robust to eliminate 'bounce' or whatever... while the other 'ratchet' mechanism would be spinning free unengaged.

    Then when you turn counter-clockwise, (volume down) the other ratchet mechanism engages and makes contact/breaks/makes contact... just like the other side, but making contact with only the "down volume" lead. That would solve the problem of directivity compared to a 'rotary encoder.'

    I know it's a pipe dream and those who actually know how these things work would be able to shoot holes in my idea, but I can't believe it couldn't be made to work well enough given the engineering minds that exist out there in the world. If a rotary encoder can be had for under $2 (but still needs additional circuitry and software) and a good quality potentiometer $5-$50, a device like this couldn't be made to turn a profit?

    Moot point I know, but the way things are going with touchscreens... knobs, and even buttons are quickly going by the wayside.

    "Long Live Knobs!"

    Anyway, sorry for the rant... now back to our regularly-scheduled thread!

    TomZ

    Leave a comment:

Working...
X