I'm writing a PID to control a toy car that follows a black line on a circuit. I've tuned my PID and it works at high speed for all the circuit except the winding section. For that, the error signal looks like a sine wave, and the toy car steers too much. I would like it to go close to straight, is it possible?
Edit: My car sees 100 grey points in a line ahead, and the difference between the darkest point and the middle of the visual range is the error signal. My output is the angle of a servo on the front wheels of the car, while the speed of the back motors is constant.
The desired performance would be to oscillate with an amplitude less than the amplitude of the winding road, and the actual performance is that the car steers close to the sine line for one period, and at the next max amplitude it under steers. Sorry, I can't provide graphs right now but I'll try to add some in the next days.
Is there a formula for adjusting the PID constants for the desired PID bandwidth?