An adaptive PID controller for nonlinear systems