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
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°
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:
- I've checked other servo motors, but all working servos behaves as described.
- Checked extension cords from servo to shield.
- Checked new Adafruit 16-Channel 12-bit PWM/Servo Driver instead shield
- 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:
- Plug USB
- Plug power adapter
- Open program, which sets motor start position with form load event
And with turning off:
- Close program, which sets motors to start position with form closing event
- Unplug USB
- 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