40 Servo/Motor Robot feasible?

Hi, my engineering club has a few arduino unos and we recently came into possesion of a pile of cheap micro servos and small dc motors. I was wondering what parts I should order to build a RC humanoid robot so I could get to my favorite part of 3D modeling and printing a frame and modules for the machine.

Ingredient list (10/2/2018):
1xArduino Uno
35-48xMicro Servos
2-3xDC motors
3xAdafruit 16 channel servo controller
2xL298N or L293D dc motor driver
2xUBEC 3A
1x9V or 12V Battery
1xMPU6050 accelerometer
1xSQ13 wifi camera
1xPS2+Receiver

Additional Questions:
Are there enough pins on the Uno for all these modules? The wifi camera is a standalone piece.

Can you control Adafruit’s 16 channel servo controller’s chained together with a PS2 reciever connected directly to the Uno? There are guides for doing one or the other but not sure if I could do both on one Uno. I’ve also seen 32 channel servo controllers use PS2 controllers but I couldn’t find a method of chaining them for more than 32 servo slots.

If the PS2 controller is more trouble than it’s worth, is there a wifi module for a pc any of you recommend?

Can you mount two L298N or L293D motor drivers on one Uno or is there a 4 port motor driver out there that someone recommends?

Are there enough pins on the Uno for all these modules

No. Each servo needs one pin.
You will need some form of port expander to get more pins.
A servo can take peak current of one Amp so that is a very large power supply you are looking at.

What exactly do you mean by a PS controller?

Typically for a beginner you are trying to do too much too fast with too little knowlage.

Grumpy_Mike:
No. Each servo needs one pin.

3xAdafruit 16 channel servo controller

I think he has that, Mike. :slight_smile:

But I DO want to add my "+1" to the "too much too fast" idea.
Slow down.
Take small bites rather than trying to eat the whole cow.

Go read the Adafruit page on the servo board, hook up a16 servos and play with their tutorial code.
Then add the other 2 boards.
Then take those off and try the motor drivers.
Then take those off and try the PS2 thingie.

Once you feel like you are getting the hang of the components individually, put 2 on and see if you can make she servos AND the motors go.

See the path I an describing?

I'd slow it down even more.

Get to control 3-4 servos in one sketch (don't bother yet with the extension boards, an Uno can handle this just fine).

When that works, build those servos into a single arm. Try to control that one arm: move the end of the arm to a specific point. That's going to be hard enough for starters, as the location of the end of the arm depends on the motion of all those servos together, and you have to think of the order of movement to not make weird swings and so.

I'd break it down even more. One controller for the left arm, one for the right arm, and eventually more for claws, movement etc.

Thanks for explaining that Vinceherman!

Thanks for all the advice, I think you guys are right that I should break down the project into smaller bites, so in terms of a bunch of small projects I guess this shopping list should be sufficient.

I’m just ordering parts for the school and going through the school beauracracy generally means these parts will take a month or two or even a semester to get here, I’d prefer not waiting that amount of time to find out something critical was missing.

By PS2 I am referring to a playstation 2 controller, they’re generally pretty cheap and available and have a sufficient reciever for almost any nonsense without delving into ESP wifi modules.

Power supply, I’m not terribly sure, there’s a variety of battery’s in the lab and from friends I can use, I’m aiming for 15 min of run time, at worse, a tether to a mosfet and 12v 30A PSU but I am still up in the air for what specific c rating and amps of a battery I should order.

Well... let's start with the servos themselves. What is their power rating (working voltage, required current)? As long as you don't know that, you're dead in the water.

HK15178 hobby king servos and maybe some bottom dollar chinese 9g servos, their working voltage is 5-6V, no current listed for any of them, which suggests their draw is negligible but added together, I’m guessing 3A is a good place to start, some random sites said their curent draw could be as high as 2-5A per micro servo which is hard to believe if heavy Nema 17’s in CNC machines generally run off of and get hot at 1-2A

but added together, I'm guessing 3A is a good place to start

Way way off for 30 servos. It is the peak current not the continuous current you need to add up when thinking of a power supply.

Then as you put more mechanical load on them the avrage current draw will increase.

which is hard to believe if heavy Nema 17's in CNC machines generally run off of and get hot at 1-2A

That is 2A in one device, not spread over 30 devices.

Read reply #1 again.

Grumpy_Mike:
Way way off for 30 servos. It is the peak current not the continuous current you need to add up when thinking of a power supply.

That's good to know that I'm way off, I'll look to finding some larger UBEC's than 3A, got any recommendations for what size I should be looking for to order?

Grumpy_Mike:
Then as you put more mechanical load on them the avrage current draw will increase.
That is 2A in one device, not spread over 30 devices.

Alright, and yes, I was comparing one micro servo with one Nema 17, it seemed overly complex to say 30 micro servos running at 60-150A seemed extreme when compared to 30 Nema 17's that could lift many times more the same load while still requiring an extraordinary 30-60A PSU. But thank you for checking.

Well, the obvious thing for you to do first is to take such a servo, wire it up, put your multimeter on current mode and measure the actual current it takes! Put some force on the servo (to make it work hard - don't do this for long, just enough to get a reading, it's not good for the servo), and see what reading you get.

Also your steppers may take only 1-2A of current, that's probably at a much higher voltage than the 5-6V a servo typically wants. That also means much more power overall.

Then you know what power you need. Your 3A power supply will do just fine for the time being, as it seems you don't even have the first servos working. So the idea of getting all 40 to work together is something that may or may not come true, and not any time soon.

SerMumble:
That's good to know that I'm way off, I'll look to finding some larger UBEC's than 3A, got any recommendations for what size I should be looking for to order?

I have used this 20A BEC from HobbyKing

Thanks Wvmarle, I’ll be sure to do a multimeter measurement to figure out how much current they take. I also see and what you’re saying makes sense about motor amps, thanks for the clarification. You’re probably right this is a long term project, I really appreciate the warning, even if I get individual part working I think it will be a great learning experience, I’m probably trying to think too far ahead.

And thanks for the recomendation Vinceherman, I’ll go shopping for a UBEC around and above that limit!

Not too bad an idea to think well ahead - but it's far too early imho to start buying those parts. Start with what you have, then when you have the feeling you're able to actually pull off a 40-servo assembly (because you've got 5-8 running in tandem) it's time to think of how to wire them all up.