2

So I am new to the board and looking for a source to answer an Arduino servo project's rough power up. The project uses a pair of servos operating together to swing a small door. I have been working with intro level sketches over the last few weeks. I have powered and re-powered my Arduino Uno several times with different codes and each time the unit is powered the two servo motors move to their last position at what appears to be full speed resulting in a rather jerky and jumpy power up.

What can you suggest in the code that would force the servo motors to gently move toward their new code starting position? Like a 'warm up cycle'.

3

You cannot do that with ordinary servos. This is because of the way the communication protocol is built: the only thing a servo understands is a command which in effect means “go to that position as fast as you can”. You can achieve smooth movements by updating the requested position (the so called “set point”) many times by tiny steps, but you still have the problem at startup.

I see two possible solutions to your problem:

  1. Make sure you know the position at which the servo was left when you powered down your Arduino. You can either arrange to leave it always at the same position, or you can store the last position in EEPROM before powering down. Then, at startup, you initialize the servo with that last known set point.

  2. Use a special type of servo known as a feedback servo, or convert a regular servo to get a feedback. A feedback servo is a type of servo that tells you its actual position, so you can arrange for the initial set point to match that position.

  • Thank you for your reply. You are correct, I was specifically and exclusively inquiring about the ability to control the servo's rotational speed at program initialization. I'm "learning" about the control methods for servo control post initialization... still learning. Based upon your comment it looks like I should add EEPROM to my list of things to learn. I will need to educate myself a little more with on line resources. – Will Ehlert Apr 15 '16 at 20:02
0

I would recommend an S curve for the angular positioning of the door.

That should guarantee a smooth start and stop.

  • Just to be clear, I'm not saying that you should use the S curve simply to represent absolute min and max. No. You should use it to assign the current and target position to begin and end of the curve, then split the space in between. This requires fairly accurate timing, so it might not fit well with the rest of the program you have written. – Igor Stoppa Apr 14 '16 at 6:32
  • This is irrelevant to the actual problem of the question. It might be worth contemplating later on (such as for commanded movement between positions while the system is running), but it provides no help for the present start-up difficulty. – Chris Stratton Apr 14 '16 at 14:03
  • @ChrisStratton I see the question as composed by 2 parts: a) handle the initial offset, which yes, I have not addressed, and b) "gently move", which is what I was addressing and you refer to as "later on". – Igor Stoppa Apr 14 '16 at 14:06
  • No, both references are to the startup problem - see the question title "gentle servo power up" and the "warm up cycle" in what you are calling part 2 if there is any doubt. – Chris Stratton Apr 14 '16 at 14:09
  • I was referring to "What can you suggest in the code that would force the servo motors to gently move toward their new code starting position?" Doesn't that mean that there is a new target set? – Igor Stoppa Apr 14 '16 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.