Go Down

Topic: Multiple Encoders (Read 3326 times) previous topic - next topic

willofgod

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?

dhenry

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.

willofgod

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.

dhenry

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.

willofgod

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

dhenry

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.

willofgod

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

robtillaart

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
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

MSP-Fan

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.


willofgod

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.

CrossRoads

#10
Nov 15, 2012, 05:27 pm Last Edit: Nov 15, 2012, 05:55 pm by CrossRoads Reason: 1
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
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

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.

retrolefty


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

CrossRoads

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.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

willofgod

Quote
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.

Go Up