 The current "error" is calculated by subtracting the "measured_value" (the process variable, or PV) from the current "setpoint" (SP).Then, "integral" and "derivative" values are calculated, and these and the "error" are combined with three preset gain terms – the proportional gain, the integral gain and the derivative gain – to derive an "output" value.In the real world, this is D-to-A converted and passed into the process under control as the manipulated variable (MV).