Go Down

Topic: How does SERVO work? (Read 455 times) previous topic - next topic

selit

Interestingly, arduino documentation to servo library http://arduino.cc/en/Reference/Servo tells us that servo data wire can be connected to any pin.
Somewhere back in my skull information is stored that servo is driven by PWM,using pulse width as a mean how to tell angle to servo.Is that right?

If servo can be driven by no-PWM pin,mean that arduino tells to the servo new position,wait upon servo movement is completed and subsequently executes following code?
If so,after servo movement completion,can servo keep position (against spring for instance) even if void loop() does not pass thru servo.write command very soon?

It simply does not take much sense...

My project is very timing dependent and waiting to end of servo movement would completely disrupt it.


retrolefty

Quote
If servo can be driven by no-PWM pin,mean that arduino tells to the servo new position,wait upon servo movement is completed and subsequently executes following code?
If so,after servo movement completion,can servo keep position (against spring for instance) even if void loop() does not pass thru servo.write command very soon?

It simply does not take much sense...


No need to be concerned. The servo.write command causes the last position code you wrote to the servo to be forever repeated automatically every 20 millisec at the output pin wired to the servo as the servo expects to see, all interrupt driven so you do not need to do anything about it other then issue servo.write commands to the position(s) you want the servo to go to. It's all interrupt driven so as long as you don't turn interrupts off you have no concerns.

Keep in mind that in your code you can have no direct knowledge of then the servo actually reaches the position command you send it, as there is no feedback signal from the servo to the arduino that it has reached that last position commanded, or if it's still moving to get there.

Lefty

Go Up