servo, ping sensor issues with arduino

Since there is no load on the servo (nothing to make it drift), you might try detaching the servo before doing the ping sensor stuff, and then reattaching the servo.

Otherwise, I have no idea what the problem is.