Servo Positions

Hello!

Sorry if this seems like a bit of an odd question - New to Servos and basically using two of them with the Uno for pan/tilt to basically move an object to a predefined angle.

In a nutshell:
If I set the servo (standard one) to move to '45 degrees' and stop, and then turn off the Arduino - when the board is powered back on and re-runs the loops, will the servo angle stay where it is, or will it move another 45 degrees, to 90 degrees from where it was right at the start?

Creating something that moves to an exact angle at a specific time and don't want the angles to screw up between power cycles!

If you use servo.write(45) it will always go to the 45 degree position. It doesn't add positions.

However things are not so straightforward when you switch the power off. You may find that the servo moves back to 0 or anywhere else before the Arduino gets around to telling it to go to 45 degrees. Unfortunately there is no standard for what servos should do when they are powered up but are not yet receiving a control signal. It may help to do servo.write(45) immediately before or after servo.attach(). It may also help to connect a 4700 ohm resistor between the servo signal wire and ground.

...R

Also while the arduino and or servos are powered off there will be no torque holding the servos at their last valid position command. So unless the 'mechanical load' is perfectly balanced it's quite possible for the servos to move because to mechanical load acting against just the gear train friction alone.

Proper way to use servos is to keep them powered up and valid control signals being sent at all times if you don't want to suffer various jitters and or start-up jumping problems.

Thank you both very much! :smiley: