Optimum tuning of the PID controller for stable and unstable systems using nonlinear optimization technique