i have amg996r servo and an arduino mega. when i am running the sweep example from the arduino servo library the servo is moving almost randomly, looks like it moves toward the desired position and before reaching moving back to 0 degrees(altough it not always keeps this pattern, sometimes it is random).
my circuit is an external 5v power supply connected to arduino ground and the servo positive and ground and the servo pwm pin to arduino pin 9. do you have any idea why is this hapenning?