I require your help regarding a problem I’m encountering.
Description: I am using arduino uno to program and work with 12 servos together(MG996R) i had used different supply to move servos (5v 6amp. ,common ground is given with arduino) and it works well but i am encountering a problem that when i power up the arduino many of these servos move to some unkonwn angle and then come backs to the given specified angle will anyone please tell me the reason and how can i solve this problem.
Hardware concerned: i am using arduino uno, 10 mg996r servo motor and external supply of 5 volt and 6 ampere
Software concerned: program i used is - #include <Servo.h>
I’ve never tried to solve the issue or chase down a cause, but most servos will jump when powered up. It’s commonly called all sorts of nasty names and sometimes “servo startup jump,” “servo startup jerk,” or just startup jerk/jump. This happens as a quick, momentary jerk before they go slack again without commanded pulse widths.
Once the controller has booted and begins to execute the sketch, the internal circuits in the servo will move it from it’s initial position to the first commanded position automatically once the servo receives a positioning pulse. The servo controller will then repeatedly resend that pulse and the servo will hold that position against input torque until the servo is commanded to a different position or the positioning pulses are stopped.
The startup jerk seems to happen to some servos, but not all. Some have reported successfully eliminating the jerk by putting a 10k resistor between the servo control lead and ground. Others report that this does not solve the problem. Some have reported successful elimination by using a relay or power MOSFET to switch on motive power after the controller has begun repeatedly issuing the positioning pulse. Others report that THIS does not solve the problem.
My personal suspicion is that it is a behavior that is inherent in the servo’s internal circuit design and that it’s occurrence and magnitude is dependent on the random tolerances of that circuit’s individual parts. Some do. Some don’t. Sometimes it’s bad. Sometimes it isn’t. Sometimes one thing fixes it. Sometimes another thing does. Sometimes nothing fixes it. That sounds to me like a perfect description of circuit design slamming full speed into the varying interactions of individual component values varying within tolerance. I also suspect that any success had by switching the motive power on after the controlling pulse is being repeated is because the jerk impulse is so fleeting that it is getting masked by the controlled movement immediately after.
One of the things that is “on my list” is to isolate a servo that does this reliably, put it on the scope, and chase down the source and cause of this startup impulse, but it’s a long list and this is a relatively low priority…
Most of us just practice reasonable appendage safety and try not to flinch when the servos jump. I know I do. I’ve never seen any evidence of servo damage from this, so I just expect it to happen when the servos get powered up.
Sorry I’m unable to provide a clear solution, but hopefully you better understand the nature of the problem and can make informed decisions about if and how to deal with startup jerk.
Also sounds about right… Though I do have one that will reliably jerk so hard it moves about 5-6 degrees (always in the same direction). Eventually, after enough power cycles (without any control signal applied), it will run into its own internal physical barrier and effectively stall momentarily before it goes limp again!
@Kailash
Ultimately, as @caltain said, the best may be to ensure a control signal is present before power… but depending on the internals of your RC servomotors that may not even prevent it (the jerk on power on) from happening.
I don’t know about the initial position that you seem to be getting as the 1st target position. But, one way to slow the initial movement of the servos, is to have a longer off-time to the pulses you are sending. Well, at least this may work on the cheap ones, which can be made much more sluggish by slowing the pulse rate. Intelligent ones, I don’t know about, since it depends on how their internal processor was programmed.
As you say, that may or may not help.
You can definitely control the speed of motion (indirectly acceleration) by changing at which rate you change the positions, too. Which (I think) is effectively what happens when you change your rate of command update.
But that also only works when you are close to the current position with the new one. Since the first position (at power-up) starts from an unknown location, you get fast movement, too.
This is just a glitch that most low cost RC servomotors seem to have. This happens before you even send positions as you power them up.