Pages: [1]   Go Down
Author Topic: Can an arduino uno be used to control a large amount of motors? If so, how?  (Read 963 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a long term project in mind where I need to control a large amount of motors (50-150!).  Not sure if I'll ever do it, but I'd like to at least know how.  I'd have a data file that specifies what each motor needs to be doing at every time increment.  How can I get that info out to that many motors and have them all work together simultaneously?  Can an arduino do it?  How?  What type of external circuitry would I need?  If not, what other alternatives are there?  Would another type of microcontroller work?  Multiple microcontrollers?  or do I need a whole different approach?

Thanks!
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 176
Posts: 12283
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Control?  As in on/off control?  As in speed control?  As in direction control?
Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Motors? As in brushed DC motors ? What voltage ? how much current ? Or servo motors, or brushless motors, or stepper motors ? Are the motors at a fixed location, or a robots moving around ?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for the lack of detail.  I was thinking hobby servo motors.  I would be controlling their angular position.  Although occasionally I would need to switch to a on/off control scheme.  The motors themselves would all be stationary.  None of them would be attached to any moving parts.  I hope that helps with the details.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16518
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry for the lack of detail.  I was thinking hobby servo motors.  I would be controlling their angular position.  Although occasionally I would need to switch to a on/off control scheme.  The motors themselves would all be stationary.  None of them would be attached to any moving parts.  I hope that helps with the details.

The arduino IDE already supplies a servo library for easy control of R/C type servos. Arduino can easily made to control just about any DC motor. What it can't do worth a snot is power such motors, so plan on using external DC power supplies to actually supply the DC current needs of the servo/motors you plan on using.

Lefty
Logged

0
Offline Offline
Tesla Member
***
Karma: 116
Posts: 8935
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd suggest you get dedicated servo control chips/boards to control the servos and use the arduino to send the appropriate commands to the servo controllers.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The arduino IDE already supplies a servo library for easy control of R/C type servos. Arduino can easily made to control just about any DC motor. What it can't do worth a snot is power such motors, so plan on using external DC power supplies to actually supply the DC current needs of the servo/motors you plan on using.

Lefty

I'd suggest you get dedicated servo control chips/boards to control the servos and use the arduino to send the appropriate commands to the servo controllers.

Totally agree. But you should consider some other issues too. Since I am not an expert of any kind, I can only provide you with some pointers:

First, the number of maximum motors (150) makes you to consider addressing issues. For example, the controller http://www.pololu.com/file/0J37/ssc03a_guide.pdf has 8 outputs, but it can be daisy-chained to control 128 servos. I am not sure, but you -may- be able to utilize more than 1 serial lines (via bit-banging, which is also a hassle). Also any I2C controller is susceptible to address conflicts, since any I2C device can be assigned quite a few selectable addresses. I don't know addressing issues with SPI or any other serial interface.

Second, timing issues. You obviously can't control those servos simultaneously, and the serial bus you use will introduce latency. The questions are: How much latency are we talking about, and if that much latency is a concern for you. For example, consider the specifications in the chart http://www.towerpro.com.tw/driver/drivers/Towerpro%20servo%20spec.pdf. Calculate
0,1 sec/60 degree ~= 0,0017 sec/degree
and dividing this by 150, we get
~0,00001 sec/deg
that is about 11usec/degree. This (11usec) is the amount of time your arduino can take to send data (which is a multibit signal) to servos, assuming you are sending data to each of them, and assuming each of them has to move 1 degree. Bigger anglular increments, more time, less problem. Translating this number to actual time needed for, say 16 bits including overhead, it already exceeds I2C specification. Of course, these are datasheet values being manipulated by some arbitrary guy on the internet. Do your own calculations, and please correct me if I am wrong.

Finally, while your arduino controls the servos, it may (depending on your application) lack computing power. Amount depends on your application, and you should consider this too.

I hope these may be of any use to you.

-d
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, I appreciate all of the replies.  Thank you.  A few follow up questions:

I understand that the motors will need their own power supply.  I also understand that the arduino by itself wouldn't be able to handle this. 

Everything else I'm not too sure on.  I'm not very familiar with dedicated servo control chips/boards.  I don't know how to set up a daisy chain.  I've never heard of bit-banging.  I don't know what SPI and I2C mean.  Not very familiar with multiple serial lines.  I don't know much about addressing or calculating latency.  Basically, there's a lot of things you mentioned that I have either never heard of or am not very familiar with.  Do all of these things fall into a specific topic or subject?  Is there a book or other resource that you could recommend?

I feel like controlling a lot of motors is an issue that someone must have found a reasonable solution to.   I don't want to reinvent the wheel so if there are any other suggestions or solutions that you are aware of, please share!

Thank you!
Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

These recent post are about controlling lots of servos:

The Arduino Mega 2560 can handle up to 48 servos:
http://arduino.cc/forum/index.php/topic,154561.0.html
That is a simple and easy solution. A few Arduino Mega for hundreds of servos.

Creating I2C devices with servos:
http://arduino.cc/forum/index.php/topic,156823.0.html
Logged

0
Offline Offline
Tesla Member
***
Karma: 116
Posts: 8935
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I feel like controlling a lot of motors is an issue that someone must have found a reasonable solution to.   I don't want to reinvent the wheel so if there are any other suggestions or solutions that you are aware of, please share!

Well, you really need to explain how you want to control the servos, and what the servos will be doing, like below.

http://www.youtube.com/watch?feature=player_embedded&v=X0apeZULiKc
« Last Edit: March 31, 2013, 02:49:49 am by zoomkat » Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, you really need to explain how you want to control the servos, and what the servos will be doing, like below.
For each motor I would have a file that has the angular position of the motor at a specific time.  It would look something like this:
Angular position    Time
180                       0.000
180                       0.001
180                       0.002
175                       0.003
170                       0.004

I don't know if that's a decent time step or angular speed for a servo, but that's not important.  I'm just trying to demonstrate the type of information I'd be supplying to the servos.  Does this answer your question?  If not, please ask me something specific.   Thank you.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

These recent post are about controlling lots of servos:

The Arduino Mega 2560 can handle up to 48 servos:
http://arduino.cc/forum/index.php/topic,154561.0.html
That is a simple and easy solution. A few Arduino Mega for hundreds of servos.

Sweet! I only have a UNO R3, so I did not know MEGA has such a potential. Sorry for that. And I learned I can control up to 12 on my board smiley Thanks. I should read more >_>

If your project is not permanent, buying a few MEGA boards would be the best solution IMO, because after that you will have 3-5 boards to play with. Otherwise, tying something as complex as a MEGA just to control servos is... cruel. It is overkill. Idea itself makes me cringe.

If you are an adventurous type, you can try something like https://www.sparkfun.com/products/10615 or better yet, you can build your own circuit with the IC used in that one: http://www.ti.com/lit/ds/symlink/tlc5940.pdf. 10 of these ICs sell for €27 (cheaper than single MEGA) at farnell. Of course, these are just examples and you should search for better ICs and better prices. But this method can be significantly harder and frustrating. Although I would go this way, I think Erdin sorted this out for you until a better approach is posted smiley

-d
Logged

Pages: [1]   Go Up
Jump to: