Reading 144 rotary encoders

I know this is completely beyond a beginner and probably quite a challenge for someone experienced.

But how would you go about accurately monitoring such a large number of quadrature encoders.

I guess this would be beyond Arduino and would need some serious processing power but I'm just interested to find out what the solution/s would be if man power and budget was not a problem?

They would all need to be monitored at the same time and it would have to read two or more (no more than around 8 ) encoders being moved at the same time.

TerryGould1991:
They would all need to be monitored at the same time and it would have to read two or more (no more than around 8) encoders being moved at the same time.

Oooh!

Tricky!

But how would you go about accurately monitoring such a large number of quadrature encoders.

By using SPI port expanders ( like the MCP23S17 ) that monitor input signals for change and generate an interrupt output when it sees a change on any one of the 16 pins.

You’d probably want to combine Mike’s idea with LS7184 to create a pulse when an encoder is changed.
When a change is seen read the direction line for left/right (up/down) turn indication.

LS7183_LS7184.pdf (190 KB)

As well as the problem of connecting to so many devices you also need to consider how many pulses per second need to be monitored. At high speed even a single encoder can be a handful.

This is one of the few situations in which my instinct says "multiple Arduinos"

...R

I was assuming that the encoders are being used as pots in some sort of control pannel but if not then yes it might be a case for multiple processors.

TerryGould1991:
They would all need to be monitored at the same time and it would have to read two or more (no more than around 8) encoders being moved at the same time.

No more than around smiley?

This is an excellent case against emoticons.

Grumpy_Mike:
some sort of control panel

It sure would be with 144 knobs to twiddle.

Maybe that's what they had at Chernobyl ?

...R

odometer:
No more than around smiley?

This is an excellent case against emoticons.

Haha whoops! only just noticed that, Ive just edited it.

So far the best solution seems to the MCP23S17 and LS7184.

Im thinking about having 1 or more Arduinos connected to the encoders via the above chips and then having something more powerful like the beagle bone black as the main processor. As there will be a loads more (much slower) digital inputs as well.

So I guess my next question would be what would be the safest amount of MCP23S17's to connect to an Arduino Mega or Due?

What would be the best way to communicate between the Arduino(s) and the BBB? I2C?

The reason Im thinking about splitting it across multiple processors is I also have 12 analog inputs, and a further 200 buttons.

TerryGould1991:
Im thinking about having 1 or more Arduinos connected to the encoders via the above chips and then having something more powerful like the beagle bone black as the main processor. As there will be a loads more (much slower) digital inputs as well.

As I'm very bad in designing fancy PCB circuits and don't know much about using specialized hardware, so I'd possibly use some more Arduino MEGA boards, like possibly that:

+------+      +------+      
| MEGA +------| MEGA +--------+
+------+      +------+        |
                              |
+------+      +------+     +------+ 
| MEGA +------| MEGA +-----| MEGA +--> Output
+------+      +------+     +------+
                              | 
+------+      +------+       ´|
| MEGA +------| MEGA +--------+
+------+      +------+

6 MEGA boards handle 2 dozen rotary encoders each, all connected via serial connections.

Every 2 MEGAs are daisy chained with each other:
1st reads 24 encoders, send out the changing values on Serial1
2nd receives values on Serial1, reads his 24 encoders and sends all out on Serial2 to the final Arduino Board

The final Arduino board then receives three chains of total 3224 = 144 encoders on Serial1, Serial2, Serial3 and has to process incoming data on three serial ports.

But of course: When using more specialiszed hardware and fancy PCB circuit, you possibly need less Arduino boards.

It still begs the question.
Why?

Paul__B:
It still begs the question.
Why?

When considering that rotating one rotary encoder will require two fingers (or finger and thumb), this must be a control panel for an alien life form with 288 fingers, if all 144 encoders have to be watched at the same time. :slight_smile:

Otherwise it would be possibly enough to watch 24 encoders at the same time, combined with a 6-step-switch, which can multiply the functions of 24 encoders by 6, depending on the step-switch setting.

So I guess my next question would be what would be the safest amount of MCP23S17's to connect to an Arduino Mega or Due?

