Pages: [1]   Go Down
Author Topic: Multiple Encoders  (Read 2208 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 170
Posts: 12482
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 1
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 442
Posts: 23834
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 (1228.65 KB - downloaded 17 times.)
« Last Edit: November 15, 2012, 11:55:02 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16540
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 442
Posts: 23834
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: