Moving 18 servo motor

Hi, I am planning on making an hexapod robot based on arduino. I am thinking about the best choice to move simultaneously the 18 servos (plus tilt and pan -> 20).

Basically I need an arduino mega, or a arduino with an external motor controller.

What should I choose? Why? :slight_smile: Are there some motor controller with libraries for arduino? It's better to use just the mega? Is the mega capable of moving smootly the servos?

Thanks, I really need to figure this out!

Federico

Anyone?
I am doing a lot of research over the internet but I can't find an aswver to my question :frowning: Basically I am trying to understand if it would be better to control 20 servo motor with an arduino2009 (or an home made rbbb) plus a board like this one (well, three)
http://www.robot-italy.com/product_info.php?cPath=83_31&products_id=597
or like this one via i2c

OR if I should choose an arduino mega, and why ::slight_smile: ::slight_smile:
Thanks again,
Federico

I cant help you.. just wanted to say thanks for those two links.. cool boards, didnt even know that sort of thing existed!

Thanks!

Duncan.

Renbotics Servo Shield might be what you are looking for

Sorry Link : http://www.renbotics.com/

http://www.seeedstudio.com/depot/renbotics-servoshield-rev-11-p-498.html

The renbotics one is a bit little for my needs, i should drive at least 18 servo motors, 20 is better. By the way, what i need is to drive the servos as best as possible, if I save some pin is ok but is not my goal.

Thanks for help, Federico

Basically I need an arduino mega...

When you run out of IO pins on the Arduino (especially with an application such as yours - controlling six legs) you also tend to want more of everything else the Arduino/ATmega has to offer - such as RAM, FLASH, external interrupts and not least processing power.

If you get into building your own Arduino's (RBB style) you can get all of that with a distributed system. E.g. use a separate ATMega328/168 for every leg and use a master Arduino (or yet another bare bones ATmega) to control the other mcu's. I2C is a good choice for interfacing multiple ATmega's. If you design it carefully, you can reduce complexity for the main controller and rather focus on controlling higher level tasks and leave low level leg/servo movement to your "intelligent" leg controllers. This is also easier to build and debug as you can develop and test each component separate from the others. Also I trust you will be able to share the same firmware for each leg.

A true barbones Arduino really does not need much more than the ATmega itself as you can run it on the internal osscillator (8MHz - this will also give you two extra IO pins per mcu) and the power supply/regulator can be shared for all boards.

You could ditch the hexapod idea and go with a quad - 3 servos per leg, you should have enough I/O on the 168/328.

From what I've priced, it should be possible (sans the body structure, and even that might be included) to build such a quad, with 3-axis accelerometer and ultra-sonic sensor (like Ping), plus foot contact switches, for around $100.00; the only thing is I don't know if the el-cheapo servos I picked out would be up to the job (cheesy chinese blue servos from hobby king - ~ $3.00 each).

Then you would have the challenge of programming such a thing to walk...

:slight_smile:

I would prefere a six leg just because i like more the idea of working on such a robot, I already have a ping and a 3axis accel that I would use for this project. I think that the 4 legged is a bit more difficult to move...

The idea of having different "arduino" for leg is interesting, I have never tried to link via i2c more atmega, I should test this... It's really a nice idea...

Thanks guys!

Hi federico,
I have been working on a hexapod as well. The individual leg control for 18 servos looks like it will eat up about 33% of the available processing power.
That leaves some room for experimenting with higher level functioning. Then, if I run out of resources, I will move the logic to a different processor, and just use the mega for leg control.

So far, I have the basic routines to place a foot where I want it, and another routine to choose the foot path based on where our master command says to go. For now, we get our master command from a RC receiver. Long term plans include moving the master command into task oriented AI. In the mean time, I am having a ball working on the lower level routines.
Vince

So, if i understand well, you are able to move the hexapod with an arduino mega and the Servo library, am I right?
In your opinion the processing power of the mega is enough for the moment...
Is it possible to see part of your code to understand how to move a leg?
Do you have a pic of your hexapod? I am so interested in!

I would like to do something very similar.
I would like to control at least 18 servos but I'm not sure where to start.
What solutions did you guys choose?
Please share the fun :slight_smile:

Thank you Richard for your quick answer.

I had a look at the Renbotics ServoShield and it is designed to control up to 16 servo using 4 pins (digital 6 to 9) which is great but I just need to control 2 more servos for my hexapod robot.

  • Do you think I can use this board to control 16 servos and plug 2 more servos on the remaining digital pins? (I believe that would make the programming part harder...)

  • Would it be possible to use 2 ServoShield with 9 servos connected to each shield?

I'm going to have a look at other Arduino shield boards as well.

PS: Thanks, avatar changed :wink:

You could get a Lynxmotion ssc-32 servo controller as it is often used in hexapod projects.

It is passed a lot of time from when I opened this topic, and now there is also a new version of the mega, with doubled capacity :slight_smile:

Thanks guys, I also have seen the SSC-32 servo controler and I think I will go for that one. I'm not sure if it can work with Arduino though...
I'm going to have a closer look.

Thank you all