Anti-wind up scheme in the implementation of PID controller
In a PID controller, the "D" term isn't really "derivative", but is actually the output of a first-order high-pass filter with a finite cutoff frequency [if it weren't, any 1GHz noise on the input would be amplified 1,000,000 times as much as a 1Khz signal].  Likewise the "I" term need not actually compute a "pure" integral [which would be the nearly-infinitely-amplified output of a first-order low-pass filter with an infinitesimal cutoff frequency] but may instead be the output of a first-order low-pass filter whose a cutoff frequency correlates somewhat with the machine's slowest plausible response.  The gain of the filter may be set to control the DC behavior if the controller has been commanding a certain output for an arbitrary long time but the system hasn't moved; the cutoff frequency may then be set to control responsiveness when things haven't gotten that far.  Unlike integrators, low-pass filters with a finite cutoff frequency have a limit to how far they can "wind up" with a given level of input.

An additional approach to prevent wind-up would be to--rather than low-pass-filtering the P term directly, either integrate the difference between the commanded output and what it would have been without the "P" term, or else low-pass filter the actual commanded output.  If the output stimulus is pegged to the point that the "P" term isn't able to have its full effect, the "I" term shouldn't operate on the "P" term, but only on its contribution to the output.  Using a low-pass filter with this approach will probably be easier than trying to use an integrator, since the filter can be set so that the loop feedback gain doesn't exceed one.  Otherwise, when using an integrator and trying to compute the difference between what the output would be with P and without P, it may be difficult to ensure that the integrator's output doesn't generate positive feedback to its input (which could destabilize the system).