#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached
And to follow from @manor-royal, the problem I detected is not a result of the servo stopping in the "wrong" position because several brief restarts (i.e. without leaving it connected long enough for servo.attach() to happen) will progressively move the arm all the way to the limit of the servos movement....R
Am i right in assuming from your answer that your set-up does not experience deflections during power-up? If this is the case may I ask the make and model of your servo? Please.
I won't answer that until I've checked that it never happens, but I've certainly never noticed it before. Or should I say I've never noticed that I noticed, if you know what I mean.Sorry, I didn't realise your problem was purely power related, I assumed it was a control thing.So just to clarify: if you literally apply just power to the servo, with no live control wire, it deflects by 20-odd degrees no matter where it last stopped?If so what happens if it was stopped at the end of travel and can't move another 20?- does it start coming back?
Without signal, they will constantly wind themselves around with each successive power-up.Look up how a servo works internally and you will see the reason why.Hint, it has to do with the internally generated servo position signal to the comparator.
So can you power your servos up with a relay or something after they are getting their signal? Should stop the jump.
Will try that solution. Many thanks.
While it should work it is a real PITA.I suspect a small transistor would be sufficient to control the power to the servo - simpler than a relay....R