Wiring Forum
http://wiring.org.co/cgi-bin/yabb/YaBB.pl
Wiring Hardware >> Troubleshooting >> multiple servos
http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1199897127

Message started by tomek on 01/09/08 at 16:45:27

Title: multiple servos
Post by tomek on 01/09/08 at 16:45:27
I'm using the standard servo library. everything goes well if I use up to 7 servos. However, when I connect the 8th one it goes crazy! all previous servos stay still and the 8th one starts to jump back and forth...

Any ideas what's wrong? Is it a bug of the servo library?

btw. I saw there are libraries for arduino to drive an unlimited number of servos. did anyone try these out on wiring?

Title: Re: multiple servos
Post by Titus on 01/09/08 at 17:21:40
What code are you using?
Could you explain how you connected them?
that will help us find the problem

Title: Re: multiple servos
Post by tomek on 01/10/08 at 10:13:48
For testing I have used a modification of the standard servo example [code below]. If I leave out the line myservo8.attach(15); and further calls to myservo8 it all works fine. Otherwise the whole thing goes crazy. I power the servos separately with a 2A power supply, grounded to the wiring board. I've also tried adding pull-down resistors just in case, but it doesn't change anything.

here's the code:
#include <Servo.h>
Servo myservo1, myservo2, myservo3, myservo4, myservo5, myservo6, myservo7, myservo8;
int pos = 0;

void setup()
{
myservo1.attach(8);
myservo2.attach(9);
myservo3.attach(10);
myservo4.attach(11);
myservo5.attach(12);
myservo6.attach(13);
myservo7.attach(14);
myservo8.attach(15);
}

void loop()
{
 for(pos = 0; pos < 180; pos += 1)
 {                                
   myservo1.write(pos);
   myservo2.write(pos);
   myservo3.write(pos);
   myservo4.write(pos);
   myservo5.write(pos);
   myservo6.write(pos);
   myservo7.write(pos);
   myservo8.write(pos);
   delay(15);                
 }
 for(pos = 180; pos>=1; pos-=1)
 {                                
   myservo1.write(pos);
   myservo2.write(pos);
   myservo3.write(pos);
   myservo4.write(pos);
   myservo5.write(pos);
   myservo6.write(pos);
   myservo7.write(pos);
   myservo8.write(pos);
   delay(15);
 }
}

Title: Re: multiple servos
Post by barragan on 01/15/08 at 20:34:11
hi, your code seems correct, the problem is in the Servo library, Ive just include the fix for release with 0014. Thanks.

Title: Re: multiple servos
Post by Yaco Roca on 01/27/10 at 21:37:47
Hi, do you need additional power if you have over 1 servo? I need to hook up 24 servos to one wiring board and have it on permanently.

Title: Re: multiple servos
Post by Andy on 01/28/10 at 01:20:35

Yaco Roca wrote on 01/27/10 at 21:37:47:
Hi, do you need additional power if you have over 1 servo? I need to hook up 24 servos to one wiring board and have it on permanently.


Absolutely, the wiring board is not designed to handle the requirements of 24 servos.  Depending on the servo and the torque requirements you are probably looking at > 10 amps@5v.

Title: Re: multiple servos
Post by barragan on 01/29/10 at 23:52:45
Yes you can, the new servo library support 24 servos on the Wiring hardware. It is available form version 23, btw, version 0024 is already there.

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.