Use global data to update the PID gain