Autonomous Overtaking Using Reachability Analysis and MPC
Total Page:16
File Type:pdf, Size:1020Kb
DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM, SWEDEN 2018 Autonomous Overtaking Using Reachability Analysis and MPC JOHN FRIBERG FILIP KLAESSON KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF ENGINEERING SCIENCES www.kth.se EXAMENSARBETE INOM TEKNIK, GRUNDNIVÅ, 15 HP STOCKHOLM, SVERIGE 2018 Autonom omkörning med nåbarhetsanalys och MPC JOHN FRIBERG FILIP KLAESSON KTH SKOLAN FÖR TEKNIKVETENSKAP www.kth.se Sammanfattning Autonoma bilar är på frammarsch. När förare inte längre har kontroll över ratten är det avgörande att bilarna själva kan garantera säkerheten för alla tra- fikanter. Denna studie syftar till att utforma ett komplett styrsystem som kan utföra en säker omkörning. Omkörningen planeras med hjälp av ramverket för modell-prediktiv reglering. För att garantera säkerhet används nåbarhetsana- lys. Slutligen utformas en modifierad proportionell regulator för att följa den planerade omkörningsvägen. Styrsystemet har implementerats i MATLAB och hela omkörningen har simulerats. Resultaten visar att det konstruerade styrsy- stemet utför omkörningen på en rak motorväg med två filer på ett säkert och framgångsrikt sätt. B3A: AUTONOMOUS OVERTAKING Autonomous Overtaking Using Reachability Analysis and MPC John Friberg and Filip Klaesson Abstract—The era of autonomous cars is on the rise. As drivers lose control of the steering wheel, it is crucial that the Reachability cars themselves can guarantee safety for all traffic participants. analysis This study aims to design a complete control system that can safely perform an overtaking maneuver. To guarantee safety of the maneuver, reachability calculations will be carried out and Safe positions analyzed. The overtaking will be planned by using the model Linearized model predictive control, MPC, framework. To complete the control system a modified proportional controller will be designed to track the planned path. The control system is implemented in MPC MATLAB and the entire overtaking maneuver is simulated. The results show that the designed control framework successfully performs the overtaking on a straight two-lane highway in a Discrete trajectory safe manner. I. INTRODUCTION Realistic model Tracking Autonomous vehicles are anticipated to revolutionize the transportation system as we know it today. In the near future we will see self driving cars as a part of our everyday life. Fig. 1: Flowchart describing the basic idea of the approach. Among its many advantages are increased safety, higher fuel efficiency and faster transportation. Although great advancements have already been made in theory described in Section III is given. All simulation results the field, many tricky traffic scenarios has to be handled in will be presented in Section V. These results will be further order to guarantee safety. Features that handle some of these discussed in Section VI. Lastly, conclusions based on the situations have already been launched on commercial cars, discussion will be presented in Section VII. such as autonomous parking and emergency braking, but a lot of other features are still in development. One such feature, II. BASIC IDEA,LIMITATIONS AND ASSUMPTIONS which handles a traffic situation that according to [1] accounts for 4-10% of accidents in traffic, is autonomous overtaking. The approach that will be used to create the control system Therefore, autonomous overtaking is of great importance to can be divided into three main parts; calculations of safe states study. using reachability analysis, trajectory planning using model As the overtaking maneuver is a particularly dangerous traf- predictive control and trajectory tracking. fic situation, it is a top priority to ensure that an autonomous In this study the overtaking maneuver will be carried out car is always able to reach a safe state, even if something on a straight two-lane highway with two traffic participants. unexpected would occur. It will be assumed that the vehicle which is being overtaken Many studies regarding trajectory planning of the overtaking stays in its initial lane. In an overtaking scenario it is also scenario have already been carried out, such as [2] and [3]. reasonable to assume that the speed of the car performing the These papers show that model predictive control is a sufficient overtaking is significantly higher than the speed of the vehicle tool. Equivalently, the safe state analysis has been researched being overtaken. thoroughly in [4] and [5], where reachability has been proven In order to ensure that no collision will occur, the first step successful. is to find the positions on the road where the overtaking car The main goal of this study is to design a complete control can be but not the car being overtaken given their initial states. system which can safely perform an overtaking maneuver on These positions are free to use as the travel path. a straight two-lane highway. The resulting controller will be The next step is to find an optimal and safe trajectory which implemented and simulated. entirely lies within these positions. This is done with consid- The remainder of this work is organized as follows. Section eration to traffic rules and appropriate overtaking behavior. II covers the basic idea of our approach. Section III discloses Such behavior includes accelerating before changing lane and the mathematical model and theory for the entire study. In keeping sufficient distance to the other vehicle during the Section IV, a brief description of the implementation of the whole maneuver. B3A: AUTONOMOUS OVERTAKING This means that the entire overtaking maneuver will be The linearized system can be described by the following planned, from the initial states of the two cars, before it is equations: executed. The last part is to design a simple tracking controller _ that makes the car safely perform the planned overtaking based X = V (7) on the real nonlinear model. The basic idea of the approach Y_ = V0θ (8) is shown in Fig. 1. V θ_ = 0 δ (9) L III. MATHEMATICAL MODELING From these equations the state vector x and the control input A. Modeling of vehicles u for the cars are constructed. There are two different vehicles included in this study; the T vehicle performing the overtaking maneuver, which will be x = [X; Y; θ] (10) referred to as the ego vehicle, and the vehicle that is being u = [V; δ]T (11) overtaken, which will be referred to as the other vehicle. In reality there is no physical distinction between these two The linearized system can easily be discretized and can then vehicles and therefore they will be modelled in the same way. be written as follows: As the papers [2] and [6] have mentioned, an accurate way to mathematically model a car is through the bicycle model. The x(kh + h) = Ax(kh) + Bu(kh) (12) same notation as in Fig. 2 from [2] will be used in this paper. where h is the time step, k is a positive integer parameter and the matrices A and B are given below: 21 0 0 3 2h 0 3 A = 40 1 V0h5 B = 40 0 5 (13) V0h 0 0 1 0 L So far no distinction between the autonomous ego car and the other car has been done. However, the numerical values on V0 and the constraints for the cars, both on the states and on the inputs, are still to be defined. These will be treated separately. 1) Constraints for the ego vehicle: First, it must be guaran- Fig. 2: Bicycle model used to model the cars. The notation teed that the car stays on the road. This gives a constraint on will be used throughout this paper. the Y -coordinate of the car. The middle of the highway will be defined as Y = 0. No such constraint can be enforced on The dynamics of the car can be described as follows: the X-coordinate, however the car will begin in X = 0 and move forward, hence the state constraints of the ego vehicle _ X = V cos θ (1) can be written as: Y_ = V sin θ (2) X ≥ 0 m (14) V ego θ_ = tan δ (3) L jYegoj ≤ 5 m (15) ◦ In order to carry out the calculations in this study, this jθegoj ≤ 10 (16) system will be linearized around certain values on θ, V and δ. The value on V ego and the input constraints also need to be These values will be denoted θ ;V and δ . As the overtaking 0 0 0 0 defined. The ego vehicle drives initially at a speed of 90 km/h, in this case takes place at a straight highway with high speeds, therefore the following values are obtained: the angles involved will at all times be very small. This also motivates why the linearization will still model the system V ego = 90 km/h (17) accurately. Therefore the following values and constraints will 0 81 km/h ≤ V ≤ 99 km/h (18) be used: ego jδ j ≤ 10◦ (19) ◦ ego θ0 = 0 and jθj ≤ 10 (4) ◦ δ0 = 0 and jδj ≤ 10 (5) 2) Constraints for the other vehicle: The state constraints for the other vehicle is similar to the ego vehicle’s, with the The speed of the cars will at all times be close to their difference being that the other vehicle will be assumed to stay initial speed and therefore V0 is chosen as their initial speed. in the right lane and start 40 m ahead of the ego vehicle. The numerical value will be chosen later in this section. In order to ensure that the linearization is a good approximation, Xother ≥ 40 m (20) the constraints on V is given by: 0 − 5 m ≤ Yother ≤ 0 m (21) ◦ 0:9V0 ≤ V ≤ 1:1V0 (6) jθotherj ≤ 10 (22) B3A: AUTONOMOUS OVERTAKING other The linearization speed, V0 is chosen as the initial speed In order to take into account the dimensions of the cars, of the other vehicle.