control algorithms
control algorithms
8-2
Objectives for Lecture 8: Control
Depth of understanding
After the lecture you are able to…
Remember Understand Apply Analyze Evaluate Develop
.. understand the necessity of stabilizing control actions
and the responsibilities of the control algorithm within the
autonomous driving software stack
.. understand the most important control concepts for
autonomous driving (geometric path following controllers,
state-space controllers and model predictive control)
.. design and tune geometric path following controllers and
state-space lateral path tracking controllers
.. design and tune a velocity controller for basic cruise
control in highway scenarios
8-3
Autonomous Driving Software Engineering
Prof. Dr. Markus Lienkamp
11
End-to-End
5 8
Sensors Perception Prediction Planning Control Actuators
2
Mapping Global
3 6
Localization Behavior
4
Detection 7 Local
9 10
Safety Teleoperated Driving
X = Lectures
8-5
Role of control in the AV software stack
Control module
8-7
The evolution of autonomous vehicle control
Geometric controllers
Model-based
feedforward and
feedback controllers
Shelley – Stanford (2015) Roborace – TUM (2018)
Model predictive
controllers
The evoluation of autonomous vehicle control can be divided into three major development steps:
• Inspired from the robotics community, the first control algorithms have been inspired by geometric
concepts such as planning a circular movement towards the target path or aligning the steering
wheels with the path. These approaches show good performance for low to medium speeds.
• When increasing the speed and accelerations of the autonomous driving prototypes, more
thorough analysis methods from control theory and system dynamics became popular within the
research community. They allow to design explicit state-feedback controllers and consider more
detailed effects such as vehicle yaw dynamics, steering actuator dynamics and others.
• In recent years, the interest gathers around model predictive control algorithms. These use a
dynamic model of the system to predict the future behavior for a few seconds and determine
optimal control actions. In contrast to explicit state-feedback controllers, they can use and exploit
knowledge about constraints and uncertainties. Furthermore, they can be extended to more
complex (nonlinear) vehicle dynamics.
Image sources:
https://stanford.edu/~cpiech/cs221/img/stanley1.jpg
https://www.researchgate.net/profile/Emilio_Frazzoli/publication/228794498/figure/fig1/AS:30069332
9072128@1448702284145/Talos-Team-MITs-race-vehicle-at-the-DARPA-Urban-Challenge.png
https://news-media.stanford.edu/wp-content/uploads/2019/03/25110734/friction_shelly9-555x370.jpg
https://control.ee.ethz.ch/research/team-projects/autonomous-rc-car-
racing/_jcr_content/par/textimage_1984079938/image.imageformat.lightbox.1404291081.jpg
1- 9
Control theory basics – System dynamics I
Input Output
System
Examples:
▪ Spring-mass-damper
systems
▪ Inverse pendulum
▪ Autonomous vehicles
8 - 10
Control theory basics – System dynamics II
Input
Output
Imaginary axis
Poles of the
System dynamics are given system
from the spectrum of A: Real axis
8 - 11
Additional Slides
• An important special case are linear time-invariant systems (LTI-Systems). They can be
described using matrix algebra only and can be analyzed using Laplace-Transformation theory.
• The system dynamics are specified via the so-called characteristic equation
• The roots of this equation are called the „poles“ and they are related to the stability and
convergence properties of the dynamic system
• If all poles have negative real parts the system is stable
• The absolute value of the negative real part of the poles determines the convergence speed
• The imaginary parts of the poles is related to it‘s oscillation characteristics
1- 12
Control theory basics – Standard control loop I
1- 14
Control theory basics – PID controller design I
Control Control
value gains
8 - 15
Control theory basics – PID controller design II
8 - 18
Autonomous Driving Software Engineering
Prof. Dr. Markus Lienkamp
Lane
▪ Determine cross-track error and centerline
heading error at the front axle
▪ Align front wheels with path and
add a correction term
8 - 21
Additional Slides
The stanley controller is a geometric controller. This name originates from the geometric interpration for
the control laws. The PID control concept is more sophisticated but can still be designed without any
knowledge about the vehicle dynamics. In contrast to the geometric controllers, it adds an integral term
which helps to mitigate external disturbances such as cross-wind or banking, but can also lead to
difficulties such as integrator wind-up.
All of the presented concepts are suitable for low-medium speed and acceleration driving (urban
scenarios and easy high-way situations), depending on the tuning efforts spent and the quality of the
vehicle hardware.
Literature:
• S. F. Campbell, “Steering control of an autonomous ground vehicle with application to the DARPA
urban challenge,” University of Notre Dame, 2005
• Snider, Automatic Steering Methods for Autonomous Automobile Path Tracking
1- 22
Velocity PI controller
Disturbances such as
wind, inclination, …
PI- Longitudinal
Controller Dynamics
The velocity control task receives a lot less interest within the control engineering community, however,
its a great example for the success of easy to design and tune control concepts.
• The system dynamics consists of a single integrator (the vehicle mass) and a low-pass modelling the
actuation delay within the brake system and the engine. The latter can often be neglected as in our
example presented in the lecture.
• The influence of modelling error (driving resistances such as aerodynamic drag or tire roll resistance)
and the presence of wind gusts and road inclination makes it necessary to add an integral part to the
control law. A derivative part can be used but is optional as only one integrator is present in the open-
loop system.
Even though the velocity control task is simple from a control engineering point of view, it has two
important consequences for the overall performance of the autonomous driving software:
• It contributes heavily to ride comfort. Jerky behavior or noise corrupted sensors leading to oscillating
force requests have to be prevented.
• The performance of the lateral controller can depend significantly on the longitudinal controller. If the
actual speed deviates a few percent from the target speed this might have significant consequences
on the resulting lateral accelerations. This is due to the quadratic influence of velocity on the lateral
acceleration.
1- 24
Autonomous Driving Software Engineering
Prof. Dr. Markus Lienkamp
Disturbance 3000N
8 - 26
Improved velocity control with model knowledge
Setpoint tracking (e.g. changing speed limit) with PI-controller:
Disturbance 3000N
8 - 27
Improved velocity control with model knowledge
Feedforward
Controller
Control Disturbances
value
Measured
Setpoint
value
Feedback
System
Controller
8 - 28
Improved velocity control with model knowledge
Vehicle longitudinal
dynamics model
Force
request Velocity
Low-pass
8 - 29
Improved velocity control with model knowledge
Setpoint tracking (e.g. changing speed limit) with PI-controller and
feedforward control:
Disturbance 3000N
8 - 30
Additional Slides
• The two-degree-of-freedom (2-DOF) control structure allows for seperate design of setpoint and
disturbance dynamics. It is well-known for its high performance for trajectory tracking
applications. The general idea is to do „everything we know about the system“ already before a
control error through a setpoint change occurs.
• This concept allows to track trajectories with fast dynamics why keeping smooth and cautious
feedback compensation via the feedback controller.
• Feedforward designs are oriented around the inverse of a plant. The inverse generates a
suitable input sequence such that the plant output matches the desired setpoint trajectory.
• There are many ways to calculate such a feedforward control law:
• Directly obtain the required input sequences or derivatives from the trajectory planning
algorithm/method, e.g. via splines or other basis functions.
• Approximate it via an inverse transfer function model. The exact inverse is usually not
realizable in this form due to the resulting non-causal transfer functions (numerator
polynomial order is higher than denominator polynomial order). This reflects the fact that
numerical inversion takes some time to work correctly.
• Use a model-predictive-control law (see chapter 5 for more details on this concept).
1- 31
Kinematic single track model
position heading
8 - 32
Additional Slides
• There are three main models used for motion controller design:
• Kinematic vehicle models
• Linear single track models
• Nonlinear single track models
• It is only very rarely that more complex models are used for controller design. The testing of the
designed controller should however still be done with more complex models such as a nonlinear dual
track model, considering effects of suspension as well as combined tire effects.
• The kinematic vehicle model is considered sufficient for slow driving at low lateral accelerations. It
represents the key relation between vehicle movement and position dynamics and is usually a good
choice to get started.
• If the speeds or accelerations are in a medium range (high-way driving or accelerations around 3-
5mps2), changing to a linear single track model should be considered. The key advantage here is that
it models the self-steering behavior and gives a coarse estimate of the vehicles lateral dynamics.
• The nonlinear single track model is often used for high-performance applications such as racing. It
models the tire behavior at the handling limits better than its linear counterpart, however, this also
poses difficulties during the control design process.
1- 33
Important relations in vehicle dynamics
Steady-state curvature
8 - 34
Frenet coordinate frame
Progress
along the path
Lateral
deviation
8 - 35
Trajectory specification in Frenet coordinates
Target
8 - 36
Additional Slides
• Many simulations models, also the ones we have presented earlier, are naturally formulated in
cartesian coordinates. This space is the most natural to formulate a mechanical problem and
therefore widely used by practioniers and researchers alike.
• One of the key issues here is the strong nonlinearity in with respect to the trajectory. A stabilizing
mechanism has to be adapted to the heading all the time, this renders the problem nonlinear and
difficult to analyze in the theoretical settings we have learned about earlier.
• This issue might be overcome by the choice of a so-called curvilinear coordinate system. It transforms
the eucledian coordinates into a coordinate system which is located along the path. The first
component is the progress along the path, the second component is the lateral deviation with respect
to that path. The coordinate system itself can be defined via a series of points on the path or via a
curvature profile for each point on the path. The actual path can then be obtained from double
integration.
• This curvilinear system will be the base for many of the control designs we see later on. It is a natural
formulation of the split between lateral and longitudinal tracking and therefore well suited for the
analysis of the respective control systems.
• There is a key difficulty: the mapping between cartesian coordinates and curvilinear coordinates might
not be well-defined in very sharp turns or if the path crosses itself. However, it should be kept in mind
that these cases also pose significant difficulty to deal with in control design of cartesian coordinates
and should therefore be considered challenging in general.
1- 37
Improved lateral control with model knowledge
Tire side slipe angle Linear tire model Nonlinear tire model
Cornering
stiffness
8 - 40
Advanced motion control – II
Yaw rate
Neutral steering /
Over- Kinematic bicycle model
steering
Understeering
Steering angle
Steering angle
Nonlinear Curvature
Vehicle velocity vehicle
dynamics
Steering angle
Steady-state Curvature
Vehicle velocity self-steering
characteristic
8 - 42
Advanced motion control – IV
Inverse self-
steering
characteristic
Target Steering
Lateral path curvature Curvature angle
tracking controller + Vehicle
controller P-controller
8 - 43
Application to autonomous racing @ Roborace 2019
✓ Successful application at
Roborace competition 2019
✓ Moderate implementation
efforts required Source: https://www.youtube.com/watch?v=-vqQBuTQhQw
✗
Minimum curvature trajectory planning and control for
Depends on curvature and an autonomous race car
acceleration signal quality (https://doi.org/10.1080/00423114.2019.1631455)
Source: https://de.wikipedia.org/wiki/Model_Predictive_Control
8 - 46
Basics of model predictive control – II
Steering angle
Vehicle motion
prediction
Time Vehicle
dynamics
model
Longitudinal force
Time
Target
Optimize based on comparison of trajectory
prediction and target trajectory
8 - 47
Basics of model predictive control – III
Quadratic Nonlinear
Programming Programming
8 - 49
Additional Slides
• Model predictive control is a promising concept – it allows to handle general nonlinear systems, multi-
input/multi-output systems as well as constrained control problems. These advantages make the
concept attractive to researchers and practitioniers within the community. However, this comes at a
price which is related to the requirement to implement the optimization as a tractable (finite
dimension) and finite-time horizon optimization task.
• One challenge within constrained problems is that a controller might tend to be overly optimistic
towards the end of the optimization horizon. This can render the solution of the next timestep
optimization infeasible. There is a great amount of literature on this problem called „recursive
feasibility“. It aims at deriving certain modifications to the optimization problem which guarantee that a
solution to the next optimization problem will be available under certain assumptions.
• The same issue might arise due to inaccuracies within the model or external disturbances, both
effects which are likely to occur. This might be tackled by „Robust MPC“ or Soft-Constraints.
• Despite these control engineering challenges, it remains to find a computational efficient version of
the desired optimization problem. Especially nonlinear problems are time consuming to solve and
usually need a lot of hyperparameter tuning for the optimization algorithms which makes them difficult
to use for online operation in safety critical systems. Many practitioniers therefore add a backup
controller which can take over in case the MPC fails.
• While this control concept seems to be promising, it is still an active research topic with many
contributions to be made until it can be considered a „standard-tool“ which can be deployed easily. In
the case of autonomous vehicle control there are many easier control concepts which allow to reach
reasonable performance levels of about 50-80% of the vehicle capabilities.
1- 50
Autonomous Driving Software Engineering
Prof. Dr. Markus Lienkamp
Stanley &
Velocity PI
Complexity
8 - 52
Helpful literature for this lecture
8 - 53
Related literature
A list of papers for the controllers presented within the literature and more
interesting concepts:
Brian Paden, Michal Cap, Sze Zheng Yong, Dmitry Yershov, and Emilio Frazzoli, A Survey of Motion
Planning and Control Techniques for Self-Driving Urban Vehicles, 2016
Gabriel M. Hoffmann, Claire J. Tomlin, Michael Montemerlo, and Sebastian Thrun, Autonomous
Automobile Trajectory Tracking for Off-Road Driving: Controller Design, Experimental Validation and
Racing, 2009
Moritz Werling, Ein neues Konzept für die Trajektoriengenerierung und -stabilisierung in zeitkritischen
Verkehrsszenarien, 2011
Nitin R. Kapania and J. Christian Gerdes, Design of a feedback-feedforward steering controller for
accurate path tracking and stability at the limits of handling, 2015
Alexander Heilmeier, Alexander Wischnewski, Leonhard Hermansdorfer, Johannes Betz, Markus
Lienkamp, and Boris Lohmann, Minimum curvature trajectory planning and control for an autonomous
race car, 2019
Alexander Liniger, Alexander Domahidi, and Manfred Morari, Optimization‐based autonomous racing of
1: 43 scale RC cars, 2015
8 - 54