# Safety Control for Satellite Formation Flying via High-Order Control Barrier Functions
## 4 Simulation Results  
This section provides the simulation results to show the effectiveness of the proposed safety control scheme. Comparisons with the PD control and model predictive control (MPC) methods without using control barrier functions are also given to illustrate the necessity of considering safety constraints. This section verifies the effectiveness of the satellite formation flight safety control method proposed in this paper through computer simulations and demonstrates the advantages of our method by comparing it with the PD control and model predictive control (MPC) methods without using control barrier functions. In the simulations, the orbital radius is assumed to be 8000 km, and on the basis of this, the constant orbital angular velocity of the parent satellite can be calculated using the gravitational constant of the Earth. The parameters of the PD controller are as follows. \[K_{p1} = 0.07,\ K_{d1}=0.1,\] \[K_{p2} = 0.05,\ K_{d2}=0.2,\] \[K_{p3} = 0.04,\ K_{d3}=0.2.\]  
For the parameters used in MPC, the values of the diagnose weighting matrices \(Q\) and \(R\) are set, respectively, as 0.2 and 0.1. The constraints of the control inputs belong to \([-5,\ 5]\), and the horizon is set as 2. The initial conditions are set the same as those in PD and safety control. The initial relative positions and velocities of the reference satellite and the accompanying satellite are stochastically chosen from an interval, that is, \(x_{1}\), \(x_{3}\), and \(x_{5}\in[10\ 100]\), and \(x_{2}\), \(x_{4}\), and \(x_{6}\in[0\ 1]\). The parameters \(\imath_{j}\ (j=1,2,3)\) are set to 10, which denotes the dimensions of the satellite. In this case, the relative positions \(x_{1}\), \(x_{3}\), and \(x_{5}\) should be greater than 10 to satisfy the safety constraint. To begin with, three simulations were conducted using the traditional PD controller. The initial conditions were chosen from the intervals mentioned above. Figures 2, 3, and 4 depict the response curves of relative positions during satellite formation flying based on PD control, respectively. Figures 5-7 present the corresponding response curves of the control inputs under the initial conditions. The state trajectories shown in these figures indicate that, although theoretically the PD controller can guarantee stability, during the process of approaching stability, there are instances where the position variables fall below a safe distance, resulting in collisions between satellites. This leads to the inability to ensure the safety of the satellites during formation flying. These simulation results show that it is necessary to design a safety control scheme for satellite formation flying. Figure 4: The relative position responses under the third stochastic initial condition: PD controller. Figure 3: The relative position responses under the second stochastic initial condition: PD controller. Figure 2: The relative position responses under the first stochastic initial condition: PD controller. Figure 5: The PD controller responses under the first stochastic initial condition. Figure 6: The PD controller responses under the second stochastic initial condition. Figure 7: The PD controller responses under the third stochastic initial condition. Figure 11: The MPC controller responses under the first stochastic initial condition. \[K_{p2} = 0.05,\ K_{d2}=0.2,\]0 The MPC controller responses under the second stochastic initial condition. \[K_{p2} = 0.05,\ K_{d2}=0.2,\]1 The relative position responses under the third stochastic initial condition: MPC controller. Subsequently, the safety-critical controller proposed in this work is implemented to rigorously validate its efficacy. To ensure a fair comparative analysis, identical initial conditions to those in the preceding PD and MPC simulations are adopted. A baseline PD controller, pre-designed for stability assurance, serves as the benchmark for performance evaluation.