Arduino Uno unexpected behavior of connected device

Hello,

I have desktop control application from Windows OS in C#, connected with USB to Adruino Uno micro-controller powered with USB 5V from PC and Adafruit 16-Channel 12-bit PWM/Servo Shield on it, powered with 6V 2A power supply. Program sends angle degrees to 8 motors:

6 units of Power HD High-Speed Digital Micro Servo DSM44 :

Stall Torque: 1.2Kg.cm (16.66 oz-in)@4.8v | 1.6Kg.cm (22.22 oz-in)@6v
Speed: 0.09 sec (4.8V) │ 0.07 sec (6.0V)
Operating Voltage: 4.8 ~ 6.0 DC Volts
Digital: YES

and 2 units of FEETECH Mini Servo FT1117M

Stall torque @ 4.8V: 3 kg·cm | @ 6V: 3.5 kg·cm
Speed: @ 4.8V: 0.13 sec/60° | @ 6V: 0.11 sec/60°
Digital: NO

Everything works fine, but sometime something goes wrong. Motor makes unexpected movement, and most worth thing, changes 0 position, then I've to remove horn from the gear and install it again. I began to identify the problem by exclusion:

  1. I've checked other servo motors, but all working servos behaves as described.
  2. Checked extension cords from servo to shield.
  3. Checked new Adafruit 16-Channel 12-bit PWM/Servo Driver instead shield
  4. Changed Arduino Due instead Uno

But in all cases failure appears, and here is what I hope found. If I connect assembly by second sequence:

  1. Plug USB
  2. Plug power adapter
  3. Open program, which sets motor start position with form load event

And with turning off:

  1. Close program, which sets motors to start position with form closing event
  2. Unplug USB
  3. Unplug power supply

I'm not absolutely sure, because in once, there was a strange behave of motors, when I touch gear of one and another does unexpected movement by unknown reason, but even this, seems like turning on/off way described above, problem does not appears. And happens, if i unplug the USB or power supply during processing, and after shutdown, turn it on again, not always, but in most cases, I get the failure described above.

First of all I'm trying to figure out, what really causes this problem. If my assumption is correct with unplugging during the process, then what can I do in this case, because user can unplug USB before closing program.

As I know, servo when powered off will remain in it's last given position, and there is no way to know what position the servo is presently at, because there is no position feedback signal from the servo.

Two things I have to notice, when the described problem occurs, unexpected movement happens not only if USB and 6V both connected, somehow it moves servo only with power supply plug or only with USB plug to incorrect position and lost of angle without any command from application or uploaded sketch. It is occurs immediately when connecting one of the wires, otherwise I could save the position of the motor to a text file and calculate its final position. And I'm not sure exactly how, but with mechanical load on the gear, this particular servo, somehow goes to the correct position with load.

If controller is able to send data without 5V of 6V separately, maybe I can prevent unexpected disconnection with load, or maybe it is a problem with remaining data on board from previous processing, and somehow it is possible clear it.

I'm not sure, what can I do, or even use, to set default position with disconnected UBS during process and do not lost position.

Any advice, guide or example would be very helpful

95% of all servo issues people report are inadequate power supply for the servo(s). How many servo's of
what type? A 2A supply can do 2 small servos at most in practice.

MarkT:
95% of all servo issues people report are inadequate power supply for the servo(s). How many servo's of
what type? A 2A supply can do 2 small servos at most in practice.

Hello, I have 8 servos. I use 1000uF capacitor on shield. But failure occurs even with 2 or 1 servo, mostly when I unplug power supply, seems like shift of starting position occurs with unexpected degree movement when servo horn reaches and goes against physical limit by some reason beyond defined SERVOMIN and MAX. So, if it is a reason of failure, I'm not sure, what must be proper amperage for particular 8 mini digital motors with 6V power supply:

6 units of Power HD High-Speed Digital Micro Servo DSM44 :

Stall Torque: 1.2Kg.cm (16.66 oz-in)@4.8v | 1.6Kg.cm (22.22 oz-in)@6v
Speed: 0.09 sec (4.8V) │ 0.07 sec (6.0V)
Operating Voltage: 4.8 ~ 6.0 DC Volts
Digital: YES

and 2 units of FEETECH Mini Servo FT1117M

Stall torque @ 4.8V: 3 kg·cm | @ 6V: 3.5 kg·cm
Speed: @ 4.8V: 0.13 sec/60° | @ 6V: 0.11 sec/60°
Digital: NO

Hi.

MarkT gave you a rule-of-thumb, telling that smaller servos need about 1A each.
But if you put a large mechanical load to your servo or these servos of yours aren’t that small, this 1A might not be enough.
You’d need to get some more detailed information from the servo manufacturer.
Stall current is the item to look for.

Another rule-of-thumb is to use separate power supplies for servos and for your Arduino, connecting the grounds of these supplies to each other and to your devices.
That way, tripping some over-current protection or other similar problems will not affect and destabilize your Arduino
You can also use a separate supply for each servo, or for instance per 2 servos, as long as you keep the GNDs connected between all of them.

MAS3:
Hi.

MarkT gave you a rule-of-thumb, telling that smaller servos need about 1A each.
But if you put a large mechanical load to your servo or these servos of yours aren't that small, this 1A might not be enough.
You'd need to get some more detailed information from the servo manufacturer.
Stall current is the item to look for.

Another rule-of-thumb is to use separate power supplies for servos and for your Arduino, connecting the grounds of these supplies to each other and to your devices.
That way, tripping some over-current protection or other similar problems will not affect and destabilize your Arduino
You can also use a separate supply for each servo, or for instance per 2 servos, as long as you keep the GNDs connected between all of them.

Hello,

I need single power supply for all, I have edited my question with given specifications, but I'm not sure how properly calculate, and there is no Stall current

Start with a 5-6V, 6 Ampere (minimum) servo power supply, and go up in current from there until your servo problems go away.