[Solved] Quick questions: Servo Library [PWM]

Hi,

Note: I have asked a similar question before, but I couldn't explain it properly and the answers confused me.

First of all, please clarify that if I use 12 RC Servos on UNO using Servo Library, would it provide pulses at exactly after 20ms to each of them? (I am confused because it says only 6 pins provide PWM outputs)

Secondly, can I connect the signal wires of two RC servos together onto one pin of UNO, and expect to see 'same rotation' for both servos?

This is how I will connect them: http://www.rockmyspace.info/image-upload/uploads/1/uno.png

Thanks

First of all, please clarify that if I use 12 RC Servos on UNO using Servo Library, would it provide pulses at exactly after 20ms to each of them? (I am confused because it says only 6 pins provide PWM outputs)

R/C servos are NOT controlled by PWM, so the question is irrelevant.
The servo library does NOT generate PWM.

Secondly, can I connect the signal wires of two RC servos together onto one pin of UNO, and expect to see 'same rotation' for both servos?

Probably. "Same" may not be exact.

First of all, please clarify that if I use 12 RC Servos on UNO using Servo Library, would it provide pulses at exactly after 20ms to each of them?

Yes, the servo library provides the appropriate timing for controlling servos

(I am confused because it says only 6 pins provide PWM outputs)

Yes, you are still confused.

Secondly, can I connect the signal wires of two RC servos together onto one pin of UNO, and expect to see 'same rotation' for both servos?

Yes, you should be able to connect several servo signal wires to a single servo output pin.

(I am confused because it says only 6 pins provide PWM outputs)

There are only 6 pins, on the non-Mega Arduinos that provide PWM. Servos don't operate on PWM though, so the number of PWM pins is irrelevant.

First of all, please clarify that if I use 12 RC Servos on UNO using Servo Library, would it provide pulses at exactly after 20ms to each of them? (I am confused because it says only 6 pins provide PWM outputs)

A link with basic servo info.

http://www.lynxmotion.com/images/html/servo01.htm

I would suggest you put those +6V into the power input plug, not into the +5V output from the uno...

Also, since you are so stubborn with PWM, this is PWM: http://www.arduino.cc/en/Tutorial/PWM
And here some explanation of PPM: Servo Tutorial - How a Servo Works

Thanks everyone !

raron:
I would suggest you put those +6V into the power input plug, not into the +5V output from the uno...

yes yes yes, sorry about the drawing, but thanks for the reminder.

raron:
Also, since you are so stubborn with PWM, this is PWM: http://www.arduino.cc/en/Tutorial/PWM

And here some explanation of PPM: Servo Tutorial - How a Servo Works

lol umm, I actually meant PPM without knowing it's called a PPM for servos ! - Anyway, thanks for the links, I will try to understand the difference between the two (though I do understand the concept).

Just another thing that confused me here was that on the 2nd link you posted (for PPM) it says:
"The 20ms cycle is long enough to represent up to 9 servo positions."
And I understand why is that, but does UNO Servo Library somehow pulse all 12 servos after every 20ms OR does the 12 pulses are repeated after every ~26ms ?

Anyway, I won't mind a ~6ms delay, that shouldn't affect the torque too much, I hope. I am declaring the Topic as [Solved], but it is open for anyone who is willing to clarify that^ minor confusion of mine. Thanks in advance !

Best thing to do is purchase a single servo and start experimenting.

sorry about the drawing

If you really intended to connect it that way you'd probably destroy something on your arduino, so it was a good thing you posted that.

Just another thing that confused me here was that on the 2nd link you posted (for PPM) it says:
"The 20ms cycle is long enough to represent up to 9 servo positions."
And I understand why is that, but does UNO Servo Library somehow pulse all 12 servos after every 20ms OR does the 12 pulses are repeated after every ~26ms ?

As far as I know, and I haven't used the servo library much (just some sporadic tests a while ago), each servo, which have their own output pin from the arduino, refreshes every 20 ms (I don't get where you have 26 ms from?).

To give you some leeway, these signals (PPM) could be seen as a special case of PWM, in which the duty-cycle is from about 5% to 10%.

As for the 20ms being long enough for 9 servos, it is if you consider the pause of the PPM is the remaining 90ish% of the 20ms cycle. You could put more servo signals on the same output pin (and it is no longer a PWM at all). Also some leeway should be calculated as not every servo uses exactly 1ms to 2ms, but some a little less to a little more. Hence you cannot put 10 servos on it, as a synchronization signal (pause) is also needed at the end of the cycle.

But it's not utilized in this way in the servo library (as far as I know), because it requires additional circuitry. I believe there is a shield that uses this method, and some counters (ringcounter?) to distribute the servo signals (so each servo still have its own signal wire). I dont have the link atm.

(In fact I started making something like this a little while ago, but haven't continued... yet)

Best thing to do is purchase a single servo and start experimenting.

Absolutely!
If you get it right the first time, you're doing it wrong :stuck_out_tongue: