Semi-autonomous Control of Multiple Heterogeneous Vehicles for Intersection Collision /4NmS LITITUTE, SO T^C ^ M Avoidance by AUG15 2014 Heejin Ahn LIBRARIES Submitted to the Department of Mechanical Engineering in partial fulfillment of the requirements for the degree of Master of Science in Mechanical Engineering at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY June 2014 @ Massachusetts Institute of Technology 2014. All rights reserved. Signature redacted Author....... ................... Department of Mechanical Engineering . May 27, 2014 Signature redacted Certified by.................. Domtilla Del Vecchio Associate Professor Thesis Supervisor Signature redacted' Accepted by......................................... David E. Hardt Chairman, Department Committee on Graduate Theses 2 Semi-autonomous Control of Multiple Heterogeneous Vehicles for Intersection Collision Avoidance by Heejin Ahn Submitted to the Department of Mechanical Engineering on May 27, 2014, in partial fulfillment of the requirements for the degree of Master of Science in Mechanical Engineering Abstract This paper describes the design of a supervisory controller (supervisor) that manages multiple heterogeneous vehicles, i.e., multiple controlled and uncontrolled vehicles, to avoid intersection collisions. Two main problems are addressed: verification of the safety of all vehicles at an intersection, and management of the inputs of controlled vehicles. For the verification problem, we employ an inserted idle-time scheduling approach, where the "inserted idle-time" is a time interval when the intersection is deliberately held idle for uncontrolled vehicles to safely cross the intersection. For the management problem, we design a supervisor that is least restrictive in the sense that it overrides controlled vehicles only when a safety violation becomes imminent. We analyze computational complexity and propose an efficient version of the supervisor with a quantified approximation bound. To mitigate the abrupt changes of control inputs and to reduce the number of unnecessary interventions, we additionally design two optimization problems and provide the supervisor with a more conservative bound. Thesis Supervisor: Domitilla Del Vecchio Title: Associate Professor 3 4 Acknowledgments First and foremost, I would like to express a sincere appreciation to my thesis supervisor, Prof. Domitilla Del Vecchio. I am particularly thankful for her thoroughness in discussing research directions and editting my naive papers. I always appreciate her interest in my research problems and her effort to provide anything that can help me tackle the problems. Her uncountable advice and encouragement have been a constant driving force behind my research work. I benefited from interaction with the past and current members of Prof. Del Vecchio's group for their valuable comments and friendship. In particular, I wish to acknowledge the help provided by Dr. Alessandro Colombo, who is now an assistant professor of Politecnico di Milano. His suggestions have inspired me to analyze problems correctly and thoroughly. I would like to thank Dr. Daniel Hoehener for his help on formulating optimization problems. Without his experience, I could not complete the optimal approaches in this paper. I wish to thank Andrea for helping me run experiments. Because of my initial ignorance of Linux and HTTP, it might be tough for him to teach everything to me. I am grateful to the members of the MIT Korean Graduate Student Association of Mechanical Engineering (KGSAME) for making my life at MIT much more pleasant and exciting. I would also like to express my gratitude to my friends who take classes and study together, to my friends from First Korean Church in Cambridge for praying for me, and to my friends in Korea for always being emotionally close to me. My special thanks go to Minkyun, who encourages me and makes me always able to count on him. Thank you for being here with me. I owe everything to my family, particularly to my parents, Kookyoung Ahn and Kyoungsoo Hong, for having given me unconditional love and support. I am also thankful to my sister and brother, Heeyoon and Junhong, and to my grandmother for their constant care. Without them, this thesis could not be possible. 5 6 Contents 1 Introduction 15 2 Basic Concepts 19 2.1 Mathematical Background ...... 2.1.1 Scheduling ....... 2.1.2 Equivalence ....... ........................ 19 ............................. 19 ............................ 21 2.2 Intersection Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 2.3 Dynamic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3 An Exact Approach 3.1 3.2 3.3 25 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 3.1.1 Verification Problem . . . . . . . . . . . . . . . . . . . . . . . 25 3.1.2 Supervisory Problem . . . . . . . . . . . . . . . . . . . . . . . 29 Problem Solutions ............................ . 3.2.1 Solution of the Verification Problem . . . . . . . . . . . . . . . 30 3.2.2 Solution of the Supervisory Problem 32 Simulation Results ....... . . . . . . . . . . . . . . ............................ 4 An Efficient Approach 4.1 4.2 30 Relaxed Verification Problem 36 39 . . . . . . . . . . . . . . . . . . . . . . 39 4.1.1 Relaxed Scheduling Problem . . . . . . . . . . . . . . . . . . . 39 4.1.2 Relaxed Verification Problem 42 Efficient Supervisors ....... . . . . . . . . . . . . . . . . . . ........................... 7 44 5.3 Motivations ............... . . . . . . . . . . . . . . . . . 47 5.1.1 Abrupt Changes of Inputs ... . . . . . . . . . . . . . . . . . 48 5.1.2 Unnecessary Intervention .... ..... .. ... .. .. ... 49 ..... .. .. ... .. .. . 51 Input Optimization Problem ...... Discrete Scheduling Problem . ... .... .. .. .. ... . 52 5.2.2 Input Optimization Problem . .... ... .. .. .. ... . 54 5.2.3 Simulation Results . . . . . . ... .... . ... . .... . 56 Schedule Optimization Problem . . . .. .... .. ... .. .. .. 57 5.3.1 Totally Unimodular Matrix [20] . . . . . . . . . . . . . . . . . 58 5.3.2 Schedule Optimization Problem . . . . . . . . . . . . . . . . . 59 5.3.3 Simulation Results . . . . . . .. 61 . . 5.2.1 . 5.2 44 47 Optimal Approaches 5.1 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Simulation Results . 4.3 . ..... .. .. .. .. ... 67 Conclusions and Future Works 69 A Proof for the discrete system A.1 Existence of input ................................... 69 A.2 Relation between Discrete Scheduling Problem and Verification Problem 72 B Total modularity of the Schedule Optimization Problem 8 75 List of Figures 2-1 An example of 3 vehicles approaching an intersection. The traffic intersection (left) is modeled as one point at which unidirectional paths intersect (right). Here, ai and Bi represent the location of the intersection on the longitudinal path i. 3-1 . . . . . . . . . . . . . . . . . . . . . 21 Positions of 5 controlled (black solid line) and 2 uncontrolled (red dotted line) vehicles controlled by the supervisor s in Section 3.2 (Algorithm 3.2). The blue boxes at the bottom represent the time steps when the supervisor overrides the controlled vehicles. The shaded region represents the location of the intersection. . . . . . . . . . . . . . 3-2 37 Positions of 8 controlled (black solid line) and 2 uncontrolled (red dotted line) vehicles controlled by the supervisor s in Section 3.2 (Algorithm 3.2). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 38 Positions of 8 controlled (black solid line) and 2 uncontrolled (red dotted line) vehicles controlled by spp,,,. in Section 4.2. The blue boxes at the bottom represent the time steps when the supervisor overrides the controlled vehicles. The darker shaded region represents the location of the intersection while the lighter shaded region represents that of the inflated intersection. . . . . . . . . . . . . . . . . . . . . . . . . . 9 45 5-1 Positions of 4 vehicles (black solid line). The blue boxes at the bottom represent the time steps when the supervisor overrides the controlled vehicles. The darker shaded region represents the location of the intersection while the lighter shaded region represents that of the inflated intersection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 48 Control input (black solid line) for the last car with its desired input (blue dotted line). The two horizontal dotted lines represent the upper and lower bounds for the input. . . . . . . . . . . . . . . . . . . . . . 5-3 Positions of 4 vehicles where the last vehicle is far from the intersection compared to the others. 5-4 49 . . . . . . . . . . . . . . . . . . . . . . . . . 50 Control input (black solid line) for the last car in Figure 5-3(a) with its desired input (blue dotted line). The two horizontal dotted lines represent the upper and lower bounds for the input. . . . . . . . . . . 51 5-5 Average cost on 60 samples of four vehicles . . . . . . . . . . . . . . . 57 5-6 Implementation of the two optimization problems (Problem 5.3 and Problem 5.4) at stage k. First, the Discrete Scheduling Problem is solved via Algorithm 4.4, and if there exists a feasible schedule, the sequence of the schedule lets the Schedule Optimization Problem compute the optimal schedule T*. If there does not exist a feasible schedule, Algorithm 4.4 returns no and an empty schedule. Depending on this answer, the supervisor either runs the Input Optimization Problem to store the safe input for the next step Uk+1,,afe or overrides the system using the safe input Uk,safe. 10 . . . . . . . . . . . . . . . . . . . 62 5-7 The same initial condition and desired input are considered as in Figure 5-3. In Figure 5-7(a), the lighter shaded rectangle represents the inflated intersection due to the discretization and approximation for the efficient solution. The blue boxes represent the time steps when the supervisor intervenes. Although the supervisor intervenes, the last vehicle is not overridden, that is, the control input (black line in Figure 5-7(b)) remains equivalent to the desired input (blue dotted line in Figure 5-7(b)). 5-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 The same initial condition but a varying desired input are considered. The control input (black line in Figure 5-8(b)) maintains the similar level to the desired input (blue dotted line in Figure 5-8(b)). . . . . . 5-9 64 Average cost on 60 samples of four vehicles. Random schedule (blue bars) represents the results from solving Problem 5.3 while Optimal schedule (red bars) represents the results from solving Problem 5.3 and Problem 5.4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 65 12 List of Algorithms 3.1 Verification of Problem 3.2 . . . . . . . . . . . . . . . . . . . . . . . . 31 3.2 Solution of Problem 3.3. . . . . . . . . . . . . . . . . . . . . . . . . . 34 4.3 Solution of DEC(1|r,p = 1ILmaxO) . . . . . . . . . . . . . . . . . . . 40 4.4 Verification of Problem 4.1 . . . . . . . . . . . . . . . . . . . . . . . . 42 13 14 Chapter 1 Introduction In the United States, the most critical and frequent vehicle collisions occur at or near intersections according to the National Motor Vehicle Crash Causation Survey (NMVCCS) [2]. In response to this, there have been a number of attempts within academia, industry, and government to reduce the number of accidents at intersections. One of the most conspicuous examples is Google's self-driving car, which has surpassed 700,000 autonomous driving miles without collisions, including at or near intersections [19]. However, the fully automated driving is still controversial [24]; one of the reasons is that people prefer having control of their vehicles. The alternative promising approach has been semi-autonomous driving, which guarantees the freedom of the drivers and takes over the controls only when safety constraints are violated [4,23]. In order to inform, warn, and eventually override human drivers to prevent crashes, the auto industry and the government have been developing vehicle to vehicle (V2V) and vehicle to infrastructure (V21) communication [1]. The potential for using multivehicle communication has stimulated research on networked vehicle systems to maintain safety since the 90's with the California PATH project [3], focusing mostly on highways. More recently, works employing job scheduling and optimal control [9,10,16,17] for intersection collision avoidance have appeared. Works that mostly focused on warning for collision avoidance at intersections have also appeared for general traffic scenarios [8,22]. Driver behavior estimation and classification near 15 intersections has also been of interest [5,13]. This paper exploits the V21 communication so that a supervisor embedded in a roadside infrastructure is able to measure the position and speed of all approaching vehicles and give commands to some of them, called controlled vehicles. The controlled vehicles are equipped with driver assist systems that enable the supervisor to communicate with the vehicles and override the human drivers. In this paper, the design of a centralized supervisor is described to prevent intersection collisions for a heterogeneous system, that is, in the presence of multiple controlled and uncontrolled vehicles. We thus extend the work of [10], which applies only to cases when all vehicles are controlled. To consider uncontrolled vehicles, a different problem formulation of safety verification and a different state prediction scheme are required. In particular, safety verification must consider all possible future states of uncontrolled vehicles to estimate when they will cross an intersection since the inputs for the uncontrolled vehicles are neither measured nor controlled. An inserted idle-time (IIT) scheduling approach [15] is employed to detect upcoming collisions in the presence of uncontrolled vehicles. Depending on the outcome of safety verification, the supervisor intervenes if necessary. In general, computa- tional complexity is a major concern in centralized control systems [6], and the IIT scheduling used in this paper is known to be NP-hard [14], that is, the IIT scheduling sometimes cannot be solved in short time. We address this problem by proposing an efficient scheduling approach that solves a relaxed problem. We quantify the extent of conservatism of the solution by determining an equivalent "Bad" set, which the trajectories of the system are forced to avoid. Based on this efficient solution, we further formulate optimization problems to generate a smoother input profile. To implement the optimization problems, we consider the corresponding discrete system dynamics and provide a more conservative Bad set. This paper is organized as follows. In Chapter 2, we review the mathematical framework of scheduling problems and define the system. Chapter 3 presents two main problems, Verification and Supervisory, and provides the algorithms that exactly solve these problems. To address the computational complexity of these exact solutions, 16 approximate problems and efficient solutions are introduced in Chapter 4. To generate smoother control inputs, optimal approaches are presented in Chapter 5. The exact, efficient, and optimal approaches are followed by their simulation results. Conclusions and future works are also provided in Chapter 6. 17 18 Chapter 2 Basic Concepts In this chapter, we introduce several basic concepts that are used through this paper. In section 2.1, mathematical background of scheduling and equivalent relation of problems are introduced. In section 2.2, we define an intersection with assumption that all cars are moving on pre-determined longitudinal paths that are converging to one point. In section 2.3, a dynamical system is modeled, and several notations and properties of system variables are given. 2.1 2.1.1 Mathematical Background Scheduling Scheduling problems are described by jobs, machines, and processing characteristics [11, p. 4]. Jobs represent tasks which have to be executed; machines represent scarce resources such as facilities where jobs are performed; and processing characteristics used in this paper are release times ri, deadlines di, and process times pi. A schedule is a vector of starting times t, for all jobs such that all constraints in a scheduling problem are satisfied. While most scheduling literature focuses on non-delay schedules, we consider a more general class of schedules which is called an inserted idle-time (IIT) schedule. This schedule is created by considering an IIT, which is an open time interval when the machine is deliberately held idle while at 19 least one job is waiting to be processed [151. If we say (fy,p,) is an IIT, a necessary condition for an IIT schedule t, to be feasible is for all i, (tilts +pi) n (i-,) =0. In this paper, we consider the scheduling problem DEC(1IrsILm.,O), which aims to find a schedule that makes the maximum lateness Lm. := maxi tj +pi - d smaller than or equal to 0. This is stated in a formal manner as follows. , Definition 2.1 (DEC(1|riL,.,0)). Given a set of n jobs that have release times r deadlines di, and process times p over one machine and given a set of m inserted idle-times (f,,y), determine whether there exists a schedule T = t1...,t.) such that for all i E {1, ... , n}, for all i ) j E{1, ... , n} and for all -7E{1,.. tj , ts :5 tj => t +p P ., m} ti. -Y =>ti 12PY. Notice that if such a schedule exists, (ti, ti + pi) n (f, pY) = 0 for all i and -y because for all t* E (ti,tj + pi), the last two constraints imply t* < , or t* > p-. The problem DEC(lri,p, = 11L,.,0) has the same constraints as in Definition 2.1 except with the addition of the constraint pi = 1. It has been shown that a problem with arbitrary process times such as DEC(1IriILm.,0) is NP-hard, while a problem with unit process times such as DEC(lri,p = 11Lm.,O) is solved in polynomial time [21]. The problem DEC(lri,p = 1L,.,O) is used to address the complexity issue in Chapter 4. 20 a2 P2 a3 Figure 2-1: An example of 3 vehicles approaching an intersection. The traffic intersection (left) is modeled as one point at which unidirectional paths intersect (right). Here, a and 3i represent the location of the intersection on the longitudinal path i. 2.1.2 Equivalence To solve a problem relying on the solution to a different problem, concepts of "reducibility" and "equivalence" [18] are introduced. In general, an instance of a problem is the information required to compute a solution to the problem, while satisfying all given constraints [12, p. 5]. A problem P is reducible to a problem P2 if for an instance 12 of P2 that can be constructed in polynomial-bounded time for any instance I1 of P1 , P2 accepts 12 if and only if P accepts 1. We write P1 oc P2 if P is reducible to P2 . If P2 oc P and P1 cx P2 , P and P2 are equivalent. 2.2 Intersection Model In this paper, we model the intersection as n vehicles moving along unidirectional paths intersecting at one point (Figure 2-1). We assume that a subset of these vehicles can be controlled while the remaining vehicles cannot be controlled. We identify vehicles with a natural number from 1 to n. To distinguish between controlled and uncontrolled vehicles, we define a controlled set C and an uncontrolled set C, which 21 contain n, and ne elements, respectively, as follows: C := {i E {1, ... , n} : vehicle i is controlled} C := {-y E {1, .. , n} : vehicle 7 is uncontrolled}. In this paper, i usually denotes a controlled vehicle while 7 denotes an uncontrolled vehicle. For notational brevity, let C = {1, ... , n,} and C = {n, + 1, ... , n} through this paper. 2.3 Dynamic Model Let xi represent the dynamic state of vehicle i with yi E R the position on its path. For i E C, let ui represent the input to vehicle i and for -y E C, let d, represent a disturbance, that is, an unknown input to vehicle -y. Each controlled vehicle is modeled by i = fi(xi, u2 ), yj = hi(xi), (2.1) y- = hy (x). (2.2) while each uncontrolled vehicle is modeled by S= f (xy , d-y),I , where xi E Xi g Rr, ui E U c R-, y E Y g R, xy E X c R', d, E Dy c R 8 and yy E Y, C R. The functional spaces of the piecewise continuous signals ui(t) and dy (t) for t E [0, oo) are U2 and Thy, respectively. The symbols x, u, d, y denote aggregate vectors for these states, inputs, disturbances, and outputs. For instance x = (x 1, . ., xn). The spaces of these vectors are denoted by X, Y, U, D,U, V. Notice that X C (R')" and Y C Rn while U C (R ' )fc and D C (RB)ne. Moreover, the output function hi(xi) and h.(xy) are continuous and the derivative of the output is bounded, that is, ij E [yi,m, Yi,M] with y4,m > 0. We assume that sets U and D, are intervals, that is, U = [ui,m, ui,M] and D, = [dy,m, df,m]. 22 The parallel composition of (2.1) and (2.2) for all n vehicles describes the system dynamics: x = f(x, u, d), y = h(x). (2.3) We assume that this system has a unique solution that continuously depends on the input and the disturbance. The state and output of vehicle i at time t starting from xi(to) with input u, are denoted by xi(t, ui, xi(to)) and y1 (t, ui, xi(to)), respectively. The corresponding aggregate state is denoted by x(t, u, d, x(to)) and the output by y(t, u, d, x(to)). For notational brevity, we omit an initial condition when to = 0 and also omit the other arguments when they are not important. From now on, we consider to = 0. For any two states xi, xl' E Xi ; R'r, we say that xi < x' if xij < x'g for all j E {1,...,r} where xij and x'. are the j-th elements of xi and x ', respectively. Similarly, for any two time signals ui, u' E 14, we say that ui 5 u' if u (t) u(t) for all t > 0. We assume that the trajectories y,(t, uj, xi(0)) and yy,(t, d.,, xz(0)) are order preserving functions of their arguments. That is, if u i<i' dci., d, for d., d, E ',,, then y;(t,ui, xi(0)) for uj, u' E U1 and yi(t,u', xi(0)) and y.,(t, dy, xy(0)) y7 (t, d,,x,(O)) for all t > 0. Also, if x2 (O) < x'(O), then y,(t, ui, xi(0)) 5 y,(t, ui, x'(O)) and if x.,(0) 5 x ,(0), then y.,(t, d., xy(O)) 5 y,(t, dy, x,(0)). In the same sense, the states x,(t, ui, xi(0)) and xy(t, d, x.y(0)) are order preserving functions of their arguments. 23 24 Chapter 3 An Exact Approach In this paper, two main problems are addressed: the Verification Problem and the Supervisory Problem. The Verification Problem determines whether the current drivers' inputs will lead to a collision. If this is the case, the Supervisory Problem overrides all controlled vehicles with safe inputs. In Section 3.1, these problems are formulated in a formal manner. An exact solution for these problems are given in Section 3.2. Finally, simulation results validate these solutions in Section 3.3 and show computational defects in these solutions. 3.1 Problem Statement In this section, we formulate the two main problems, the Verification Problem and the Supervisory Problem. Also, the Inserted Idle Time Scheduling Problem is introduced, which is proved to be equivalent to the Verification Problem. 3.1.1 Verification Problem As seen in Figure 2-1, an interval (ai, /i) is assigned to vehicle i for all i E C U C. Let a := {ai, ... , ao} and / := {#1,..., #,}. If two or more vehicles, at least one of which is a controlled vehicle, are inside the intersection at the same time, we consider that a collision occurs. Accordingly, we define the bad set B C Y as the set of output 25 configurations corresponding to a collision as follows: B := {y E Y : yi E (ai, Pi) and yj E (aj, #j) (3.1) (3.2) for some i : j such that i E C and j E C UC}. This implies that we focus on preventing collisions in which one or more controlled vehicles axe involved. These include collisions between controlled and uncontrolled vehicles and collisions among controlled vehicles. Problem 3.1 (Verification Problem). Given an initial condition x(O), determine if there exists an input signal u E U which guarantees that y(t, u, d) B for all d E V for all t > 0. Input u E U ensures safety if and only if y(t, u, d) g B for all d E V for all t > 0. An instance of Problem 3.1 is described by the initial condition x(O) and the parameters E) = {f, h, X, Y, U, D, U, E), a,#B}. Thus, if there exists u which ensures safety for a given instance {x(0), e}, then we say {x(0), 6} E Problem 3.1. To solve Problem 3.1, we adapt the IIT scheduling problem DEC(1rsIL,., 0) in Definition 2.1 to our problem. In particular, the intersection plays the role of the machine, and the nr vehicles are the jobs. Furthermore, we define release times R,, deadlines Di, process times P(T), and IITs (I.,, I 7) as follows. Definition 3.1. For all i E C where y2 (0) < ai, let R, :=min{t > 0 : y,(t, ui) = ai}, Di :=max{t > 0 : yi(t, ui) = ai}. Given a non-negative real number Ti, let # Pi(T) := min{t > 0 : y,(t, ui) = with constrainty (Ti,ui) = ai}. 26 For all - E C where y,(0) < a,, let - R:= min {t > 0 : y(t, dy) = ay}, d-ED-y P7 := max{t > 0 : y(t, dy) = 8}. For i E C, if yt(O) /3l, then set R, = 0, Di = 0, and P(T) = 0. If y,(0) then set R, = 0, Di = 0, and P(T) = miniEui{t : yi(t, uj) = #l}.If yi(T, uj) = ai is not satisfied, set P(T) = oo. For ^ E J, if y7 (0) and PR = 0. If yy(0) aj, the constraint 8,, set R, = 0 ay, set R, = 0 and P, = maxEy.,{t : yy(t, dy) = # }. These variables axe well-defined since it is assumed that the system (2.3) has a unique solution and y; > 0. Notice that R, Di, R, P for all i E C and -yE C are fixed once an initial condition is provided. We can view (Ry, Py) for -y E j as an IT because the intersection needs to be kept empty as long as an uncontrolled vehicle can occupy it. We introduce the following scheduling problem. Problem 3.2 (IT Scheduling Problem). Given an initial condition x(O), determine whether there exists a schedule T = (T1,..., Tn) where C = {1,... ,nc}, such thatfor all i E C, R45 T !- Ds,7(3.3) for alli j EC, T < T => P;(TO) (3.4) T, for all i E C and y E C, T T R , P(T) < ,=> T , (3.5) P,. (3.6) This problem is also described by an instance I = {x(0), 0}. We say {x(0), e} E Problem 3.2 if there exists a schedule T that satisfies all constraints in Problem 3.2. A feasible schedule for Problem 3.2 ensures (T, P(T)) n(T,, PY) = 0 by (3.5) and (3.6). The IT scheduling determines if a sequence of controlled vehicles exists such 27 that controlled vehicles cross an intersection before or after IIT. We now prove that Problem 3.2 is equivalent to Problem 3.1 and then propose a solution to Problem 3.2 in Section 3.2. Theorem 3.1. Problem 3.1 and Problem 3.2 are equivalent. Proof. We prove that the Verification Problem (Problem 3.1) is reducible to the IIT Scheduling Problem (Problem 3.2) and vice versa. Notice that Problem 3.1 and 3.2 have the same instance I E {x(0), E}. Thus, equivalence between the two problems follows by showing that for any given instance I = {x(0), 9}, I E Problem 3.1 -> I E Problem 3.2. (=>) Given an initial condition x(0), there is an input fi which ensures safety, that is, y(t,f, d) B for all d and for allt > 0. For y(0) < a for i E C, define T as the time t when y,(t, fi) = aj, and for y,(0) < 8i, define P,(T) as the time when y,(t, fi) = 63. If yj (0) : ai , set T = 0. Set Pi(T) By definitions of R, and Di, R, =0 if yj (0) ! #8. T Di (Condition (3.3)). Suppose T :5 T for some i $ j E C. Since fij and fii prevent an intersection collision between vehicles i and j, when y,(t, s,) = a3 , we have that y,(t, fi) /3. Since i(Ti) 5 T. By definition of P(T), it follows that P(T) y, > 0 by assumption, i (T) 5 T (Condition (3.4)). Also, with the assumption that the input fi ensures safety for all d, if T 5 Ry for i E C, - E C, when maxs y7 (t, dy) = ay, it must be true that y,(t, fii) /3. Since y,(t) is increasing with time, {t: max 4 yy(t, dy) = ay} becomes min,{t : y7 (t, dy) = a7 } which is equal to R, by definition. Combining this with the definition of P(T), we have that P(T) 5 F(T) Ry (Condition (3.5)). If T kBy, when y (t,fii) = as, the vehicle y must stay away from the intersection, i.e., mind y,,(t, dy) because of the increasing property of the output with respect to t, T 8,. Again, P, (Condition (3.6)). (.=) Given an initial condition x(O), there exists a schedule T E Rnc that satisfies all conditions of Problem 3.2. We start assuming that y,(O) < ai for all i E C U C, which does not break generality since vehicles after the intersection axe not of interest. 28 According to Lemma 5.1 in [10], if T E [Ri, Dj] for yi < as, there exists an input ui E Uj such that y (T, ui) = aj. Then, we can construct ui E Uj such that y (Ti, u) = ai for all i E C. Now, we show that these inputs ui for i E C ensure safety, if T satisfy conditions When T < Tj for i # j E C, condition (3.4) indicates P(T) (3.3)-(3.6). which implies that when y (t, Uj) = fl, we have y,(t, u,) a so that uj and u, prevent collisions between controlled vehicles. From condition (3.5), when T for i E C,7-y E j, P(T) have yi(t, u) 3l, that is, y,(t, dy) ay and yi(t, u) aj, it is true for all d, that yy(t, d) /,l. #li. If T > R,,, condition yy(t, dy) f,. Thus, when Hence, ui for i E C prevent collisions between controlled and uncontrolled vehicles for all d. 3.1.2 RY R.. This implies that when maxdy,(t, d) = ay, we (3.6) indicates that when yi(t, u) = aj, we have min y (t, uj) T, 0 Supervisory Problem We now design a supervisor operating in discrete time. At each time step kr, a current state x(k-r) E X and a desired input ak E U for the controlled vehicles are given, where the desired input represents the input applied by a driver. Then, the supervisor returns an input based on the partial state prediction for the next step. We define the j-th entry of this partial state prediction as follows: (xj(r,ak3 ,x 3 (kr)) j EC xj (kr) jEC [xk+1(ak)]3 -= (3.7) where akj E U for j E C is the j-th entry of the vector ak, and it it known since it is for a controlled vehicle. Notice that the current disturbance d E V does not contribute to the partial state prediction since uncontrolled vehicles are not equipped with driver assist systems that can monitor the input of the drivers. This is why we called xk+1(ak) the partial state prediction. Because a supervisor interacts with human operators, it has to be least restrictive in the sense that it intervenes only if a collision is guaranteed to occur in the future 29 for some d E V. To describe future trajectories, define a continuous input profile u'|(t) defined for t E [kr, oo) and let uk(t) be uj|(t) restricted to t E [kr, (k + 1)r]. During this time period, let Uk(t) = ak, where ak is the desired input at t = kr and is considered constant on [kr, (k + 1)r]. Similarly, let u',,e(t) be a safe input defined for t E [kr, oo) and let Uk,,afe(t) be u00,fe(t) restricted to t E [kr, (k + 1)r]. We now formalize the Supervisory Problem. Problem 3.3 (Supervisory Problem). Design a supervisor s(x(k-r), ak) at time step kr such that B if 3uj|*: y(t, uj|, d) for all d E D for t > kr uk,safe otherwise, = and such that it is non-blocking: if s(x(kr), ak) # 0, then for any ak+1, s(x((k + s(x(k'r), ak) IUk 1)-r), ak+1) = 0. 3.2 Problem Solutions By virtue of Theorem 3.1, we can solve the Verification Problem by solving the IIT Scheduling Problem. In this section, we thus focus on providing an exact solution to the IT Scheduling Problem, which we then use to solve the Supervisory Problem. 3.2.1 Solution of the Verification Problem Assume, without loss of generality, that yi > a for m controlled vehicles. Let P be the set of all permutations of controlled vehicles such that yi < ai. Then, each element of P is an (ne - m)-tuple denoted by ir. Let fr be an n--tuple composed of all -f E d in an increasing order of R.. The notation -r represents the i-th element of 7r, and fri represents the i-th element of ir. Parameter d represents a time delay, as explained in Section 3.2.2. Algorithm 3.1 with 6 = 0 solves Problem 3.2 (IIT Scheduling Problem), and, hence, Problem 3.1 (Verification Problem) by Theorem 3.1. Also, notice that the 30 Algorithm 3.1 Verification of Problem 3.2 procedure EXACTSOLUTION(X(0), 6) if y(O) E B then return {0, no} for all i E C and -y E C do given x,(0) calculate R, Di given x,(0) calculate I?, P, Ih +- max(Ih - 6,0) P1 +- max(P1 - J, 0) for i E C such that yi(O) ;> ai do T +- 0 calculate P(T) and P. +- max, P(T) for all 7r E P do for j +- 1 to n, - m do Tr1 +-max(Rri, P Tr+- max(RK, ) forj = 1 -,,_(T,,_,)) given T,, calculate P3 for r +- 1 to nE do if T 1 . > R,. then Tr, +-max(T,,, Ifr) given T, calculate P, else if Pj, > R*, then Tr +-P, given T, calculatePr if T < Di for all i E C then return {T, yes} 31 running time of Algorithm 3.1 increases in a factorial manner with (nc - m) since the algorithm checks all permutations in P to return no. This is consistent with the fact that Problem 3.2 is known to be NP hard [141. Example 3.1. Suppose we have C = {1, 3,4} and C = {2, 5} that are modeled for simplicity as f(xi, u) = uj, h(xi) = xi for i E C, and f (zy, d-,) = d., h(x1,) = Xy for - E C. A given initialcondition is x(0) = (44,26,20,5,2) with J = 0 with parameters um = 3 ,U 15, dm = 6, dM = 12 and (ci,#6l) = (50,53). The release times become = (R1 , R3 , R 4 ) = (, 2,3), the deadlines (D1 , D 3 , D4 ) = (2,10,15), and the idle-times Consider r = (1,3, 4) and i = (2,5). Forj = 1 andr, = 1, we have T1 = R,= and P1 = T1 + -. that T1 = 2 and P1 =I . Since T < R2 < R5 and P1 < 12< &1, we determine =' For j = 2 and then r2 = 3, we have T =max(R3,P1) = 2 However, and Pa= 2. , (?2, 7A) = (2,4), and (P2,iP 5)= (4-,8}). for r = 1, we have Tr1 = 2 and T3 12. Thus, T3 = max(Ta,P2 ) = 41. This leads to P = 4-. For r = 2, we have T2 = 5. Because T3 <11 5 and P3 > R5 , we have T 3 = P5 = 8. and P3 = 8-L. Finally, for j = 3, we have r3 = 4 so that T4 = max(R4 , P) = 8-L and P4 = 8 . Even though for r = 1 we have T4 R 1, notice that T4 does not change because max(T4 , T1) = T4 . This is the same for r = 2. Since Ti ; Di for alli E {1,3,4}, we have found a set of schedule T = (2,81,8-6 ). If there was no feasible schedule for this -x,Algorithm 3.1 would try the other permutations such as -r = (1, 4, 3). 3.2.2 Solution of the Supervisory Problem A supervisor is designed to override controlled vehicles with a safe input Uk,,afe if a desired input ak leads to an intersection collision at some future time. To achieve this goal, we define an input operator for y;(O) < a for i E C as follows: a- (xi(0), T) := arg inf {t > 0 : y (t, u,) = f8 for i E C with constraint y (T, uj) = ai}. uEU, (3.8) 32 This operator returns an input ui E U2 for i E C such that y (t, uj) reaches a at TI and 3 at P(T). Set ai (xi(0), T) = uj,m if y (0) y1 (0) > #j. aj, and set a1 (x1 (0), T) = 0 if If the constraint y2 (T, ui) = ac cannot be satisfied, set a,(x1 (0), T) = 0. Let a(x(O), T) be the parallel composition of (3.8) for all i E C. Then, a(x(0), T) indicates the safe input uf'f,e introduced in Section 3.1. At each time step, Algorithm 3.1 determines whether a predicted state from a desired input leads to an intersection collision. To account for the fact that in the partial state prediction xk+1 (ak) we do not predict the states for the uncontrolled vehicles since their inputs are not known, a time delay r is considered for vehicle -Y with -y E C. In particular, let (R', P4) denote an IIT for a given initial condition xz(kr). That is, Pk:= min {t : y,,(t, d7 , x-(kr)) = ay} 47EV7 y and P := max{t: y7 (t, dy, x-,(kr)) = d-fEV-y181 }. Also, let (R+, PI+') denote the predicted idle-time defined as follows: min{t : y,(t, d, x,(r, dy,m, x,(kr))) = Iy} and PY+' := max{t : yy(t, d, x,(,dy,m, ,(kr))) = From these definitions, it can be verified that ( +) P;+1 -r). - (3.9) We propose Algorithm 3.2 to solve the Supervisory Problem (Problem 3.3). Notice that Algorithm 3.1 takes J = 0 when x(0) is a measured state and J = ir when x(0) is a partial state prediction. The next lemmas and theorem prove that Algorithm 3.2 solves Problem 3.3. Lemma 3.1. If EXACTSOLUTION(x(k-r), 0) = {T, yes}, then u := u(x(kr), T) 33 #0. Algorithm 3.2 Solution of Problem 3.3 procedure s(x(kr),ak) Uk(t) +- ak Vt E [kr, (k + 1)r] {T, answer} +- ExACTSOLUTION(xk+1 (Uk), r) if answer = yes and y(t, uk, d) 0 B for all d E V for all t E [kr, (k + 1)r] then (Xk+1(Uk), T) ,,l,safe +U C+,,sa0erestricted to[kr, (k + 1)r] Uk+1,aafe return uk else {T, answer} +- EXACTSOLUTION(Xk+1(Uk,safe), r) U01,safe +- 0(Xk+1(Uk,,afe), T) Uk+1,afe Cu+0,saferestricted return Uk,safe to[kr, (k + 1)7] Moreover, EXAcTSOLUTION(Xk+1(uk), r) = {T, yes} where uk restricts u to [kr, (k+ 1)7]. Proof. Given an initial condition x(kr), if a schedule T exists, then {x(kr), e} E Problem 3.1 by Theorem 3.1, indicating that there exists an input u E U such that y(t, u, d, x(kr)) 0 B for all d for t E [kr, oo). Thus, a(x(kr), T) = 0. Let fi be u restricted to [(k + 1)-r, oo). By assumption, the schedule T is feasible, which implies that it satisfies the conditions that Ti E [Ri, Dj] for all i E C, that (T, P2(T)) does not intersect each other, and that (T, P(T)) n (RJ, P4) = 0 for all 7 E C. Define T' as Tj = {t : yi(t,iii, [xk+1(uk)] 1 ) = ai} for all i E C where fi, is the entry of 6i corresponding to vehicle i. Then Tj' = T -,r and P (Ti') = P(T) - -rsince uk equals u on [kr, (k + 1)r]. Consequently, intervals (T, P(Ti')) do not overlap for all i E C and (T,P (T1 )) n (Rk+, P+') = 0 for all y E j due to (3.9). Also Tj' E [R, Dj] by construction. Therefore, EXACTSOLUTION(Xk+l(Uk), -r)has a feasible schedule T' 0 and thus returns yes. Lemma 3.2. Given a desired input ak, if ExACTSOLUTION(xk+1(ak), -r) = {T, yes}, then o(xk+1(ak), T) # 0. Proof. Define xk+1(ak) such that its j-th element [kk+1(ak)] is either x (-r, akj, x 3 (kr)) for j E C where akj is the j-th element of ak, or xj(r, dj, xj(kr)) for j E j for any 34 disturbance dj E [dj,m, dj,M] on [kr, (k + 1)r]. Let (R+1, P4+') denote the IIT corresponding to [kk+,(ak)]y. Because the state is an order preserving function of the disturbance, we have x-y (r, dy,m, xy(kr)) 5 [kk+,(ak)] 5 x y(7, dy,M, xY(kr)). Also, since the output is an order preserving function with respect to the initial condition, we have y (t, dy, [kk+,(ak)]y) 5 yy(t, d,x, x7 (r, d7 ,m, zy(kr))), and y-y (t, dy, x-, (7, df,m , x-y (kr))) :5 y-y (t, d-y, [:kk+1(ak)].Y)These two inequalities and the definitions of 5f+1 and P4+l further imply that since y > 0 by assumption, R+1 "+1 and pk+1 that (R+,P4 +1 ) ; (pk+1, Jk+1, respectively. Thus, we have P+ 1 ). If EXAcTSOLUTION(xk+1(ak),r) returns yes, a schedule T satisfies that Ti E [Ri, DI], that (Ti, P(T)) does not intersect each other for all i E C, and that for all y E C, (T,P(T)) n (R+1, pk+1) = 0. The last condition implies that (T, P(T)) n (R +1 Pk+1) = 0. Therefore, this schedule T makes EXACTSOLUTION(kk+1(ak),0) return yes. From Lemma 3.1, this implies -(^k+1(ak), T) = 0. Notice that [ik+,(ak)], is equal to [xk+l(ak)]i for all i E C. Thus, o-([xk+,(ak)]i,T) = og([kk+,(ak)]i, T). Since o(xk+1(ak), T) is composed of ai([xk+l(ak)] , T) for all i E C, it follows that o(xk+,(ak), T) = 0. 0 Theorem 3.2. The supervisor s(x(kr), ak) defined in Algorithm 3.2 solves Problem 3.3. Proof. If EXACTSOLUTION(xk+1(ak), r) returns yes, by Lemma 3.2 there exists an input signal -(xk+1(ak), T) $ 0 that ensures safety. Thus, Algorithm 3.2 returns uk which is identical to ak. If ExAcTSOLUTION(xk+1(ak), r) returns no, Algorithm 3.2 35 returns Uk,safe. We next show that Algorithm 3.2 is non-blocking. We use mathematical induction to prove this. Suppose at t = k-r, s(x(kr), ak) = Uk,,,t and Uk,out # 0. Then we must prove that s(x((k + 1)r), ak+1) =#4 0 for any ak+1. Notice from Algorithm 3.2 that this is possible when Uk+1,safe As seen in Algorithm 3.2, Uk,mt ACTSOLUTION(xk+1 (Uk), r) = empty. exists, that is, u+1afe = is either uk or Uk,,afe. O(Xk+1(Uk,out), T) # 0. In the former case, Ex- {T, yes}, and by Lemma 3.2, -(xk+1(uk), T) is non- In the latter case, because we assume that upafe exists, ExACTSOLU- TION(Xk+i(Uk,aafe), -) returns yes by Lemma 3.1. In turn, Lemma 3.2 implies that U+00 1,safe exists. Therefore, the supervisor is non-blocking. 3.3 Simulation Results Consider the design of the supervisor s, which is described in Section 3.2, for multiple vehicles converging to an intersection in the presence of uncontrolled vehicles. The dynamic state of each vehicle is xi = (pi, vi) where pi is the position and vi is the speed. With an input u, and a disturbance dy for i E C and -y E C, the longitudinal dynamics of each vehicle are modeled as follows: u= vi E (Vi,m, VM) A. 0 otherwise, -, = 0 Vi E(V-.y,m,7V"yM) otherwise. We implement the algorithms using MATLAB with a time step r = 0.1s. Each vehicle has the same parameters: (a1 , fi) = (50m, 53m) and [vi,m, Vi,M] = [3m/s, 15m/s]. Also, the input ui E [-2m/s2 , 2m/s 2 ] for i E C and the disturbance dy E [-lm/s 2 , 1m/s 2] for -f E j. We consider the desired input as lm/s2 for all controlled vehicles and construct the disturbance using a random number generator in MATLAB. In Figure 3-1 and Figure 3-2, Algorithm 3.2 is simulated, based on EXACTSOLU36 44" . 30 140 20 0 1 2 3 4 5 6 7 time (S) Figure 3-1: Positions of 5 controlled (black solid line) and 2 uncontrolled (red dotted line) vehicles controlled by the supervisor s in Section 3.2 (Algorithm 3.2). The blue boxes at the bottom represent the time steps when the supervisor overrides the controlled vehicles. The shaded region represents the location of the intersection. TION (Algorithm 3.1). Notice that the supervisor s guarantees that only one vehicle crosses the shaded region at a time, that is, the trajectories avoid the bad set. The overall simulation time when using the exact supervisor s in Figure 3-2 is 8000 seconds (7.3 seconds per iteration on average). This computation time is greater than the time step T = U.s so that this algorithm is unable to be implemented in a real time. 37 50 40 30 w20 -10 0 1 2 3 4 5 6 time (s) 7 a 9 1 Figure 3-2: Positions of 8 controlled (black solid line) and 2 uncontrolled (red dotted line) vehicles controlled by the supervisor s in Section 3.2 (Algorithm 3.2). 38 Chapter 4 An Efficient Approach As seen from Chapter 3, Problem 3.1 is NP-hard. To address this computational complexity problem, we introduce a relaxed version of Problem 3.2, called the Relaxed Scheduling Problem, which can be solved in polynomial time. Based on this scheduling problem, we construct a modified version of Problem 3.1, called the Relaxed Verification Problem in Section 4.1. The corresponding supervisor, called the Efficient Supervisor, is designed in Section 4.2. Finally, in Section 4.3, simulation results verify that computation complexity problem is resolved by this efficient approach. 4.1 Relaxed Verification Problem To formulate the Relaxed Verification Problem, we first introduce the Relaxed Scheduling Problem, whose solution is solved in polynomial time as can be found from the scheduling literature. Then, we modify Problem 3.1 by inflating the bad set in light of the relaxation for the Relaxed Scheduling Problem. 4.1.1 Relaxed Scheduling Problem Garey et al. [14] proposed an efficient algorithm to solve DEC(1|r,pi = 1JL,O..,) in 0(n2 ) where n is the number of jobs. To design the algorithm, they introduce the 39 concept of a forbidden region F, a time interval when no task is allowed to start to have a feasible schedule. Let F, C R be the k-th interval in F. Algorithm 4.3 is Algorithm 4.3 Solution of DEC(ljr,,p = 1JL,.,0) procedure POLYNOMIAL(F, r, d) Sort r, d into an increasing order of r for i +- n to 1 do for all j such that d4 di do if c3 = 0 then c +- dj - 1 else c3 +- c, - 1 if cj E F for some k then c+- inf(Fk) if i = 1 or r.- 1 < ri then c +- min{c,} if c < ri then return {0, no} else if r, _< c < r + 1 then F +- F U (c - 1, ri) for all it +- 1 to n do if {i : r5 < s and t not defined}= 0 then s +- min r, while s E F for some k do s +-sup(F) for all k such that rk :; s and tk = 0 do d = mink (dk) t- s and set s +- s + 1 Sort T = {t 1 ,..., t,} in the original order return {T, yes} adapted from Algorithm A in [14]. The difference between these two algorithms is that Algorithm A in [14] initially declares F an empty set, while here we allow to introduce F arbitrarily. Example 4.1. Consider 3 jobs on a machine with r = (7,7,8), d = (12,12,10), and unit process time. An initially declaredforbidden region is F = {(81, 101)}. The , increasingorder of r is (1, 2, 3), so Algorithm 4.3 startsfrom i = 3. Ford1 , d2 , d3 > d3 since di - 1 = d 2 - 1 F, we have cl = 11, c 2 = 11, while c3 = inf(Fl) = 82 because d3 - 1 E F1 . Since r2 < r3 , we find c = 81 which is inside [r3 , r3 + 1), and thus we update F = {(71,8),(8-,10)}. c= For i = 2, we have d1 ,d 2 > d2 and c2 = 81, and neither i $ 1 nor r1 < r2 . Fori = 1, since ci = c2 = 7., we obtain F = {(61,7), (7, 8), (81, 101)}. Then, the next step allocates a schedule to each job. 40 For it = 1, we have s = 7 and t1 = 7. For it = 2, we have that j = 3 since d3 is the least due date and r3 s, we have t3 = 8. For it = 3, s E F3 so that s becomes 101 thus t2 = 10 1. Algorithm 4.3 has a complexity that is polynomial with respect to the number of jobs n. We next relax Problem 3.2 to DEC(1|ri,pi = 1L.,,0) in order to address the complexity problem. To make the constraint p = 1, we define the maximum process time and normalize with it the other problem variables in Definition 3.1. Let 0,.z := max max iEC zx(O)EXi:y(O)=ac {t : yi(t, ui,m) = #l}, (4.1) which determines the largest time required to cross the intersection among all controlled vehicles. Considering this as the fixed process time, we rewrite the relaxed version of Problem 3.2 as follows. Problem 4.1 (Relaxed Scheduling Problem). Given an initial condition x(0), determine whether there exists a schedule T = (T1 ,... ,T), where C = 1, ... ,ne}, such that for all i E C, Rt :5 T 5 Di (4.2) for alli A j E C and y E C if T > 0, T T= T + maz T T R => T + O= R- I(4.4) T (4.3) (4.5) => T ! R if yt(0) > a1 , i.e., T = 0, condition& (3.4) and (3.5) need to be satisfied instead of conditions (4.3) and (4.4). Notice that (4.4) and (4.5) in Problem 4.1 imply that T for any i E C cannot start during (T - Oma, P) for all -y E C. Thus, we normalize these time intervals with m., and let them be the initial forbidden region F in Algorithm 4.3. Assume that yi(0) ai for i E {1, ... , m} and yi(0) < ai for i E {m+ 1, ... 41 ne}. Algorithm 4.4 Verification of Problem 4.1 procedure APPROXSOLUTION(X(0), 6) if y(O) E B then return {0, no} for all i E C and y E d do given x,(0) calculate R4, D, 0,,. given xy(0) calculate Ry, Py A 7 +- max(Iy - 6,0) S-max(P - 6, 0) for all -y E j such that P > 0 do F +- F U (max(RI/G,,. - 1,0), P7/9max) for i - 1 to m do calculate P(T) and P,,, +- maxi P (T) for i +- m+1 to n, do R, +- max(R, P,.) r +-(R:4+1/Omax, .. - -, ./Om=) d+- (Dm+/Omax+1, ... , Dnc/9maz+1) [tm+1,... , tn, answer] +- POLYNOMIAL(F, r, d) for i +- m + 1 to n, do T +- mxi return {T, answer} Algorithm 4.4 is the solution for Problem 4.1 when 6= 0. Relaxed Verification Problem 4.1.2 Notice that Algorithm 4.4 may return no even when the solution for Problem 3.2 exists. We quantify how conservative Algorithm 4.4 is, which will be considered to formulate the Relaxed Verification Problem. Lemma 4.1. ConsiderT and T for some i, j E C with y,(0) < a, and y,(O) < a and a, and y (T,uj) = aj. If T > T and T - T < OM= ui and u, such that y (T,u ) = or if (T,T +8m=) n (R-,P 7 ) $0 for some 7 E j, then there exists t* E [T;, T + 0'.] such that eithery (t*, u3 ) E (a3 , a, + 0raxc.j,M) or yy(t*, dy) E (ay, ) respectively. Proof. The condition T - T < Omax implies a violation of (4.3). Let t* = T. Since T > Tj, we have y,(t*, u,) > aj. Also, the assumptions that T < T + On= and Y,,M imply y,(t*, u,) < a3 + 9 ma4 j,M. Thus, t* satisfies y (t*, u,) E (aj, aj + j < Ocyj,m). The next condition (T, T + 0,O,) n (Iy, I 7 ) 42 $ 0 implies that T does not satisfy (4.4) and (4.5). That is, for an uncontrolled vehicle -y, there is t* such that t* E (Ti, Ti + ,m=) n (I, P). Since . > 0, for t* > I?., and dy = d,m, we have yY(t*,dy) > %y; for t* < P. and dy = dy,m, we have yy(t*,d1 ) < 8y. Therefore, for some d., E D.,, we have that yy (t*, c4) E (ay 8,).0 Taking this lemma into account, we inflate the intersection witha := ai+,. yi,M for i E C and Ay :=.y for -y E C. Then, an inflated bad set is defined as follows: B :={y E Y : yi E (ai,/ji) and y E (aj, 8j) for some i 3 j such that i E C and j E C U}. (4.6) We then modify Problem 3.1 by substituting the inflated bad set B in place of the bad set B. Problem 4.2 (Relaxed Verification Problem). Given an initial condition x(O), determine if there exists an input signal u E U which guarantees that y(t, u, d) B for all d E V for all t > 0. Theorem 4.1. Given x(0) and 3 = {0, r}, if APPROXSOLUTION(X(O), 3) returns no, then there is no input u such that y(t, u, d) B for all d for all t > 0. Proof. In Algorithm 4.4, APPROXSOLUTION(X(0), J) returns no for two cases: y(O) E B or POLYNOMIAL(F, r, d) returns no. In the first case, y(O) E B because B C B so that at t = 0, y(t, u, d) E B for any u. In the second case, according to Algorithm 4.3, POLYNOMIAL(F, r, d) returns no when the conditions described in Lemma 4.1 hold. Thus, by Lemma 4.1, if APPROXSOLUTION(X(0), 6) returns no, then there exist some d E E) and some t > 0 such that y(t, u, d) E B for any u. Therefore, there is no input u such that y(t, u, d) V B for all d for all t > 0. Theorem 4.1 indicates that if Algorithm 4.4 returns no, then there is no solution to Problem 4.2, thereby letting the efficient supervisor introduced in the next section intervene. 43 4.2 Efficient Supervisors We now define an efficient supervisor s(x(kr), ak) by employing B in place of B in Problem 3.3. Also, define the input operator for i EC as follows: ai(xi(O), T) := arg inf {t > 0: y(t,u,) = [ with constraint y;(T,uj) = a;}. (4.7) Ui EUi Moreover, define another efficient supervisor sa,,,.x(x(kr), a,) as in Algorithm 2 in which APPROXSOLUTION is used in place of EXACTSOLUTION and & is used in place of a. Here, we prove that s is no more restrictive than sap,,.', that is, we prove that if S^ is non-empty, sapp,.x is also non-empty. # Lemma 4.2. If APPROxSOLUTION(X(kr), 0) = {T, yes}, then u := &(x(kr),T) 0. Furthermore,for uk defined as u on [k-r, (k+1)'rI, APPRoxSOLUTION(Xk+1(Uk),-)= {T, yes}. Proof. Same procedure as in proof of Lemma 3.1. 0 Lemma 4.3. If APPRoxSOLUTION(xk+1(ak), r) = {T, yes}, then (xk+1(ak), T) 3 0. Proof. Same procedure as in proof of Lemma 3.2. 0 Theorem 4.2. The supervisors.,,.(x(kr), ak) is no more restrictivethan S(x(k-r), ak and non-blocking. Proof. If 8(x(k-r), ak) is non-empty, then APPROxSOLUTION(xk+1(ak), r) returns yes by Theorem 4.1 and definition of S. Then Lemma 4.3 implies that &(xk+1(ak), T) is non-empty, which in turn implies that sappro.,,(x(kr), ak) is non-empty by definition of sa,,,.x. Therefore, sap,,(x(kr), ak) is no more restrictive than S(x(kr), ak). The non-blockingness follows the same procedure as in proof of Theorem 3.2. 4.3 0 Simulation Results The same parameters and dynamic model are considered as in Section 3.3. The initial condition used in this section is equivalent to the initial condition used in Figure 3-2 44 in Section 3.3. 50 J 40 130 20 ~4e 10 -10 -20 0 2 4 6 time (s) 8 i 10 12 Figure 4-1: Positions of 8 controlled (black solid line) and 2 uncontrolled (red dotted line) vehicles controlled by sa,,ppo in Section 4.2. The blue boxes at the bottom represent the time steps when the supervisor overrides the controlled vehicles. The darker shaded region represents the location of the intersection while the lighter shaded region represents that of the inflated intersection. In Figure 4-1, Algorithm 3.2 using APPROXSOLUTION (Algorithm 4.4) in place of EXACTSOLUTION (Algorithm 3.1) is simulated to design sajprox for an example with 8 controlled and 2 uncontrolled vehicles. Figure 4-1 shows that the trajectories cross the darker shaded region without time overlapping, which implies the system's output avoids the bad set. Meanwhile, saprox does not guarantee that only one vehicle stays inside the lighter shaded region at a time, that is, the trajectories are inside the inflated bad set. This, together with the result of Theorem 4.2, shows that sapprox is strictly less restrictive than s. Recall that the simulation time per iteration for Figure 3-2 is 7.3 seconds on average. However, the simulation in Figure 4-1 takes 0.001 seconds per iteration on average and 0.07 seconds for the worst iteration. In light of the fact that 0.1 seconds is a usual practical sampling time, this algorithm is fast enough to be implemented in real-time applications. 45 46 Chapter 5 Optimal Approaches This chapter designs two optimization problems on the top of the efficient solution, which is introduced in Chapter 4. By virtue of solving the optimization problems, new smoother inputs are achieved in the sense that the abrupt change of the inputs and unnecessary intervention are minimized. These problems must be solved in polynomial time to maintain fast computation time for real-time applications. We specify the motivations of these optimization problems in Section 5.1 and formulate the problems called the Input Optimization Problem and the Schedule Optimization Problem in Section 5.2 and Section 5.3, respectively. The Input Optimization Problem is designed to replace the input operator & defined in (4.7), and the Schedule Optimization Problem is designed to optimize the solutions of Problem 4.1. Since we only override controlled vehicles with designed inputs, uncontrolled vehicles are not considered in this chapter. 5.1 Motivations In this section, we present two issues of the control inputs that are generated by the Efficient Supervisor in Chapter 4. The first issue is the abrupt changes of inputs, which may cause inconvenience to drivers. The other issue is unnecessary intervention, which can be seen when there is one vehicle that is not involved in any collisions. 47 5.1.1 Abrupt Changes of Inputs Consider an example with 4 controlled vehicles. The intersection is located at [30m, 33m], and speed bounds are [lm/s, 10m/s] with a sampling time 0.1sec. The other parameters are equivalent to the example in Section 3.3. As been noticed in Chapter 4, one iteration takes at most 0.07sec using the efficient supervisor. 40 I . ....... ... ............ ...... 3530 ram 25 C S 20 10- 1 2 3 4 t0 5 time (s) 6 7 8 9 Figure 5-1: Positions of 4 vehicles (black solid line). The blue boxes at the bottom represent the time steps when the supervisor overrides the controlled vehicles. The darker shaded region represents the location of the intersection while the lighter shaded region represents that of the inflated intersection. Recall from Section 3.3 that the control input for this system is a longitudinal acceleration of the vehicles. The accelerations that we apply to vehicles usually show many oscillations as in Figure 5-2. Because of this flutter, the actuator could be damaged, and the car sways back and forth by inertia. Moreover, the drivers would feel the discrepancy between the input that they apply to the vehicles and the input that the supervisor imposes. To address this issue and provide a more convenient driving environment to drivers, we propose the Input Optimization Problem in Section 5.2, where the difference between a control effort and a desired input is minimized for every step. 48 control effort . --desired input 2 ................................................................. 1 ________---___ ---- CL -1- -3 0 1 1 1 2 3 4 5 - ------------ -- ------ - -2 --------------- .. 1 1 6 7 1 8 1 9 time Figure 5-2: Control input (black solid line) for the last car with its desired input (blue dotted line). The two horizontal dotted lines represent the upper and lower bounds for the input. 5.1.2 Unnecessary Intervention Suppose a different initial condition of 4 vehicles is given such that one vehicle travels far from an intersection compared to the other vehicles. All the parameters are the same as in Section 5.1.1. The Efficient Supervisor in Chapter 4 is used to control the vehicles. The positions of the vehicles over time are shown in Figure 5-3(a). All of the vehicles are overridden when the blue boxes are present. However, in Figure 5-3(b), the last vehicle is not overridden and travels with its desired input. This still does not cause any collision because the last vehicle is not involved in any collision. 49 - 40 20 -- - S10 C . 0 - -10 - -20 0 1 2 3 4 5 6 7 8 9 10 time (s) (a) All four vehicles are controlled by the Efficient Supervisor in Chapter 4 40 - - -- 30 - - - 20- 10 E C U -10-20-30 0 1 2 3 4 5 6 time (s) 7 8 9 10 (b) The last vehicle is not in control Figure 5-3: Positions of 4 vehicles where the last vehicle is far from the intersection compared to the others. 50 3 control effort - - - desired input 0- . . .. . . .. . .. . . .. ..-. .- -3 0 0 2 - - -- -. - 2 -.. .. . . .-.. . . . ..- 4 6 8 10 time Figure 5-4: Control input (black solid line) for the last car in Figure 5-3(a) with its desired input (blue dotted line). The two horizontal dotted lines represent the upper and lower bounds for the input. Figure 5-4 shows the input signal for the last vehicle in Figure 5-3(a). Although the intervention in the last vehicle is unnecessary as can be seen in Figure 5-3(b), the Efficient Supervisor overrides not only the other vehicles but also the last vehicle, which is not involved in collisions. In this individual perspective, the Efficient Supervisor is not least restrictive, that is, it violates that it intervenes only if necessary. This issue mainly originates from the design of the decision version of scheduling problem as in Definition 2.1. Therefore, to address this problem, we propose optimizing a schedule to be closest to a desired schedule which is defined in Section 5.3. 5.2 Input Optimization Problem To take advantage of a dynamic model in the design of an optimization problem, we consider a linear discrete system. Based on this model, we formulate the Discrete 51 Schedule Problem and the Input Optimization Problem. 5.2.1 Discrete Scheduling Problem Recall the dynamic model of vehicle i: (2.1) yi = hi(xi). i = fA(xi, ui), For a non-negative integer k E Z>o where Z>o is a space of non-negative intgers and for a sampling time At, let the dynamical state xi(kAt) be denoted by xi[k] and the output yi(kAt) by yi[k]. The input ui(t) for t E [kAt, (k + 1)At) is considered constant and denoted by u [k]. Through this chapter, we consider the corresponding linear discrete time-invariant system to (2.1) denoted as follows: yi[k] = Cixi[k], xi[k + 1] = Aixi [k] + Biu [k], (5.1) where Ai is the system matrix, Bi is the input matrix, and Ci is the output matrix for each vehicle i. The input signal for t E [0, (N + 1)At) is a vector denoted by Ui := (ui[0],... , u[N]). Similar to the continuous system, 9; [k] E [yi,m,l,M] and ui[k] E [ui,m, ui,M] for all k E Z>o. The output trajectory yi[k, ui, xi[ko]] and state xi[k, ui, xi[ko]] denote the output and state reached at t = (k + ko)At with an input signal ui starting from xi [ko], respectively. We assume that both yi [k, ui, xi [ko]) and xi[k, ui, xi[ko]] are order preserving functions of their arguments. For notational brevity, we omit an initial condition when ko = 0. The aggregate state, output, and input are denoted by x[k], y[k], and u[k], respectively. Based on the dynamic model (5.1), we define the variables of discrete scheduling. To ensure the existence of these variables, a truncation error Aai is considered. Definition 5.1. For all i where yi[0] < ai - Aai, let Ri := min{k E Z Ut : ai - Aai 52 yi[k, ui] ai}, D := max{k E Z>o : ai - Aai y [k, u4] ai}. U, Given a non-negative integer Ti E Z>o, where 9m, := max min{k E Z>o : y,[k, uj t If ai - Aaj y [k,u,] y4[0] < ai, let R := 0, and ai}. If ai B3}. U, y[0] < Pi, let i := max,,{k E Z>o : ai - Aai , := 0 and Di := 0. For both cases, that is, a - Aaj 5 y[0] < i, given a non-negative integer Ti E Z>o, Pi (T) :=min{k E Z>o : y [k, u.] > #3i with contrainty,[7j] - ai}. Ui If the constrainty [T, u] a, is not satisfied, set Pi(T) = oo. If y [0] f3i, then set R = 0, Vi = 0, and A (M)= 0. We now formulate the Discrete Scheduling Problem. This problem requires the same constraints as Problem 5.1 except the idle-time constraints. We consider n vehicles approaching an intersection. Problem 5.1 (Discrete Scheduling Problem). Given an initial condition x[0], determine whether there exists a schedule T = (T1 , ... T,) where 7; E Z>o for all i such that for all i E {1...,n}, for all i 0 j, Notice that a truncation error Aaj appears when R, and Vi are defined. This implies that a feasible schedule 7; obtained from Problem 5.1 satisfies ai - Aai 5 y4[T] 53 ai. Similarly, from the definition of P(TK), a truncation error A,3i can be introduced where A/3, satisfies #5 y[Pi(T), 4 /38+ A 0. Notice that we consider Pi to take the definition of 19, into account, where fl: a, + 9 vna.xj,M defined from a result of Lemma 4.1. Therefore, the inflated bad set from discretization is defined as follows: $:= {y E Y :3t > 0 such that y,(t) E (a, - Aaj,,fl + 4#3l) and (5.2) y 3 (t) E (aj - Aaj, #l + A#3) for some i = j}. where Aa, 0 and Ai > 0 for all i E {1,...,n}. Notice that B considers the continuous dynamics while Problem 5.1 considers the discrete dynamics. Similar to Problem 4.2, we then modify Problem 3.1 by substituting the inflated bad set from discretization B in place of the bad set B and eliminating the disturbance of uncontrolled vehicles. Problem 5.2 (Relaxed Verification Problem for Discretization). Given an initial condition x(0), determine if there exists an input signal u E U which guarantees that y(t,u) V $ for all t > 0. The relation between this verification problem (Problem 5.2) and the Discrete Scheduling Problem (Problem 5.1) is that if Problem 5.1 returns no, that Problem 5.2 always returns no. The converse is not true. Moreover, if Problem 5.1 returns yes, then there exists an input to avoid the original bad set B, that is, Problem 3.1 returns yes. These are proved in Appendix A.2. Thus, we design a discrete supervisor such that it overrides the system when Problem 5.1 returns no. 5.2.2 Input Optimization Problem In the design of a discrete supervisor, the most important part is to define an input generator such as a in (3.8) and & in (4.7) because the safety is directly guaranteed from an input operator. While o and & randomly select the input that satisfies their 54 definitions, in this section an input operator is defined to minimize the difference between a control input and a desired input by a driver, as mentioned in Section 5.1.1. To implement an optimization problem, we use model predictive control (MPC), which is widely used for the on-line computations of optimization problems with constraints. The MPC encompasses open-loop feedback control and certainty equivalence [7]. The open-loop feedback control is a classical suboptimal scheme that selects the present control input at each period r as if future measurements will be disregarded while indeed it updates the measurements in future step. When a disturbance is applied to a system, the computation is simplified via certainty equivalence, which at each period assumes a fixed disturbance at a nominal value. In the formulation of the Input Optimization Problem, a desired input plays a role of a disturbance, which can be regarded constant as in the certainty equivalence scheme. Let a desired input vector ak,i be a constant vector of a desired input ak,i in a (Pi('7) - 1)-dimensional space for a given process time Pi(7). Also, we assume the time step for the supervisor r is a multiple of the sampling time for the discrete dynamic At, that is, -r = m * At where m E Z>o. The weighting matrix Q is a symmetric positive semi-definite and diagonal matrix. Since the MPC selects the present control input, we choose Q = diag([1,0,...,0]) to weight only the present input. Problem 5.3 (Input Optimization Problem). For each vehicle i at time step K and for given a schedule T and a process time Pi(7), find u, such that min(ui - aKi)Q(ui - aK,i) u< subject to for all k E {0, Pi(T) - 1}, Uim <ui[k] 5 yi,M, ui,m < ui [k] < ui,m, 55 and cei - ack 5 yL[u, uI ai, Notice that due to the constraints, the solution of Problem 5.3 guarantees safety if ['7, 1'( 7 )] does not overlap for all i. Indeed, Problem 5.1 finds such a schedule. Provided that the weighing matrix Q is positive semi-definite, Problem 5.3 is a convex quadratic optimization problem, which can be easily solved. The existence of a feasible input for Problem 5.3 is presented in Appendix A.1. 5.2.3 Simulation Results The input vector solving Problem 5.3 minimizes the cost at every step. However, this input vector and the actual control input are different due to the change from future measurements, the uncertainties from a disturbance, and the construction of the supervisor. To visualize the improvement achieved by solving the Input Optimization Problem, we generate 60 different initial conditions for 4 vehicles and compute the square of the difference between the actual control input and the desired input for each vehicle. For each sample of initial conditions, we find a stage 1' when vehicle i exits an intersection and then compute the average cost, 'Pi-1 E (ui[k] - ak,i) 2 k=O 'P (5.3) for each vehicle. Thus, each sample contains 4 average costs for each vehicle. Finally, we sort these 4 costs in an increasing order and call the one that has the minimum cost by the best performance and the one that has the maximum cost by the worst performance. The following figures show the average cost across 60 samples from the best to worst performance. In Figure 5-5, we observe that the worst performance deteriorates in the optimal 56 34 - Random input Optimal input 2.5- 2- cc 1 0.5- 0 1 2 3 from best to worst performance 4 Figure 5-5: Average cost on 60 samples of four vehicles control that is obtained from Problem 5.3 while the others improve in the optimal control input. 5.3 Schedule Optimization Problem Consider a vehicle i travelling far from an intersection while the others are not, as in Section 5.1.2. Recall that the Relaxed Scheduling Problem (Problem 4.1) is a decision problem, which returns a binary answer. Thus, Algorithm 4.4 searches the soonest possible schedule, more precisely, the schedule that minimizes Lmax, and checks if the schedule violates T < Di. Because of this soonest schedule scheme, vehicle i is assigned the soonest possible schedule at each stage, thereby being forced to accelerate when collisions among the others become urgent. To address this issue of unnecessary intervention, we formulate another optimization problem. Since in this chapter, we consider the discrete dynamic model and thus an integer schedule, optimizing a schedule becomes an integer linear optimization 57 problem. To solve this problem in polynomial time, we introduce a special class of matrix in Section 5.3.1 and transform the integer linear optimization problem into the equivalent linear optimization problem in Section 5.3.2. In Section 5.3.3, simulation results are given. 5.3.1 Totally Unimodular Matrix [20] Since a schedule obtained from the Discrete Schedule Problem is integer, the Schedule Optimization Problem becomes an integer linear optimization problem, which can be formulated as follows: min{c'x : Ax < b, x integers}. (5.4) Because of the integer constraint, this problem is known to be NP-hard. However, for a special class of A, c and b, this problem can be transformed to a linear optimization problem. The same problem without the integer constraints, that is, min{c'x: Ax < b}, is called the LP-relaxation of the problem (5.4). Consider a feasible set {x : Ax < b}. If every element of a matrix A is integer, A is called an integral matrix. If every element of a vector b is integer, b is called an integral vector. A square integral matrix B is "unimodular" if detB = t1. An integral matrix A is "totally unimodular" if every square non-singular submatrix of A is unimodular. Proposition 5.1 (p. 269). Let A be a totally unimodular matrix, and let b be an integral vector. Then, the polyhedron {x: Ax < b} has only integral vertices. Proposition 5.2 (p. 267). If A is a totally unimodular matrix, and b and c are integral vectors, then the problem min{c'x: Ax < b} has only integral optimum solutions. Proposition 5.2 implies that given a totally unimodular matrix A and integral vectors b and c, the LP relaxation of (5.4) retains only integral solutions, which 58 satisfy the integer constraint in (5.4). That is, the solutions for the LP relaxation become the solutions for the original problem. Since a linear optimization problem can be solved in polynomial time, the corresponding integer linear optimization problem can be solved in polynomial time. 5.3.2 Schedule Optimization Problem As we define a desired input vector aKi for vehicle i at stage K as a constant vector to simplify computation, we define a desired schedule Td, for y[0] < a, - Aa as follows: Td, := {k E Z>O: ai - Aai yi[k,aKI < ai}. (5.5) The goal of this section is to minimize the difference between an actual schedule T and a desired schedule Td, where Td is an aggregate vector of Td,. By solving such an optimization problem, the schedule T7 for vehicle i is equivalent to T,i if vehicle i does not have to change its input, thereby, minimizing the occurrence of unnecessary intervention. For the Schedule Optimization Problem, we only consider the vehicles that satisfy y [0] < ai - Aai. Let 7r be a given sequence of n vehicles. This sequence can be obtained from Algorithm 4.4. If Algorithm 4.4 returns yes, we take the feasible sequence; otherwise, there is no feasible schedule so that we do not have to solve a further optimization problem. The ith element of 7r is denoted by 7ri. Problem 5.4 (Schedule Optimization Problem). Find a schedule T = (T1 ,..., Tn) such that n subject to R, Z T 5 VI Vi E {1, ..., n}, 'P7Q(T ) :5T%,, Vi < j, T E Z>0, Vi. Notice that via the constraints, a feasible schedule must solve the Discrete Scheduling Problem (Problem 5.1). That is, Problem 5.4 chooses the best schedule in terms 59 of the objective function among all possible schedules that satisfy Problem 5.1. Since all vehicles of interest satisfy y [0] < ai - Aai, we have Pi (T) = '7 + V,.. In general, the absolute objective function can not be solved in polynomial time [looking for a reference]. To modify the objective function into a solvable one, define non-negative integers T,+ and T~ as follows: + := max(( - Td,i), 0) and Then they also satisfy Ti - T, = %+ - 7' Let T+ := (77, ... ,7) in Z2" is denoted by Ti := 'Ti~ := max(O, -(7i - Td,)). while minimizing I Ti - and T- := (T,-, ... , T-). 'd,i= 7;+ + 7~. The aggregate column vector (T+, T-)'. Now we reformulate Problem 5.4 into a linear programming format. Problem 5.5 (Reformulation of Problem 5.4). Find a vector T that = (7+, T-)' such n min Z(T++T-) subject to 7i <(T7 -WT) + Td,i Vii 'Ti+, T E Z>O, Vi Vi. By the definition of the LP relaxation of an linear integer programming, given in Section 5.3.1, the LP relaxation of Problem 5.5 is as follows. Problem 5.6 (LP relaxation of Problem 5.5). Find a vector T* = (T+, T-)' such that min Z(T++'Ti~) 'r+7ii=1 60 subject to 7ZT7-) + Tdh< Di, (T7 -T7,)+Td,r + max !5 (77 Vi T7) +Td7r., Vi <j Vi. 7j+ >01T->O0 Problem 5.6 can be rewritten as min{c'T : AT < b}, where the explicit expressions of A, b , and c are given in Appendix B(under construction...). Given the fact that the variables RiDi,di,, and id are integers, it can be verified also in Appendix B that A is a totally modular matrix, and b and c are integral vectors. By Proposition 5.2, Problem 5.6 has only integral optimum solutions. These solutions also satisfy the integer constraints in Problem 5.5. That is, the solutions for Problem 5.6 become the solutions for Problem 5.5. Using these optimal solutions for Problem 5.6 denoted by 7"+* and 7-* for all i, the solutions for Problem 5.4 can be obtained by T* = ( 5.3.3 _ 7-*) + T,. -+* Simulation Results In this section, we implement the optimal inputs derived from the Input Optimization Problem and the Schedule Optimization Problem, as described in Figure 5-6. 61 Verification Supervisor If answer = yes, Algorithm 4.4 Input yes n --answer 7ak Optimization -0 ak Problem :_1 r Sche dule Store Uk+1,safe If answer = no, OptirnzaItion Prob lerm Uk,safe Figure 5-6: Implementation of the two optimization problems (Problem 5.3 and Problem 5.4) at stage k. First, the Discrete Scheduling Problem is solved via Algorithm 4.4, and if there exists a feasible schedule, the sequence of the schedule lets the Schedule Optimization Problem compute the optimal schedule T*. If there does not exist a feasible schedule, Algorithm 4.4 returns no and an empty schedule. Depending on this answer, the supervisor either runs the Input Optimization Problem to store the safe input for the next step Uk+1,safe or overrides the system using the safe input Uk,safe- In the first example, the same initial condition and desired input as in Figure 5-3 in Section 5.1.2 are considered. By solving the Input Optimization Problem and the Schedule Optimization Problem at each period r, the unnecessary intervention that used to be observed in Figure 5-4 does not appear as can be seen in Figure 5-7(b). However, although all the problems can be solved in polynomial time, this simulation takes 0.13 sec per iteration on average and 2.46 sec on the worst case. A larger sampling time for the supervisor r than the computation time can tackle this problem but make the supervisor conservative. 62 20 110-310 .9 0 --10-20 0 1 2 3 4 5 6 7 8 9 10 time (s) (a) Positions of the optimally controlled vehicles 3 control - -desired effort input] *1 -2 ......... .3 0 1 ' - 2 ...........-........ ---............................. 3 4 5 time p 6 7 8 9 I 10 (b) Control input of the last car Figure 5-7: The same initial condition and desired input are considered as in Figure 5-3. In Figure 5-7(a), the lighter shaded rectangle represents the inflated intersection due to the discretization and approximation for the efficient solution. The blue boxes represent the time steps when the supervisor intervenes. Although the supervisor intervenes, the last vehicle is not overridden, that is, the control input (black line in Figure 5-7(b)) remains equivalent to the desired input (blue dotted line in Figure 5-7(b)). To confirm that this optimal scheme also works with a general desired input, a varying desired input is considered in the next example. Recall that the definition of a desired schedule Td,i in (5.5) is defined with a constant desired input because the future desired input is unknown. As can be seen in Figure 5-8(b), unnecessary intervention for the last vehicle, which is not involved 63 40 ,in 20- g 10 - 0 -20 -2- 0 2 4 6 10 8 lime (s) (a) Position of the optimally controlled vehicles 3 control 9Wor - -desired input -2. .. ................................. o 2 4 6 ....... I - ...... 8 10 time (b) The input of the last car Figure 5-8: The same initial condition but a varying desired input are considered. The control input (black line in Figure 5-8(b)) maintains the similar level to the desired input (blue dotted line in Figure 5-8(b)). in a collision, can be prevented even for an unpredicted varying desired input. Also it is noteworthy that at 4sec, the supervisor intervenes, as known from the presence of the blue box in Figure 5-8(a), and there is one step delay for the control input to follow the change of the desired input. This is because the change of the desired input is unknown at the time when the control input is generated. To provide a global quantification, we generate 60 random initial conditions of 4 vehicles, where one vehicle starts between 50 m and 60 m before an intersection, and the others start between 20 m and 30 m before the intersection. That is, one 64 vehicle travels farther from an intersection than the others. Then, using the metric of the difference between a control input and a desired input in (5.3), we compare the inputs obtained by solving the Input Optimization Problem and the inputs obtained by solving both the Input Optimization Problem (Problem 5.3) and the Schedule Optimization Problem (Problem 5.4). 1.5 Random schedule Optimal schedule 1 0 a) a) 0.5 0, 1 2 3 from best to worst performance 4 Figure 5-9: Average cost on 60 samples of four vehicles. Random schedule (blue bars) represents the results from solving Problem 5.3 while Optimal schedule (red bars) represents the results from solving Problem 5.3 and Problem 5.4. In Figure 5-9, the results present that solving Problem 5.4 along with Problem 5.3 generates smoother control inputs for most of vehicles than solving only Problem 5.4. 65 66 Chapter 6 Conclusions and Future Works In this paper, we have designed a supervisor to prevent collisions among multiple heterogeneous vehicles. The design of the supervisor is based on two main problems: verification of the system safety, and construction of a safe input for the controlled vehicles. An inserted idle-time (IIT), scheduling is employed to determine safety in the presence of uncontrolled vehicles. The supervisor is least restrictive by construction, that is, it intervenes only if necessary. Since the exact problem is NP-hard, we also introduced a relaxed problem and used an efficient scheduling algorithm with polynomial complexity to solve it. A quantification of conservatism of the approximate solution was also provided. To mitigate the abrupt changes of control inputs and to reduce the number of unnecessary interventions, additional optimization problems were formulated, which can be solved in polynomial time. The simulation results showed that the computation time exceeded 0.1 sec. Thus, to apply the problems to real-time applications, we need to enlarge the step size of the supervisor. While the extension that we have presented in this paper to consider uncontrolled vehicles and to generate smoother control inputs makes the scheduling approach more practical, a number of real-world issues still need to be tackled. These include considering also rear-end collisions, the fact that real intersections include multiple conflict points, that a vehicle's path may be not known a priori, and that vehicle positions and speeds may be subject to measurement uncertainty. The issue of the multiple 67 conflict points, which relaxes the assumption of the intersection model in Section 2.2, is currently being investigated. 68 Appendix A Proof for the discrete system A.1 Existence of input Proposition A.1. If there exists a schedule T; E [.,' an input vector u := (Us([0],.. .,uj[ Vi] C Z>o, then there exists - 1]) such that u,[k] E [ui,,,uim] for all k = {0, ...,% - 1} and ai - Aaj < yi[Ti, ufi] < aj. Proof. Consider an input u[0], ... ,u[N - 1], where N E Z>o. From the discrete system dynamics (5.1), the future state xi[N] for vehicle i at stage N can be written for a given initial condition xi [0] E Rn as follows: x4[1] = Axi[0] + Bjui[0], x [2] = Axi[1] + Bju[1] = A?xi [0] + ABju [0] + B u [1], x,[N] = Afx [O] + A- 1 Bju,[0] +... + Bju[N - 1], (u[0] = Aixj[0I + [IA -'B...,Bj] u[N - 1] Afvxj[0] + Qvu, where we define a matrix '$ as [Av- 1 Bj, A69 2 B4, ... ,Bi] and a vector uf as (u [0], ... ,[N- 1])'. Thus, the output at stage N becomes yj [N] = CiAlxi [0] + C u. Recall that for an input vector uf, the output y [N, uj, xi[0]] is an order preserving N2 E Z>o, we have function with respect to the arguments. That is, for N yi[N1 ,u' , xj[0]] yi[N2 ,U2, X,[O]], where U2 contains the same elements of U1 from 1st to Nith elements and is augmented by (N2 -N1) random inputs. By choosing U1 = 0 and u 2 = 0, we have (A.1) CjAfvixj[0] : CiAjxj[O]. Furthermore, by choosing x1 [O] = 0, we have C4',lufi < Cjx$J2u$2. By letting Cjxv = (Co,..., CN-1), we have k=N 2 -1 k=N1-1 Zk=O which becomes 0 < kN- E CkUikI ckUi~k], k=O ckui[k] for any ui[k]. This implies that ck for all k is non-negative. By the definitions of 7Z and Vi in Definition 5.1, there must exist input vectors yj[R,u,] < a1 ai - Aaj < CjA xj[0] + CjxFsu <a , ai - Ace , respectively. For N = ys[RI i,us] 5 ai and a, - Aaj 5 y[Vi, ,u'] 5 a, , u~' and upi that satisfy ai - Aaj a - Aaj - CiA 1xi[0] 5 CPiV-u% 5 a - C A xj[0]. Notice that Ci'44' is a vector so that let Ci{z = (co,.. ., C,.i-1). Let the 1-norm |ICjxP ck for all k E {0,.. ., |i|1 represent Icol + ... + |cg,_ 1 = co + ... + ci-1 because - 1} are non-negative, and let urs = (u[0], .. u[, 70 - 1]) in an abuse of notation. Then, = cou[0+...+c (1C IO =|jC ~it := llCily'& [7- 1] u[O]+ ... + i' 1Ci QIi - l j 11) iUR.- The last equation comes from the mean-value theorem. Since all elements of u~' are inside [u,m, ui,M], we have uR E [Ui,m, Ui,MI C R. Thus, for 'R and Vi, a, - Aa- - C A 'xi[O] <u < a - Aaj - C A "xj[O] -<D <5 ai - C Ai x[0] ai - CA 'x[O] IICp" i1 (A.2) (A.3) II ci'i I I< Let u-r; E R be a corresponding input to ui such that a - Aaj < yj[7', uT ] < aj, and then, ai - Aa1 - CiA xi [O] <- ||ci q; Ill <r a, - C A xi [0] < <i iny- (A.4) For the existence of such uT, we must show that u-r; is inside [ui,m, ui,M]. In other words, the proof completes if we can find any uw; that satisfy U-; E [ui,m, u,,M] and (A.4). We prove this by contradiction. Suppose any u-r; satisfying (A.4) is not feasible, that is, wr; < uim or u; > ui,m. If u-; < ui,m, then from (A.4), a, - Ci[A] z <[0] < Ui'M- IICit %,1 Since Di l, we have ICi,'l|| IICj1FT'II because each element of Ca'IT 71 is non-negative and CAi"xi[O] > C.Af x[O] by (A.1). Using (A.3), we have D. a, - CA'x[O] a - CA x[O] This contradicts the fact that up, E [ui,m, ui,M]. The same procedure for the case of w7; > ui,M leads to ul, > ui,M, which contradicts the fact that up, E [ui,m, ui,M]- y (T, u0) Aa ui,M] such that ai - Therefore, there must exist uT corresponding to uWi E [ui,m, ai..5 By the definition of ?(7) in Definition 5.1, P (T) := min,{k E Z>o : y,[k, u,] > # 6 with contraint y,[R] fli and yi [Ti, uf I A.2 ai}, we can obtain the input ur' such that y[-P(T), u']> ai. Relation between Discrete Scheduling Problem and Verification Problem In Chapter 5, the Discrete Scheduling Problem (Problem 5.1) and the corresponding Relaxed Verification Problem (Problem 5.2) are formulated. In this section, we also consider the Verification Problem (Problem 3.1) to see what the answers of the Discrete Scheduling Problem imply. Proposition A.2. If there is no schedule for Problem 5.1, neither is an input u(t) for Problem 5.2. Proof. The condition implies that there exist T E [RT,I)i] and Tj E [Ri, 2)] for i 7 j such that satisfy T7 Pi(T) 5 T and P (T) > Tj, which violates the constraint 7. From Proposition A.1, there are input vectors uj and u, that satisfy a, - Aaj 5 yi[T7, iii] 5 a, and a3 - Aaj 5 y [T, uj] 5 aj, respectively. Since T, T7 and ?,(T7) are integers, we have T <7 < Tj+ 1 72 Pi(T). Now consider the continuous outputs and prove that they are inside the inflated bad set from discretization $ in (5.2). The corresponding continuous input ui(t) to u- is a piecewise constant with ui(t) = ui[k] for t E [kAt, (k + 1)At). Similary, the continuous input u,(t) corresponds to u. At t* = (T7 + !)At, a3 - Aaj + fjy,mAt Since (T7 + -)At < t* < (Pi(7') ai - Aaj + 1 < y,(t*, Uj(t)) a3 + gyy'At. })At, imAt < Ys(t*, u(t)) 1 3 + A3 - 3i9,mAt. These inequalities hold because the output function yi(t) is non-decreasing in time. 9j4,mAt. Then, y,(t*,uj(t)) E (aj - Assume that for all i, A43 are greater than Aaj, 38+ A 43) and y (t*, ui) E (ai - Aai, /i + A#i3). That is, if there is no feasible schedule for Problem 5.1, there always exists t* such that y(t*) E B. This completes 0 the proof. Proposition A.3. If a feasible schedule T for Problem 5.1 exists, then an input u(t) for Problem 3.1 always exists. Proof. For any i Pi(T) # j, if we have R 5 'T for 1 E [R, 7i] and T7 E [R1, Vj], then 7Tj. From Proposition A.1, there are input signals u,(t) and u,(t) as defined in the proof of Proposition A.2. At t* = Pi(7)At, vehicle i exits the intersection by definition of Pi(7), i.e., y (t*, u2(t)) > 3. At the same time, because t* = Pi(T) enter the intersection, i.e., y,(t*, u,(t)) 5 y(TjAt, u) and u,(t) have the vehicles avoid tha bad set B in (3.1). 73 T, vehicle j still does not a3 . This implies that u1(t) 0 74 Appendix B Total modularity of the Schedule Optimization Problem Recall the LP relaxation of the Schedule Optimization Problem: Problem 5.6 [LP relaxation of Problem 5.5] Find a vector T that = (T+, T-)' such n min subject to Vi R<'+ ( , >-) Td, !5 Vi <j, Ti-+>O0 T->O0 We rearrange Problem 5.6 to write it as min{c'TI Vi. : AT 5 b}. Since the objective function is the sum of T+ and Ti- for all i, we have c = (1,1, 75 ... ,1). The constraints can be written as follows: (B.1) T~ < -Rs +,Td, Vi, -;++ T+ - T-! E9 - (T+ -7T-) -Ti+:! Ti, (B.2) Vi, (B.3) -ima - Td,7, +T,,, Vi < j, 0, -:-5 (B.4) 0, Vi. Constraint (B.3) contains (n - 1) inequalities with {(7r,, 7r2), (72 , 7 3 ), .... , (Irn-.1, rn)}To generalize Problem 5.6 by considering preceding vehicles that are y [0] ai - Aaj, we define Po as the maximum process time 'Pi(7) among the vehicles satisfying y[0] - T;) -P + Td,, 1 . ai - Aaj. Thus, we consider an additional inequality -(T+ For the aggregate vectors T+ and T- and for the column vector T* := (T+, T-)', bi for i = {1, 2,3, 4}, respec- these constraints (B.1)-(B.4) can be notated by A.T tively. Notice that A1 = [-InynInxn], A2 A 3 = [L, -L], A 4 = I2nx2n, = [Inxn, -Inxn], where L:= -1 0 0 0 1 -1 0 0 0 1 -1 0 0 --- (B.5) 0 Let bi, denote the jth element of a vector bi for i E {1, 2, 3,4}. Then, for j E n}, bij = -Rr + Td,rj, b2j = 76 hr, - , {1, ... and b3,1 = -PO + Td,,i,, b3, = - - Td,7 ..1_ + Td,,, for j E {2, ... , n}, b 4 , = 0, for j E {1, ... , 2n}. Notice that for all i E {1, 2, 3, 4}, A. are integral matrices with elements of 1,0,or -1, and bi are integral vectors. To prove that the aggregate matrix A = [Ai; A 2 ; A 3 ; A 4 ] is totally modular, we employ the following proposition from [20]. Proposition B.1. Let A be a totally unimodularmatrix. Then the following matrices are all totally unimodular: -A, AT, [A,I], [A,-A]. By virtue of Proposition B.1, we can confirm that if L is totally unimodular, then A is totally unimodular. This is because a totally unimodular matrix L leads sequentially [I; L], [-I; I; L], and then [-I, I; I, -I; L, -L] to be totally unimodular. Therefore, A becomes a totally unimodular matrix. Lemma B.1. The square matrix L is a totally unimodularmatrix. Proof. From (B.5), notice that L has -1 on the diagonal and 1 on the subdiagonal. The other elements are 0. Thus, for any submatrix of L is always a triangular matrix. Since all elements in L are either 1, -1, or 0, any subdeterminant of L is 1, -1, or 0. 0 Therefore, given the optimization problem min{c'T* : AT ; b}, which is equiv- alent to Problem 5.6, we confirm that the matrix A is totally unimodular, and the vectors b and c are integral. 77 78 Bibliography [1] ITS Strategic research plan 2010-2014. http: //www. its. dot. gov/strategic_ plan2010_2014/, 2008. [2] National Motor Vehicle Crash Causation Survey. http: //www-nrd. nhtsa. dot. gov/Pubs/811059.pdf, 2008. [3] Luis Alvarez and Roberto Horowitz. Analysis and verification of the PATH AHS coordination-regulation layers hybrid system. In Proceedings of American Control Conference, pages 2460-2461, 1997. [4] Sterling J. Anderson, Steven C. Peters, Tom E. Pilutti, and Karl Iagnemma. An optimal-control-based framework for trajectory planning, threat assessment, and semi-autonomous control of passenger vehicles in hazard avoidance scenarios. International Journal of Vehicle Autonomous Systems, 8(2):190-216, January 2010. [5] Georges S. Aoude, Vishnu R. Desaraju, Lauren H. Stephens, and Jonathan P. How. Driver behavior classification at intersections and validation on large naturalistic data set. IEEE Transactions on Intelligent Trunsportation Systems, 13(2):724-736, 2012. [6] Lubomr Bakule. Decentralized control: An overview. Annual Reviews in Control, 32:87-98, 2008. [7] Dimitri P. Bertsekas. Dynamic programming and suboptimal control: A survey from ADP to MPC*. European Journal of Control, 11(45):310-334, 2005. [8] Mattias Brannstrom, Erik Coelingh, and Jonas Sjoberg. Model-based threat assessment for avoiding arbitrary vehicle collisions. IEEE Transactions on Intelligent TransportationSystems, 11:658-669, 2010. [9] Leonardo Bruni, Alessandro Colombo, and Domitilla Del Vecchio. Robust multiagent collision avoidance through scheduling. In Proceedingsof IEEE Conference on Decision and Control, 2013. [10] Alessandro Colombo and Domitilla Del Vecchio. Efficient algorithms for collision avoidance at intersections. In Proceedings of the 15th ACM international conference on Hybrid Systems: Computation and Control, pages 145-154, 2012. 79 [11] Richard Walter Conway, William Laughlin Maxwell, and Louis Weber Miller. Theory of Scheduling. Courier Dover Publications, 2003. [12] Thomas H. Cormen. Introduction To Algorithms. MIT Press, 2001. [13] Vijay Gadepally, Ashok Krishnamurthy, and Umit Ozguner. A framework for estimating driver decisions near intersections. IEEE Transactions on Intelligent TransportationSystems, 15(2):637-646, April 2014. [14] M. R. Garey, D. S. Johnson, B. B. Simons, and R. E. Tarjan. Scheduling UnitTime tasks with arbitrary release times and deadlines. SIAM Journal on Computing, 10:256-269, 1981. [15] John J. Kanet and V. Sridharan. Scheduling with inserted idle time: Problem taxonomy and literature review. Operations Research, 48:99-110, 2000. [16] Hemant Kowshik, Derek Caveney, and P.R. Kumar. Provable systemwide safety in intelligent intersections. IEEE Transactions on Vehicular Technology, 60:804818, 2011. [17] Joyoung Lee and Byungkyu Park. Development and evaluation of a cooperative vehicle intersection control algorithm under the connected vehicles environment. IEEE Transactions on Intelligent TransportationSystems, 13:81-90, 2012. [18] J.K. Lenstra, A.H.G. Rinnooy Kan, and P. Brucker. Complexity of machine scheduling problems. Annals of Discrete Mathematics, 1:343-362, 1977. [19] John Markoff. A trip in a self-driving car now seems routine. The New York Times, May 13 2014. from http://bits.blogs.nytimes.com/2014/05/13/ a-trip-in-a-self -driving-car-now-seems-routine. [20] Alexander Schrijver. Theory of Linear and Integer Programming. Wiley, June 1998. [21] Barbara Simons. A fast algorithm for single processor scheduling. In 19th Annual Symposium on Foundations of Computer Science, pages 246-252, 1978. [22] Lai Tu and Chung-Ming Huang. Forwards: A map-free intersection collisionwarning system for all road patterns. IEEE Transactions on Vehicular Technology, 59:3233-3248, 2010. [23] Ram Vasudevan, Victor Shia, Yiqi Gao, Ricardo Cervera-Navarro, Ruzena Bajcsy, and Francesco Borrelli. Safe semi-autonomous control with enhanced driver modeling. In Proceedings of American Control Conference, pages 2896-2903, June 2012. [24] Jay Yarow. Here's the problem with self-driving cars becoming a mainstream reality. Business Insider, May 17 2014. from http: //www.businessinsider. com/will-self-driving-cars-ever-be-a-mainstream-reality-2014-5. 80