Automatic stop in the minimum and maximum height