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