You are on page 1of 5

MPC Course

Mahdi Ansari 40200216


Project assignment 5

Simulation of MPC controller for Lane change maneuver

In this stage of the project, we assumed that both front and rear wheels of the bicycle model can be
steered.

Figure 1 Bicycle model with two steered wheels

With this assumption, the state-space model of the system is derived as follows:
̇
�𝑋𝑋 = 𝐴𝐴𝐴𝐴 + 𝐵𝐵𝐵𝐵 1
𝑌𝑌 = 𝐶𝐶𝐶𝐶 + 𝐷𝐷𝐷𝐷

2𝐶𝐶𝛼𝛼𝛼𝛼 + 2𝐶𝐶𝛼𝛼𝛼𝛼 2𝑙𝑙𝑓𝑓 𝐶𝐶𝛼𝛼𝛼𝛼 − 2𝑙𝑙𝑟𝑟 𝐶𝐶𝛼𝛼𝛼𝛼


⎡ � � �−𝑉𝑉𝑥𝑥 + � 0 0 ⎤
⎢ −𝑚𝑚𝑉𝑉𝑥𝑥 −𝑚𝑚𝑉𝑉𝑥𝑥 ⎥
⎢ 2𝑙𝑙 𝐶𝐶 − 2𝑙𝑙𝑟𝑟 𝐶𝐶𝛼𝛼𝛼𝛼 2𝑙𝑙12 𝐶𝐶𝛼𝛼𝛼𝛼 + 2𝑙𝑙22 𝐶𝐶𝛼𝛼𝛼𝛼 ⎥
𝐴𝐴 = ⎢� 𝑓𝑓 𝛼𝛼𝛼𝛼 � � � 0 0 ⎥
⎢ −𝐼𝐼𝑧𝑧 𝑉𝑉𝑥𝑥 −𝐼𝐼𝑧𝑧 𝑉𝑉𝑥𝑥 ⎥
⎢ 1 0 0 𝑉𝑉𝑥𝑥 ⎥
⎣ 0 1 0 0 ⎦
2𝐶𝐶𝛼𝛼𝛼𝛼 /𝑚𝑚 −2𝐶𝐶𝛼𝛼𝛼𝛼 /𝑚𝑚 1 0 0 0
2𝑙𝑙 𝐶𝐶 /𝐼𝐼 2𝑙𝑙𝑟𝑟 𝐶𝐶𝛼𝛼𝛼𝛼 /𝐼𝐼𝑧𝑧
𝐵𝐵 = � 𝑓𝑓 𝛼𝛼𝛼𝛼 𝑧𝑧 � , 𝐶𝐶 = �0 1 0 0� , 𝐷𝐷 = [0]
0 0 0 0 1 0
0 0 0 0 0 1
The state-space variables are lateral slipping speed (𝑉𝑉𝑦𝑦 ), yaw angle rate (𝜓𝜓̇), vertical position of the vehicle
(Y) and the yaw angle of the vehicle (𝜓𝜓). The outputs of the system are the same as the state-space
variables.

This model has been used both as control-oriented model and the plant for simulation of the controller.
The manipulated variables, front and rear steering angle (𝛿𝛿𝑓𝑓 & 𝛿𝛿𝑟𝑟 ), output variables and MPC weights have
been defined as structures in MATLAB. The steering angle the for front and rear tires are subjected to
conditions to be in range of -20 to +20 degrees which is compatible with most of the steering systems for
vehicles. The MPC controller has been defined using the aforementioned structures plus the time step
duration and the prediction (15) and control (2) horizons.

The flowchart of the simulation has been developed in Simulink. A step input with a magnitude of 2 has
been used as the reference for the vertical position of the vehicle (Y).

Figure 2 Simulink model of the MPC controller

The response of the system is illustrated as below.

Figure 3 The response of the system with default weights

The system has controlled the Y position of the vehicle with acceptable accuracy in 5 seconds. This
response is derived using the default weights for the MPC controller.
Table 1 Default MPC weights in simulation

Manipulated Variable [0, 0]

Manipulated Variable Rate [0.1, 0.1]

Output Variable [1 1 1 1]

Since the most important variable is the Y position of the vehicle, the weight for this out put has been
enhanced. The corresponding response is as below.

Output variable = [ 1 1 20 1]

Figure 4 The response of the system with manipulated weights

This change has decreased the overshoot of the system dramatically and also the response of the system
became faster.

The diagram of the yaw angle and yaw angle rate of the vehicle is illustrated as below:

Figure 5 Left: The variation of yaw angle of the vehicle. Right: The diagram of the yaw angle rat of the vehicle
The behavior of the yaw angle and yaw angle rate of the system is logical since the yaw angle starts at
zero degree and then the vehicle turns to make the lane change. After that, the vehicle must turn the
other way and reaches the zero degree once again so that the vehicle could be aligned with the road
and continue its path in the new lane.

Figure 6 The variation of control signals (steering angles) of the system

The above diagram shows the variation of control signals (steering angles) of the system. As it can be
seen in the diagram, at the transient part of the maneuver the controller uses the maximum permissible
steering angles to reach the reference and after that these angles become smaller to compensate the
small misalignments.

The trajectory of the vehicle is as follows:

Figure 7 Trajectory of the vehicle in response to step input

Moreover, the response of the system to a sinusoidal input has been studied.
Figure 8 response of the system to a sinusoidal reference with 0.5 rad/s frequency

The system has been subjected to a sinusoidal input with 0.5 rad/s frequency and amplitude of 2. As we
can see in the above diagram, the controller is able to follow the reference with a small delay which
could be an acceptable response for a vehicle system.

You might also like