Question about servos

I uploaded the basic servo program into my Arduino. Its just sweeping from 0 to 180. Now, 0 is not 0 and 180 is not 180. The total physical sweeping angle is less than 180, maybe about 160 degrees.

Is the fact that hardware sweep is less than software sweep problem with a servo?

Is the fact that hardware sweep is less than software sweep problem with a servo?

Not all servos move exactly 180 degees maximum travel. So it's not either a hardware or software problem. In your code you can adjust for actual Vs assumed travel stops by various methods.

Thanks retrolefty.

I have another question. Power for servo is coming from an external power source, while signal is coming from the venerable Arduino. I arranged the circuit so that both external power source and Arduino share a common ground. And everything worked just super-fine.

Than silliness got hold of me, and I wanted to see what will happen when I pull out the ground lead that is going into the Arduino’s ground pin. I thought that power will just shut down, but instead servo started spinning a full circles and several of them, at that. What is strange is that I thought that servo only can do a part of circle, and at this ‘silly’ condition it apparently can spin several full circles. How comes? Is this bad for servo?

Than silliness got hold of me, and I wanted to see what will happen when I pull out the ground lead that is going into the Arduino's ground pin. I thought that power will just shut down, but instead servo started spinning a full circles and several of them, at that. What is strange is that I thought that servo only can do a part of circle, and at this 'silly' condition it apparently can spin several full circles. How comes? Is this bad for servo?

Now that is weird.

Does it still work now?

Mowcius

A normal servo chat can do full rotations??? That is very weird! The hardware (pin in the gears) nor the pot should be able to do that. :o

I just wanted explanation. I do not think it would be wise to repeat experiment, since it didtn't look healthy at all.

I thought that I broke the pin and that was why it did several full circles. Servo works fine now and it is obeying its limits.

I thought that I broke the pin and that was why it did several full circles. Servo works fine now and it is obeying its limits.

Do you have any information on the servo (model number and manufacturer)?

Some servos -can- do multiple rotations (for a limited number of full rotations); they are typically used for winch control on sailboat models...

Maybe you have one of those (but without having the model and manufacturer info, I am just guessing)...

:)

Yeah, I bought them on eBay. They are unmarked. Only thing I know is that they are 9gr, analog, metal gear, which doesn't help much.

9gr with metal gears? I have only seen those with pom, do you have an image of them?

They are tough little cookies. You can get them on eBay here:

4x MG90 Metal Gear 9g RC Servo

Here is a forum thread where I show photo of that one, that spun its neck (or was it a head) several times:

Arduino multitasking problem

Have you tried adjusting the limits in code to see what maximum you can get?

Mowcius

I tried going up to 200, with no results. It would just sit at 180 for some time.

Maybe you need to adjust the max and min pulse width.

I think you do it like:

servo.attach(12, minpulse, maxpulse);

You'd better look that up to make sure though.

Mowcius

thanks for that, I didn't notice those options.

can somebody explain to me how servo's are instructed to move. Is it that you send to servo a pulse of say 1543 microseconds, and from that servo will surmise to move to 91.4 degrees of angle?

So if you just send it any 5V pulse of a right length it will go where it is told.

can somebody explain to me how servo's are instructed to move. Is it that you send to servo a pulse of say 1543 microseconds, and from that servo will surmise to move to 91.4 degrees of angle?

So if you just send it any 5V pulse of a right length it will go where it is told.

Both those statements sound synonymous to me. The servo has a built in controller, it knows it's present wheel location via it's built in position pot and it can read the input signal pulse width to determine the desired location, from those two things it can determine which direction and how far to move if the signal command does not equal the existing position.

thanks, I got it. Servo's controller just cares about the length of the pulse.

Since servo's controller know servo's present position can one interrogate controller to get the current physical position? I am not talking about 'desired' previously set software position, but the actual hard physical position. For example, servo didn't get where it needs to be, because of some resistance, so 'desired' software position and 'real' hardware position are different.

I think you would need something like this http://www.sparkfun.com/commerce/product_info.php?products_id=9014 to do that

Since servo's controller know servo's present position can one interrogate controller to get the current physical position? I am not talking about 'desired' previously set software position, but the actual hard physical position. For example, servo didn't get where it needs to be, because of some resistance, so 'desired' software position and 'real' hardware position are different.

No, because there is no output signal line avalible from the servo to the Arduino to read such position feedback information. One can modify a servo by running a new wire from the servos internal pot (the wiper terminal) to a Arduino analog input pin, then one could calculate the present position of the servo from that reading.

thanks guys, most appreciated. I am completely clear on what can be done with servos.

can somebody explain to me how servo's are instructed to move. Is it that you send to servo a pulse of say 1543 microseconds, and from that servo will surmise to move to 91.4 degrees of angle?

So if you just send it any 5V pulse of a right length it will go where it is told.

Umm, I haven't really looked into it but you send a specific length pulse then it will move to a specific position.

You can ignore the servo library and just send it pulses if you know what length you need to send for the position you want (bit banging it)

Mowcius