I set up a very simple test sending a series of servo positions to two servo motors. For troubleshooting purposes everything is disconnected except the Arduino mega and the two servo motors. literally nothing else is plugged into the Arduino. There are no other power sources or cables near by either. When I run the program pictured below It seems to stop at a different line randomly and the servos stop working.
Occasionally I does work through the whole sequence and the servos move as they should.
So far the only way to get it working again... for perhaps one cycle before it stops randomly again…is to unplug the Arduino and plug it back in... then hit "set com" again. Any ideas?
You no provide dedicated power source by right you can’t operate 2 servo motor effectively. from you image I feel the 2 servo drain too much power. You try to use external power source to operate servo motor