Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: benji on February 28, 2008, 12:17:54 PM

Title: 4 servos , 1 pin
Post by: benji on February 28, 2008, 12:17:54 PM
hey folks, i have 4 servos who share the same movement(same control pwm signal)
can i attach the four to one atmega32 pin? the pin is able to source/sing (20 m.amps)
,,but im not sure about the control terminal of the servo
Title: Re: 4 servos , 1 pin
Post by: Asellith on February 28, 2008, 01:36:22 PM
Get yourself a quad buffer chip and wire all the inputs together and use that to drive the servos. Your not driving the servos so current isn't that big a deal. But with the buffer is something gets shorted in the signal lines to the servos you blow a 30 cent buffer ic instead of your microcrontroller.
Title: Re: 4 servos , 1 pin
Post by: benji on February 28, 2008, 04:14:42 PM
wut do u mean if things get shorted? its the same wire
i meant to connect PORTD.7 to all my 4 servos,,

its just a current issue, would 4 servos control terminals draw more than 20 milli amps?
Title: Re: 4 servos , 1 pin
Post by: hazzer123 on February 28, 2008, 04:17:18 PM
No they won't draw a damaging amount of current. I think Aselith was just saying that with more servos, comes more chance of failure. therefore you should protect the expensive things in your circuit (ie your atmega32 chip).
Title: Re: 4 servos , 1 pin
Post by: benji on February 28, 2008, 04:24:05 PM
so ur sayin its better to include a buffer ic to control the servos,
,know any ic numbers that can be good for that?

thanks
Title: Re: 4 servos , 1 pin
Post by: Tsukubadaisei on February 29, 2008, 07:36:27 AM
I dont think you need the buffer IC chip. just use a resistor and connect all the servors to the same pin.
Use like 5kΩ and that should be more then enough. Trust me because I have done stuf like that, but with H-bridges and dc motors.
Title: Re: 4 servos , 1 pin
Post by: benji on February 29, 2008, 03:27:58 PM
can you explain what the resistor function is about?
is this a good solution?
Title: Re: 4 servos , 1 pin
Post by: paulstreats on March 01, 2008, 12:58:19 PM
see what it says here http://www.servocity.com/html/boosted_servo_extensions.html (http://www.servocity.com/html/boosted_servo_extensions.html) about servo signal booster when using more than 1 servo
Title: Re: 4 servos , 1 pin
Post by: Tsukubadaisei on March 02, 2008, 07:02:33 AM
can you explain what the resistor function is about?
is this a good solution?

the resistor will protect the controller from high currents. Usually a controller port can support up to 50mA. I dont know how much current the servo will drain for the signal but if its is more than 12mA it will burn your controller(each servor will drain 13mA for example so the total current will be 62mA=bye bye mcu). The resistor will reduce the current. Just dont use a very high resistance otherwise you will be insulating the servo.
And yes I think it is a good solution, it works. And if you doubt me just try it yourself. A resistor costs less then $0.01 and it is easy to manipulate.
Title: Re: 4 servos , 1 pin
Post by: benji on March 02, 2008, 09:41:39 AM
Quote
the resistor will protect the controller from high currents. Usually a controller port can support up to 50mA. I dont know how much current the servo will drain for the signal but if its is more than 12mA it will burn your controller(each servor will drain 13mA for example so the total current will be 62mA=bye bye mcu). The resistor will reduce the current. Just dont use a very high resistance otherwise you will be insulating the servo.
And yes I think it is a good solution, it works. And if you doubt me just try it yourself. A resistor costs less then $0.01 and it is easy to manipulate.
well isnt that what the buffer ic would do? supply more current when its needed?
a resistor would just not supply the current enough for the servos
i guess the buffer is a better solution ,,
Title: Re: 4 servos , 1 pin
Post by: Tsukubadaisei on March 03, 2008, 08:02:20 AM
But the servos dont need that much current from the controller. Buffer ICs are good when when you have really lots of componets in parallel. Just 4 servos is fine. And I told it already 2 times, I used this approach already and it works. If you doubt try it you just need a resistor. It is insanely easy (and cheapr and easier then buying an IC).
Title: Re: 4 servos , 1 pin
Post by: benji on March 03, 2008, 10:42:50 AM
alright, ill give it a shot
, but are you sure there are no losses in torque/speed?

thanks
Title: Re: 4 servos , 1 pin
Post by: Tsukubadaisei on March 03, 2008, 11:18:47 PM
alright, ill give it a shot
, but are you sure there are no losses in torque/speed?

thanks

