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?