# Truck Platoon Control Considering Heterogeneous Vehicles
## 4 MATLAB Simulations  
MATLAB simulations are presented to verify the proposed control laws. The initial speed of every heterogeneous truck is zero. (1) is used to model the motion of every truck.  
The simulation settings are as follows. As a method to simulate localization error in the waypoints, we added i.i.d. Gaussian noise with mean 0 and standard deviation 0.01 (m) to each element in every waypoint. This error is associated to GPS error which exists in practice.  
Recall that a truck \(p^{i}\) needs to access \(D_{k}^{i-1,i}\) and \(s_{k}^{i-1}\) in order to derive \(r_{k}^{i}\) in (10). A truck accesses these values using local sensors, such as radar or lidar, or local communication with \(p^{i-1}\). Considering noise in local distance measurements, we added i.i.d. Gaussian noise with mean 0 and standard deviation 0.01 (m) to \(D_{k}^{i-1,i}\). Additionally, we added i.i.d. Gaussian noise with mean 0 and standard deviation 0.001 (m/s) to speed measurements in \(s_{k}^{i-1}\).  
In simulations, the following variables are used. The time delay bound is \(t_{d}=0.01\), and the sampling interval is \(T=0.5\) (s). The maximum steering angle is \(\delta_{M}^{i}=30\) degrees. For all \(i\in\{1,2,\dots,N\}\), the maximum speed \(s_{M}^{i}\) is 80 km/h.  
Initially, five trucks are located at \([0,3]\),\([-0.001,3]\), \([-0.002,3]\),\([-0.003,3]\),\([-0.004,3]\) in km. The speed of every truck is 0 initially.  
Heterogeneous trucks are simulated as follows. In the case where \(mod(j,3)\) is 0, \(L^{j}=10\) (m). In addition, \(a_{A}^{j}=1.5\) m/s\({}^{2}\) and \(a_{D}^{j}=2\) m/s\({}^{2}\). In the case where \(mod(j,3)\) is 1, \(L^{j}=5\) (m). Additionally, \(a_{A}^{j}=1\) m/s\({}^{2}\) and \(a_{D}^{j}=2\) m/s\({}^{2}\). In the case where \(mod(j,3)\) is 2, \(L^{j}=3\) (m). In addition, \(a_{A}^{j}=2\) m/s\({}^{2}\) and \(a_{D}^{j}=2\) m/s\({}^{2}\). Using (4), each truck with distinct length has distinct maximum yaw rate. In this way, we consider heterogeneous trucks composed of various kinds of trucks.  
In practice, the leader is controlled by a trained truck driver. In simulations, the leader truck follows one lane initially. Simulations also handle the case where the leader changes its lane to avoid obstacles.  
The leader increases its speed with the maximum acceleration \(a_{A}^{1}\) until the speed reaches 80 km/h. Then, the leader maintains its speed as 80 km/h using ACC. After the leader moves for 16 min, the scenario ends.  
Figure 2a shows the lanes that the trucks follow. In addition, Figure 2b shows the trajectory of every truck.  
Figure 2: (**a**) The lanes that the trucks follow. In addition, (**b**) shows the trajectory of every truck.  
Figure 3 shows the enlarged figure of Figure 2a. Waypoints of the leader are shown with red circles. Simulations handle the case where the leader changes its lane to avoid obstacles. See that waypoints jump from one lane to another. The jump is marked with an arrow in this figure.  
Figure 4 shows the speed of each heterogeneous truck with respect to time(sec). \(\gamma=1.01\) is used. The speed of every truck converges to the speed of the leader (truck 1) as time goes on. Due to the noise in the system, the truck speed is also noisy.  
Figure 5 shows the separation between every neighboring truck. Initially, the separation between neighboring trucks increases. However, the separation converges to the desired separation as time goes on. An overshoot (marked with arrow in Figure 5) happens at the moment when the truck changes its lane. See Figure 3 for the moment when the truck changes its lane.  
Figure 4: \(\gamma=1.01\) is used. The speed of every truck converges to the speed of the leader as time goes on. Due to the noise in the system, the truck speed is also noisy.  
Figure 3: This figure shows the enlarged figure of Figure 2a. Waypoints of the leader are shown with red circles. Simulations handle the case where the leader changes its lane to avoid obstacles. See that waypoints jump from one lane to another. The jump is marked with an arrow in this figure.