fixed PID setup function