Go Down

Topic: A problem controlling multiple servos. (Read 1 time) previous topic - next topic

Treg

Dec 02, 2012, 12:43 pm Last Edit: Dec 02, 2012, 12:47 pm by Treg Reason: 1
Hello everyone! I'm a second year mechatronics student, and this is my first Arduino project. I'm building a quadruped walker that can either be RC controlled or autonomous (basic collision avoidance). I have built a prototype body for testing the program, and this is the result:

http://www.youtube.com/watch?v=H4Sy9n3iw-8

Before testing the servos are manually set in "sleep" position. This is what the program is supposed to do:

Code: [Select]

void loop()
{
reset_pos();//set all the legs in their normal position
delay(1000);
servoA1.write(posA1+45);
delay(1000);
servoA1.write(posA1-45);
delay(1000);
}


The problem: Servos start twitching when there are multiple servos operating. I use external Li-Po battery and the voltage is regulated to 5V. The wiring is a mess right now but getting the program work is a priority right now.


Parts:
- 12x EMAX ES3154 17g digital servos with metal gears and bearing
- Arduino Leonardo
- Firefox 7.4V 1600mAh 20C lipo battery (will be replaced by Dualsky 7.4V 1750mAh 45C lipo battery)
- 3mm plywood for prototyping

Grumpy_Mike

Quote
Servos start twitching when there are multiple servos operating

That code uses delays, using delays is not a good way when you have multiple things to do.
See the blink without delay example in arduino IDE for how to remove delays.

zoomkat

Quote
The problem: Servos start twitching when there are multiple servos operating. I use external Li-Po battery and the voltage is regulated to 5V. The wiring is a mess right now but getting the program work is a priority right now.


Sounds like a possible low power issue. The power to the servos should be closer to 6v than 5v for best performance. How are you regulating the voltage from the batterys?
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

HazardsMind

@zoomkat
Quote
How are you regulating the voltage from the batterys?


I would assume a 7805 regulator.

@Treg
Quote
That code uses delays, using delays is not a good way when you have multiple things to do.
See the blink without delay example in arduino IDE for how to remove delays.


I agree with Mike, you should look into that example, it will definitely help you, and with any other projects.

Treg

Ok, I tried to use 4x AA batteries to drive three servos at the same time and it worked! The problem was low signal voltage I guess. The servo specs said they were for 4.8-6V, and the regulator gave steady 4.97V that I used to power all the servos. The funny thing is that I could run three Futaba S3003 servos @5V without problems.

After short googling:

Plastic gears or metal gears?
When you shop for a servo, its gear is one of the first things you should consider. Servo gears are typically made of molded plastic or machined metal (brass or aluminum alloy). As you'd expect, plastic gears are much cheaper to produce than metal gears, but they aren't as strong. Certain manufacturers offer a servo in both plastic and metal versions, and the plastic one almost always has a lower torque rating. But there's one area in which a plastic gear excels--low radio frequency (RF) noise. When metal parts move against one another, they generate RF noise, and an electrically "noisy" servo can cause glitching. This is why many top drivers use plastic-gear throttle servos in their vehicles.


Looks like metal gears have their downsides. Do I need to wrap the whole thing in tinfoil? :P


retrolefty

Quote
Ok, I tried to use 4x AA batteries to drive three servos at the same time and it worked! The problem was low signal voltage I guess. The servo specs said they were for 4.8-6V, and the regulator gave steady 4.97V that I used to power all the servos. The funny thing is that I could run three Futaba S3003 servos @5V without problems.


It's not about the voltage directly, but rather the current demand that the servos are drawing. Servo companies do a poor job of listing the maximum current they require and each brand and model of servo will consume a different amount and of course the mechanical load placed on the servos will drastically increase their current consumption. If you try and draw too much current from a voltage regulator it's output voltage will sag or even shutoff. So yes most hobby servos will work just fine with a steady 4.8 to 6vdc DC voltage, however the source of that voltage must be able to handle the peak current requirements of all the servos it is trying to power. I usually recommend that the DC power source be able to handle at least 1 amp per servo attached if you want to avoid voltage dips, board resets and other annoying problems that servos can bring to the party.

Lefty

Treg

#6
Dec 04, 2012, 07:18 pm Last Edit: Dec 04, 2012, 07:41 pm by Treg Reason: 1

Quote
Ok, I tried to use 4x AA batteries to drive three servos at the same time and it worked! The problem was low signal voltage I guess. The servo specs said they were for 4.8-6V, and the regulator gave steady 4.97V that I used to power all the servos. The funny thing is that I could run three Futaba S3003 servos @5V without problems.


It's not about the voltage directly, but rather the current demand that the servos are drawing. Servo companies do a poor job of listing the maximum current they require and each brand and model of servo will consume a different amount and of course the mechanical load placed on the servos will drastically increase their current consumption. If you try and draw too much current from a voltage regulator it's output voltage will sag or even shutoff. So yes most hobby servos will work just fine with a steady 4.8 to 6vdc DC voltage, however the source of that voltage must be able to handle the peak current requirements of all the servos it is trying to power. I usually recommend that the DC power source be able to handle at least 1 amp per servo attached if you want to avoid voltage dips, board resets and other annoying problems that servos can bring to the party.

Lefty

True. The regulator (7800 series) was not the component I needed. I think I need invest in 10-15A (or two 5-8A) battery elimination circuit to power all the servos. For example: http://www.dualsky.com/downloads/VR_Pro_Instructions_Manual_cn_en.pdf

rgallant

If you go with a R/C hobby BEC add a small 5 volt fan on that heatsink, they are designed to to have fairly constant airflow over the heatsink, think heli's and airplanes fast moving cars.

Lastly if you plan on using a dedicated servo controller later make sure the output wires will handle your maximum amperage. If not you will have to change them out.  I use a Castle Creations 20 amp for my bot, and it is nice and easy to switch wires, I am not sure why they don't come with 20 amp capable to start with.

zoomkat

You can get inexpensive UBEC voltage converters on ebay. You can add a small diode on the ground leg of the 7805 chip like below to increase the output voltage to 5.7v for better servo performance.

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

Treg

#9
Dec 05, 2012, 02:53 pm Last Edit: Dec 05, 2012, 03:00 pm by Treg Reason: 1

If you go with a R/C hobby BEC add a small 5 volt fan on that heatsink, they are designed to to have fairly constant airflow over the heatsink, think heli's and airplanes fast moving cars.

Lastly if you plan on using a dedicated servo controller later make sure the output wires will handle your maximum amperage. If not you will have to change them out.  I use a Castle Creations 20 amp for my bot, and it is nice and easy to switch wires, I am not sure why they don't come with 20 amp capable to start with.


The BEC i linked have option to put a fan on top of it.

I'm wondering what are the benefits of using a dedicated servo controller. I assume they are used to smooth down the movements by using so called "ramps". I could buy the same BEC you got, and I'm sure I need more Amps if I'm going to expand the project later on.


You can get inexpensive UBEC voltage converters on ebay. You can add a small diode on the ground leg of the 7805 chip like below to increase the output voltage to 5.7v for better servo performance.




Thanks for the tip. I heard UBECs cause RF noise am I correct?

Go Up