Multiple Encoders

I am doing a project that utilizes multiple rotary encoders. I had repeatibility problems with every solution I found in my online searches that read quadrature directly into the Arduino, even with just one encoder. This was probably due to the rate of the pulses in my particular application.

So I designed an encoder shield that can handle up to 8 encoders simultaneously and the Arduino seems to be able to read and report the counts via serial to the PC in about 2 ms. Anyone else interested in such a thing?

Encoders are simple to deal with, and it takes very little time to detect their rotation: I would guess 20-30 ibstructions max?

2ms is an eternity to read encoders.

I see how I was not clear. I am hardly 'detecting rotation' nor just reading an encoder in 2ms, but doing joint angles on 6DOF articulated arm and forward kinematics to ultimate position in that time. However, if you can get repeatable results with zero dropped pulses (on a 2048-50000 ppr encoder) using any of the 5-6 methods floating around the Arduino forums please let me know. I had pulses dropping out on every method I could find with only one encoder moving at about 256 pulses a second.

50kppr translates to 20us period. Recording that is not difficult, without using input capture.

The issue with multiple encoders is that you can have susscceve pulses coming in. You can lose pulses, or recording the wrong arrival time, without using input capture - for example you run out of input capture channels.

But using pcintx + a running timer, you can easily record many encoders.

I hear you, but empirical testing with the interrupts show lost pulses due to collisions.

It will depend on your design. It is easy to mis-read (isr latency for example on consecutive pulses) but more difficult to miss pulses.

It could be that was it. I attempted every variation of software I could find, but everything lacked repeatabillity.

There is definitely a market for such a shield, I am thinking in the MIDI world but also in robot control or Domotica.

Does the shield already have a name? maybe a contest ?

Do you have pictures of the shield?
a datasheet?
a schema?
sample sketches how it works?

do not forget to register it at - http://shieldlist.org

Multiple encoder interfacing can easy dome with the iC-MD special interface. It include three 16-bit counter channel and application are available here: http://www.ichaus.biz/wp2_simple_measurement.

I am using a similar chip, but not the iC Haus one. I have been bitten by their some-what-quick obsolesce cycle in the past. Their chips are nice though.

So why not take a higher-tech approach?
Use magnets on your moving parts with high resolution magnet sensors such as Austria Micro Systems AS5048A.

Adapter/demo boards:
http://www.ams.com/eng/Support/Design-Resources/Demoboards/Magnetic-Position-Sensors/Magnetic-Rotary-Position-Sensors/AS5048A-DK-AB
http://www.ams.com/eng/Support/Design-Resources/Demoboards/Magnetic-Position-Sensors/Magnetic-Rotary-Position-Sensors/AS5048-DK-ST
http://www.ams.com/eng/Support/Design-Resources/Demoboards/Magnetic-Position-Sensors/Magnetic-Rotary-Position-Sensors/AS5048A-EK-AB-STM1.0

AS5048_1.3[1].pdf (1.2 MB)

First, I am not sure how magnetic is better or higher tech than optical. Second, my current design would work fine with any encoder output including the ones that that manufacturer sells.

willofgod:
First, I am not sure how magnetic is better or higher tech than optical. Second, my current design would work fine with any encoder output including the ones that that manufacturer sells.

It really is a system type problem. Fast encoder handling (no matter optical or magnetic) is best done via interrupts but as the AVR globally disables interrupts while any one ISR is active (including the arduino timer0 used for micros and millis) I think the possibility of missing pulses will always be there depending on the number and speed of the multiple encoders attempting to be supported. The concept of a standalone hardware supported encoder interface shield is a good one for higher performance applications.

Lefty

Exactly. Distributed processing to collect the data, let the main processor know what is going on, vs having to figure out what is going and then controlling it.

I think the possibility of missing pulses will always be there depending on the number and speed of the multiple encoders attempting to be supported.

My testing agrees with you. The board design is finalized and I am finishing up the documentation.