So, I'm starting a new thread because it appears what I am asking wasn't very clear in the other thread. I'm not an EE, I am a software geek with solid mechanical/fabrication skills. I have a project I want to make and I am trying to decide if Arduino is the right platform and, if so, which pieces fit together with each other easily. My hope is to find a benevolent EE guru who can make suggestions.
I understand that it may be difficult to recommend a processor size, but suffice it to say that I can start smaller with a focus on interfaces and prototyping. If I run into CPU performance issues, I can look for a bigger/better chip after that point. Hardware interfaces, daughter boards, and the like are where I am truly at a loss.
It appears i2c is the interface of choice fairly often, or, serializing multiple analog or digital inputs into a USB as well. What I am hoping for is some guidance toward products that combine together to provide the following:
40 digital outputs (for LEDs and to pulse solenoids via relays using PID to manage multiple air pressures)
40 analogue inputs (some of these are potentiometers and several will be air pressure sensors to feed back into the PID function)
Gyroscopic inputs
Inertia on all 3 axes (3g is probably plenty, but 6 or 9 wouldn't be overkill, as long as it scales cleanly to 1024 bits for fine grained control)
capture data (preferably to a removable medium like an SDCard or USB stick)
Some kind of LCD display for output
Ultimately, I will want the compensation variables in the PID to adjust based on actual feedback. This should be a closed loop / autonomous project. Looking into the Arduino platform, it appears to be single threaded..with interrupts? So, interrupts are the mainstay for switching focus or priority, no?
Well I'm an EE, though not a guru, and I generally try to be benevolent. So here's my take.
The I/O requirements are fairly steep, but could be possible with an Arduino board, a especially Mega2560 because they have a few more timers (including more potential ISRs for each) and quite a bit more I/O pins. However, it will only be possible if the I/O can be multiplexed. Although, if you can spare around a hundreth of a second or so between sampling the same sensor this shouldn't be a problem.
With a Mega you'd have upto 16 analog inputs with 48 digital I/O pins. So if you use I2C or similar serial protocol to communicate with the gyroscope, accelerometors (for the inertia), LCD, and data storage device; you will likely have enough pins for each of the 40 misc. digital outputs you mention. You will still have to multiplex the analog inputs. Depending on the exact multiplexing scheme, not all of the analog inputs need be used, and any unused analog pins can also be used as digital I/O pins.
In contrast, both the Uno and the Leonardo have fewer I/O pins total and specifically few analog inputs. So you'd have to much more multiplexing, in this case with the digtial I/O as well as the analog input. You will probably also need to use I2C's ability to communicate with multiple devices using the same I/O pins as much as feasible.
In regards to if the 16 MHz available on an Arduino is fast enough, a lot of that will depend on the response requirements and how tight the code crafted by a certain software geek will be.
Edit: For a decent example on how to do PID (including multiple sets of PID coefficients) with Arduinos refer to this page.
A few hundredths shouldn't be an issue at all. In fact, I will probably look to sample at around 10-15 hz and only 3 of the analog inputs are high priority, the rest are for data logging and calibration (closed loop).
Can you tell me more about multiplexing? Any links/examples that point to how I would accomplish it physically?
It is probably time to go pick up a bread board and order some parts, but I don't even know where to start. A friend of mine is trying to push me to Raspberry Pi but I think the libraries for Arduino have everything I am looking for and a solid community under it, so I am resisting..for the moment.
Well taking into consideration the given information, I have an idea. However, perhaps some background is in order...
Multiplexers (AKA MUXes) are IC components that allow one output line to connect to a given number of different input signals. The connection is only one at a time, and is controlled one or more select lines. Some people like to think of them as a switch with multiple connections, this is true but sometimes hard for people to visualize. A different analogy would be a common part of a railroad (real or model) switching yard; a main set of tracks branches off to several other possible tracks but is only connected to one at a time. Multiplexers are commonly available with a total amount of input signals equal to some power of two, i.e. TInputs = 2n, with n being equal to the number of select lines needed to control it.
An example of what you could do would be to have ten 4-to-1 MUXes each attached to a different analog input pin. A 4-to-1 MUX needs two select lines to control it, but all of them are the same size you can control them with only two pins (I'd use two of the analog inputs set as digital outputs) on your Arduino by tying all the SEL0 pins from the different MUXes together and doing the same with SEL1 pins. In other words, when SEL0 and SEL1 are both low all ten MUXes are connected to the first input (I'm sure you can do the binary counting from there). Not only does this allow you to be connected to a fourth of your analog inputs at any given time, it also makes it easier to keep track of which analog sensors are connected (provided you arranged them in some sensible order of course). Then you'd still have at least four analog input pins which can be used for their default purpose or as digital I/O.