AFS-Assisted Trailer Reversing
AFS-Assisted Trailer Reversing
Examensarbete
Olof Enqvist
LITH-ISY-EX--06/3752--SE
Linköping 2006
Olof Enqvist
LITH-ISY-EX--06/3752--SE
Sammanfattning
Abstract
Reversing with a trailer is very difficult and many drivers hesitate to even try it.
This thesis examines if active steering, particularly AFS (Active Front Steering),
can be used to provide assistance.
For analysis and controller design a simple geometric model of car and trailer
is used. The model seems to be accurate enough at the low speeds relevant for
trailer reversing. It is shown that the only trailer dependent model parameter can
be estimated while driving. This enables use with different trailers.
Different schemes to control the system are tested. The main approach is to
use the steering wheel as reference for some appropriate output signal, for example
the angle between car and trailer. This makes reversing with a trailer more like
reversing without a trailer. To turn left, the driver simply turns the steering
wheel left and drives. Test driving, as well as theoretical analysis, shows that the
resulting system is stable. Of the eight drivers that have tested this type of control,
five found it to be a great advantage while two considered it more confusing than
helpful.
A major problem with this control approach has to do with the way AFS
is constructed. With AFS, the torque required to turn the front wheels results
in a reaction torque in the steering wheel. Together with the reference tracking
controllers, this makes the steering wheel unstable. Theoretical analysis implies
that this problem has to be solved mechanically. One solution would be to combine
AFS with electric power steering.
This thesis also presents a trajectory tracking scheme to autonomously reverse
with a trailer. Starting from the current trailer position and the desired trajectory
an appropriate turning radius for the trailer is decided. Within certain limits,
this will stabilize the car as well. The desired trajectory can be programmed
beforehand, but it can also be saved while driving forward. Both variants have
been tested with good results.
Nyckelord
Keywords Automotive Control, Trajectory Tracking, Active Steering
Abstract
Reversing with a trailer is very difficult and many drivers hesitate to even try it.
This thesis examines if active steering, particularly AFS (Active Front Steering),
can be used to provide assistance.
For analysis and controller design a simple geometric model of car and trailer
is used. The model seems to be accurate enough at the low speeds relevant for
trailer reversing. It is shown that the only trailer dependent model parameter can
be estimated while driving. This enables use with different trailers.
Different schemes to control the system are tested. The main approach is to
use the steering wheel as reference for some appropriate output signal, for example
the angle between car and trailer. This makes reversing with a trailer more like
reversing without a trailer. To turn left, the driver simply turns the steering
wheel left and drives. Test driving, as well as theoretical analysis, shows that the
resulting system is stable. Of the eight drivers that have tested this type of control,
five found it to be a great advantage while two considered it more confusing than
helpful.
A major problem with this control approach has to do with the way AFS
is constructed. With AFS, the torque required to turn the front wheels results
in a reaction torque in the steering wheel. Together with the reference tracking
controllers, this makes the steering wheel unstable. Theoretical analysis implies
that this problem has to be solved mechanically. One solution would be to combine
AFS with electric power steering.
This thesis also presents a trajectory tracking scheme to autonomously reverse
with a trailer. Starting from the current trailer position and the desired trajectory
an appropriate turning radius for the trailer is decided. Within certain limits,
this will stabilize the car as well. The desired trajectory can be programmed
beforehand, but it can also be saved while driving forward. Both variants have
been tested with good results.
v
Acknowledgements
A lot of people has helped me with this thesis. Christian Lundquist worked to-
gether with me all the way, providing valuable feedback and ideas. Wolfgang
Reinelt invited me to do the thesis and shared his experience in control. I want
to thank them both. I am also very grateful to Gustaf Hendeby and Jacob Roll,
for their patience and for good advice concerning the thesis.
Further, my family and friends, Camorasan, Alexander, Christine, Frank, Gerd,
Ralf, Reinhard, Samuel, Schusterle, Thomas and Thorsten are not forgotten. . . och
Christian, se nu till att du kommer ut och får sladda lite ibland också.
vii
Contents
1 Introduction 1
1.1 Active Front Steering . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 This Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Modelling 3
2.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.3 Geometric Constraints . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.4 Kinematic Constraints . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5 Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.6 Model Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.7 Trailer Length Estimation . . . . . . . . . . . . . . . . . . . . . . . 9
3 System Characteristics 11
3.1 Equilibria . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Left-Right Steering . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 Jackknifing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4 Reference Tracking 15
4.1 Controlling γ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.1 Input-Output Linearization . . . . . . . . . . . . . . . . . . 16
4.1.2 Optimal Feedback . . . . . . . . . . . . . . . . . . . . . . . 16
4.1.3 Comparing the γ-controllers . . . . . . . . . . . . . . . . . . 18
4.2 Controlling the Turning Radius . . . . . . . . . . . . . . . . . . . . 19
4.3 Anti-Jackknifing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.4 Test Driving . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.5 Alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.5.1 Error Correction . . . . . . . . . . . . . . . . . . . . . . . . 23
4.5.2 Modified Steering Characteristics . . . . . . . . . . . . . . . 24
4.5.3 Assisting Steering Wheel Torque . . . . . . . . . . . . . . . 24
ix
5 Steering Wheel as Reference 25
5.1 Linear Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.2 Stabilizing the Steering Wheel . . . . . . . . . . . . . . . . . . . . . 27
5.2.1 No Steering Shaft Friction . . . . . . . . . . . . . . . . . . . 27
5.2.2 With Steering Shaft Friction . . . . . . . . . . . . . . . . . 28
5.3 Limiting Instability . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6 Autonomous Steering 31
6.1 Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.2 Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.3 Saving a Trajectory . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6.4 Special Trajectories . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
A Derivations 37
A.1 Deriving the Differential Equations . . . . . . . . . . . . . . . . . . 37
A.2 Deriving the Trailer Velocity . . . . . . . . . . . . . . . . . . . . . 38
Bibliography 43
Chapter 1
Introduction
1
2 Introduction
steering
wheel
angle
super-
position
angle
@
@
@@
Figure 1.1. With AFS, an angle is superposed to the steering wheel angle.
Modelling
The design and analysis of a controller requires an appropriate model of the system
that we want to control. In this chapter, a model for the car-trailer system is
derived. The modelling is made in a structured manner to enable expansions.
Sections 2.1–2.4 discuss the basic assumptions and formulate them as algebraic
and differential constraint equations. From these equations a system of differential
equations is derived. The derivations can be found in Appendix A and the resulting
differential equations in Section 2.5. The validity of the model is examined in
Section 2.6 and Section 2.7 presents a method to estimate the trailer length while
driving.
2.1 Basics
An important part of modelling, is to choose what kind of model to use. Which
effects are essential and which can be disregarded? Choosing the most complex
model is not always a good idea. Though such a model is theoretically more
accurate, it tends to be more sensitive to variations and it can be difficult to
estimate all the parameters. A simpler model is also easier to analyse.
One choice we have to make is whether to include lateral slip in our model.
Lateral slip is an effect of cornering. To turn, a car has to be affected by a lateral
force. This force is provided by friction when the tyres slip sideways.
A few facts can guide us when we decide whether to include slip in our model.
One is that the weight of a specific trailer varies, and thus tyre friction and dynamic
properties. If the model depends on these parameters, they would have to be
estimated each time the car starts. Moreover, car owners tend to use their car with
different trailers. Therefore, we want controllers that can adapt to a new trailer,
and thus all trailer dependent parameters have to be estimated while driving.
Since slip is linked to the lateral forces, a model with slip would depend on
the dynamic properties of both the car and the trailer. A model without slip, on
the other hand, only depends on the geometry of the car and the trailer. Besides,
trailer reversing mostly takes place at low speeds, where side forces and lateral
slip are small.
3
4 Modelling
It seems a model without slip is more suitable for our purposes. (In cases when
slip cannot be disregarded the model in Appendix B might be a starting point.)
We will now look a little closer at the geometry of the car. To allow all wheels
of the car to roll without lateral slip, the inner front wheel needs to turn more
than the outer. The ideal geometry, often called Ackermann steering geometry,
is shown in Figure 2.1. Here, all wheels are aligned to move in circles around a
common central point, M . The relation between the left front wheel angle, δF L ,
and the right, δF R , is
w1
tan δF L − tan δF R = tan δF L tan δF R ,
l1
where w1 and l1 are the distances between the wheels as can be seen in Figure 2.1.
Note that the wheel angles are positive when turning left.
δ F.
..
v 6 F ..
.
.. ..
.
. .
.. .. .
.... .. .. ..
...... .. ..
....
rP
.
.. .... . 0
. .
. ..
.
.. .
.. ....... ...
M .. .. .....
r .
.
...
.
.
.
..
.
..
..
....
δF L .
.
. .
. ..
..
.
.. ..
δF R .. ..
.. ...
. .
.. ..
.. .. l
.. v .. 1
.. R .
.. ..
..
..
.
. .
..
..
..
..
.
r ..
..
. .
.. ..
.. P 1
..
. ....
..
.. ..
.
.
.. ..
.. ..
P
i
PP ...
.
..
PP
w P
q
1 ..
For our model, we will assume that the car has Ackermann steering geometry
and that all wheels roll without lateral slip. Thus, all points on the car will move
on circles around a common point (Figure 2.1).
We define the points P0 and P1 as in Figure 2.1 and vF and vR as their velocity
vectors. The movement of the car can be specified by the signed speed vR = ±|vR |,
and the angle δF between vF and the central axis of the car. In practice δF is
computed from measurements of the front wheel angles, using
tan δF L tan δF R
tan δF = w1 = .
1 + 2 l1 tan δF L 1 − 2wl11 tan δF R
From now on we will call δF the front wheel angle of the car, though that is not
entirely true.
2.2 Coordinates 5
2.2 Coordinates
We introduce a (global) inertial frame R with coordinates xR and y R as well as
local frames Li with coordinates xLi and y Li (Figure 2.2). The car-fixed frame, L1 ,
has its origin in the point P1 between the rear wheels, and its x-axis in the forward
direction of the car. Frame L2 is trailer-fixed with origin between the wheels of the
trailer, and x-axis in the forward direction of the trailer. We also define a frame
L0 with origin in P0 , between the front car wheels, and x-axis coinciding with the
velocity vector, vF (see Section 2.1).
..
..
yR ..
..
..
..
..
6 AK r
..
*
..
..
L 0 ....
- ..
..
xR ..
..
R ..
..
..
..
..
..
..
..
..
I r
@ ..
..
..
..
..
L .
1 .....
.. ..
..
.. ..
.. ..
..
..
r:
OC ..
C ..
..
L 2...
..
..
..
..
..
..
.
The position of body i in the plane is specified by the global coordinates of the
origin Pi of the body-fixed frame Li , and the orientation of body i is specified by
ψi = ψLi R , the angle of rotation of Li with respect to R. For convenience, we also
introduce the displacement vector rR R R T
Pi O = (xPi O , yPi O ) (see Figure 2.3).
HH
Y
H.. Li
......
:
rR
Pi O ..
..
..
.
..
..
6
..
..
ψ i
..
R - .
..
..
....................................................................................................
• The angles between the front wheels and the car are controlled by the driver
together with the controller. These angles are specified by the single angle δF
(see Section 2.1). Thus, with ψ0 and ψ1 as defined in the previous section,
ψ0 − ψ1 − δF = 0. (2.1)
..
..
..
.. .
.. ..
.. ..
.. ...
.. ..
....
.. rP
... .. 0
. ..
.. ..
.. ..
. ..
... ..
.. ..
.. .
..
.. ..
.. . .
.. .
.
.
.
. .. ..
. . .. ..
.
.
.
. .. . ..
. . .. ..
.
.
.
.
.
. ..
.. ..
.... r
.
.
.
.
.
.
..
... . ... .. 1
.. P l1
.
.
.
. .. .. ..
. . .. ... ..
. . ..Q
.. ...
. ..
rP
. . 2 ..
.
.
.
.
2 .
.
...............................................................
.
.
r1 ....... Q r ..
. . .. ..
. . ..
..
. .
. . ..
. . ..
. . ..
. .
.
.
.
.
.
.
..
. 12 l
. .
. .
. .
. . -
. .
. .
l2
where
cos ψ1 − sin ψ1 l
A RL1
= and rL1
P0 P 1 = 1 .
sin ψ1 cos ψ1 0
We get the constraint equations
xR R
P0 O − l1 cos ψ1 − xP1 O = 0 (2.2a)
yPR0 O − l1 sin ψ1 − yPR1 O = 0. (2.2b)
2.4 Kinematic Constraints 7
• We define a point Q1 for the towing hook of the car and a point Q2 for the
coupling of the trailer (see Figure 2.4). Since the trailer is attached to the
car, these points coincide,
rR R R R
P1 O + rQ1 P1 − (rP2 O + rQ2 P2 ) = 0.
where
−l12 l2
rR
Q1 P1 =A RL1
and rR
Q2 P2 =A RL2
.
0 0
We get
xR R
P1 O − l12 cos ψ1 − xP2 O − l2 cos ψ2 = 0 (2.3a)
yPR1 O − l12 sin ψ1 − yPR2 O − l2 sin ψ2 = 0. (2.3b)
• By definition, P0 moves only along the x-axis of the L0 frame and as an effect
of the no lateral slip assumption P1 only move along the x-axis of L1 . With
a similar argument we assume that the trailer has zero lateral slip. Thus the
point P2 will only move along the x-axis of L2 . We have
?
ALi R ṙR
Pi O = , i = 0, 1, 2
0
− sin ψ0 ẋR R
P0 O + cos ψ0 ẏP0 O = 0 (2.4a)
− sin ψ1 ẋR
P1 O + cos ψ1 ẏPR1 O =0 (2.4b)
− sin ψ2 ẋR
P2 O + cos ψ2 ẏPR2 O = 0. (2.4c)
• Finally, the speed of the car can be measured. Let us assume that the speed
of the rear wheels is measured. Since there is no slip,
vR
AL1 R ṙR
P1 O = ,
0
which yields
cos ψ1 ẋR R
P1 O + sin ψ1 ẏP1 O = vR . (2.5)
Assuming that initial conditions are known we now have enough equations to
decide the behaviour of the system as a result of the steering angle, δF , and rear
wheel speed, vR .
8 Modelling
|δF | ≤ δFbd .
Sometimes it is more appropriate with a model that uses traveled distance, rather
than time, as independent variable. We introduce σ as the distance travelled
backwards by the rear wheels. Using the chain rule we get
and
0 1 l12 1
γ (σ) = − + cos γ tan δF + sin γ. (2.7)
l1 l 1 l2 l2
Naturally, the same substitution could be performed in the first three equations,
but that will not be necessary.
0.8
0.4
γ [rad]
−0.4
−0.8
0 20 40 60 80 100 120
Time [s]
Figure 2.5. Measured (solid) and simulated (dashed) γ, when driving forward at low
speed.
We get our estimation of l2 from the θ that minimizes VN (θ). Because γ̂ is linear
in θ this minimum can be found easily. First we define
N
1 X
fN = γ(k + 1) − γ(k) − g1 (k) g2 (k)
N
k=1
10 Modelling
and
N
1 X
RN = g2 (k)2 .
N
k=1
If RN > 0
N 2
1 X
VN (θ) = γ(k) − γ(k − 1) − g1 (k) + 2 θ fN + θ2 RN
N
k=1
N 2
f2
1 X fN
= g1 (k)2 − N + RN θ + .
N RN RN
k=1
0
0 5 10 15 20 25 30 35 40 45 50
Travelled distance [m]
Figure 2.6. Estimation of the trailer length in real-time. The solid line is the estimated
trailer length and the dashed line is the actual length.
Figure 2.6 shows estimated and true trailer length from a test drive. The test
drive included several curves. As the plot shows, a good estimation of the trailer
length was obtained after just a few meters.
Chapter 3
System Characteristics
In the next chapter we will construct controllers for trailer reversing, but first
we look at some of the characteristics that make it difficult to reverse without
assistance.
In the first section we derive an expression for the equilibria of our model. Then
we define the concept of left-right steering. In Section 3.3 we derive an expression
for the jackknifing angle and the last section of this chapter concerns stability.
3.1 Equilibria
As in most of this thesis, we will replace the front wheel angle, δF , with the more
convenient u = tan δF . Not to forget its meaning, we will refer to it as the front
wheel tangent. The bounds on the front wheel angle are easily translated. We
have
|u| < ubd = tan δFbd .
Next, we rewrite (2.7) and define a function for the right hand side,
0 1 l12 1 ∆
γ (σ) = − + cos γ u + sin γ = f (γ, u). (3.1)
l1 l 1 l2 l2
In order to analyse this equation, we first seek the equilibria. Since we are only
interested in realistic car-trailer angles, we can assume |γ| ≤ π/2. We put γ 0 = 0,
which yields
l1 sin γ
u= .
l2 + l12 cos γ
This equilibrium relation will prove important, so we define the function
l1 sin γ
ueq (γ) = . (3.2)
l2 + l12 cos γ
Note that this function is strictly monotonic on [− π2 , π2 ]. Thus, for each front
wheel tangent, u, one unique car-trailer angle is in equilibrium, and inversely, for
each car-trailer angle there is only one front wheel tangent that will put the trailer
in equilibrium.
11
12 System Characteristics
We conclude that
What this means is that to get the trailer to turn left, you have to turn the front
wheels of the car to the right and inversely. Lacking a better expression, we will
call this left-right steering. It should be familiar to anyone who has tried reversing
with a trailer. For inexperienced drivers it can pose quite a problem.
3.3 Jackknifing
In the previous section we learned that to make γ smaller, we simply make u > ueq ,
but what happens if this is not possible? The problem arises if ueq (γ) > ubd . Then
γ 0 must be positive and γ will increase. The trailer will fold up to the car like a
jackknife (Figure 3.1). The only way for the driver to regain control of the trailer
is to stop and drive forward.
The critical jackknifing angle γjk can be found by putting ueq (γ) = ubd .
(Thanks to the symmetry it is sufficient to consider the positive case.) Using
3.4 Stability 13
(3.2) yields
l1 sin γ
ubd = ueq (γ) = ,
l2 + l12 cos γ
and
l1 sin γ − l12 ubd cos γ = l2 ubd .
Using the relation sin (α + β) = sin α cos β + cos α sin β we get an expression for
the jackknifing angle
!
l2 ubd l12 ubd
γjk = arcsin p 2 2 u2
+ arctan . (3.3)
l1 + l12 bd
l1
Symmetrically, the trailer will jackknife if γ < −γjk . From now on we will mainly
be interested in angles γ ∈ (−γjk , γjk ). For them |ueq (γ)| < ubd and thus the
trailer can be controlled. Notice that at the jackknifing angle itself the system is
not controllable.
3.4 Stability
In this section, we examine the stability of our equilibria, and present some theory
that will be needed in the next chapter. First we recall the definition of stability.
Consider a scalar autonomous differential equation z 0 = f (z), z(0) = z0 where f
is a continuous function and f (Z) = 0.
Definition 3.1 The equilibrium Z is stable, if for an arbitrary ε > 0, there exists
a δ > 0 such that |z0 − Z| < δ assures |z(t) − Z| < ε for all t > 0.
For a proof of this theorem and a good general discussion on stability, see [5].
The definition of stability is valid for autonomous differential equation. A
differential equation with an input signal results in an autonomous function if the
input signal is kept constant. In our case, assuming u ≡ U , yields the equation
0 1 l12 1
γ =− + cos γ U + sin γ = fU (γ).
l1 l 1 l2 l2
which has only one equilibrium, Γ ∈ (−γjk , γjk ), such that U = ueq (Γ), (see
Section 3.1). According to Theorem 3.1, the equilibrium is unstable if f 0 (Γ) > 0.
Differentiation yields
l12 1
f 0 (γ) = sin γ U + cos γ.
l1 l 2 l2
Equation (3.2) tells us that Γ and U , will always have the same sign. Thus, f 0 (Γ)
is positive and the equilibrium is unstable.
14 System Characteristics
Note that an attractive equilibrium is also asymptotically stable (as defined in [5]
or [1]).
Chapter 4
Reference Tracking
Normally, the steering wheel is used to control the front wheels of the car. To
control the trailer, the driver has to predict how it will react to different front
wheel angles. Because of the factors discussed in the previous chapter, this is
quite difficult.
In this chapter we try to make trailer reversing more like reversing without
a trailer. To achieve this we break the direct link between steering wheel and
front wheels. Instead, the steering wheel will be used to provide a reference signal
for some appropriate output. Different outputs are tested. In Section 4.1, two
controllers for the car-trailer angle γ are designed, and in Section 4.2, a controller
for the trailer turning radius. Experiences from test driving are presented in
Section 4.4 and in Section 4.5, some alternatives to reference tracking controllers
are discussed.
It could be argued that this approach is misguided, that it will change the
steering characteristics too much and confuse the driver. Even if this is true, it
is interesting to test reference tracking systems. The reason is that they let us
examine, more generally, the possibility of controlling a car-trailer system. The
experiences can then be used for more intricate control schemes or, as in Chapter 6,
for autonomous steering.
4.1 Controlling γ
Since the car-trailer angle, γ, is measured, that is perhaps the most natural choice
of output. To turn left, the driver steers left, indicating that he wants a positive
angle between car and trailer.
In Chapter 2 we found the differential equation, describing how the trailer
angle depends on the steering input. Although this equation is nonlinear, a lin-
ear controller would probably work. However, because of the nonlinearity, the
effectiveness of such a controller could depend on the trailer length. It seems
more satisfactory to use nonlinear controllers. In the following sections we try
input-output linearization and optimal feedback.
15
16 Reference Tracking
yields
γ 0 = w as long as |u| ≤ ubd
which is, within the bounds, a linear system from the new input signal w to
the output γ. This linear system can be controlled with a normal P-controller,
w = K1 (rγ − γ), where rγ is the reference value for γ. All combined, we get the
controller
l1 sin γ K10 (γ − rγ )
u= + . (4.2)
l2 + l12 cos γ l2 + l12 cos γ
To examine the stability of the controlled system, we assume that the reference
value is kept constant rγ = R ∈ (−γjk , γjk ). This yields an autonomous differential
equation
γ 0 = K1 (R − γ), |u| ≤ ubd , (4.3)
with one equilibrium γ = R.
Theorem 3.2 states that the system is attractive if γ 0 switches sign at the equi-
librium (and has no other zeros). It is pretty obvious that this is the case for
(4.3).
Z∞
min L(u(σ), γ(σ)) dσ (4.4a)
τ
γ̇ = f (γ, u) (4.4b)
u(s) ∈ U = [−ubd , ubd ] (4.4c)
γ(0) = z (4.4d)
Getting a good controller is a question of choosing L(u, γ). Clearly, γ should track
its reference value, rγ and hence we put a term (γ − rγ )2 in L.
L(u, γ) = (γ − rγ )2 + . . .
Furthermore, we want the steering to feel smooth. To ensure this we add a term
(u − ueq (γ))2 , where ueq refers to the current equilibrium. Recall the definition
from Section 3.1,
l1 sin γ
ueq (γ) = .
l2 + l12 cos γ
Further, we need some way to adjust the trade-off between reference tracking and
smoothness, so we also introduce a design parameter K2 > 0,
K22 1
L(u, γ) = (γ − rγ )2 + (u − ueq (γ))2 . (4.5)
2 2
We now seek a control law that is optimal for this criterion. Again, the theory can
be found in [1]. A central roll is played by the optimal return function
Z∞
V (τ, z) = L(u∗ , γ ∗ )dσ,
τ
∗ ∗
where u and γ refer to functions satisfying (4.4).
Since the interval is infinite and all functions are position invariant the optimal
return function must also be independent of the starting position τ . This means
that
Vτ0 ≡ 0 and V (τ, z) = V (z).
We get the Hamilton-Jacobi equation
which is almost the same criterion as the one we chose for the optimal feedback.
(Note that to some extent this discussion could be repeated in a multi-variable
case.)
Since the difference between the controllers is so small, the work we did on
optimal feedback can be seen mainly as a motivation for the linearizing controller.
4.2 Controlling the Turning Radius 19
Since the curvature is not measured, it cannot be controlled using standard meth-
ods. Instead we try a kind of predictive control choosing the control signal that,
according to the model, should give the desired output.
Let rκ be the reference value for κ. To find the value of u that will give the
desired curvature, we put κ = rκ , in (4.7) and solve for u. This gives us the control
law
l1 tan γ − l2 rκ
u = g(rk , γ) = . (4.8)
l12 1 + l2 rκ tan γ
Note that the controller has a discontinuity. At l2 rκ tan γ = −1 the denominator
turns zero and u switches sign. Remembering that u = tan δF , we understand that
the controller switches between δF = π/2 and δF = −π/2, that is, the wheels are
supposed to turn from full right to full left. Though this is mathematically correct,
it is naturally undesirable in practice. Moreover, the front wheel angle can never
become larger than δFbd , corresponding to u = ubd = tan δFbd . This maximum is
attained for
l1 tan γ − l12 ubd
rκ = .
l1 l2 + l2 l12 ubd tan γ
We modify the controller accordingly. The modified controller is u = h(rκ , γ),
with
l1 tan γ − l12 ubd
h(rκ , γ) = ubd when rκ ≤ , (4.9a)
l1 l2 + l2 l12 ubd tan γ
l1 tan γ + l12 ubd
h(rκ , γ) = −ubd when rκ ≥ (4.9b)
l1 l2 − l2 l12 ubd tan γ
and otherwise
l1 tan γ − l2 rκ
h(rκ , γ) = g(rκ , γ) = . (4.9c)
l12 1 + l2 rκ tan γ
Now we would like to check if this controller will actually stabilize the trailer.
First we need to find the equilibria of the system. Since we are only interested in
equilibria γ ∈ (−γjk , γjk ), where |ueq (γ)| < ubd , the saturation in (4.9) is of no
interest. Thus, we insert (4.8) in the differential equation (3.1),
0 1 1 tan γ − l2 rκ 1
γ =− + cos γ + sin γ.
l12 l2 1 + l2 rκ tan γ l2
20 Reference Tracking
In equilibrium γ 0 = 0, so
1
(sin γ − l2 rκ cos γ) − rκ cos2 γ = rκ sin2 γ
l12
and
sin γ
rκ = . (4.10)
l12 + l2 cos γ
This relation shows us that if the reference value rκ gets too large, the controller
will steer towards an equilibrium γ > γjk , and cause the trailer to jackknife. To
prevent this the reference value has to be kept within the bound
sin γjk
|rκ | < rκbd = .
l12 + l2 cos γjk
Now that we have found a relation that describes the equilibria of the controlled
system, we go on to check the stability of these equilibria. As commented in
Section 3.4, stability is defined for autonomous differential equations. As in that
section, we get an autonomous equation by assuming a constant input signal.
In this case we assume that the reference signal is kept constant rκ = R, with
|R| < rκbd . We write the resulting differential equation
γ 0 = fR (γ) (4.11)
where the R indicates that we get a different equation for each value of R. The
autonomous equation has only one equilibrium Γ ∈ (−γjk , γjk ).
Next we define
1 l12 1
f (γ, u) = − + cos γ u + sin γ
l1 l 1 l2 l2
noting that (4.11) can be written
From Lemma 4.2 we know that h(R2 , Γ1 ) < h(R1 , Γ1 ) and consequently,
Proof (Proposition) To use Theorem 3.2, we need to prove that for γ ∈ (−γjk , γjk )
γ > Γ ⇒ fR (γ) < 0
4.3 Anti-Jackknifing
As discussed in Chapter 3, one of the disturbing characteristics of a car-trailer
system, is its tendency to jackknife. A strength of the reference tracking controllers
is that jackknifing can be prevented. All we need to do is bound the reference
values. For the γ-controllers, the obvious bound is
In case of the turning radius controller the bound has already been mentioned,
but we repeat it here
sin γjk
|rκ | < rκbd = .
l12 + l2 cos γjk
0.6
0.4
γ [rad]
0.2
−0.2
0 10 20 30 40 50 60 70 80
Time [s]
Figure 4.1. Steering wheel reference signal (solid) and car-trailer angle γ (dashed),
when using the linearizing γ-controller.
meter
10
−5
−10
0 10 20 30 40 50 60 70 80 meter
Figure 4.2. Backwards slalom driving with (dashed) and without controller.
4.5 Alternatives
In this section, we discuss a few alternatives to the reference tracking controllers
that we covered earlier in this chapter.
0.6
Front wheel angle, δF
eq
−0.6
−π 0 π
Steering wheel angle
This approach was also implemented and tested. It was most effective when
making a turn to, for example, park. When trying to drive straight backwards it
provided little or no help. A variant is to use a γ-controller for reversing straight,
and modified characteristics in all other driving situations.
Our assistance functions are meant to assist drivers not used to reversing with a
trailer. The aim was therefore to make it as similar as possible to reversing without
trailer. That means that turning the steering wheel to the left should cause the
trailer to go left. In Section 3.2 we called this left-left steering. This turned out
to work poorly with AFS.
With AFS the torque needed to turn the front wheels will cause an opposing
torque in the steering wheel. Normally, turning the steering wheel to the left will
cause the wheels to go left and the opposing torque in the steering wheel will tend
to decelerate the steering wheel movement.
However, when reversing with a trailer the front wheels initially have to turn
right for the trailer to move left. The torque in the steering wheel will therefore
tend to accelerate the steering wheel movement. This makes it very hard to steer.
In this chapter, we analyse the torque feedback problem using linear models of
the involved systems. In Section 5.1 we show that left-left steering will cause the
steering to become unstable, while left-right steering creates a stable system. The
theoretical possibility of solving this problem, is explored in Section 5.2. Finally,
we look at a few methods to make the instability less disturbing (Section 5.3).
25
26 Steering Wheel as Reference
Tf = −k δ̇F ⇒ E(s) = −k s.
Assuming that friction in the steering shaft can be ignored, the steering wheel
angle, δS , follows
J
δ̈S = J (T + Tf ) ⇒ H(s) = 2 .
s
E(s)
Tf
?
T - Σ - H(s) - Fr (s) - Σ - G(s) -γ
δS δF
6
Fγ (s)
Figure 5.1. Block diagram showing the linear model used to analyse the torque feedback.
The input is the driver’s steering wheel torque, T , and the output is the car-trailer angle,
γ. Note the undesired loop created by E(s).
Now, we have a model from driver input to trailer angle (see Figure 5.1). To
examine stability we calculate the transfer function, GC (s), from driver torque, T ,
to trailer angle, γ,
Fr G sJ2
GC (s) = .
1 − Fr sJ2 k s − Fγ G
From test drives we know the nice properties of left-right steering. Are they also
reflected in this linearized model? First look at proportional control, Fr = Kr > 0,
5.2 Stabilizing the Steering Wheel 27
Fγ = Kγ > 0. Note that a positive steering wheel angle will give a negative trailer
angle. We get the transfer function
−Kr b J 1
GC (s) =
s2 + (Kγ b − Kr J k − a) s + Kr Jkb s
and the system poles (not counting the integration)
r
1 1
s = − (Kγ b − Kr Jk − a) ± (Kγ b − Kr Jk − a)2 − Kr Jkb.
2 4
For small positive Kr , the system is stable (apart from the integration), but if Kr
gets too large the system will become oscillating or even unstable.
To get left-left-steering instead, we use the controller Fr = −Kr . We then get
the transfer function
Kr b J 1
GC (s) =
s2 + (Kγ b + Kr Jk − a) s − Kr Jkb s
and the poles
r
1 1
s = − (Kγ b + Kr Jk − a) ± (Kγ b + Kr Jk − a)2 + Kr Jkb.
2 4
Now, the square root is always greater than the first term, and thus there will
always be at least one unstable pole.
We can always choose to have Q(0) > 0. If we want the controller to be stable
in itself, Q(s) cannot have any zeros in the right half plane, which means that
Q(s) → ∞ when s → ∞. To get left-left-steering, the steady state gain must be
negative. That is, when steering left, the front wheels turn right. Since
P (0)
0 > Fr (0) =
Q(0)
we get P (0) < 0. This means
and
R(s) → ∞ when s → ∞.
Since R(s) is continuous, this implies that R(s) has a real positive zero. The
conclusion is that there is no stable linear controller that can locally stabilize the
system.
µ Q(0) + Jk P (0) ≥ 0
which means
P (0) µ
Fr (0) = ≥− . (5.1)
Q(0) Jk
5.3 Limiting Instability 29
Since there is very little friction in the steering shaft, µ is small and thus this is a
hard restraint. The only ways to get stability is left-right steering (Fr (0) < 0), or
with a very indirect steering ratio. The latter means that the driver will have to
turn the steering wheel a lot to get the desired reaction.
Figure 5.2. Relation between reference signal and steering wheel angle.
Practically, this means that the front wheels move back and forth. The
major drawback is that the steering feels uneven.
30 Steering Wheel as Reference
Chapter 6
Autonomous Steering
6.1 Tracking
Let us assume that we know the current position of car and trailer, as well as the
desired trajectory. How do we track it? Most trajectory tracking schemes in the
literature seem to involve some kind of prediction control. The path is predicted
for a couple of different input values and the different paths are evaluated. In
our case, this would mean solving our nonlinear differential equation in each step.
Since we have very limited computing capacity in the car, this would not work.
We need a simpler control scheme.
When driving forward with a trailer, you mostly only consider the movement
of the car, expecting the trailer to follow. The principle is illustrated in Figure 6.1.
The driver indicates with the steering wheel how much he wants the car to turn.
Since the system from car movement (turning radius) to trailer angle is stable, the
trailer will follow the car in a nice way.
car
position
- -
desired driver - car-trailer
- δF system -
path
car-trailer
stable angle
31
32 Autonomous Steering
In Section 4.2, we showed that controlling the turning radius of the trailer
would also stabilize the trailer angle, γ. This result inspires the trajectory tracking
scheme in Figure 6.2. Comparing the current trailer position with the desired
path, an autonomous steering function decides an appropriate turning radius for
the trailer. To obtain this turning radius, the radius controller from Section 4.2 is
used. Since this also stabilizes the car-trailer angle, the car position can normally
be disregarded.
........................................................................
.... .... trailer
-
autonomous .... - .... position
.... ....
desired
-
path
- function rκ ....
radius - car-trailer
....
.... - controller system .... -
.... .... car-trailer
.... .... angle
..........................................................................
.. ....
stable
Next, we need a way to decide the appropriate turning radius, given the desired
path and the current trailer position. It seems natural to consider the point on the
trajectory that is closest to the current position as our desired position. We define
dpos as the deviation from the desired position, and dψ as the deviation from the
desired orientation of the trailer (as an angle). Ideally dpos and dψ are both zero.
The appropriate turning radius for the trailer is then given by the curvature of the
trajectory,
rκ = κtraj .
If the deviations are not zero the turning radius should be adjusted accordingly,
rκ = κtraj ± K1 dpos + K2 dψ ,
where the sign in front of K1 dpos depends on whether the current position is to
the left or to the right of the desired path.
6.2 Positioning
Our only way to decide the position of the trailer is to calculate from measurements
of rear wheel speed, vR , front wheel angle, δF and car-trailer angle, γ. For this
purpose we will use the model from Section 2.5. We define the initial position and
orientation of the car as zero.
where h is the sample time. The trailer position can then be decided using the
geometric relations from Section 2.3.
r(τ ) = (1 − τ ) rR R
Ti O + τ rTi+1 Ti .
The point on this line that is closest to the current trailer position is considered our
desired position. With the corresponding value of τ , we calculate desired values
for ψ and κ.
This method seems to work well in practice. Figure 6.3 compares the saved
forward trajectory to the trajectory chosen by the controller. Note that the trailer
positions in the plot are estimated. Errors in the estimation are not regarded, but
other tests imply that they are quite small.
34 Autonomous Steering
meter
−2
−4
−6
−8
−10
−5 0 5 10 15 20 25 meter
Figure 6.3. Tracking a saved trajectory. The solid line is the trajectory saved when
driving forward, and the dashed line shows how the controller tracks this trajectory when
reversing.
meter
−2
−35 −30 −25 −20 −15 −10 −5 meter
7.1 Modelling
In Chapter 2 we derived a simple model for car and trailer. Data from test drives
shows that the model works well for low speeds. We can also note that the model
reflects several of the system characteristics that we know from practice. If a model
for higher speeds is required, the one in Appendix C can be used, but first it has
to be validated and the parameters in it have to be estimated.
To enable use with different trailers, a method to estimate the trailer length
was presented in Section 2.7. Initial tests imply that it is effective, but more tests
are desirable. It would also be interesting to see how sensitive the controllers are
to errors in the trailer length. Perhaps it would be possible to start the controllers
with a guessed trailer length and then switch to the estimated value when the
estimation is done.
35
36 Conclusions and Future Work
Derivations
ẋ1 = vR cos ψ1
ẏ1 = vR sin ψ1
Differentiating (2.2a), (2.2b) and combining them with (2.4a) we get
l1 ψ̇1 sin ψ0 sin ψ1 + l1 ψ̇1 cos ψ0 cos ψ1 − sin ψ0 ẋ1 + cos ψ0 ẏ1
= l1 ψ˙1 cos (ψ0 − ψ1 ) − ẋ1 sin ψ0 + ẏ1 cos ψ0 = 0
Using (2.1) and the newly found expressions for ẋ1 and ẏ1 we can rewrite this
37
38 Derivations
ẋL R R
P2 O = cos ψ2 · ẋP2 O + sin ψ2 · ẏP2 O .
2
ẋL
P2 O = ẋ1 · cos ψ2 + ẏ1 sin ψ2 + l12 ψ̇1 sin γ.
2
Using the equations from the previous section this can be rewritten
vR l12
ẋL
P2 O = vR cos γ +
2
tan δF sin γ.
l1
A reasonable measure for the turning radius, ρT , of the trailer is given by the
curvature, κ
Notice that the curvature is positive when turning left and negative when turning
right.
Appendix B
In this section we derive a model that includes lateral wheel slip. The mechanical
laws that are needed can be found in any textbook on mechanics, for example [4].
We use the coordinate frames from Section 2.2, but also introduce some new. To
get easier equations we build the model around the coordinates of the car hook
(x, y)T . We also introduce the longitudinal and lateral velocities of the towing
hook
vx = ẋ cos ψ1 + ẏ sin ψ1
vy = −ẋ sin ψ1 + ẏ cos ψ1 ,
and the accelerations
ax = ẍ cos ψ1 + ÿ sin ψ1
ay = −ẍ sin ψ1 + ÿ cos ψ1 ,
noting that
v̇x = ax + ω1 vy
v̇y = ay − ω1 vx .
Geometric constants l for the car, and λ for the trailer are defined as shown
Figure B.1. Furthermore, we define lC = lR + lCR , lF = lC + lC F and λR =
λC + λCR .
Our aim is to create a state space model, with inputs vx , v̇x , δF and state space
variables x, y, ψ1 , ψ2 , vy , ω1 and ω2 .
39
40 Model with Lateral Slip
..
..
..
.. .
.. ..
.. ..
.. ..
.. ...
rP
....
.. ..
.. .. ... 0
.. ... ..
.. .. ..
.. .. ..
..
.. . .. ..
..
.. ... .
..
..
. .
rC
.. ...
....
. ... 1
.. .. .. .. . ..
.. .. ..
.. .. .. .. .. ..
.. .. .. .. .. ..
..
..
..
..
..
.. ..
.. ...
rP
....
.
..
..
l CF
.. .. ... .
.. .. .. ..
. .. ..1
.. .. .. .. .. ..
.. .. .. .. .. ...
Q .. .. ..
rP rC r Q r
.. ... l
.. . .. 2 ..
.. 2 ... 2 CR
...............................................................
.. ..
..
.. 1 ....... .
.. .. .. ... ...
.. .. .. . ..
..
.. .. .. ..
..
..
..
..
..
..
..
.. l R
- ... ... - ...
.. .. ..
λCR λC
slip angles it is a good approximation to assume that the lateral friction force in
the tyre is proportional to the slip angle,
Fi = ki βi . (B.1)
A more thorough discussion of wheel slip and of tyre properties in general can be
found in [3]. Assuming that the wheels moved without lateral slip, gave us (2.4).
With a slip angle βi , similar derivations yield
− sin (ψi + βi ) ẋR R
Pi O + cos (ψi + βi ) ẏPi O = 0.
Using (2.2a) and (2.2b) from Section 2.3 and the definitions of vx and vy we get
vx vy
ω1 = tan (δF + β0 ) −
lF lF
and
vy + lR ω1 = vx tan β1 .
With these equations we can express β0 and β1 in terms of the state space variables,
lF ω1 + vy
β0 (z) = arctan − δF (B.2)
vx
vy + lR ω1
β1 (z) = arctan . (B.3)
vx
A similar expression can be derived for the trailer
vx sin γ + vy cos γ + λR ω2
β2 (z) = arctan (B.4)
vx cos γ + vy sin γ
From now on these expressions are intended when we write β0 , β1 and β2 .
B.2 Dynamics 41
B.2 Dynamics
In this section we use the basic laws of mechanics to derive the equations of motion
for car and trailer. For the coordinates of the car center of gravity, (xR R
C1 O , yC1 O ),
it holds that
xR
C1 O − lC cos ψ1 − x = 0
R
yC 1O
− lC sin ψ1 − y = 0
and for the trailer
x − λC cos ψ2 − xR
C2 O = 0
R
y − λC sin ψ2 − yC 2O
= 0.
Differentiating gives the corresponding relation of the accelerations. For the car
aC1 ,y = ay + lC ω̇1
For the trailer the external forces are the slip force (along the lateral axis) and the
car pulling force. We define Fx2 as the longitudinal pulling force and Fy2 as the
lateral, noting that
Fx2 sin γ − Fy2 cos γ = Fy1 . (B.5)
For the trailer Newton’s law yields
m2 λC m2 λC λCR + λC
ω̇2 = 2 ax sin γ + 2 ay cos γ − k2 β2
J2 + m2 λC J2 + m2 λC J2 + m2 λ2C
[1] Glad, Torkel and Ljung, Lennart: Control Theory – Multivariable and
Nonlinear Methods, Taylor & Francis, 2000.
[2] Glad, Torkel and Ljung, Lennart: Modellbygge och simulering, Studentlit-
teratur, 2004.
[3] Wong, Jo Yung: Theory of Ground Vehicles, John Wiley & Sons, 2001.
[4] Hahn, Hubert: Rigid Body Dynamics of Mechanics – 1 Theoretical Basis,
Springer, 2002.
[5] Hansson, Kurt: Föreläsningar i ordinära differentialekvationer, 2005,
URL: http://www.mai.liu.se/˜kuhan/kurser/NMAC09/, 2005.
[6] Reinelt, Wolfgang; Klier, Willy; Reimann, Gerd; Schuster, Wolfgang and
Grossheim, Reinhard: Active Front Steering: Safety and Functionality,
SAE Paper 2004-01-1101, SAE World Congress, 2004.
43
Upphovsrätt
Detta dokument hålls tillgängligt på Internet — eller dess framtida ersättare —
under 25 år från publiceringsdatum under förutsättning att inga extraordinära
omständigheter uppstår.
Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner,
skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för icke-
kommersiell forskning och för undervisning. Överföring av upphovsrätten vid en
senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av doku-
mentet kräver upphovsmannens medgivande. För att garantera äktheten, säkerhe-
ten och tillgängligheten finns det lösningar av teknisk och administrativ art.
Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman
i den omfattning som god sed kräver vid användning av dokumentet på ovan be-
skrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form
eller i sådant sammanhang som är kränkande för upphovsmannens litterära eller
konstnärliga anseende eller egenart.
För ytterligare information om Linköping University Electronic Press se förla-
gets hemsida http://www.ep.liu.se/
Copyright
The publishers will keep this document online on the Internet — or its possible
replacement — for a period of 25 years from the date of publication barring ex-
ceptional circumstances.
The online availability of the document implies a permanent permission for
anyone to read, to download, to print out single copies for his/her own use and
to use it unchanged for any non-commercial research and educational purpose.
Subsequent transfers of copyright cannot revoke this permission. All other uses of
the document are conditional on the consent of the copyright owner. The publisher
has taken technical and administrative measures to assure authenticity, security
and accessibility.
According to intellectual property law the author has the right to be mentioned
when his/her work is accessed as described above and to be protected against
infringement.
For additional information about the Linköping University Electronic Press
and its procedures for publication and for assurance of document integrity, please
refer to its www home page: http://www.ep.liu.se/
c Olof Enqvist