Circuit and working principle of the controller