# Generating Low-Earth Orbit Satellite Attitude Maneuver Profiles Using Deep Neural Networks
## 3 Proposed Technique for Generating Attitude Reference Profiles
The cost function for selecting the optimal network and parameters for training was designed to minimize the error of the time-series prediction results during the maneuver period, as indicated by  
\[cost\;funtion\;for\;training=\sqrt{\frac{1}{n}\sum\Bigl{(}Q_{verification}-Q_{ Prediction}\Bigr{)}^{2}}, \tag{35}\]  
where \(Q_{verification}\) is the reference quaternions of the verification dataset, n is the number of the verification quaternions data, and \(Q_{Prediction}\) is the predicted quaternion values of the DNN model. The selection factors for the network and parameters used to model the quaternion include the number of bidirectional long short-term memory (bi-LSTM) layers, number of hidden units for each bi-LSTM, maximum epoch number, mini-batch size, initial learning rate, drop rates of the first and last drop-out layers, and frequency of the feature data [28; 29; 30]. As the reverse order of time-series data is also meaningful, learning using bi-LSTM was used because of its high prediction accuracy of time-series data [31; 32]. Next, the frequency of the feature data was chosen as the selection factor for optimization. If the frequency of each feature data is too dense, training can become time-consuming, and overfitting may occur. Conversely, if the frequency is extremely low, the accuracy of the training model may decrease. The factors for developing the network were selected using a genetic algorithm (GA) to modify each parameter and find the DNN that minimized the cost function within a specified number of iterations (in this case, 500). The DNN architecture determined using the GA is shown in Figure 4.  
Figure 3: Training process for quaternion prediction of maneuvering duration. The process proposed for generating the maneuver profile of an LEO satellite between its target pointings was performed in two stages. In the first stage, an initial guess for the profile was obtained for optimization. The satellite's position, velocity, relative angle, angular rate difference to the target point, and quaternion at the start of the maneuver were fed to the pretrained DNN to output the next point's quaternion. Then, the next point's position, velocity, relative angle, angular rate difference to the target point, and the generated quaternion were sent as current information to predict the quaternion of the next point. This process was repeated to predict the quaternion until the next target pointing's starting point was reached. The aim of this process was to reproduce the quaternion from the initial point to the final point of the maneuver. The predicted quaternion values were then converted into angular accelerations and time profiles for each axis, which were uploaded to the LEO satellite via Euler angle transformation and differentiation. In the second stage, the angular acceleration and time profiles of each axis obtained as initial guesses in the first stage were used for optimization. The cost function for this optimization process utilized the quaternion at the end of the generated profile, maneuver time, and angular rate error. The comparison point of the cost function affected the final performance. If the calculation point of the cost function is set as the initial target pointing of the mission, errors may occur at the beginning of the mission, requiring additional time for stabilization depending on the attitude control. Therefore, \(t_{7}\) in Figure 2 was selected as the calculation point for the cost function to secure additional stabilization time for optimization. As shown in Figure 2, the generated profile only has angular acceleration values up to \(t_{7}\).