Automatic differentiation applied to excitations with projected entangled pair states