Trouble coding Servo motor to move 90 degrees

After messing around with some of the values i have realized that the power is indeed the issue, like you implied Robin2 sometimes its fine and others it just behaves strangely. Has any one got any advice on sustaining a servo motor, and how many volts will i need to make it work fluently?