Arduino Rebooting in middle of work!

Maybe it’s a beginners mistake but I’m using two servos, I upload the sketch, everything is fine, working; BUT, when a servo (in SOME CASES ONLY) gets to the far right or left it starts to do shity things, rebooting the whole USB connection and even the servos working at angles I didn’t sketched. What do you think?
Can you help me?
I already set limits to the pulse width so it don’t get to the limit.
And most of the time works well, but the “most” part is what I don’t like.

Hope some Arduino Wizard to help me.

I had similar symptoms, caused by the servos drawing more power than the USB could supply. Try it with the servos powered from and external source, you could use a 4 cell battery pack or a 5v power supply.