A controller includes a control unit, at least one DOF (Dynamic Offshoot Factor) unit, and a compensation unit. The control unit produces an output signal for a process according to a measured signal and a reference signal, so that the measured signal can be changed to approach the reference signal. The DOF unit receives a selection signal corresponding to a variable of the process that affects the measured signal or is affected by the control unit. Also, the DOF unit produces a DOF signal according to short-time and long-time average values of the selection signal. The compensation unit incorporates the DOF signal into one of the measured signal, the reference signal, and the output signal to obtain a compensation signal being sent back to the control unit, instead of the measured signal, the reference signal or the output signal, to facilitate controlling the process.