Many Problems with a single servo

Hi to all,

my first topic hrhr ... well i am new here and with my arduino. i build one 3x3x3 led cube for fun and then one 4x4x4 wich looks much more like a cube...finally.

my project:
is a Laser-safety shutter for our LaserTable. For that i will use a hallswitch and some magnets for the signal. If someone moves the important part the magnetic field changes and boom the shutter goes down. Hallswitch was easy to read out but the servo is controlling me, not i controll the servo.

The Problem:
I tried to run the sweep example from the library and the servo is just twitching. Servo is hooked up on pin10(orange cable, signal), GND(brown) and the power 5V(red). Dont work...

Then i tried to use an external Power supply. Again pin10 Signal, i connected the GND form the arduino with the GND form the external powersupply and the red cable to the power supply. Dont work...

I use this servo:
http://www.produktinfo.conrad.com/datenblaetter/225000-249999/233751-da-01-en-Top_Line_Standard_Servo_RS_2_JR.pdf
My Arduino Duemilanove ATmega 328 is connected via usb.

Hopefully this crappy paint picture will help to understand what i am doing wrong.
http://s7.directupload.net/file/d/2989/urx7tqnu_png.htm
Thanks in advice
Gero

On that .png drawing you show your external power supply as having three connections, ground, - , and +. Perhaps the ground is just a protection ground and not referenced to the - side of the power supply. Just move your ground wire from the ground terminal on the power supply to the - terminal on the power supply and see if it does not then work properly.

Lefty

If you are using the "Sweep" sketch included with the download, the servo signal line is connected to pin 9, not pin 10. It works fine on my Ubuntu 10.04 system.

I checked the pin in sweep and i already changed it to 10. So the pin is correct.

Moving the ground wire from my ground terminal to the - terminal on the power supply killed my servo...
Any ideas why?

puzzu:
I checked the pin in sweep and i already changed it to 10. So the pin is correct.

Moving the ground wire from my ground terminal to the - terminal on the power supply killed my servo...
Any ideas why?

If you could post a link of a datasheet for your specific power supply maybe we could help, but otherwise we would just be guessing. So killed your servo means they not longer function as before if you move the ground wire back to where you first had it?

Lefty

http://www.home.agilent.com/agilent/product.jspx?pn=e3631a&cc=DE&lc=ger

There is no picture of it but this is the one i used.

I saw smoke... thus it will not move anymore...

Well that is a triple output power supply, that has 3 different output voltages, all which are adjustable, none that are referenced to ground unless you wire them as such. So there is no telling how much voltage you applied to the servos. You original posting drawing showed a single output power supply, that so we had no way to figure out what you were working with. I suspect you have applied both a +5vdc and a -5vdc to your servos which mean they received 10vdc which is above their maximum, maybe even more as we don't know what values the voltages were adjusted to. That is a very nice and capable power supply but you much have a good understanding of it to proper and safely use it in your projects. Sorry if I contributed to any damage caused by my suggestion.

Lefty

yes i applied +5vdc, and i checked with the oscilloscope it is +5 and -5...i had to order some new servos for my next try...well i made again a crappy paint picture of my wiring. Will it work this way?

With 2,5 vdc on the 0-6V output?

I fell me so dump at the moment. Maybee i will understand why it dont work all the time soon...

Well i tried it again...

i observed something new. The new servo run the sweep example from 0 to 180 degrees and then started twitching. Thus i rotated the servo with my hands back and then again connected it to the arduino. And it again only goes from 0 to 180 degrees up but not back?

Do i have to add something to the normal code to get it working? Signal on pin9, vdc on 5V pin, GND on GND.

// Sweep
// by BARRAGAN http://barraganstudio.com
// This example code is in the public domain.

#include <Servo.h>

Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created

int pos = 180; // variable to store the servo position

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}

For a small servo connect +ve 5V on the uno and -ve grd on the uno.

Mark

Will it work this way?

No, you do not have the arduino and power supply grounds connected.

puzzu:
yes i applied +5vdc, and i checked with the oscilloscope it is +5 and -5

Are you using an ordinary hobby servo from an analog radio control system?

You don't need a scope, you need a DC voltmeter between the servo +ve and ground connections. This should read the same as the voltage the servo is designed to work with - typically 5V for an ordinary RC servo, but you haven't said what you're using. The servo ground needs to be connect to the Arduino ground, and the servo signal needs to be connected to the Arduino signal pin.

If you're using a different type of servo it may have different power and signal requirements,so you need to be clear about what sort of servo you're using.