In order to achieve automatic braking and optimization of the braking process, this paper proposes a hierarchical control for the automatic braking system of vehicle, in which the upper level controller is used to find the optimal braking deceleration and the lower level controller is used to generate appropriate braking torque to make the vehicle follow the upper controller's target. The upper level controller uses model predictive control. In the design of model predictive control, a set of discrete orthonormal Laguerre functions are used to replace the traditional control vector to reduce the computational burden. The lower level controller adopts the extended observer-based PID compensation control. The extended observer is able to estimate external disturbance even when the disturbance is time-varying such as that caused by the change of road slope. The observed data is then used for PID control. The proposed control method is able to make the car well track the car in front of it. Even though both the velocity of the leading car and the road conditions change, the proposed method is still able to make the following car well track the leading car while remaining at a safe distance. The effectiveness of the proposed control system is validated by numerical simulations.