# Trajectory Planning with Time-Variant Safety Margin for Autonomous Vehicle Lane Change +
## 2 Methodology
### Trajectory Planning with Time Variant Safety Margin
#### 2.2.2 Supplementary Longitudinal Constraints  
During the lane change, the traffic states is in a dynamic and ongoing process. In addition to the predefined constraints of host vehicle in Equation (12), a supplementary dynamic constraints is proposed for the trajectory planning. In the time-varying traffic flow, a safety margin concept with the dynamic constraints is employed to improve the lane changing control effect. In this part, the calculation of the supplementary constraints used in longitudinal trajectory planning is investigated. The longitudinal position constraint sequence \(x_{min}\) and \(x_{max}\) are defined for the host vehicle \(V_{H}\). These constraints are sequences made up of the lower and upper boundary of current and target lane safe region intersection at each time instance within the planning horizon. From the Figure 4, the horizontal axis is the discrete time sequence \(k\), \(k_{fin}\) is the finished time instance of lane change, and \(k_{end}\) is end time instance of planning horizon. The vertical axis represents the longitudinal displacement of the host vehicle \(V_{H}\) during the lane change. The yellow colored region is the safe zone of \(V_{H}\) with respect to time, and its boundaries are determined by \(x_{min}\) and \(x_{max}\). Since the safe region intersection of the current and target lane, constraint sequence \(x_{min}\) and \(x_{max}\) are given by  
\[x_{min}\left(k\right) =\begin{cases}\max\left[x_{min}^{t}\left(k\right),x_{min}^{s} \left(k\right)\right],\;  
where \(x_{min}^{t}\) and \(x_{max}^{t}\) are constraints determined by the gap on the target lane, while \(x_{min}^{s}\) and \(x_{max}^{s}\) are their counterparts on the current lane. Calculation method is the same for \(x_{min}^{t}\), \(x_{max}^{t}\) and \(x_{min}^{s}\), \(x_{max}^{s}\), so we use \(x_{min}^{g}\), \(x_{max}^{g}\) to refer to either of them:  
\[ \begin{split} x_{min}^{g}\left(k\right)&=x_{R}\left( k\right)+s_{R}^{t}\left(k\right)+s_{R}^{a}\left(k\right)\\ x_{max}^{g}\left(k\right)&=x_{F}\left(k\right)-s_ {F}^{t}\left(k\right)-s_{F}^{a}\left(k\right)\end{split}  \tag{15}\]  
where \(x_{R}\) is the head position sequence of following vehicle and \(x_{F}\) is the tail position sequence of leading vehicle. An illustration of the longitudinal constraint sequence during the lane change is shown in Figure 5.  
\(s_{R}^{t}\) and \(s_{F}^{t}\) are safety margins related to vehicle speed, which are calculated by  
\[ \begin{split} s_{R}^{t}(k)&=v_{R}\left(k\right)t_{g }+d_{x}+L\\ s_{F}^{t}(k)&=min\left[vx_{max},v_{F}(k)\right]t_{g }+d_{x}+L\end{split}  \tag{16}\]  
where \(v_{R}\) and \(v_{F}\) are the speeds of following and leading vehicle; \(t_{g}\) is a desired time gap for two vehicles; \(d_{x}\) is the minimal safe distance between \(V_{H}\) and other vehicle; and \(L\) is the length of vehicle. Here, setting \(t_{g}\) too small (resulting in small safety margin and loose constraint) may cause frequent trajectory invalidation due to even minor unexpected traffic vehicle movement, while doing the contrary raises the size requirement for valid gaps, thereby wasting potential LC opportunities. We thus introduce additional safety margins \(s_{R}^{a}\) and \(s_{F}^{a}\), which start small, then monotonically increases towards the end of the planning horizon, corresponding to the rise of traffic vehicles movement uncertainty with respect to time. For simplicity, we define the new time-variant safety margin as  
\[ \begin{split} s_{F}^{a}(k)&=\left(k-1\right)K_{F} \\ s_{R}^{a}(k)&=\left(k-1\right)K_{R}\end{split}  \tag{17}\]  
With this simple linear relationship, we can conveniently use parameters \(K_{F}\) and \(K_{R}\) to adjust the size of \(s_{R}^{a}\) and \(s_{F}^{a}\). A larger \(K_{F}\) and \(K_{R}\) sets larger safety margins around traffic vehicles, which brings a higher success rate for the lane change, but also more conservative trajectory planning. Conversely, a smaller \(K_{F}\) and \(K_{R}\) can bring more aggressive trajectory planning.