What do you mean by safe?
You can connect 8 MCP23S17s ( there is no apostrophe needed ) with no extra fiddling and an unlimited number with a slight amount of using extra pins.

Bu you need to say your application if it is a control panel or a large robot because that makes a difference to the advice.

Grumpy_Mike:
( there is no apostrophe needed )

You should be more definite - an apostrophe is wrong in that situation !

...R

An apostrophe is most definitely needed because it distinguishes the plural “s” from the part number, which also may include an “s”.

Back to the original question…
How fast are these encoders moving? How many pulses per second? If an individual encoder output wire can produce 10 transitions per second then the whole array must be monitored at at least double this frequency, four times would be even better. So that’s a minimum of 10 * 144 * 2 * 2 = 5760 digitalRead() per second. That’s within capability of an individual Arduino, ignoring the fact that no Arduino has 288 inputs.

So if the Arduino is reading some kind of port expander chips, how often can it get that data in? Imagine a hypothetical expander chip that has 32 inputs and returns a 32-bit value when requested. You would need only 9 of these chips. But you need to read them at a minimum 5760 bits per second, including the time taken to open the channel, initiate the reading and close the channel. Assume there’s 32 bits of overhead, the data rate is now 11520 bits per second. That’s actually not a lot of bits per second so it still seems feasible with one Arduino.

It just depends on the port-expander chips you choose and the maximum bit-rate required by the application.

MorganS:
An apostrophe is most definitely needed because it distinguishes the plural "s" from the part number, which also may include an "s".

Not an English major, I suspect (but neither am I).

The apostrophe denotes ownership as in John's pony and it is NEVER appropriate for a plural. When it is used to denote ownership by several people (or things) it follows the s as in the boys' toys meaning the toys belonging to several boys.

When the word ends in s - as in the name Jones - you can either use Jones' or jones's to denote ownership. And the plural might be the Jones or (I'm not sure) the Joneses (the latter may be just a colloquialism).

...R

MorganS:
Back to the original question…
How fast are these encoders moving? How many pulses per second? If an individual encoder output wire can produce 10 transitions per second then the whole array must be monitored at at least double this frequency, four times would be even better. So that’s a minimum of 10 * 144 * 2 * 2 = 5760 digitalRead() per second. That’s within capability of an individual Arduino, ignoring the fact that no Arduino has 288 inputs.

Sorry if I am raining on the parade but …

10 per second is slow for an encoder with (say) 1024 pulses per revolution

And for a quadrature encoder you also need time to do some calculations to figure out the direction.

Then, presumably, there also needs to be time to do something useful with the data.

…R

And 144 of those adds up to $5752.80. Not a hobby project then.

My reading of the original post was that the 'something useful' happens in an external processor outside the scope of this question.

So where does the apostrophe go when you are talking about the car belonging to your boss?

So where does the apostrophe go when you are talking about the car belonging to your boss?

"Your boss' car" to be strictly accurate. According to my wife who is an English teacher.

The use of an apostrophe in any sort of plural is wrong. It is called a green grocers apostrophe.
I once saw a sign in a chip shop that read:-
"mar's bar's fritter's"
the use of each one of those apostrophes is totally wrong, as is the entire concept of a Mars Bar Fritter.

For people who have not come across them this is a Mars Bar:-

OP - we are just amusing ourselves while you get back with the vital information to allow us to answer your question without having to guess too much detail.

Who knew that a misplaced apostrophe could have spark so much conversation!

Its actually for a midi interface.

Im planning to use alps EC11E1834403, they seem just what is needed and have a push button ( I can get them for around £1 each from a friend who is a distributor for alps )

Please remember I am a beginner when it comes to electronics and programming, I know enough to make very simple projects but I have yet to complete anything as big as this. As well as advice about how to go about completing this it would be good to know two things:

Just how hard is this going to be for a hobbyist to get this working reliably?
If money or man power wasn't an object how would this be done?

By safest amount of MCP23S17s I meant is there a limit to reliability when monitoring such a large number of inputs through SPI with one processor.