Offline
Newbie
Karma: 0
Posts: 10
|
 |
« on: October 31, 2012, 09:51:08 am » |
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
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #1 on: October 31, 2012, 09:59:16 am » |
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
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #2 on: October 31, 2012, 10:32:23 am » |
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
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #3 on: October 31, 2012, 10:48:17 am » |
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
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #4 on: October 31, 2012, 11:02:57 am » |
I hear you, but empirical testing with the interrupts show lost pulses due to collisions.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Edison Member
Karma: 114
Posts: 2205
|
 |
« Reply #5 on: October 31, 2012, 11:10:14 am » |
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
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #6 on: October 31, 2012, 12:11:32 pm » |
It could be that was it. I attempted every variation of software I could find, but everything lacked repeatabillity.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 101
Posts: 9551
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #7 on: October 31, 2012, 01:56:32 pm » |
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
|
|
|
|
|
Offline
Newbie
Karma: 1
Posts: 9
|
 |
« Reply #8 on: November 02, 2012, 02:27:44 am » |
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
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #9 on: November 15, 2012, 10:30:49 am » |
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
Brattain Member
Karma: 269
Posts: 17035
Available for Design & Build services
|
 |
« Reply #10 on: November 15, 2012, 11:27:05 am » |
|
|
|
|
« Last Edit: November 15, 2012, 11:55:02 am by CrossRoads »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #11 on: November 15, 2012, 02:29:36 pm » |
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
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #12 on: November 15, 2012, 02:45:54 pm » |
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
Brattain Member
Karma: 269
Posts: 17035
Available for Design & Build services
|
 |
« Reply #13 on: November 16, 2012, 12:53:49 am » |
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
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 10
|
 |
« Reply #14 on: November 30, 2012, 03:59:22 pm » |
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
|
|
|
|
|
|