F2-DP-2018-Tuma-Jiri-MT_JiriTuma_2018
F2-DP-2018-Tuma-Jiri-MT_JiriTuma_2018
F2-DP-2018-Tuma-Jiri-MT_JiriTuma_2018
F2
Faculty of Mechanical Engineering
Department of Mechanics, Biomechanics and Mechatronics
Bibliographic citation:
TŮMA, Jiří. Torque Vectoring Predictive
Control for Electric Vehicles. Master’s
Thesis. Prague: Czech Technical Uni-
versity in Prague, Faculty of Mechanical
Engineering, 2018.
v
Abstract Abstrakt
The electric mobility and digitalisation Elektromobilita a digitalizace mají obrov-
have an immense potential and will write ský potenciál a budou psát automobilovou
the automotive future. More and more budoucnost. Bude implementováno stále
sophisticated algorithms considering and více sofistikovaných algoritmů zohledňují-
handling safety, efficiency, sustainability cích bezpečnost, efektivitu, udržitelnost a
and increasing transport demands will be zvyšující se požadavky dopravy.
implemented. V této práci je prezentován algoritmus
The torque vectoring algorithm designed vektorování točivých momentů navržený
especially for electric vehicles with inde- zvláště pro elektrická vozidla s nezávisle
pendently controlled all-wheel drive is pre- říditelným pohonem všech kol, vycházející
sented within this thesis while consider- ze zjednodušeného dynamického modelu
ing a simplified planar vehicle dynamic vozidla a využívající strategie prediktiv-
model and utilizing model predictive con- ního řízení.
trol strategies. Práce představuje sestavení dynamického
The thesis introduces construction of the modelu, jeho vhodnou úpravu pro syntézu
dynamic model, its appropriate trimming řízení a řídicí algoritmus spolu s vlastní
for control synthesis and the control al- realizací v prostředí Simulink® . Provedené
gorithm along with implementation in simulace byly úspěšně zakončeny výsled-
the environment Simulink® . The per- ným váhově optimálním rozložením jed-
formed simulations resulted successfully notlivých hnacích točivých momentů.
in weighted optimal distribution of the
individual wheel torques being applied to Klíčová slova: vektorování točivých
the vehicle electric motors. momentů, prediktivní řízení, dynamika
vozidel, elektromobilita, simulace
Keywords: Torque Vectoring,
Predictive Control, Vehicle dynamics,
Electromobility, Simulation
vi
Contents
1 Introduction 1 6 Conclusions and future work 43
1.1 Motivation . . . . . . . . . . . . . . . . . . . . 1
1.2 Driver assistance systems . . . . . . . 1 Appendices
1.3 Torque vectoring system . . . . . . . . 2 A Simulink models 47
1.4 Electric vehicles . . . . . . . . . . . . . . . 3 B Bibliography 53
Part I C Key symbols 55
Modelling vehicle dynamics D Content of enclosed CD 57
2 Planar Vehicle Dynamics 7
2.1 Body frame and coordinates . . . . . 7
2.2 Newton-Euler equations . . . . . . . . 7
2.3 Forward vehicle dynamics . . . . . . . 9
2.4 Vehicle kinematics . . . . . . . . . . . . 10
2.5 Wheel and tyre dynamics . . . . . . 11
2.6 Nonlinear dynamic model . . . . . . 13
3 Model verification and state space
form 15
3.1 Model simulation . . . . . . . . . . . . . 15
3.2 Trimming and linearization . . . . 18
3.3 Discrete state space . . . . . . . . . . . 21
Part II
Predictive control
4 Algorithm design and solving 25
4.1 Introduction . . . . . . . . . . . . . . . . . 25
4.2 Prediction within state space
model . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.3 Unbiased prediction with desired
outputs . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4 Objective function . . . . . . . . . . . . 28
4.5 Generalised predictive control . . 29
4.6 Quadratic programming and
constrained predictive control . . . . 30
4.7 Nonlinear Model Predictive
Control . . . . . . . . . . . . . . . . . . . . . . . . 31
5 Implementing predictive control
algorithm 33
5.1 Control synthesis without MPC 33
5.2 Predictive control matrices . . . . . 34
5.3 Analytical control law . . . . . . . . . 35
5.4 Applying quadratic programming 38
5.5 Summary . . . . . . . . . . . . . . . . . . . . 41
vii
Figures Tables
2.1 Vehicle model dynamics . . . . . . . . 8 3.1 Vehicle test parameters . . . . . . . . 15
2.2 Forward vehicle dynamics . . . . . . 10
2.3 Wheel dynamics . . . . . . . . . . . . . . 12
2.4 Lateral tyre force determination 13
viii
Chapter 1
Introduction
1.1 Motivation
In recent years, there has been a larger impact of new technologies coming to our
everyday lives than ever before. Major contribution surely belongs to the development
of faster and more efficient data processing units and furthermore, the code complexity
in all computers increases rapidly. We tend to replace more and more routine tasks
in production and services, to better optimize time and resources and the world just
gets quicker and more automated. It is all down to the sophisticated algorithms
which operate the machines in order to increase safety, improve reliability, accelerate
productivity and enhance functionality.
This transformation has inevitably affected the car industry as well. Two of the
greatest challenges which drive the automotive society today are electromobility and use
of artificial intelligence for autonomous driving. This certainly requires more complex
and reliable embedded systems and more advanced algorithms, solutions and strategies.
Lots of assistance systems have been developed over the years helping the driver
to avoid accidents and to prevent potential vehicle uncontrollability in poor driving
conditions. Nowadays, a completely new era of advanced driver assistance systems
(ADAS) is coming up, relying upon very high-tech components and sensors, such as
lidar (Light Detection and Ranging), utilizing laser pulses to detect objects in its range,
or radar, cameras or ultrasonic sensors. Some assistance systems based upon these
technologies are listed below:
. Automatic parking
. ...
1
1. Introduction ...........................................
Nevertheless, those control systems focus on data acquisition from the vehicle surround-
ings and upon object detection and recognition, but they themselves do not improve
vehicle stability or maneuverability in any way.
The problems regarding the vehicle poor stability in certain driving or weather
conditions were encountered much earlier, therefore, the following systems have been
developed since 1970s and 1980s or even beforehand.
Anti-lock braking system (ABS) is a safety control system which prevents the
wheels from locking up and skidding on the surface and ensures continuous traction
while braking. In principle, the system measures speed of each wheel and compares
it with the vehicle’s speed. If the wheel speed is considerably lower than it should
(often due to loss of traction on a slippery road), the system releases a hydraulic
valve, which reduces hydraulic pressure and thus braking force to the corresponding
wheel. ABS is considered as an essential system, according to EU law it is a
compulsory element of all cars built in Europe since 2004.
Electronic stability control (ESC) is a safety control system which monitors loss
of traction and steering while driving and it brakes individual wheels in order to
steer the vehicle in driver’s intentional direction. In principle, applying brakes
independently while driving creates a yaw moment which helps (when correctly
estimated) the vehicle to stabilize. It might be utilized in certain oversteer or
understeer situations, etc., or it prevents the car from skidding on a wet or icy
road surface. The vehicles in Europe have been obligatory fitted with ESC since
2014.
Since their first release, these systems have been further improved and extended, and
other new related systems have been evolved. All the above mentioned solutions
have been integrated into the ECUs (Electronic control units) with respect to quality
standards and functional safety described for instance in well-known ISO 26262.
The purpose of this thesis is to aim for the above indicated direction and to present,
simulate and to develop a rather new torque vectoring system technology, which is
ideally based upon a proper torque splitting and torque differentiating among the
vehicle wheels while cornering in order to improve its stability, handling, performance
and maneuverability and thus to reduce the driver’s effort and increase passenger
safety.
Such systems are not entirely new, they have been used mostly in premium car
segment and have been working largely on a mechanical basis with electronic control as
an additional feature of the differential. The torque vectoring system could be further
classified according to the drive axles. Driving only front or rear axle and varying
torque between two wheels makes the system less complex. However, torque vectoring
is mostly implemented on cars with all-wheel drive, as for example a quattro® system
from Audi AG.
Ricardo plc, a British based, global engineering and technical consultancy company,
has been offering one of the most compact torque vectoring solutions available and
2
........................................ 1.4. Electric vehicles
demonstrated with it the improvement in handling and stability both on and off-road.
This master’s thesis has been created in an association with Ricardo Technical Centre
in Prague.
Regarding the climate change and the environmental issues caused by an increasing
level of CO2 emissions, it is our mission in a few decades to transform the energy
exploitation into something sustainable. The legislation process in Europe massively
supports pure electric and hybrid vehicles, all major car manufacturers present every
year a new electric fleet and invest immensely into the development. We can certainly
expect this trend to be further ongoing. But we cannot just skip over the so far very
advanced internal combustion engines (ICEs), because a ton of predictable and possibly
even unexpected problems will emerge.
Supersport cars are usually developed by companies demonstrating as much of an
ultra-advanced and futuristic technology as they can. Mainly because the interested
customers pay the huge price regardless of its height. For instance, the Rimac Concept
One or Concept Two developed and manufactured in Croatia by Rimac Automobili
or the Mercedes-Benz SLS AMG Electric Drive coming from Stuttgart, they have in
common a four-wheel electric drive, so the wheels are completely independent and
utilize the torque vectoring solution. As the development costs of this system decline,
it is still going to be offered in more affordable car segments spreading throughout the
automotive industry.
Electric vehicles have overall lots of advantages, they operate very quietly, have
huge performance figures in terms of acceleration, which is instant comparing it to
the vehicles with ICEs. They also have zero CO2 emissions, treat energy flows better,
they can recuperate while braking and their powertrain is mechanically less complex,
which reduces its production costs. On the downside, there is a critical point of storing
the electrical energy. The so far developed and produced electric vehicles rely mostly
on using Li-Ion battery packs. And their production is such energy-intensive, that
according to Fraunhofer Institute for Building Physics the amount of overall energy
required to produce the electric car is twice as much as to produce the conventional
one. And if we consider electric vehicles being recharged with electricity coming from
coal-fired power stations, there is certainly no point of proclaiming them as eco-friendly,
the emissions may decrease merely locally, but it generally does not solve the issue.
Taking into account a problematic battery packs disposal and mining and quarrying
rare earth minerals, it might overall seem that we are still not heading in the right
direction.
Regardless of how exactly the world will look like in 20-year-horizon, it is clear
that this ”eco-transformation” will affect us more than anybody can presume. At this
point I would like to challenge everybody to take true responsibility in every way for
contributing to our shared living environment and appeal on the importance of being
and behaving smarter, which might help, but not paying attention and not taking care
will make everything worse definitely.
3
4
Part I
5
6
Chapter 2
Planar Vehicle Dynamics
0
B
M = 0 (2.2)
Mz
ẋ
B
v = ẏ (2.3)
0
0
B
ω= 0 (2.4)
ψ̇
We assume the body frame to be the principal coordinate frame to obtain the principal
moment of inertia matrix, which further reduces complexity of the motion dynamics.
Ixx 0 0
B
I = 0 Iyy 0 (2.5)
0 0 Izz
7
2. Planar Vehicle Dynamics ......................................
The rigid body dynamics concentrated to the COM - center of mass is according
to standard convention without loss of generality described by these (Newton-Euler)
equations:
B
F = mB v̇ = m(B at + B an ) = m(B v̇ ût + B ω × B v) (2.6)
B
M = B I B ω̇ + B ω × B I B ω (2.7)
0
ẍ ẋ mẍ − mψ̇ ẏ
B
F = m ÿ + m 0 × ẏ = mÿ + mψ̇ ẋ (2.8)
0 ψ̇ 0 0
Ixx 0 0 0 0 Ixx 0 0 0 0
B
M = 0 Iyy 0 0 + 0 × 0 Iyy 0 0 = 0 (2.9)
0 0 Izz ψ̈ ψ̇ 0 0 Izz ψ̇ Izz ψ̈
8
.................................... 2.3. Forward vehicle dynamics
These applied forces are distributed among 4 wheels as depicted in fig. 2.1. We define
the steering angles δ1 and δ2 on the front axle and compute the forces summation
accordingly (δ3 = δ4 = 0).
4 4
Fx = Fxi = (Fti cos δi − Fsi sin δi ) (2.11)
X X
i=1 i=1
4 4
Fy = Fyi = (Fti sin δi + Fsi cos δi ) (2.12)
X X
i=1 i=1
4
Mz = (Mzi + xi Fyi − yi Fxi ) =
X
i=1
4
(2.13)
= (Mzi + xi (Fti sin δi + Fsi cos δi ) − yi (Fti cos δi − Fsi sin δi ))
X
i=1
Forces Fti and Fsi are summations of all forces in the wheel’s longitudinal and lateral
direction, respectively, xi , yi represent wheel’s coordinates and Mzi are sums of all yaw
moments acting on the individual wheel.
As we can predict, some of the previously derived tyre forces depend on the ground
reaction forces. In order to determine the weight distribution, we come out of the
fig. 2.2, considering x-axis symmetry, omitting the steering angle dependence for this
instance (δ1 ≈ δ2 ≈ 0) and lateral y motion. This simplification significantly reduces
the complexity of overall kinematics and dynamics. Newton-Euler equations for this
instance can be described by:
Fx = mẍ (2.14)
X
Fz = 0 (2.15)
X
My = 0 (2.16)
X
Since we assume equal force distribution between the wheels on the same axle and
x1 = x2 , x3 = x4 , we elaborate the expressions further:
9
2. Planar Vehicle Dynamics ......................................
where h is the center of gravity height. By simplifying x-forces into one unknown, we
obtain solutions:
1 |x3 | 1 h
Fz1 = Fz2 = mg − mẍ (2.20)
2 x1 + |x3 | 2 x1 + |x3 |
1 x1 1 h
Fz3 = Fz4 = mg + mẍ (2.21)
2 x1 + |x3 | 2 x1 + |x3 |
The expressions 2.20 and 2.21 contain terms with ẍ dependence, which represent
contributions to the reaction forces appearing either by accelerating or decelerating.
But as we assume torque optimization rather for lateral vehicle motion, we state ẍ ≈ 0
and use in all cases following reaction forces.
1 |x3 |
Fz1 = Fz2 = mg (2.22)
2 x1 + |x3 |
1 x1
Fz3 = Fz4 = mg (2.23)
2 x1 + |x3 |
The highest impact on maneuverability has the vehicle’s steering mechanism. There are
several steering types. Most two-axle-vehicles utilize front-wheel-steering (passenger
vehicles), but forklifts usually have rear-wheel-steering and there are also some premium-
segment-cars which are capable of steering both axles simultaneously. The other division
10
.................................... 2.5. Wheel and tyre dynamics
y1 + |y2 |
cot δ2 − cot δ1 = (2.24)
x2 + |x3 |
The advantage of Ackermann steering is that the tyres produce no slip at low speeds
because of the common turning center. We will derive other expressions utilizing this
mechanism, considering lower vehicle speeds in order to minimize the contribution of
slip forces onto the final dynamics. Our independent input is a steering wheel angle
which we consider as a ”mean” value δ (heading angle measured from the center of
gravity):
cot δ2 + cot δ1
cot δ = (2.25)
2
Regarding the lateral vehicle velocity, wheel velocities can be generally derived [1] in
the body coordinate frame 2.26 and for our case specifically 2.27. Lateral tyre slip
forces begin to appear as a result of the lateral tyre slipping on the surface, described
by so-called global 2.28 or local 2.29 tyre slip angles, which are according to standard
convention defined for each wheel (i = 1 - 4) and generate the nonholonomic constraint
to our system.
B
vi = B v + B ω × B ri (2.26)
0
ẋi ẋ xi ẋ − ψ̇yi
ẏi = ẏ + 0 × yi = ẏ + ψ̇xi (2.27)
0 0 ψ̇ 0 0
ẏi ẏ + ψ̇xi
βi = arctan = arctan (2.28)
ẋi ẋ − ψ̇yi
ẏ + ψ̇xi
αi = δi − arctan (2.29)
ẋ − ψ̇yi
Every wheel has in general case 6 dof as well, we consider the corresponding forces in
longitudinal Fti and lateral Fsi direction and pitch moment Myi (also called rolling
resistance torque). Remaining forces Fzi (reaction force itself), Mxi (roll moment,
tilting moment) and Mzi (yaw moment, aligning moment) will be neglected further for
the dynamic model.
We derive the motion equation for a wheel regarding the actual inputs of our torque
11
2. Planar Vehicle Dynamics ......................................
vectoring model Ti (depicted in fig. 2.3). Adding up the kinematic condition for no
longitudinal tyre slip allowed, we claim 2.31.
ξ
µr = (2.32)
rw
ẍwi ≈ ẍ (2.33)
ẍ
=⇒ Iw = Ti − Fzi µr rw − Fti rw (2.34)
rw
where rw and Iw are the wheel’s radius and inertia, θ̈wi and ẍwi are wheel’s coordinates,
µr is a dimensionless rolling friction coefficient 2.32 and ξ an alternative coefficient with
dimension of length corresponding to an offset caused by contact pressure deformation.
We must emphasize at this point that 2.34 could only be derived under the assumption
of forward wheel dynamics 2.33, when no lateral vehicle motion is considered and also
δ1 ≈ δ2 ≈ 0, which is obviously in conflict with 2.10 for front (steered) wheels. As
previously, we state ẍ ≈ 0, neglect rolling resistance torque and obtain final expression.
Ti
Fti = (2.35)
rw
The remaining unknowns to be determined are the wheel or tyre lateral forces.
This itself is a complex topic and is influenced by many parameters. So we simplify
our consideration for this part as well, as much as possible. A tyre possesses very
anisotropic properties, it contains many different material layers with complex vis-
coelastic attributes, the local structure varies significantly and the resulting behaviour
may be observed as elastoplatic nonlinear deflections.
In reality, tyre modelling appears to be empirically determined and there exist
more or less complicated equations describing the tyre-road interaction. One of the
12
.................................... 2.6. Nonlinear dynamic model
-0.5
-1
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5
Side slip angle [rad]
Figure 2.4: Lateral tyre force determination
most popular is certainly the Pacejka’s Magic Formula 2.36, where the lateral force
depend on unique coefficients for each type of a tyre and moreover, in nonlinear fashion.
Coefficient B represents stiffness factor, C shape factor, D peak value and E curvature
factor. This solution can be nowadays achieved with software modelling aid much
faster, for instance with the product Delft-Tyre from company TASS International.
Another approach is to utilize any type of estimator to determine the friction or tyre
characteristics as it was shown in master’s thesis in cooperation with Volvo Group [2].
In our model we use a very similar dependence, as explained in [4], and described by
following equation set
2αp µp
µ(αi ) = αi (2.38)
αp2 + αi2
where αp and µp are peak values of the curve depicted in fig. 2.4
We put together the above mentioned principles and dynamic equations. Substituting
2.35 and 2.37 into 2.10, we obtain the following equation set:
( )
Ti
mẍ − mψ̇ ẏ = cos δi − Fzi µ(αi ) sin δi (2.39)
X
i
rw
( )
Ti
mÿ + mψ̇ ẋ = sin δi + Fzi µ(αi ) cos δi (2.40)
X
i
rw
13
2. Planar Vehicle Dynamics ......................................
( )
Ti Ti
Izz ψ̈ = sin δi + Fzi µ(αi )cos δi − yi cos δi − Fzi µ(αi )sin δi (2.41)
X
xi
i
rw rw
We trim the equations further into a proper form containing merely first order
differential equations with definitions as follows:
ẋ z1
x = ẏ = z2 (2.42)
ψ̇ z3
T1 u1
T2 u2
u= = (2.43)
T3 u3
T4 u4
1
!( " # )
X ui
ż1 = cos δi − Fzi µ(αi ) sin δi + mz2 z3 (2.44)
m i
rw
1
!( " # )
X ui
ż2 = sin δi + Fzi µ(αi ) cos δi − mz1 z3 (2.45)
m i
rw
1
!( " #)
ui ui
ż3 = sin δi + Fzi µ(αi )cos δi − yi cos δi − Fzi µ(αi )sin δi
X
xi
Izz i
rw rw
(2.46)
z2 + z3 xi
αi = δi − arctan (2.47)
z1 − z3 yi
where 2.42 defines system state variables and 2.43 input torques and 2.47 tyre local
side slip angle nonintegrable constraint, which makes the whole dynamic system
nonholonomic.
14
Chapter 3
Model verification and state space form
We test and verify the dynamic model described by equations 2.44 - 2.47 in Simulink
environment. Firstly, we declare vehicle and tyre parameters, as the tab. 3.1 shows.
We create function ack, see 3.1, computing individual wheel steering angles explicitly
from expressions which can be easily derived according to Ackermann conditions and
we feed the output angles into our dynamic model function. The test steering angles
are demonstrated in fig. 3.1, where the Ackermann angle distribution on both wheels
can be observed.
Listing 3.1: Ackermann steering
1 function [ delta1 , delta2 ] = ack ( d )
2
3 % individual wheel coordinates from center of gravity
4 y1 = 0.8; y2 = -0.8; x2 = 1.3; x3 = -1.7;
5
6 w = ( y1 + abs ( y2 ) ) ; % axle track
7 l = ( x2 + abs ( x3 ) ) ; % wheelbase
8 delta1 = acot ( cot ( d ) - w /(2* l ) ) ;
9 delta2 = acot ( cot ( d ) + w /(2* l ) ) ;
15
3. Model verification and state space form ...............................
Listing 3.2: Dynamic model computation
1 function [ z1t , z2t , z3t ] = dyn_model ( d1 , d2 , u1 , u2 , u3 , u4 , z1 ,
z2 , z3 )
2
3 % parameter declaration
4 m = 1500; g = 9.81; rw = 0.28; x1 = 1.3; x2 = 1.3;
5 x3 = -1.7; x4 = -1.7; y1 = 0.8; y2 = -0.8; y3 = 0.8;
6 y4 = -0.8; Izz = 2000; d3 = 0; d4 = 0;
7
8 % calculating reaction forces
9 Fz12 = 0.5* m * g *( abs ( x3 ) /( x1 + abs ( x3 ) ) ) ;
10 Fz34 = 0.5* m * g *( x1 /( x1 + abs ( x3 ) ) ) ;
11
12 % calculating longitudinal forces
13 F1t = u1 / rw ; F2t = u2 / rw ; F3t = u3 / rw ; F4t = u4 / rw ;
14
15 % calculating lateral forces
16 F1s = Fz12 * tyre ( d1 , x1 , y1 , z1 , z2 , z3 ) ;
17 F2s = Fz12 * tyre ( d2 , x2 , y2 , z1 , z2 , z3 ) ;
18 F3s = Fz34 * tyre ( d3 , x3 , y3 , z1 , z2 , z3 ) ;
19 F4s = Fz34 * tyre ( d4 , x4 , y4 , z1 , z2 , z3 ) ;
20
21 % dynamic model
22 z1t = (1/ m ) *( F1t * cos ( d1 ) - F1s * sin ( d1 ) + F2t * cos ( d2 )
23 - F2s * sin ( d2 ) + F3t + F4t + m * z2 * z3 ) ;
24 z2t = (1/ m ) *( F1t * sin ( d1 ) + F1s * cos ( d1 ) + F2t * sin ( d2 )
25 + F2s * cos ( d2 ) + F3s + F4s - m * z1 * z3 ) ;
26 z3t = (1/ Izz ) *( x1 *( F1t * sin ( d1 ) + F1s * cos ( d1 ) )
27 - y1 *( F1t * cos ( d1 ) - F1s * sin ( d1 ) ) + x2 *( F2t * sin ( d2 )
28 + F2s * cos ( d2 ) ) - y2 *( F2t * cos ( d2 ) - F2s * sin ( d2 ) )
29 + x3 * F3s - y3 * F3t + x4 * F4s - y4 * F4t ) ;
30
31 % function computing normalized tyre lateral force
32 function mu = tyre (d ,x ,y , z1 , z2 , z3 )
33 alpha_p = 6* pi /180; % peak alpha value
34 mu_p = 0.9; % peak mu value
35 alpha = d - atan (( z2 + z3 * x ) /( z1 - z3 * y ) ) ;
36 mu = ((2* alpha_p * mu_p ) /( alpha_p ^2 + alpha ^2) ) * alpha ;
We add a state integration and feedback and validate our model considering four
equal torque inputs as depicted in fig. A.1. Since we consider all states expressed in a
body frame, we need to perform transformation into global coordinate system to get
global position. The vehicle trajectory corresponding to the test steering angles and
small equal torques is shown in fig. 3.2. As we can see, although the input torques are
negligible, the output longitudinal velocity in the long term increases (fig. 3.3), thus
the model with symmetric steering does not return to the original zero y position.
16
....................................... 3.1. Model simulation
Steering angles
0.4
Steering angle [rad]
0.2
-0.2
delta1
delta2
-0.4 delta
0 1 2 3 4 5 6 7 8 9 10
time [s]
15
10
Position y [m]
-5
-10
0 10 20 30
Position x [m]
Figure 3.2: Model verification
Our simplified model does not take into account aerodynamic forces or even rolling
resistance, it merely has to overcome lateral forces acting on the vehicle’s front axle,
projected into the longitudinal direction. And as can be observed in fig. 3.3, the speed
locally declines. The initial conditions for state space integrator are chosen in the
equation form 3.1 according to our previous convention.
ẋ0 v x0
zi0 = ẏ0 = 0 (3.1)
ψ̇0 0
17
3. Model verification and state space form ...............................
Maneuvering velocity
Longitudinal velocity [ms-1]
4.2
4.1
3.9
0 1 2 3 4 5 6 7 8 9 10
Time [s]
" #
X uieq
0= sin δieq + Fzi µ(αi ) cos δieq − mz1eq z3eq (3.3)
i
rw
" #
uieq uieq
0= sin δieq + Fzi µ(αi )cos δieq cos δieq − Fzi µ(αi )sin δieq
X
xi − yi
i
rw rw
(3.4)
z2eq + z3eq xi
αi = δieq − arctan (3.5)
z1eq − z3eq yi
So far, we have considered our inputs to be the applied torques, which we want to
control and perform the optimization with. Nevertheless, the other input to our system
is a steering angle δ, which has to be distinguished and perceived as a different input,
namely uncontrollable. We will discuss consequences of this issue in next chapters.
In order to compute system states corresponding to the equilibrium point, a common
practice is to deliberately choose inputs to be zero (uieq = 0 ∧ δieq = 0). As the script
3.3 shows, we utilize Symbolic Math Toolbox™ in MATLAB® to express our dynamic
system and find the equilibrium point symbolically. Function precompute precalculates
all necessary variables used in the script. Similarly, the model can be trimmed directly
from Simulink by trim function.
18
................................... 3.2. Trimming and linearization
We linearize now the nonlinear system around the computed equilibrium point to
obtain a continuous-time model time-invariant state space representation 3.6, 3.7.
∂f (x, u) ∂f (x, u)
f (x, u) = f (xeq , ueq ) + (x − xeq ) + (u − ueq )
∂x (xeq ,ueq ) ∂u (xeq ,ueq )
(3.9)
∂f1 (x,u) ∂f1 (x,u) ∂f1 (x,u)
···
∂x1 ∂x2 ∂xn
∂f2 (x,u) ∂f2 (x,u) ∂f2 (x,u)
∂f (x, u) ∂x1 ∂x2 ··· ∂xn
= .. .. .. (3.10)
..
∂x .
. . .
∂fn (x,u) ∂fn (x,u) ∂fn (x,u)
∂x1 ∂x2 ··· ∂xn
19
3. Model verification and state space form ...............................
∂f (x,u) ∂f1 (x,u) ∂f1 (x,u)
1
···
∂u1 ∂u2 ∂up
∂f2 (x,u) ∂f2 (x,u) ∂f2 (x,u)
∂f (x, u) ∂u1 ∂u2 ··· ∂up
= (3.11)
.. .. .. ..
∂u
. . . .
∂fn (x,u) ∂fn (x,u) ∂fn (x,u)
∂u1 ∂u2 ··· ∂up
By substituting the Jacobian matrices 3.10, 3.11 into the Taylor expansion, then since:
f (xeq , ueq ) = 0 (3.12)
and by comparing the terms with general state equation we obtain:
∂f (x, u)
AC = (3.13)
∂x (xeq ,ueq )
∂f (x, u)
BC = (3.14)
∂u (xeq ,ueq )
The output equation could be derived and compared similarly in general case. As we
consider the states to be the observed outputs and assume no feedthrough dependence,
we define CC as an identity matrix and DC as a zero matrix.
CC = In (3.15)
DC = 0n,p (3.16)
20
...................................... 3.3. Discrete state space
A discrete equivalent for difference between two samples considering zero-order hold
(u(τ ) = u(kT ) = const.) and while defining variable λ = (k + 1)T − τ for λ ∈ [0, kT )
can be easily foreseen:
Z T
x(k+1)T = e AC T
xkT + eAC λ BC ukT dλ (3.19)
0
And by comparing 3.19 with discrete state equation 3.20, we calculate discrete system
matrix and discrete input matrix as the functions of sample time period.
Z T
B = B(T ) = eAC λ BC dλ = (eAC T − In )A−1
C BC (3.22)
0
We further use a following expansion into power series while neglecting higher order
terms in order to avoid computing inversion from a singular matrix, which occurs, if
the system is not stable.
A2C λ2 Ak λk
eAC λ = In + AC λ + + ... + C + ... (3.23)
2! k!
Since there is no integration in equation 3.7, the equivalent discrete output equation
takes the algebraic form 3.24 and output and feedthrough matrices are straightforward.
C = CC (3.25)
D = DC (3.26)
21
3. Model verification and state space form ...............................
Listing 3.5: Continuous to discrete state space conversion
1 function [A , B ] = conti2disc ( Ac , Bc , Ts )
2 [ rA , cA ] = size ( Ac ) ; [ rB , cB ] = size ( Bc ) ;
3 if ( rA == cA && rA == rB ) % check matrix dimensions
4 In = diag ( ones ( rA ,1) ) ;
5 A = In + Ac * Ts + Ac ^2* Ts ^2/2;
6 B = In * Bc * Ts + Ac * Bc * Ts ^2/2 + Ac ^2* Bc * Ts ^3/6;
7 else
8 return
9 end
10 end
We get the same discrete linearized state space model by applying function dlinmod,
or alternatively, we can convert continuous to discrete system by calling c2d function.
In order to prove consistency between the original nonlinear dynamic model and our
obtained discrete linearized state space system, we create a simple model substitution
of A.1 with block Discrete State-Space in A.2 by specifying control matrices, sample
time period and the same initial conditions. The results of comparison can be observed
in fig. 3.4, where the states z1 and z3 according to our convention are monitored. As
expected, the linear model approximates our system well around initial conditions and
by time the error increases. Nevertheless, strong nonlinearities cannot be tracked at
all.
22
Part II
Predictive control
23
24
Chapter 4
Algorithm design and solving
4.1 Introduction
N
JM P C (u) = (yk+i )T Q(yk+i ) + (uk+i−1 )T R(uk+i−1 ) (4.1)
X
i=0
where yk+i designates system output at sample k + i, similarly for uk+i−1 , and Q
and R are weighting matrices. It is important to notice that we sum over N elements
25
4. Algorithm design and solving ....................................
and to distinguish MPC from objective function used for LQR 4.2.
∞
JLQR (u) = (yk+i )T Q(yk+i ) + (uk+i−1 )T R(uk+i−1 ) (4.2)
X
i=0
It can be demonstrated that by applying LQR the stability is achieved because of the
infinite horizon. However, in case of finite-horizon MPC the stability is not inherently
guaranteed and thus we either analyse its stability a posteriori, or we extend the cost
function with terminal penalty weight QP , which is basically solution of the Riccatti
equation.
We derive the expression for output predictions of a general discrete MIMO (multiple-
input multiple-output) state space model without any noise, commonly described by
following equations:
where u ∈ Rp is the input vector with p inputs, x ∈ Rn the state vector with n states,
y ∈ Rq the output vector with q outputs, A ∈ Rn×n the state matrix, B ∈ Rn×p the
input matrix, C ∈ Rq×n the output matrix and D ∈ Rq×p is the feedthrough matrix.
The index k indicates the sample at time k, index k + 1 at time k + 1, ...
We may come out of 4.3 and from this one-step ahead prediction we may find
recursively an n-step ahead prediction.
If we can afford to further assume D = 0 and we substitute 4.5 into 4.4, the n-step
ahead prediction for system outputs is then:
26
............................. 4.3. Unbiased prediction with desired outputs
We notice that the expressions 4.7 and 4.8 contain term xk without double subscript
indicating it is a measurement, not a prediction. In order to make our equations further
more compact, we introduce another notation 4.9 for our predictions. It represents a
vector (possibly of vectors - MIMO systems) with first predicted sample comprised in
the index and with arrow indicating past, or in our case future prediction. There is
no information regarding number of future samples being computed, we choose the
horizon completely independently as a certain degree of freedom of our prediction.
xk+1|k
xk+2|k
xk+1 = (4.9)
..
−−→ .
xk+n|k
Considering computing all the states up to the sample k + n with the compact notation
and rewriting 4.7, we obtain:
A B 0 ··· 0
A2
AB B ··· 0
xk+1 = xk + (4.10)
.. .. .. .. ..
u k
−−→ .
. . . . −→
An An−1 B An−2 B · · · B
Considering obtaining the desired outputs (our reference) from our system, the state
space equations without any disturbances must satisfy the following:
where yds represent the desired system outputs at the steady state, xds corresponding
states and uds appropriate inputs. The system unknowns are designated then directly
by 4.15:
" # " #−1 " #
xds C 0 yds
= (4.15)
uds A − In B 0
27
4. Algorithm design and solving ....................................
We further define unbiased (relative to the desired state) outputs, states and inputs
and since we consider linear state space, which holds the superposition principle, we
introduce an unbiased state space representation 4.19, 4.20 and an unbiased state space
output prediction 4.21.
Model predictive control performs an optimization at each control step regarding the
state feedback and control inputs. The objective measure of the system relations
contains an objective (cost) function, as introduced by 4.1. This function can generally
take up different forms, however, the equation in our instance is selected utterly
deliberately.
We often use the single terms in a quadratic form, since the quadratic function
always has a unique minimum, thus the optimization outputs no ambiguity. When
considering multiple system variables this term is a product of vector and its transposed
identity. And we multiply each of them with an appropriate weighting matrix, which
is capable of penalising vector elements with different coefficients. With a reference to
the previous section, the purpose of controlling a system is to obtain a desired output
as a steady state, therefore, it is natural to minimize tracking errors and manipulated
inputs, generally unbiased values. The literature presents a suitable generic objective
function accordingly:
N
J(u) = (ek+i )T Q(ek+i ) + (uk+i )T R(uk+i ) + (∆uk+i )T R∆ (∆uk+i )
X
i=0
(4.22)
where (ek+i ) denotes the tracking errors 4.23, (uk+i ) the input deviations 4.24 and
(∆uk+i ) the rate of input change 4.25.
28
.................................. 4.5. Generalised predictive control
We simplify the objective function for our case by neglecting the rate of input change
and adjust the notation to match our statements, namely 4.21 (considering summation
over i indicating the horizon).
N
J(ûk+i ) = (ŷk+i+1 )T Q(ŷk+i+1 ) + (ûk+i )T R(ûk+i ) (4.26)
X
−−→ i=0 −−−−→ −−−−→ −−→ −−→
Generalised predictive control (GPC) is an MPC control method, which has all the
above mentioned principles applicable for MPC. The main difference is that it provides
an analytical control law if no constraints are considered. GPC algorithm was proposed
originally in 1987 by Clarke, Mohtadi and Tuffs.
If we use previously derived terms and substitute 4.21 into 4.26 we obtain:
N
J(ûk+i ) = (P x̂k + H ûk+i ) Q(P x̂k + H ûk+i ) + (ûk+i ) R(ûk+i ) (4.27)
X
T T
−−→ i=0 −−→ −−→ −−→ −−→
We find the objective function minimum by setting its gradient with respect to the
future input vectors to zero.
∂J(ûk+i )
−−→ = 0 (4.28)
∂ ûk+i
−−→
Since we assume matrices Q and R to be diagonal, then Q = QT and R = RT , which
∀i yields:
29
4. Algorithm design and solving ....................................
4.6 Quadratic programming and constrained predictive
control
Since all systems naturally work properly only in certain conditions, we often must
ensure that the inputs comply with specified input ranges, or on the contrary we must
guarantee the output limits. In those cases we need to include constraints into our
predictive control algorithm design, while still optimizing the system performance.
For this purpose we introduce a quadratic programming method (QP), which
can optimize a quadratic function of several variables while complying with linear
constraints, as follows. We define the quadratic function F(x):
1
F(x) = xT Gx + f T x + c (4.32)
2
N
minimize (P x̂k + H ûk+i ) Q(P x̂k + H ûk+i ) + (ûk+i ) R(ûk+i )
X
T T
ûk+i i=0 −−→ −−→ −−→ −−→
−−→
I 0 ··· 0
···
0 I 0
u
.. .. .. .. .
..
. . . .
(4.34)
0 0 ··· I u
subject to
uk+i ≤
−I 0 ··· 0
u
−−→
..
0
−I · · · 0
.
.
.. .. ..
.
. . . .
u
0 0 · · · −I
where I denotes the identity matrix for p system inputs, u designates the vector of
corresponding fixed upper input limits and u the vector of fixed lower limits. However,
the cost function minimizes the differential values ûk+i , though the limits has to
−−→
be determined for the absolute input values. If we rewrite uk+i in terms of ûk+i
−−→ −−→
by assuming 4.35, we alter the vector of limits by substracting the time-varying
unoptimized current known system input uk , which yields 4.36 constraint.
30
............................... 4.7. Nonlinear Model Predictive Control
By multiplying the cost function expression and rewriting it in terms of 4.33 we form
4.36, and by utilizing an appropriate solver we perform the optimization with input
constraints.
N
1
minimize (ûk+i ) (2H QH + 2R)(ûk+i ) + (2x̂Tk P T QH)T (ûk+i )
X
T T
ûk+i i=0
2 −−→ −−→ −−→
−−→
I 0 ··· 0
··· 0 u − uk
0
I
. .. .. ..
. ..
. . . . .
0 0 ··· I u − uk
subject to ûk+i ≤
−I 0 ··· 0
u + uk
−−→
..
0
−I · · · 0
.
. .. ..
..
.
. . . . u + uk
0 0 · · · −I
(4.36)
Similarly, output constraints derivation can be indicated:
I 0 ··· 0
···
0 I 0
y
.. .. .. .. .
..
. . . .
0 0 ··· I y
(4.37)
yk+i+1 ≤
−I 0 ··· 0 y
− −−−→
.
.
0
−I · · · 0
.
. .. ..
..
.
. . . .
y
0 0 · · · −I
where y denotes the vector of upper output limits and y the vector of lower limits.
We abbreviate the left-side matrix with Cy , the right-side vector with dy and express
the outputs in terms of input measures 4.38.
Cy (P xk + Huk+i ) ≤ dy (4.38)
−−→
By substituting 4.35 into equation above and by separating known and unknown terms,
we obtain:
Predictive control strategies have been evolving continuously since the development of
optimal control and various algorithm approaches have been researched so far. Although
they were not being applied in their entire complexity in the early phase, nowadays,
due to the sufficient hardware computation capability, very advanced predictive control
31
4. Algorithm design and solving ....................................
techniques in combination with sophisticated optimal problem solving tools are being
deployed and successfully implemented. As a further logical step from the previously
presented method, a Nonlinear Model Predictive Control (NMPC) is introduced.
The structure of NMPC algorithm can be mostly interpreted analogously to the
linear MPC. The nonlinear system can be generally described by:
x+ = f (x, u) (4.40)
x+
k+1 = f (xk , uk ) k = 0, ..., N − 1. (4.41)
−−→ −
→ − →
We solve at each time step the optimal control problem given by:
N −1
minimize L(xk (x0 ), uk )
X
uk −−−− → − → (4.42)
−
→ k=0
subject to xk+1 (x0 ) = f (xk (x0 ), uk )
−
−−−−− → −−−− → − →
32
Chapter 5
Implementing predictive control algorithm
3.95
3.9
3.85
0 1 2 3 4 5 6 7 8 9 10
Torque [Nm]
20
10
0
0 1 2 3 4 5 6 7 8 9 10
time [s]
Figure 5.1: Control algorithm without MPC optimization for lane change maneuver
Assuming the vehicle has a small enough speed, by which the driver does not need
to brake and wants to maintain the speed throughout the maneuver, then by a proper
adjustment of the proportional regulator (Kp coefficient reflects the driver’s experience),
33
5. Implementing predictive control algorithm ..............................
we obtain fig. 5.1. It is important to state at this point, that the driver inputs do not
contain any delayed responses or imperfections.
34
..................................... 5.3. Analytical control law
The script 5.1 initializes discrete system and input matrices and fills them into P and
H accordingly. Since the outputs of our system are the same as its states and thus
matrix C is and identity matrix, we do not need to consider it in our calculations. We
create a structure of the system parameters and a corresponding bus, which we feed
into MPC function block A.4 as fixed parameters.
As we mentioned earlier, there is a logical mismatch between the system inputs
and the inputs, which we want to control. We derived previously the generic model
considering four torques and the steering angle as the model inputs. However, as we
do not intend to control how the driver shall steer in order to track the desired states,
as the first approximation we define the future steering angle input to be zero, just
for purposes of control synthesis. This step is equivalent to erasing the appropriate
column in the input matrix and thus neglecting the input sensitivity or input direction
with respect to the outputs and is performed in the script (listing) 5.1.
In order to deploy the predictive control computation, we define our desired states
and calculate the corresponding deviations regarding the actual dynamic model states.
We may arbitrarily set any desired state value, however, with respect to behavior
and performance of the vehicle, the choice shall be based on a proper estimation of
the achievable dynamic responses. We estimate the longitudinal velocity as a current
measured vehicle velocity and additionally, by taking into account the actual torque
demand, accordingly 5.1.
u u
Z
vxdes = vx + dt ≈ vx + kTs (5.1)
mrw mrw
The purpose of the torque vectoring algorithm is to make the vehicle dynamics more
efficient, namely reduce the local slip angle and thus the lateral velocity.
vydes = 0 (5.2)
Eventually, the most abstract state to choose is the angular velocity, which determines
vehicle behavior the most. We theoretically set it according to 5.3, which reflects the
35
5. Implementing predictive control algorithm ..............................
Listing 5.3: Control law computation
1 function [ u1 , u2 , u3 , u4 ] = mpc ( sys , wgt ,u , v_sc ,d , vx , vy , omega )
2
3 % deviation from desired state
4 vx_des = vx + v_sc /( sys . m * sys . rw ) ;
5 vy_des = 0;
6 omega_des = vx * tan ( d ) ;
7 x_k = [ vx - vx_des ; vy - vy_des ; omega - omega_des ];
8
9 % control law
10 H = sys . H ; P = sys . P ; Q = wgt . Q ; R = wgt . R ;
11 u_k = -(H '* Q * H + R ) \( H '* Q * P * x_k ) ;
12 u1 = u + u_k (1) ;
13 u2 = u + u_k (2) ;
14 u3 = u + u_k (3) ;
15 u4 = u + u_k (4) ;
36
..................................... 5.3. Analytical control law
û(k+i)tq = −(Htq
T
QHtq + R)−1 Htq
T
Q(P x̂k + Sst ûkst ) (5.6)
−−−−→
Since the predicted steering angle input stays the same over the predicted horizon, the
differences equal to zero vector and thus 5.8.
ûkst = 0 (5.7)
û(k+i)tq = −(Htq
T
QHtq + R)−1 Htq
T
QP x̂k (5.8)
−−−−→
0
0 1 2 3 4 5 6 7 8 9 10
6
Torque [Nm]
0
0 1 2 3 4 5 6 7 8 9 10
time [s]
Figure 5.2: MPC algorithm example results for lane change maneuver
The significant impact upon the vehicle behavior has a choice of weighting coefficients
penalising either system states or system inputs. If we assume Q and R to be identity
matrices scaled by prescalers qpr and rpr , then by varying the ratio of the prescalers we
affect the vehicle performance and it is thus adjustable, as the fig. 5.3 shows. However,
the weights have to be carefully chosen, properly calibrated and tested on a real vehicle,
in order to avoid possible instability.
The fig. 5.4 illustrates the advantages of Torque Vectoring and improvements of
handling and vehicle stability. We track the vehicle states and inputs while cornering
with the prescribed input steering angle (1st graph) both with and without Torque
Vectoring System (further used as TVS). This figure (as well as fig. 5.2 for lane change
maneuver) depicts the optimized torque distribution (TVS) among all wheels (2nd and
3rd graph) and indicates the higher torque deployment onto the outer wheels, which is
typical for all TVS implementations and enhances the vehicle performance. In the 5th
graph we observe the actual longitudinal velocity with the optimized torques of TVS
and graphs 4 and 6 reflect yaw and longitudinal velocity differences, respectively, of an
37
5. Implementing predictive control algorithm ..............................
Torque distribution based on weighting coefficients
8
Front left wheel
6
Torque [Nm]
rising Q/R
0 1 2 3 4 5 6 7 8 9 10
8
Front right wheel
6
Torque [Nm]
rising Q/R
0 1 2 3 4 5 6 7 8 9 10
time [s]
optimized (TVS) and common solution at each time step. Applying more torque onto
the outer wheels generates an additional torque onto the whole body frame and results
in increasing yaw velocity (graph 4), which can be considered as a main target of this
optimization, since the vehicle better follows trajectory corresponding to the defined
steering angle and tries to compensate the inertial forces acting onto the body frame.
We further establish specific linear constraints for system input measures, modify
the control parameters and test the quadratic programming method to solve the
optimization. For testing purposes, we assume the upper input limit to be 5.9 with
respect to our previous definitions, where uk represents a saturated driver accelerator
input. And we set the lower limit as 5.10, by which we completely cut negative torque
values off and avoid possible system interaction between TVS and Anti-lock Brake
System, which could be potentially anticipated.
u = ks uk (5.9)
u=0 (5.10)
38
................................ 5.4. Applying quadratic programming
0
0 0.5 1 1.5 2 2.5 3
Torque [Nm]
8
6 Front left wh.
4 Front right wh.
2
0
0 0.5 1 1.5 2 2.5 3
Torque [Nm]
8
6 Rear left wh.
4 Rear right wh.
2
0
0 0.5 1 1.5 2 2.5 3
× 10-4
Velocity [ms-1] Yaw velocity [s-1]
10
5
Angular velocity difference
0
0 0.5 1 1.5 2 2.5 3
4
Longitudinal velocity
3.9
6
4
2 Longitudinal velocity difference
0
0 0.5 1 1.5 2 2.5 3
Time [s]
Figure 5.4: Comparison of stability and handling with and without Torque Vectoring
System
The script 5.4 defines the structure for constraints with respect to number of future
predicted inputs and the corresponding bus is then being deployed as depicted in A.5
into the mpc function 5.5. This function introduces the available quadratic program-
ming solver quadprog in Matlab environment. The function quadprog is not supported
directly for code generation, hence it must be declared as an external function in order
to be called and since it returns output as type mxArray, the output needs to be
converted by assigning to a variable of a known type.
Several example situations were simulated utilizing both analytical GPC and uncon-
strained MPC quadratic programming algorithm in order to compare their performance
figures. Though it could not be inherently anticipated, they both yielded identical
39
5. Implementing predictive control algorithm ..............................
Listing 5.4: Defining structure for constraints
1 % constraints
2 c = ones (4* n ,1) ; C = diag ( c ) ;
3 C = vertcat (C , - C ) ;
4 dupper = ones (4* n ,1) ; dlower = zeros (4* n ,1) ;
5
6 con = struct ( 'C ' ,C , ' dupper ' , dupper , ' dlower ' , dlower ) ;
7 busCon = Simulink . Bus . createObject ( con ) ;
results and thus both very different methods have been verified.
Furthemore, the quadratic programming for predictive control with defined input
constraints has been simulated, which shows the fig. 5.5. We observe the saturated
torques by the lower input limit from constrained MPC at those points, where the
GPC algorithm computes a negative torque value. The maximum applied wheel torque
corresponds to ks multiple of the given driver torque input.
40
........................................... 5.5. Summary
Similarly, the system states can be restricted, as derived in the previous chapter, which
can prevent vehicle potential instability and improve performance.
0.4
0.2 Input steering angle
0
-0.2
-0.4
0 0.5 1 1.5 2 2.5 3 3.5
Torque [Nm]
6
4
2 Driver torque input
0
0 0.5 1 1.5 2 2.5 3 3.5
10
Torque [Nm]
5.5 Summary
In all previous example situations, we were utilizing the symmetrical linear state space
model obtained by assuming all the inputs to be zero and thus only considering the
forward vehicle motion. However, if we trim the nonlinear dynamic model around an
other point, we obtain qualitatively different state space model and hence the control
computation will yield different results, as the 5.6 shows. This concept introduces a
41
5. Implementing predictive control algorithm ..............................
potential multi-model predictive control, which can be utilized in order to improve
performance of control applied to the nonlinear system, where each one of the multiple
controllers operates in a different system region.
0.8
0.6 Input steering angle
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3
Velocity [ms-1]
4
Longitudinal vel. - unsym. model
Longitudinal vel. - sym. model
3.8
5
Front left wh. - unsym. model
0 Front left wh. - sym. model
10
8
Front right wh. - unsym. model
6
Front right wh. - sym. model
4
2
0 0.5 1 1.5 2 2.5 3
Torque [Nm]
8
6
4
Rear left wh. - unsym. model
2
0 Rear left wh. - sym. model
-2
0 0.5 1 1.5 2 2.5 3
Torque [Nm]
12
10
8
6 Rear right wh. - unsym. model
4 Rear right wh. - sym. model
2
0 0.5 1 1.5 2 2.5 3
time [s]
Figure 5.6: Comparison of symmetric and unsymmetric control
42
Chapter 6
Conclusions and future work
The content of this thesis describes a procedure and approaches for development of
a torque vectoring algorithm for an all-wheel drive electric vehicle with utilizing of a
simplified planar vehicle dynamic model and predictive control strategies. It presents
the necessary basic dynamic motion laws, creation and validation of a nonlinear
dynamic model with respect to the expected drive configuration, namely four electric
motors actuating each half axle. Furthermore, it introduces the principles of trimming
and linearizing of the model for linear control synthesis and by deploying the derived
predictive control algorithms also the example results and analysis.
The performed simulations yielded convincing results and thus proved suitabilility of
this control approach for the torque vectoring development, which has been the principal
target. Apart from simulation outputs, there have been presented many outlines for
further extensions and development. In order to correctly implement the system onto
the real vehicle, a proper estimation of the desired behavior must be undertaken and
the weighting coefficients must be reasonably chosen and calibrated, possibly even made
adjustable to deliberately alter the vehicle performance. Since we can mathematically
enforce the model to behave in any way, an improper set of weighting coefficients
may destabilize the vehicle by applying unreasonable torque inputs, unless they are
appropriately constrained, hence the constrained model predictive control for both
inputs and outputs shall be deployed. As we know from practical experiences with real
torque vectoring systems of the car manufacturers, the systems provide many benefits
to the vehicle performance figures and will thus be implemented more frequently in
the future.
The greatest impact upon computational results has the created model. Since
the whole dynamic model contains nonlinearities, it is not always an easy task to
find and determine the operating point around which the system shall be linearized
and furthermore, by trimming the model at the specific point we neglect perhaps an
important system behavior and hence the control cannot achieve the optimum, which
can lead to instability. The solution may provide an extended linear MPC controller
capable of switching among various local linearized state space models and thus control
parameters, according to the measured states. Such a method is called multi-model
predictive control and it can handle nonlinear system dynamics very efficiently with
already known techniques. In order to make the algorithm more accurate, we might
apply the nonlinear model predictive control, which is based upon an iterative approach
of predicting the future trajectory, but the optimization conceptually remains the
43
6. Conclusions and future work ....................................
same. The future is most probably heading in this direction, since it is already
being successfully implemented in various cases, though there are much more complex
procedures of computing the control inputs and it poses much higher requirements onto
the hardware performance and optimization solvers. Though for linear model predictive
control the computational demands are very high as well, especially in dealing with
long prediction horizons and large and extensive systems. The optimization solver or
technique must be then validated and verified in order to ensure compliance of the
convergence time within the control period.
As a future development, the vehicle model shall be extended with more precise
subsystems, either as it has been shown in this thesis, or while considering vertical
dynamics, the model shall reflect suspension tilting when cornering, and its impacts
upon the planar dynamics. In order to synthesise the control properly, there should
be clearly established the desired vehicle behavior, as described within this thesis,
which can be estimated and tuned by performing various tests with a real vehicle.
As indicated and explained in the previous paragraph, the proper control should be
based upon at least multi-model predictive control, or the nonlinear model predictive
control if it guaranteed more reasonable behavior. Even though the more advanced
methods can deliver better results, we rather opt for a reliable and safe solution and
thus perhaps simpler, than to risk passenger safety. Measure twice, cut once!
44
Appendices
45
46
Appendix
A
Simulink models
47
Figure A.1: Nonlinear vehicle dynamic model
A. Simulink models
48
Figure A.2: Discrete linearized state space vehicle dynamic model
.........................................
49
........................................
50
........................................ A. Simulink models
51
52
Appendix B
Bibliography
[1] Reza N. Jazar. Vehicle Dynamics: Theory and Applications. Springer Sci-
ence+Business Media, LLC, 233 Spring Street, New York, NY 10013, USA,
2008. ISBN 978-0-387-74243-4.
[2] Prokeš, Jakub. Realtime estimation of tyre-road friction for vehicle state estimator
[online]. Master thesis. Chalmers Reproservice, Göteborg, Sweden, 2015. ISSN
1652-8557.
[3] Hans B. Pacejka. Tire and Vehicle Dynamics. SAE International, 2nd edition,
2005. ISBN 978-0768017021.
[4] G. Vasiljevic, S. Bogdan. Model Predictive Control based Torque Vectoring Al-
gorithm for Electric Car with Independent Drives [online]. 24th Mediterranean
Conference on Control and Automation (MED), Athens, Greece. IEEE 2016. ISBN
978-1-4673-8345-5.
[7] František Vlk. Dynamika motorových vozidel. 2nd edition, Brno, 2003. ISBN
80-239-0024-2.
[9] Mikuláš, Ondřej. Quadratic Programming Algorithms for Fast Model-Based Pre-
dictive Control [online]. Bachelor thesis. Czech Technical University in Prague,
Prague, 2013.
[10] L. Grüne, J. Pannek. Nonlinear Model Predictive Control. Theory and Algorithms.
Springer-Verlag London Limited 2011. ISBN 978-0-85729-500-2.
53
54
Appendix C
Key symbols
A system matrix
B input matrix
C output matrix
D feedthrough matrix
F,F force vector, force
g standard gravity
I, I inertia matrix, inertia
m mass
M, M moment vector, moment
T torque
u vector of inputs
v, v̇ velocity vector, acceleration vector
ẋ, ẍ longitudinal velocity, acceleration
x vector of system states
ẏ, ÿ lateral velocity, acceleration
55
56
Appendix D
Content of enclosed CD
/
MT_JiriTuma_2018.pdf ............................. Master’s thesis in PDF
src...............................compatible with Matlab R2016a and later
Modelling dynamics and linear analysis
nonlinear_model.slx .................... Nonlinear vehicle dynamics
precompute.m...............................Symbolic precalculations
eqp.m......................................Finding equilibrium point
con_system.m ................................ Continuous state space
conti2disc.m ...................... Continuous to discrete conversion
lin_model.slx...........................Linearized vehicle dynamics
Predictive control algorithm
control_unoptimized.slx.....................Control without MPC
GPC_algorithm.slx..................................GPC algorithm
system_params.m.................................System parameters
weights.m ....................................... Weighting matrices
Constrained_MPC.slx ......................... MPC with constraints
constraints.m.................................Constraints definition
IO_dynamic_model.slx ......... Undefined IO - prepared for trimming
trim_IO_model.m...........................Trimming and linearizing
system_params_unsym.m.........................Unsymmetric model
MPC_unsym_model.slx.................MPC with unsymmetric model
57