Hi Sancho. It's possible that your Kp value may be too large. At the moment, you have a value of 700 for Kp.
I guess it all depends on the relative scaling factors for your error signal...... but I think values of Kp are typically in the range of 10 to 20 or so. Having very large values of Kp can make the bot become unstable.
For testing..... just set Ki to zero for now. And leave Kd as it is. And, if possible.....make Kp much smaller than 700..... such as 15. But then again, it all depends on the what sort of error voltages you have. Although, 700 appears way too large.
Also, the code that you posted....... this code doesn't run within your robot, right? If it does.... then avoid using delay() functions. Delay() functions will slow the loop iteration time, and can make a control system sluggish and maybe glitchy.