> Output = PGain(error) + IGain(sum of errors) + DGain(previous error- new > error) In a regulator application (constant setpoint) you may want to calculate the DGain term differently depending on whether the error change was caused by a change in setpoint or a change in the process value. The general idea is that the DGain term will be disabled in the case of setpoint change, this eliminates problems with large output swings etc after a possibly large (step) change in setpoint. One way to ackomplish this could be to calculate the DGain term as DGain(previous process value-new process value). In a servo application however (setpoint not constant) the DGain term should be calculated as above, DGain(previous error-new error) regardless of the cause of the error change. Maybe this is in the Microchip AN (have not read it yet)? Regards, Anders Friberg