I am currently undertaking a university project that makes use of 150 Tower Pro SG90 Mini servos. I want to be able to control each of the servos individually; each of them on a different pin of an Arduino.
I currently have multiple Arduino Uno's and one Arduino Mega, however I can buy more to facilitate all of the servos.
I am wondering whether I buy two more Mega's which can theoretically control 48 servo's each.
If I am to do this, does anyone have any suggestions as to how to power the servos and the arduino together?
I have a prototype for this project, for that I powered 5 servo's with 4 AA batteries and the arduino uno with a 9V battery.
Any suggestions would be much appreciated. Money isn't an issue so I can buy anything that you suggest I need.
No, you need to get PWM expander chips that can control 8 or 16 servos at a time - then
you'll need far fewer pins from the Arduino and can site each expander need the power supply
for each bunch of servos. Think modular in chunks of 8 or 16 or 32, each module separately
powered, possibly opto-isolated even.
Here's an example: http://www.adafruit.com/product/815
(Note that although this one is I2C you have 6 jumpers to select addresses so upto 62 of
them can share an I2C bus (pull-up / impedance issues permitting).
There will be other such options.
How much space will the project take up? I2C is only meant for short runs, for larger
configurations something like an RS485 network might be the way to go (ideally
there would be a DMX512 -> servo breakout board in this case - happy googling)
Another option would be to use serial servo controllers, such as those sold by Pololu; for instance, their "Mini Maestro 24-Channel USB Servo Controller":
...can be controlled via USB, TTL serial, or via on-board scripting - depending on your needs. Standard servos plug right in, and there's screw terminals for an external regulated power supply for the servos (budget about 1 amp per servo), and you can daisy chain multiple controllers (via the TTL serial bus) to control the number of servos you need (in your case, with a 24 channel controller - you would need 7 controllers).
Plenty of documentation and other resources are available from the site, so interfacing shouldn't be a big issue. By using such servo controllers, you can reduce the number of wires you need to run, the need to create custom servo interface board(s) (so you can properly supply power), and the coordination of multiple Arduino boards. You won't have to worry about solving any pesky "servo jitter" problems (most likely), because the servo control boards do all the work for you - simply dump one or more commands down the serial line to the boards, telling what servo to move where, and it will do the rest - your microcontroller can continue on with it's business (whatever that is). Or - if you are doing all the motion control via a PC, you could simply plug the boards into the PC via USB, and command them each that way (and eliminate the Arduinos).
The only downside will be the cost - the boards aren't cheap. But cost shouldn't be a big deal for you for this kind of project, because it's going to be expensive no matter how you look at it (have you priced what a 5 or 6 volt 24 amp regulated power supply costs? And you're going to need seven of them!). What you gain is a simplified control interface (you don't have to code that up yourself - and debug it too), and better modularity (which will hopefully simplify tracking down any bugs).
As said, you probably need to control the servos with servo controllers, and control the servo controllers with the arduinos. For servo power I'd look at a lead acid 6v lawn tractor battery with a charger floating on it.