ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.12k stars 9.7k forks source link

MRAC vs MPC control? #11741

Closed Addi2020 closed 4 years ago

Addi2020 commented 4 years ago

Apollo 5.5

Q1. Apollo 5.5 introduce MRAC(model reference adaptive control) together with LQR control for steering control (lateral control), what is the advantage of using MARC with LQR instead of MPC?

Q2. If use MRAC then we need to tune both LQR ( matrix_q: 0.05 matrix_q: 0.0 matrix_q: 1.0 matrix_q: 0.0)

and MRAC gain vlaues (adaption_state_gain: 1.0 adaption_desired_gain: 1.0 adaption_nonlinear_gain:1.0 adaption_matrix_p: 1.0) ?

I used both LQR and MPC control on real car, LQR control tuning did not give stable steering control where as after tuning MPC control give much better control of steering at apollo3.5 platform.

kevin-y-wang commented 4 years ago

To clarify this argument, actually MRAC control is an additional controller stacked on the lateral control. MRAC can be cascaded with both the LQR control and MPC control; i.e., we may use LQR + MRAC or MPC + MRAC as the lateral controller. The purpose of designing the MRAC control is to addresses the by-wire steering actuation system dynamics and time-latency, which is neglected in both LQR and MPC design process.

kevin-y-wang commented 4 years ago

In particular, the MRAC actually uses the steering command from either LQR or MPC as input, and generated a compensated steering command which may improve the response of the steering control. Hopefully this will help to explain the relations among LQR, MPC and MRAC

Addi2020 commented 4 years ago

@kevin-y-wang Thank you for you explanation. As in apollo 5.5, MRAC is added with LQR, Similarly we can add ouself MRAC with MPC to get better performance of steering control.

AlexandrZabolotny commented 3 years ago

Hello colleagues! I am trying to tune a control module on a real car.

I will try to run both MPC and LQR+PID

I get the following result

In the case of LQR+PID Good speed control (longitudinal control), but poor lateral control. When cornering, it does not follow the desired trajectory and therefore dynamically turns the steering wheel. 2.in case of MPC It repeats the trajectory well. Smoothly turns the steering wheel. Provides a comfortable ride. But poor speed control. A very large longitudinal error, also the car does not stop at the required point.

I want to use MPC. So I have two questions.

Is it possible to set up longitudinal control for MPC? If so, how? Is it possible to use MPC for lateral control, but for longitudinal - PID ??