There are no losses in torque and speed because the power supply for the actual motor inside the servo is not the signal comming from controller. The controller/sensors and the motors have different power supplies usually.
Title: Re: 4 servos , 1 pin
Post by: benji on March 04, 2008, 05:58:31 AM
Quote
The controller/sensors and the motors have different power supplies usually.
im feeding my controller from the same battery that feeds the motors/sensors but after a 7805
,would this make any problems?
Title: Re: 4 servos , 1 pin
Post by: benji on March 04, 2008, 06:05:41 AM
Quote
the resistor will protect the controller from high currents. Usually a controller port can support up to 50mA.

mine is atmega128 ,the pin can only supply/sink 20 mA
what res value is good for this?
Title: Re: 4 servos , 1 pin
Post by: Tsukubadaisei on March 05, 2008, 01:04:19 AM
Quote
The controller/sensors and the motors have different power supplies usually.
im feeding my controller from the same battery that feeds the motors/sensors but after a 7805
,would this make any problems?

No problem that is exactly what I was trying to say. I consider the regulator a "different power supply".

Quote
the resistor will protect the controller from high currents. Usually a controller port can support up to 50mA.

mine is atmega128 ,the pin can only supply/sink 20 mA
what res value is good for this?

Do the maths by yourself! But this time I will help though. Consider that the maximum volatage between the pin and the servo input is 5V. And you are using 4 servos. Each servo should receive 5mA. V=RI ⇒  R=4kΩ.
4.7kΩ are very easy to find so get one of those.
Title: Re: 4 servos , 1 pin
Post by: benji on March 05, 2008, 03:02:11 AM
allright ill give it a shot, hope it works, thanks anyways
Title: Re: 4 servos , 1 pin
Post by: Admin on March 09, 2008, 09:30:04 AM
I don't think you will have a problem with four directly connected.

If you are really worried, use a multimeter to measure the current, and add one servo at a time and see what happens.

Title: Re: 4 servos , 1 pin
Post by: Tsukubadaisei on March 10, 2008, 05:11:15 AM
that is an interesting idea.
Title: Re: 4 servos , 1 pin
Post by: benji on March 10, 2008, 06:11:57 AM
Quote
use a multimeter to measure the current
i guess i would need an osciloscope cuz a meter would not give the maximum voltage/current of the PWM
Title: Re: 4 servos , 1 pin
Post by: Tsukubadaisei on March 10, 2008, 08:16:43 PM
Uhm... That is an even better idea.
Title: Re: 4 servos , 1 pin
Post by: Admin on March 10, 2008, 08:39:52 PM
It will work with a multimeter (oscopes can't measure current, silly :P)

The current value will fluctuate on the screen, in which case just watch it for a bit and use the highest number you see. My multimeter actually has a 'maximum value' setting.

The only other way is to use a current sensor.
Title: Re: 4 servos , 1 pin
Post by: benji on March 11, 2008, 06:38:10 AM
Quote
The current value will fluctuate on the screen, in which case just watch it for a bit and use the highest number you see.
do u recognize the frequency? the pwm high cuty cycle? i dont think human eyes can catch up with this

and yes oscopes CAN measure current,when you use a low value resistor(100 ohm) in the way ,silly ?? ;D
Title: Re: 4 servos , 1 pin
Post by: Admin on March 11, 2008, 06:54:02 AM
Quote
do u recognize the frequency? the pwm high cuty cycle? i dont think human eyes can catch up with this
I just use the current setting. My multimeter has a low refresh rate of like half a second - more than enough time to read it.

Quote
and yes oscopes CAN measure current,when you use a low value resistor(100 ohm) in the way ,silly ??
Adding a resistor changes the current, ohm's law, silly :P

If you still wanted to use a resistor, 100 ohms is A LOT!!! You'd want something called a 'current sense resistor'. But then it'd be better to just get a current sensor . . .
Title: Re: 4 servos , 1 pin
Post by: benji on March 11, 2008, 07:12:37 AM
Quote
Adding a resistor changes the current,

the servo input resistance is so big , voltage/current = 5 volts/ somthin in micro-amps(control pin)
even if its in milliamps it would still big BIG
so 100 ohms wont change much, , ,silly ?????? ;)
Title: Re: 4 servos , 1 pin
Post by: Admin on March 11, 2008, 07:56:06 AM
If its so low, and you know that for sure, then why'd you ask
Quote
would 4 servos control terminals draw more than 20 milli amps?

 :P

Ok ok seriously, just hook it all up, the worst that will happen is that it just won't work.
Title: Re: 4 servos , 1 pin
Post by: benji on March 11, 2008, 07:59:17 AM
i was jus askin to be sure, anyways i will do that, thanks