Boat autopilot - PID not centralizing rudder.

If the apparent wind shifts 5 degrees to port, you want to steer the boat 5 degrees to port. This is to keep the full power in the sails, and take advantage of any lift. If the apparent wind shifts 5 degrees to starboard, you want to steer the boat 5 degrees to starboard.

Sounds logical, but what will your circuit do when the wind stops, or reverses direction, as it frequently does where I often sail?