# Staring Imaging Real-Time Optimal Control Based on Neural Network

Authors: Peiyun Li; Yunfeng Dong; Hongjue Li
Journal: International Journal of Aerospace Engineering
 (2020)

---

## Abstract

In this paper, a real-time optimal attitude controller is designed for staring imaging, and the output command is based on future prediction. First, the mathematical model of staring imaging is established. Then, the structure of the optimal attitude controller is designed. The controller consists of a preprocessing algorithm and a neural network. Constructing the neural network requires training samples generated by optimization. The objective function in the optimization method takes the future control effect into account. The neural network is trained after sample creation to achieve real-time optimal control. Compared with the PID (proportional-integral-derivative) controller with the best combination of parameters, the neural network controller achieves better attitude pointing accuracy and pointing stability.


---

## Body

## 1. Introduction

Staring mode of satellites can be used to collect the dynamic information of ground targets. Emergency rescue, airport, and traffic monitoring are all cases where staring imaging is more advantageous than conventional modes.The optical axis of the camera is required to point fixedly to the ground target in the process of staring imaging. Thus, the attitude controller should run in a three-axis mode. Imaging quality is closely related to attitude control performance which is affected by the control strategy.Control laws in analytical type are widely applied in attitude controllers for staring imaging. In those analytical control laws, one-step decision is usually considered instead of long-term planning. Lian proposed two different calculation methods of the desired angular velocity for staring imaging [1]. Zhang designed the control strategy under the condition that the target error can be detected, and that the actuator acts with delay [2]. Cui designed a PD adaptive controller for multiobjective staring imaging [3]. Zhang designed a controller to observe spatial cooperative targets [4].Staring imaging is one application of attitude tracking control. For the more general tracking control problem, one-step decision instead of long-term planning is also the main concern. Wu [5] designed a combined control strategy consisting of a saturation controller for spatial motion targets and proposed a backstepping controller using multiexecuting mechanism control. Leonard designed a control law to monitor space debris [6]. An adaptive fault-tolerant controller with backstepping control is designed by Hu for attitude tracking control problems of rigid spacecraft under unknown but constant inertial parameters, unexpected disturbances, and faults under actuators or saturation [7]. Lu proposed an FNTSM control law with finite time control [8]. Pong designed a control law to achieve spacecraft pointing in a specified direction [9]. Wu implemented attitude tracking control based on iterative learning [10].Recently, neural networks are mainly applied to the following three aspects in aerospace guidance and control.First, neural networks are used to accelerate some evolutionary algorithms in aerospace. Cassioli et al. [11] applied SVMs (support vector machines) to improve initial guesses for some trajectory problems in the GTOP (global trajectory optimization problem) database. Basu et al. [12] deployed a neural network to set initial conditions for the PSO (particle swarm optimization), which reduced the planning time of reorientation for a space telescope.Another application of neural networks is real-time trajectory planning. Izzo et al. [13] trained a DNN (deep neural network) to design optimal interplanetary trajectories. Furfaro et al. [14] designed neural networks based on LSTM (long short-term memory) to generate optimal trajectories for planetary landing tasks.Neural networks are also directly used in aerospace controllers. Zou [15] proposed a scheme for limited time attitude tracking control of spacecraft using the terminal sliding mode and Chebyshev neural network. Biggs and Fournier [16] trained MLP to optimize the thruster application scheme to control the attitude of a 12 U CubeSat. CNNs (convolutional neural networks) have shown superior performance in the image classification, and they are also used as control networks. Furfaro et al. [17] designed a CNN to process simulated moon images and generate landing control commands in the simulation of a 2D environment.Different from traditional control methods, the optimal control method proposed in this paper seeks the optimal control command sequence for a period of time in the future. The beginning of the command sequence is the current optimal control decision. However, the optimal control method requires iterative calculation, which consumes high computational resources and is not a real-time control method. Thus, the optimal control method is used to create training samples where the relationship between input and output is contained. Finally, the neural network is trained to achieve optimal control and real-time control simultaneously.The main contributions of this paper are stated as follows.(i)
In the aspect of staring imaging, a controller which considers a future period of time and makes the optimal control decision is proposed, and it performs better than the traditional controller(ii)
An algorithm for compressing the satellite state information is proposed. The state information consists of current dynamics of the satellite as well as the desired sequence of the future angle and angular velocity. After compression, only 12 scalars are prepared as the input of the neural networkThis paper is organized as follows. Section2 states the staring imaging problem of the spacecraft system. The structure of the real-time optimal controller for staring imaging is designed in Section 3. In Section 4, auxiliary parts of the controller are designed. In Sections 5 and 6, the training sample set is generated, and the neural network in the controller is constructed, respectively. Simulation results are provided in Section 7. Finally, conclusions are given in Section 8.


## 2. Problem Formulation

### 2.1. Definition of the Coordinate System

Inertial frameSiOxiyizi: its origin is located at the mass center of the Earth. The xi axis points from the Earth towards the vernal equinox. The zi axis is along the Earth rotation axis. The yi axis is determined by the right-hand rule.Satellite body frameSbOxbybzb: its origin is located at the mass center of the satellite. xb, yb, and zb axes lie along the corresponding principal axes of the satellite.Desired satellite body frameSdOxdydzd: it is used for describing the desired attitude of the satellite. Its three axes lie along xb, yb, and zb when the satellite is located at the desired attitude.Orbital reference frameSoOxoyozo: its origin is located at the mass center of the satellite. The yo axis is along the antisymmetric direction of the orbit momentum. The zo axis points to the Earth center. The xo axis is determined by the right-hand rule.


### 2.2. Kinematic and Dynamic Equations

The satellite is considered as a rigid body equipped with 3 reaction wheels installed orthogonally along the three axes of the satellite body frame. The camera is fixed to the satellite, and its optical axis lies along thezb axis of the satellite body frame.The mathematical model contains orbit and attitude constraints, both of which are described by kinematic and dynamic equations. The orbital kinematic equation in the inertial frame is given by(1)Ṙs=Vs,where Rs∈ℝ3×1 is the satellite position and Vs∈ℝ3×1 is the satellite velocity.The orbital dynamic equation in the inertial frame is(2)V̇s=−μRs3Rs,where μ is the product of the gravitational constant and the mass of the Earth.The attitude kinematic equation ([18], pp. 344) is defined using quaternions
(3)q̇1q̇2q̇3q̇4=120ωbz−ωbyωbx−ωbz0ωbxωbyωby−ωbx0ωbz−ωbx−ωby−ωbz0q1q2q3q4,where q=q1q2q3q4T=qvq4T is the quaternion denoting the rotation from the inertial frame Si to the satellite body frame Sb. qv=q1q2q3T is the vector part, and q4 is the scalar part. ωb=ωbxωbyωbzT is the angular velocity vector of the satellite body frame Sb with respect to the inertial frame Si. It can also be expressed in terms of basis vectors of Sb as ωb=ωbxxb+ωbyyb+ωbzzb.The attitude dynamics equation is(4)Iω̇b+ωb×Iωb+ωb×IwΩw=Mc+Mext,where I∈ℝ3×3 is the inertia tensor of the whole satellite.
(5)I=Ix−Ixy−Ixz−IxyIy−Iyz−Ixz−IyzIz.Iw∈ℝ3×3 is the inertia tensor of the 3 reaction wheels. Ωw∈ℝ3×1 is the angular velocity of the 3 reaction wheels relative to the satellite body. Mc∈ℝ3×1 is the control torque generated by reaction wheels. Mext∈ℝ3×1 is the external disturbance torque.


### 2.3. Attitude Control Effect Evaluation

As illustrated in Figure1, Timg is the imaging time interval, and timgi (i =1, 2, 3…) is the instant when image i is taken. Imaging quality has a close relationship with the nearby attitude control effect. For example, the image taken in timg2 is affected by the attitude control effect during [timg2−Timg/2, timg2+Timg/2].Figure 1
Imaging time interval and imaging instants.Thus, two steps are designed to properly evaluate the attitude control effect for the whole task of staring imaging. First, the attitude control effects nearby each image are evaluated, respectively, (i.e., the attitude control effect nearby imagei is evaluated based on the angle and angular velocity within [timgi−Timg/2,timgi+Timg/2]). Then, the average value of those effects is obtained for evaluating the whole task.Pointing accuracy and stability are the two major categories that the payload attitude control requirements fall into [19]. Therefore, mean pointing error [20] and rate error [19] are included in the attitude control effect evaluation. Assuming that the number of all images is m, the pointing accuracy JA is proposed in Eq. (6), the pointing stability Jω is proposed in Eq. (7), and the control effect of the whole task is obtained by Eq. (8).
(6)JA=13mp+1∑i=1m∑j=13∑k=1p+1Aeseqj,k.In Eq. (6), symbol  means getting the absolute value of the variable within. p is the number of simulation steps during [timgi−Timg/2, timgi+Timg/2], and Aeseq∈ℝ3×p+1 is the Euler angle error sequence during that time. Aeseqj,k is the element in row j and column k of the matrix Aeseq. The column k in the matrix Aeseq is denoted as Aeseqk∈ℝ3×1, and the Euler angle error vector Aeseqk=φe,θe,ψeT represents the rotation from the desired satellite body frame to the real satellite body frame, with the order 3-1-2 (i.e., ψe−φe−θe). Other Euler angles defined in this paper share the same method of rotation (ψe−φe−θe) as Aeseqk.
(7)Jω=13mp+1∑i=1m∑j=13∑k=1p+1ωeseqj,k.In Eq. (7), ωeseq∈ℝ3×p+1 is the angular velocity error sequence during [timgi−Timg/2, timgi+Timg/2], and ωeseqj,k is the element in row j and column k of matrix ωeseq. The column k in matrix ωeseq is denoted as ωeseqk∈ℝ3×1, and the angular velocity error vector ωeseqk=ωb−ωd represents the difference between the real angular velocity ωb∈ℝ3×1 (in the satellite body frame) and the desired angular velocity ωd∈ℝ3×1 (in the desired satellite body frame).
(8)J=k1⋅JA+k2⋅Jω.In Eq. (8), k1 and k2 are the weights of each term.


## 2.1. Definition of the Coordinate System

Inertial frameSiOxiyizi: its origin is located at the mass center of the Earth. The xi axis points from the Earth towards the vernal equinox. The zi axis is along the Earth rotation axis. The yi axis is determined by the right-hand rule.Satellite body frameSbOxbybzb: its origin is located at the mass center of the satellite. xb, yb, and zb axes lie along the corresponding principal axes of the satellite.Desired satellite body frameSdOxdydzd: it is used for describing the desired attitude of the satellite. Its three axes lie along xb, yb, and zb when the satellite is located at the desired attitude.Orbital reference frameSoOxoyozo: its origin is located at the mass center of the satellite. The yo axis is along the antisymmetric direction of the orbit momentum. The zo axis points to the Earth center. The xo axis is determined by the right-hand rule.


## 2.2. Kinematic and Dynamic Equations

The satellite is considered as a rigid body equipped with 3 reaction wheels installed orthogonally along the three axes of the satellite body frame. The camera is fixed to the satellite, and its optical axis lies along thezb axis of the satellite body frame.The mathematical model contains orbit and attitude constraints, both of which are described by kinematic and dynamic equations. The orbital kinematic equation in the inertial frame is given by(1)Ṙs=Vs,where Rs∈ℝ3×1 is the satellite position and Vs∈ℝ3×1 is the satellite velocity.The orbital dynamic equation in the inertial frame is(2)V̇s=−μRs3Rs,where μ is the product of the gravitational constant and the mass of the Earth.The attitude kinematic equation ([18], pp. 344) is defined using quaternions
(3)q̇1q̇2q̇3q̇4=120ωbz−ωbyωbx−ωbz0ωbxωbyωby−ωbx0ωbz−ωbx−ωby−ωbz0q1q2q3q4,where q=q1q2q3q4T=qvq4T is the quaternion denoting the rotation from the inertial frame Si to the satellite body frame Sb. qv=q1q2q3T is the vector part, and q4 is the scalar part. ωb=ωbxωbyωbzT is the angular velocity vector of the satellite body frame Sb with respect to the inertial frame Si. It can also be expressed in terms of basis vectors of Sb as ωb=ωbxxb+ωbyyb+ωbzzb.The attitude dynamics equation is(4)Iω̇b+ωb×Iωb+ωb×IwΩw=Mc+Mext,where I∈ℝ3×3 is the inertia tensor of the whole satellite.
(5)I=Ix−Ixy−Ixz−IxyIy−Iyz−Ixz−IyzIz.Iw∈ℝ3×3 is the inertia tensor of the 3 reaction wheels. Ωw∈ℝ3×1 is the angular velocity of the 3 reaction wheels relative to the satellite body. Mc∈ℝ3×1 is the control torque generated by reaction wheels. Mext∈ℝ3×1 is the external disturbance torque.


## 2.3. Attitude Control Effect Evaluation

As illustrated in Figure1, Timg is the imaging time interval, and timgi (i =1, 2, 3…) is the instant when image i is taken. Imaging quality has a close relationship with the nearby attitude control effect. For example, the image taken in timg2 is affected by the attitude control effect during [timg2−Timg/2, timg2+Timg/2].Figure 1
Imaging time interval and imaging instants.Thus, two steps are designed to properly evaluate the attitude control effect for the whole task of staring imaging. First, the attitude control effects nearby each image are evaluated, respectively, (i.e., the attitude control effect nearby imagei is evaluated based on the angle and angular velocity within [timgi−Timg/2,timgi+Timg/2]). Then, the average value of those effects is obtained for evaluating the whole task.Pointing accuracy and stability are the two major categories that the payload attitude control requirements fall into [19]. Therefore, mean pointing error [20] and rate error [19] are included in the attitude control effect evaluation. Assuming that the number of all images is m, the pointing accuracy JA is proposed in Eq. (6), the pointing stability Jω is proposed in Eq. (7), and the control effect of the whole task is obtained by Eq. (8).
(6)JA=13mp+1∑i=1m∑j=13∑k=1p+1Aeseqj,k.In Eq. (6), symbol  means getting the absolute value of the variable within. p is the number of simulation steps during [timgi−Timg/2, timgi+Timg/2], and Aeseq∈ℝ3×p+1 is the Euler angle error sequence during that time. Aeseqj,k is the element in row j and column k of the matrix Aeseq. The column k in the matrix Aeseq is denoted as Aeseqk∈ℝ3×1, and the Euler angle error vector Aeseqk=φe,θe,ψeT represents the rotation from the desired satellite body frame to the real satellite body frame, with the order 3-1-2 (i.e., ψe−φe−θe). Other Euler angles defined in this paper share the same method of rotation (ψe−φe−θe) as Aeseqk.
(7)Jω=13mp+1∑i=1m∑j=13∑k=1p+1ωeseqj,k.In Eq. (7), ωeseq∈ℝ3×p+1 is the angular velocity error sequence during [timgi−Timg/2, timgi+Timg/2], and ωeseqj,k is the element in row j and column k of matrix ωeseq. The column k in matrix ωeseq is denoted as ωeseqk∈ℝ3×1, and the angular velocity error vector ωeseqk=ωb−ωd represents the difference between the real angular velocity ωb∈ℝ3×1 (in the satellite body frame) and the desired angular velocity ωd∈ℝ3×1 (in the desired satellite body frame).
(8)J=k1⋅JA+k2⋅Jω.In Eq. (8), k1 and k2 are the weights of each term.


## 3. Structure of the Real-Time Optimal Controller

As is shown in the dashed box named “Attitude Controller” in Figure2, six modules are outlined. They are established in the following sections of this paper.Figure 2
The structure of the attitude controller.The modules named “Calculating Staring Imaging Desired Sequence” and “Network Input Preprocessing” are explained in the section named “Auxiliary Parts of the Real-time Optimal Controller.”The modules named “Normalization,” “Neural Network,” and “Anti-normalization” are central parts, which will be explained in two sections of this paper. In order to establish the neural network, the method of creating training samples will be firstly shown in the section named “Sample Creation.” Then, the design of those three modules will be shown in the section named “Learning the Optimal Control Strategy.”The module named the “PID Control Law” is designed in case that the real inputs exceed the designed input range of the neural network. This module only works under big disturbances, and it is tested in “Impulse Response” of “Results and Discussion.” The PID coefficients are shown in Table1.Table 1
The optimal PID coefficient combination.
Coefficientx-axisy-axisz-axisProportional175418Integral000Differential467750The inputs of the controller consist of seven parts, which are current Euler angleAbo∈ℝ3×1 from the star sensor, current angular velocity ωb∈ℝ3×1 from the gyro, target longitude and latitude from telecommand, UTC (coordinated universal time) from the on-board computer, and current Rs∈ℝ3×1 as well as Vs∈ℝ3×1 from GPS (Global Positioning System). Abo represents the rotation from the orbital reference frame to the satellite body frame.The output of the controller is the torque commandMcmd∈ℝ3×1. Reaction wheels receive the torque command and generate the Mc in Eq. (4).


## 4. Auxiliary Parts of the Real-Time Optimal Controller

### 4.1. Calculating Staring Imaging Desired Sequence

The module named “Calculating Staring Imaging Desired Sequence” is used to predict and obtain the future data for the controller. The outputs consist of the desired Euler angle sequenceAdiseq∈ℝ3×n+1 and the desired angular velocity sequence ωdseq∈ℝ3×n+1. n is the number of steps in the simulation to predict the future.Denoteτ as the time taken in a single simulation step. Column j in matrix Adiseq is defined as Adiseqj∈ℝ3×1, and it represents the desired Euler angle (representing the rotation from the inertial frame to the desired satellite body frame) in time τj−1. Column j in matrix ωdseq is defined as ωdseqj∈ℝ3×1, and it represents the desired angular velocity (in the desired satellite body frame) in time τj−1. Adiseq and ωdseq are calculated according to the states of the satellite, and the algorithm is shown in ref. [1].


### 4.2. Network Input Preprocessing

The module named “Network Input Preprocessing” is used to calculate the input for neural network. The inputs consist ofAbo, ωb, Adiseq, and ωdseq, and the outputs consist of ωd∈ℝ3×1, ω̇d∈ℝ3×1, Abd∈ℝ3×1, and ωe∈ℝ3×1.The desired angular velocityωd is the first column in matrix ωdseq.
(9)ωd=ωdseq1.The method of calculating the first derivative of the desired angular velocityω̇d is
(10)ω̇d=ωdseqn−ωdseq1τ⋅n.The Euler angleAbd is obtained by the following steps. First, the satellite current Euler angle Abo is converted [18] to coordinate transformation matrix Lbo∈ℝ3×3 (representing the rotation from So to Sb). The current desired Euler angle Adiseq1 is converted to coordinate transformation matrix Ldi. The coordinate transformation matrix from Si to So is defined as Loi, and it can be obtained [21] according to Rs and Vs. The coordinate transformation matrix from Sd to Sb is obtained by Lbd=Lbo⋅Loi⋅LdiT. Finally, Lbd can be converted toAbd.The current angular velocity error vectorωe=ωb−ωd represents the difference between the angular velocity ωb and the desired angular velocity ωd.


## 4.1. Calculating Staring Imaging Desired Sequence

The module named “Calculating Staring Imaging Desired Sequence” is used to predict and obtain the future data for the controller. The outputs consist of the desired Euler angle sequenceAdiseq∈ℝ3×n+1 and the desired angular velocity sequence ωdseq∈ℝ3×n+1. n is the number of steps in the simulation to predict the future.Denoteτ as the time taken in a single simulation step. Column j in matrix Adiseq is defined as Adiseqj∈ℝ3×1, and it represents the desired Euler angle (representing the rotation from the inertial frame to the desired satellite body frame) in time τj−1. Column j in matrix ωdseq is defined as ωdseqj∈ℝ3×1, and it represents the desired angular velocity (in the desired satellite body frame) in time τj−1. Adiseq and ωdseq are calculated according to the states of the satellite, and the algorithm is shown in ref. [1].


## 4.2. Network Input Preprocessing

The module named “Network Input Preprocessing” is used to calculate the input for neural network. The inputs consist ofAbo, ωb, Adiseq, and ωdseq, and the outputs consist of ωd∈ℝ3×1, ω̇d∈ℝ3×1, Abd∈ℝ3×1, and ωe∈ℝ3×1.The desired angular velocityωd is the first column in matrix ωdseq.
(9)ωd=ωdseq1.The method of calculating the first derivative of the desired angular velocityω̇d is
(10)ω̇d=ωdseqn−ωdseq1τ⋅n.The Euler angleAbd is obtained by the following steps. First, the satellite current Euler angle Abo is converted [18] to coordinate transformation matrix Lbo∈ℝ3×3 (representing the rotation from So to Sb). The current desired Euler angle Adiseq1 is converted to coordinate transformation matrix Ldi. The coordinate transformation matrix from Si to So is defined as Loi, and it can be obtained [21] according to Rs and Vs. The coordinate transformation matrix from Sd to Sb is obtained by Lbd=Lbo⋅Loi⋅LdiT. Finally, Lbd can be converted toAbd.The current angular velocity error vectorωe=ωb−ωd represents the difference between the angular velocity ωb and the desired angular velocity ωd.


## 5. Sample Creation

### 5.1. Structure of the Sample Creation Algorithm

A sample set should be created before the neural networks are trained. The algorithm for creating a sample in the sample set is shown in Figure3.Figure 3
The algorithm of sample creation.To start the algorithm, the interior-point optimizer firstly provides a three-axis zero torque command sequenceMcmdseq∈ℝ3×q, which is the matrix to be optimized in the loop. q is the number of torque commands used in the simulation of the “Attitude Dynamics” module.The inputs of the “Attitude Dynamics” module areMcmdseq as well as the initial values, and the outputs of that module are the Euler angle sequence Abiseq∈ℝ3×n+1 as well as the angular velocity sequence ωbseq∈ℝ3×n+1. n is the number of steps in the simulation.The sample inputSin∈ℝ12×1 is also used for calculating the desired sequence Adiseq∈ℝ3×n+1 and ωdseq∈ℝ3×n+1. The more Abiseq approaches Adiseq and ωbseq approaches ωdseq, the better Mcmdseq is. Finally, Sout∈ℝ3×1 is obtained when the exit condition is met.


### 5.2. Definitions of Sample Input and Output

Each sample is divided into a sample input vectorSin and a sample output vector Sout, and their definitions are
(11)Sin=ωd,ω̇d,Abd,ωeT(12)Sout=McmdThe number of samples should cover the input range of the neural network. The input vectorSin of each sample is created randomly, with the 12 elements selected within the designated input ranges shown in Table 2. The ranges are selected according to the requirement of staring imaging tasks. If the input is out of the designated range, Mcmd will be generated by the PID controller instead of the neural network. This function is tested in the simulation part of this paper. The variables in Table 2 are defined as ωd=ωdx,ωdy,ωdzT, ω̇d=ω̇dx,ω̇dy,ω̇dzT, Abd=φbd,θbd,ψbdT, and ωe=ωex,ωey,ωezT.Table 2
Input range of sample and the neural network.
Sample inputRangeωdx[-0.1, 0.1] °/sωdy[-1.2, 0] °/sωdz[-0.05, 0.05] °/sω̇dx[-0.005, 0.005] °/s2ω̇dy[-0.015, 0.015] °/s2ω̇dz[-0.005, 0.005] °/s2φbd[-0.02, 0.02] °θbd[-0.02, 0.02] °ψbd[-0.02, 0.02] °ωex[-0.004, 0.004] °/sωey[-0.004, 0.004] °/sωez[-0.004, 0.004] °/s


### 5.3. Calculating the Desired Sequence

From the desired angular velocityωd and its first derivative ω̇d at the initial time, the desired angular velocity sequence ωdseq can be generated by
(13)ωdseqj=ωd+τj−1ω̇dj=1,2,⋯,n+1,where τ is the simulation time step and ωdseqj∈ℝ3×1 is the column j in matrix ωdseq.The desired Euler angle sequenceAdiseq∈ℝ3×n+1 is calculated via quaternions. The desired angular velocity sequence ωdseq can be integrated in time to obtain the quaternion sequence qdiseq∈ℝ4×n+1 (denoting the rotation from the inertial frame Si to the desired satellite body frame Sd). The column j in matrix qdiseq∈ℝ4×n+1 is qdiseqj∈ℝ4×1. It is set that the inertial frame coincides with the desired attitude frame at the beginning of the simulation in sample creation. Thus, the quaternion at the initial time is qdiseq1=1,0,0,0T. The following equations are used to calculate the quaternion sequence qdiseq.
(14)q̇diseqj=12Ωωdseqjqdiseqjj=1,2,⋯,n+1,(15)qdiseqj+1=qdiseqj+τ⋅q̇diseqjj=1,2,⋯,n+1,where the function Ωω is defined as
(16)Ωω=0ωz−ωyωx−ωz0ωxωyωy−ωx0ωz−ωx−ωy−ωz0,(17)ω=ωx,ωy,ωzT.The quaternion sequenceqdiseq can be converted to the desired Euler angle sequence Adiseq.


### 5.4. Calculating the Initial Values of Simulation

The desired satellite body frame coincides with the inertial frame at the initial time. Thus, the initial Euler angle of the satellite is(18)Abi=Abd,where Abi denotes the rotation from the inertial frame Si to the satellite body frame Sb.The initial satellite angular velocity in the satellite body frame is(19)ωb=ωe+ωd.


### 5.5. Attitude Dynamics

It has been defined thatq is the number of commands in Mcmdseq∈ℝ3×q, and that n is the number of steps in the simulation. Assuming that T is the time interval between two commands, the relationship between q,T,n, and the simulation time step τ is
(20)qT=nτn=k⋅q,k=1,2,3,⋯,where k is the ratio of T to τ and it is a positive integer.The standard fourth-order Runge-Kutta method is used to calculate the kinematics and dynamics of the satellite. The Euler angle sequenceAbiseq∈ℝ3×n+1 and the angular velocity sequence ωbseq∈ℝ3×n+1 in the whole process are recorded, and they are obtained after the simulation.


### 5.6. Calculating the Objective Function

The objective functionJ (defined in Eq. (8)) is used to evaluate the performance of Mcmdseq. The smaller the objective function is, the better the control performance is.


### 5.7. Interior-Point Optimization

At the beginning of the sample creation for a sample inputSin, the interior-point optimizer creates a three-axis zero torque command sequence Mcmdseq∈ℝ3×q. The objective function J is obtained after the simulation where Mcmdseq is tested. Then, the optimizer makes the judgment according to J. If the exit condition is satisfied, the loop exits. If it is not satisfied, a new Mcmdseq is generated and the optimization continues.The terminal value ofMcmdseq is generated when the loop exits. The sample output Sout is obtained by
(21)Sout=Mcmdseq1,where Mcmdseq1 is the first column of matrix Mcmdseq.


## 5.1. Structure of the Sample Creation Algorithm

A sample set should be created before the neural networks are trained. The algorithm for creating a sample in the sample set is shown in Figure3.Figure 3
The algorithm of sample creation.To start the algorithm, the interior-point optimizer firstly provides a three-axis zero torque command sequenceMcmdseq∈ℝ3×q, which is the matrix to be optimized in the loop. q is the number of torque commands used in the simulation of the “Attitude Dynamics” module.The inputs of the “Attitude Dynamics” module areMcmdseq as well as the initial values, and the outputs of that module are the Euler angle sequence Abiseq∈ℝ3×n+1 as well as the angular velocity sequence ωbseq∈ℝ3×n+1. n is the number of steps in the simulation.The sample inputSin∈ℝ12×1 is also used for calculating the desired sequence Adiseq∈ℝ3×n+1 and ωdseq∈ℝ3×n+1. The more Abiseq approaches Adiseq and ωbseq approaches ωdseq, the better Mcmdseq is. Finally, Sout∈ℝ3×1 is obtained when the exit condition is met.


## 5.2. Definitions of Sample Input and Output

Each sample is divided into a sample input vectorSin and a sample output vector Sout, and their definitions are
(11)Sin=ωd,ω̇d,Abd,ωeT(12)Sout=McmdThe number of samples should cover the input range of the neural network. The input vectorSin of each sample is created randomly, with the 12 elements selected within the designated input ranges shown in Table 2. The ranges are selected according to the requirement of staring imaging tasks. If the input is out of the designated range, Mcmd will be generated by the PID controller instead of the neural network. This function is tested in the simulation part of this paper. The variables in Table 2 are defined as ωd=ωdx,ωdy,ωdzT, ω̇d=ω̇dx,ω̇dy,ω̇dzT, Abd=φbd,θbd,ψbdT, and ωe=ωex,ωey,ωezT.Table 2
Input range of sample and the neural network.
Sample inputRangeωdx[-0.1, 0.1] °/sωdy[-1.2, 0] °/sωdz[-0.05, 0.05] °/sω̇dx[-0.005, 0.005] °/s2ω̇dy[-0.015, 0.015] °/s2ω̇dz[-0.005, 0.005] °/s2φbd[-0.02, 0.02] °θbd[-0.02, 0.02] °ψbd[-0.02, 0.02] °ωex[-0.004, 0.004] °/sωey[-0.004, 0.004] °/sωez[-0.004, 0.004] °/s


## 5.3. Calculating the Desired Sequence

From the desired angular velocityωd and its first derivative ω̇d at the initial time, the desired angular velocity sequence ωdseq can be generated by
(13)ωdseqj=ωd+τj−1ω̇dj=1,2,⋯,n+1,where τ is the simulation time step and ωdseqj∈ℝ3×1 is the column j in matrix ωdseq.The desired Euler angle sequenceAdiseq∈ℝ3×n+1 is calculated via quaternions. The desired angular velocity sequence ωdseq can be integrated in time to obtain the quaternion sequence qdiseq∈ℝ4×n+1 (denoting the rotation from the inertial frame Si to the desired satellite body frame Sd). The column j in matrix qdiseq∈ℝ4×n+1 is qdiseqj∈ℝ4×1. It is set that the inertial frame coincides with the desired attitude frame at the beginning of the simulation in sample creation. Thus, the quaternion at the initial time is qdiseq1=1,0,0,0T. The following equations are used to calculate the quaternion sequence qdiseq.
(14)q̇diseqj=12Ωωdseqjqdiseqjj=1,2,⋯,n+1,(15)qdiseqj+1=qdiseqj+τ⋅q̇diseqjj=1,2,⋯,n+1,where the function Ωω is defined as
(16)Ωω=0ωz−ωyωx−ωz0ωxωyωy−ωx0ωz−ωx−ωy−ωz0,(17)ω=ωx,ωy,ωzT.The quaternion sequenceqdiseq can be converted to the desired Euler angle sequence Adiseq.


## 5.4. Calculating the Initial Values of Simulation

The desired satellite body frame coincides with the inertial frame at the initial time. Thus, the initial Euler angle of the satellite is(18)Abi=Abd,where Abi denotes the rotation from the inertial frame Si to the satellite body frame Sb.The initial satellite angular velocity in the satellite body frame is(19)ωb=ωe+ωd.


## 5.5. Attitude Dynamics

It has been defined thatq is the number of commands in Mcmdseq∈ℝ3×q, and that n is the number of steps in the simulation. Assuming that T is the time interval between two commands, the relationship between q,T,n, and the simulation time step τ is
(20)qT=nτn=k⋅q,k=1,2,3,⋯,where k is the ratio of T to τ and it is a positive integer.The standard fourth-order Runge-Kutta method is used to calculate the kinematics and dynamics of the satellite. The Euler angle sequenceAbiseq∈ℝ3×n+1 and the angular velocity sequence ωbseq∈ℝ3×n+1 in the whole process are recorded, and they are obtained after the simulation.


## 5.6. Calculating the Objective Function

The objective functionJ (defined in Eq. (8)) is used to evaluate the performance of Mcmdseq. The smaller the objective function is, the better the control performance is.


## 5.7. Interior-Point Optimization

At the beginning of the sample creation for a sample inputSin, the interior-point optimizer creates a three-axis zero torque command sequence Mcmdseq∈ℝ3×q. The objective function J is obtained after the simulation where Mcmdseq is tested. Then, the optimizer makes the judgment according to J. If the exit condition is satisfied, the loop exits. If it is not satisfied, a new Mcmdseq is generated and the optimization continues.The terminal value ofMcmdseq is generated when the loop exits. The sample output Sout is obtained by
(21)Sout=Mcmdseq1,where Mcmdseq1 is the first column of matrix Mcmdseq.


## 6. Learning the Optimal Control Strategy

In this section, the neural network, the normalization module, and the antinormalization module in the attitude controller are established, which are the three central parts shown in Figure2. The three modules can be modeled as function N. The algorithms of normalization and antinormalization can be found in ref. [22].
(22)Mz=Nωd,ω̇d,Abd,ωeT.


### 6.1. Division and Normalization of the Sample Set

The whole sample set is divided into two parts, which are the training sample set and the test sample set. 75% of the samples are randomly selected as training samples, and the others are test samples.The training sample set consists of two matrices. One is the sample input matrixItrain∈ℝ12×Ntrain and the other is the corresponding sample output matrix Otrain∈ℝ3×Ntrain. Ntrain is the number of samples in the training sample set. Each row of the two matrices has been normalized to [-1,1] before the training sample set is applied to training neural networks.The test sample set also consists of two matrices. One is the sample input matrixItest∈ℝ12×Ntest, and the other is the corresponding sample output matrix Otest∈ℝ3×Ntest. Ntest is the number of samples in the test sample set. Each row of the two matrices has been normalized to [-1,1] before the test sample set is applied to testing the neural networks.


### 6.2. Training the Neural Networks

The structure of the neural network is inputlayer-feedforwardlayer-feedforwardlayer. The stochastic gradient descent (SGD) algorithm is applied to the training process. In order to reduce overfitting, dropout (the fraction of dropout is set to 0.1) and weight decay (the regularization parameter is set to 0.01) are also applied.Different network structure parameters and training parameters are tested to achieve the best performance. The values of parameters are selected in a linear method and are shown in Table3. All parameter combinations are used in training, and 3876neural networks (3876=4×51×19) are obtained.Table 3
Training parameters.
ParameterValuesTotal number of valuesActivation functionTansig, logsig, sigmoid, relu4Nodes in hidden layer10, 11, 12, …, 6051Training iterations100, 150, 200, …, 100019


### 6.3. Evaluating the Neural Networks

In the process of evaluating a neural network, the output matrixO^test∈ℝ3×Ntest is obtained by
(23)O^testj=NItestjj=1,2,⋯,Ntest,where Itestj∈ℝ12×1 is the column j in matrix Itest∈ℝ12×Ntest and O^testj∈ℝ3×1 is the column j in matrix O^test∈ℝ3×Ntest. Define that Otesti,j is the element in row i and column j of matrix Otest, and that O^testi,j is the element in row i, and column j of matrix O^test. MSE (Mean Squared Error) is defined as
(24)MSE=∑i=13∑j=1NtestO∧testi,j−Otesti,j2.Finally, the neural network with the smallest MSE (0.00011686) is obtained. Its parameters used in training are shown in Table4, and its training process is shown in Figure 4.Table 4
Optimal values of training parameters.
ParameterOptimal valueActivation functionTansigNodes in hidden layer40Training iterations700Figure 4
Training process of the neural network with the minimum MSE.


## 6.1. Division and Normalization of the Sample Set

The whole sample set is divided into two parts, which are the training sample set and the test sample set. 75% of the samples are randomly selected as training samples, and the others are test samples.The training sample set consists of two matrices. One is the sample input matrixItrain∈ℝ12×Ntrain and the other is the corresponding sample output matrix Otrain∈ℝ3×Ntrain. Ntrain is the number of samples in the training sample set. Each row of the two matrices has been normalized to [-1,1] before the training sample set is applied to training neural networks.The test sample set also consists of two matrices. One is the sample input matrixItest∈ℝ12×Ntest, and the other is the corresponding sample output matrix Otest∈ℝ3×Ntest. Ntest is the number of samples in the test sample set. Each row of the two matrices has been normalized to [-1,1] before the test sample set is applied to testing the neural networks.


## 6.2. Training the Neural Networks

The structure of the neural network is inputlayer-feedforwardlayer-feedforwardlayer. The stochastic gradient descent (SGD) algorithm is applied to the training process. In order to reduce overfitting, dropout (the fraction of dropout is set to 0.1) and weight decay (the regularization parameter is set to 0.01) are also applied.Different network structure parameters and training parameters are tested to achieve the best performance. The values of parameters are selected in a linear method and are shown in Table3. All parameter combinations are used in training, and 3876neural networks (3876=4×51×19) are obtained.Table 3
Training parameters.
ParameterValuesTotal number of valuesActivation functionTansig, logsig, sigmoid, relu4Nodes in hidden layer10, 11, 12, …, 6051Training iterations100, 150, 200, …, 100019


## 6.3. Evaluating the Neural Networks

In the process of evaluating a neural network, the output matrixO^test∈ℝ3×Ntest is obtained by
(23)O^testj=NItestjj=1,2,⋯,Ntest,where Itestj∈ℝ12×1 is the column j in matrix Itest∈ℝ12×Ntest and O^testj∈ℝ3×1 is the column j in matrix O^test∈ℝ3×Ntest. Define that Otesti,j is the element in row i and column j of matrix Otest, and that O^testi,j is the element in row i, and column j of matrix O^test. MSE (Mean Squared Error) is defined as
(24)MSE=∑i=13∑j=1NtestO∧testi,j−Otesti,j2.Finally, the neural network with the smallest MSE (0.00011686) is obtained. Its parameters used in training are shown in Table4, and its training process is shown in Figure 4.Table 4
Optimal values of training parameters.
ParameterOptimal valueActivation functionTansigNodes in hidden layer40Training iterations700Figure 4
Training process of the neural network with the minimum MSE.


## 7. Results and Discussion

### 7.1. Simulation Condition Design

The satellite orbit parameters at the initial time are shown in Table5. The initial time is 2017-05-31-04-40-00 (in yyyy-MM-dd-HH-mm-ss format).Table 5
Orbit parameters.
ParameterValueSemimajor axis6878.14 kmEccentricity0Inclination97.3°Ascending node255°Argument of perigee0°True anomaly145°As is shown in Figure5, 100 ground targets are randomly selected in the circle with the center at 120°E 30°N and a radius of 100 km. After all the ground targets are tested, the average performance J¯ is obtained by
(25)J̄=1Ntarget∑i=1NtargetJ,where Ntarget=100 and J is the performance defined in Eq. (8) of a single test.Figure 5
Ground targets randomly selected in the circular range.The average pointing accuracyJ¯A is obtained by
(26)J̄A=1Ntarget∑i=1NtargetJA.The average pointing stabilityJ¯ω is obtained by
(27)J̄ω=1Ntarget∑i=1NtargetJω.Other simulation parameters are defined in Table6.Table 6
Other simulation parameters.
ParameterValueSatellite mass1000 kgInertia tensorIx=797.34, Iy=304.86, Iz=792.48, Ixy=14.3, Ixz=25.1, Iyz=10.5 (kgm2)Star sensor constant error3″Star sensor random error (3σ)3″Gyro constant error0.15°/hGyro random error (1σ)0.15°/hReaction wheels constant error0.01 nmReaction wheels random error (1σ)0.01 nmExternal disturbanceGravitational torque, aerodynamic torque, solar radiation torque and magnetic torque. (modeled according to ref. [23])Initial Euler angleEqual to the desired initial Euler angle for each ground targetInitial angular velocityEqual to the desired initial angular velocity for each ground target


### 7.2. Searching the Optimal Coefficients for the PID Controller

Different combinations of coefficients in the PID controller are tested to achieve its best performance as the baseline for comparison. The coefficients of each axis are optimized, respectively, using the same combinations (12240=60×4×51) defined in Table 7. The Euler angles and angular velocities used in the PID control law are expressed in degrees.Table 7
Combinations of coefficient in PID control.
CoefficientValuesTotal number of valuesProportional1, 2, 3, …, 6060Integral0, 0.01, 0.02, 0.034Differential40, 41, 42, …, 9051All the ground targets defined in Figure5are tested for each coefficient combination, and the average performance J¯ is calculated. Then, the optimal PID coefficient combination is obtained according to Eq. (25) (k1=1 and k2=5, in order to balance the pointing accuracy and the pointing stability).


### 7.3. Performance Comparison of Steady-State Control

The comparison of steady-state control performance between the PID controller and the neural network controller consists of two parts. The first part is testing the condition in which the satellite stares at the central ground target (at 120°E 30°N). Curves of the Euler angle error and angular velocity error are provided. The second part includes testing all the ground targets shown in Figure5and calculating the average performance J¯.


### 7.4. Testing the Central Ground Target

The performances are tested for the neural network controller and the PID controller with the optimal coefficient combination when the satellite stares at the central ground target. The neural network controller performs better than the PID controller according to the results shown in Table8 and the error curves.Table 8
Performances of staring at the central ground target.
ControllerJAJωJ¯ (k1=1 and k2=5)PID controller3.96×10−4°4.23×10−5°/s6.07×10−4Neural network controller2.13×10−4°3.81×10−5°/s4.03×10−4Error curves of the PID controller are shown in Figure6 and Figure 7.Figure 6
Euler angle error of the PID controller with the optimal coefficient combination.Figure 7
Angular velocity error of the PID controller with the optimal coefficient combination.Error curves under the control of neural network are shown in Figures8 and 9.Figure 8
Euler angle error under the control of neural network.Figure 9
Angular velocity error under the control of neural network.


### 7.5. Testing all the Ground Targets

All the ground targets defined in Figure5are tested for the neural network controller and the PID controller with the best coefficient combination. The neural network controller performs better according to the results shown in Table 9.Table 9
Performances of staring at all the ground targets.
ControllerJ¯AJ¯ωJ¯ (k1=1 and k2=5)PID controller3.96×10−4°4.25×10−5°/s6.09×10−4Neural network controller2.13×10−4°3.76×10−5°/s4.01×10−4Figure10 is provided to visualize the performances and excludes the influence of k1 and k2. The x-axis and y-axis denote the pointing accuracy JA and the pointing stability Jω, respectively. The blue points represent the performances of the PID controller on all the ground targets, and the red points represent the performances of the neural network controller.Figure 10
Performance comparison between the PID controller and the neural network controller.


### 7.6. Performance Comparison of the Dynamic Response

#### 7.6.1. Step Response

In order to test the step response, two simulations are executed for each controller and each ground target. One is the normal simulation, and the other is the simulation in which an extra angle measurement error (0.005° to three axes) is added at 30s and later. According to the difference between the two Euler angle sequences, the overshoot, settling time (the error band is±5%), and steady-state error are obtained.The average values of overshoot, settling time, and steady-state error for all the ground targets are shown in Table10 (PID controller) and Table 11 (neural network controller). The Euler angle difference of the two simulations (the satellite stares at 120°E 30°N) are provided in Figure 11 (PID controller) and Figure 12 (neural network controller). The neural network controller shows an advantage over the PID controller on all the three indices (in column “Average of Three Axes”) according to the results.Table 10
Average step response performance of the PID controller for all the ground targets.
Indexx-axisy-axisz-axisAverage of three axesOvershoot13.49%0.97%1.12%5.25%Settling time10.33 s3.67 s8.06 s7.35 sSteady-state error7.34×10−6°4.19×10−7°2.95×10−4°1.24×10−5°Table 11
Average step response performance of the neural network controller for all the ground targets.
Performancex-axisy-axisz-axisAverage of three axesOvershoot2.80%0.001%3.56%2.12%Settling time3.07 s3.42 s2.99 s3.16 sSteady-state error7.13×10−6°5.38×10−8°1.33×10−5°6.83×10−6°Figure 11
Step response of the PID controller when the satellite stares at the central ground target.Figure 12
Step response of the neural network controller when the satellite stares at the central ground target.


### 7.7. Frequency Response

In order to test the frequency response, external periodical torque is applied in the simulation in which the satellite stares at the central ground target. The amplitude of the external periodical torque is 0.03 Nm, and the response of three axes is tested, respectively. Magnitude-frequency characteristic curves of the two controllers are shown in Figure13 (PID controller) and Figure 14 (neural network controller). The amplitude of the neural network controller is higher than that of the PID controller when the frequency is lower than 2 Hz, and the amplitudes are similar when the frequency is higher.Figure 13
Magnitude-frequency characteristic of the PID controller.Figure 14
Magnitude-frequency characteristic of the neural network controller.


### 7.8. Impulse Response

A big disturbance is applied to the system under the control of the neural network in order to test the stability of the system (the satellite stares at 120°E 30°N). The disturbance starts at 30s and lasts for 0.5 s, and its amplitudes for the three axes are [1.0, 1.0, 1.0] Nm. Figure15 shows that though the Euler angle error has exceed the input range (defined in Table 2) of the neural network, and the PID control law in the proposed attitude controller (in Figure 2) manages to converge and gives the control back to the neural network.Figure 15
Impulse response of the neural network controller.


### 7.9. Testing the Real-Time Control Ability

It takes an average of 6.1 seconds to create a sample using CPU i7-8700. As a result, applying the loop of optimization (defined in Figure3) to the satellite attitude controller does not meet the real-time control requirement (e.g., the control period is usually set to 0.1 s). The calculation time of the whole neural network controller using ARM (STM32F417) is 3.3 ms (3.1 ms in the process of neural network forward propagation, 0.2 ms in other modules), which meets the requirement of real-time control.


## 7.1. Simulation Condition Design

The satellite orbit parameters at the initial time are shown in Table5. The initial time is 2017-05-31-04-40-00 (in yyyy-MM-dd-HH-mm-ss format).Table 5
Orbit parameters.
ParameterValueSemimajor axis6878.14 kmEccentricity0Inclination97.3°Ascending node255°Argument of perigee0°True anomaly145°As is shown in Figure5, 100 ground targets are randomly selected in the circle with the center at 120°E 30°N and a radius of 100 km. After all the ground targets are tested, the average performance J¯ is obtained by
(25)J̄=1Ntarget∑i=1NtargetJ,where Ntarget=100 and J is the performance defined in Eq. (8) of a single test.Figure 5
Ground targets randomly selected in the circular range.The average pointing accuracyJ¯A is obtained by
(26)J̄A=1Ntarget∑i=1NtargetJA.The average pointing stabilityJ¯ω is obtained by
(27)J̄ω=1Ntarget∑i=1NtargetJω.Other simulation parameters are defined in Table6.Table 6
Other simulation parameters.
ParameterValueSatellite mass1000 kgInertia tensorIx=797.34, Iy=304.86, Iz=792.48, Ixy=14.3, Ixz=25.1, Iyz=10.5 (kgm2)Star sensor constant error3″Star sensor random error (3σ)3″Gyro constant error0.15°/hGyro random error (1σ)0.15°/hReaction wheels constant error0.01 nmReaction wheels random error (1σ)0.01 nmExternal disturbanceGravitational torque, aerodynamic torque, solar radiation torque and magnetic torque. (modeled according to ref. [23])Initial Euler angleEqual to the desired initial Euler angle for each ground targetInitial angular velocityEqual to the desired initial angular velocity for each ground target


## 7.2. Searching the Optimal Coefficients for the PID Controller

Different combinations of coefficients in the PID controller are tested to achieve its best performance as the baseline for comparison. The coefficients of each axis are optimized, respectively, using the same combinations (12240=60×4×51) defined in Table 7. The Euler angles and angular velocities used in the PID control law are expressed in degrees.Table 7
Combinations of coefficient in PID control.
CoefficientValuesTotal number of valuesProportional1, 2, 3, …, 6060Integral0, 0.01, 0.02, 0.034Differential40, 41, 42, …, 9051All the ground targets defined in Figure5are tested for each coefficient combination, and the average performance J¯ is calculated. Then, the optimal PID coefficient combination is obtained according to Eq. (25) (k1=1 and k2=5, in order to balance the pointing accuracy and the pointing stability).


## 7.3. Performance Comparison of Steady-State Control

The comparison of steady-state control performance between the PID controller and the neural network controller consists of two parts. The first part is testing the condition in which the satellite stares at the central ground target (at 120°E 30°N). Curves of the Euler angle error and angular velocity error are provided. The second part includes testing all the ground targets shown in Figure5and calculating the average performance J¯.


## 7.4. Testing the Central Ground Target

The performances are tested for the neural network controller and the PID controller with the optimal coefficient combination when the satellite stares at the central ground target. The neural network controller performs better than the PID controller according to the results shown in Table8 and the error curves.Table 8
Performances of staring at the central ground target.
ControllerJAJωJ¯ (k1=1 and k2=5)PID controller3.96×10−4°4.23×10−5°/s6.07×10−4Neural network controller2.13×10−4°3.81×10−5°/s4.03×10−4Error curves of the PID controller are shown in Figure6 and Figure 7.Figure 6
Euler angle error of the PID controller with the optimal coefficient combination.Figure 7
Angular velocity error of the PID controller with the optimal coefficient combination.Error curves under the control of neural network are shown in Figures8 and 9.Figure 8
Euler angle error under the control of neural network.Figure 9
Angular velocity error under the control of neural network.


## 7.5. Testing all the Ground Targets

All the ground targets defined in Figure5are tested for the neural network controller and the PID controller with the best coefficient combination. The neural network controller performs better according to the results shown in Table 9.Table 9
Performances of staring at all the ground targets.
ControllerJ¯AJ¯ωJ¯ (k1=1 and k2=5)PID controller3.96×10−4°4.25×10−5°/s6.09×10−4Neural network controller2.13×10−4°3.76×10−5°/s4.01×10−4Figure10 is provided to visualize the performances and excludes the influence of k1 and k2. The x-axis and y-axis denote the pointing accuracy JA and the pointing stability Jω, respectively. The blue points represent the performances of the PID controller on all the ground targets, and the red points represent the performances of the neural network controller.Figure 10
Performance comparison between the PID controller and the neural network controller.


## 7.6. Performance Comparison of the Dynamic Response

### 7.6.1. Step Response

In order to test the step response, two simulations are executed for each controller and each ground target. One is the normal simulation, and the other is the simulation in which an extra angle measurement error (0.005° to three axes) is added at 30s and later. According to the difference between the two Euler angle sequences, the overshoot, settling time (the error band is±5%), and steady-state error are obtained.The average values of overshoot, settling time, and steady-state error for all the ground targets are shown in Table10 (PID controller) and Table 11 (neural network controller). The Euler angle difference of the two simulations (the satellite stares at 120°E 30°N) are provided in Figure 11 (PID controller) and Figure 12 (neural network controller). The neural network controller shows an advantage over the PID controller on all the three indices (in column “Average of Three Axes”) according to the results.Table 10
Average step response performance of the PID controller for all the ground targets.
Indexx-axisy-axisz-axisAverage of three axesOvershoot13.49%0.97%1.12%5.25%Settling time10.33 s3.67 s8.06 s7.35 sSteady-state error7.34×10−6°4.19×10−7°2.95×10−4°1.24×10−5°Table 11
Average step response performance of the neural network controller for all the ground targets.
Performancex-axisy-axisz-axisAverage of three axesOvershoot2.80%0.001%3.56%2.12%Settling time3.07 s3.42 s2.99 s3.16 sSteady-state error7.13×10−6°5.38×10−8°1.33×10−5°6.83×10−6°Figure 11
Step response of the PID controller when the satellite stares at the central ground target.Figure 12
Step response of the neural network controller when the satellite stares at the central ground target.


## 7.6.1. Step Response

In order to test the step response, two simulations are executed for each controller and each ground target. One is the normal simulation, and the other is the simulation in which an extra angle measurement error (0.005° to three axes) is added at 30s and later. According to the difference between the two Euler angle sequences, the overshoot, settling time (the error band is±5%), and steady-state error are obtained.The average values of overshoot, settling time, and steady-state error for all the ground targets are shown in Table10 (PID controller) and Table 11 (neural network controller). The Euler angle difference of the two simulations (the satellite stares at 120°E 30°N) are provided in Figure 11 (PID controller) and Figure 12 (neural network controller). The neural network controller shows an advantage over the PID controller on all the three indices (in column “Average of Three Axes”) according to the results.Table 10
Average step response performance of the PID controller for all the ground targets.
Indexx-axisy-axisz-axisAverage of three axesOvershoot13.49%0.97%1.12%5.25%Settling time10.33 s3.67 s8.06 s7.35 sSteady-state error7.34×10−6°4.19×10−7°2.95×10−4°1.24×10−5°Table 11
Average step response performance of the neural network controller for all the ground targets.
Performancex-axisy-axisz-axisAverage of three axesOvershoot2.80%0.001%3.56%2.12%Settling time3.07 s3.42 s2.99 s3.16 sSteady-state error7.13×10−6°5.38×10−8°1.33×10−5°6.83×10−6°Figure 11
Step response of the PID controller when the satellite stares at the central ground target.Figure 12
Step response of the neural network controller when the satellite stares at the central ground target.


## 7.7. Frequency Response

In order to test the frequency response, external periodical torque is applied in the simulation in which the satellite stares at the central ground target. The amplitude of the external periodical torque is 0.03 Nm, and the response of three axes is tested, respectively. Magnitude-frequency characteristic curves of the two controllers are shown in Figure13 (PID controller) and Figure 14 (neural network controller). The amplitude of the neural network controller is higher than that of the PID controller when the frequency is lower than 2 Hz, and the amplitudes are similar when the frequency is higher.Figure 13
Magnitude-frequency characteristic of the PID controller.Figure 14
Magnitude-frequency characteristic of the neural network controller.


## 7.8. Impulse Response

A big disturbance is applied to the system under the control of the neural network in order to test the stability of the system (the satellite stares at 120°E 30°N). The disturbance starts at 30s and lasts for 0.5 s, and its amplitudes for the three axes are [1.0, 1.0, 1.0] Nm. Figure15 shows that though the Euler angle error has exceed the input range (defined in Table 2) of the neural network, and the PID control law in the proposed attitude controller (in Figure 2) manages to converge and gives the control back to the neural network.Figure 15
Impulse response of the neural network controller.


## 7.9. Testing the Real-Time Control Ability

It takes an average of 6.1 seconds to create a sample using CPU i7-8700. As a result, applying the loop of optimization (defined in Figure3) to the satellite attitude controller does not meet the real-time control requirement (e.g., the control period is usually set to 0.1 s). The calculation time of the whole neural network controller using ARM (STM32F417) is 3.3 ms (3.1 ms in the process of neural network forward propagation, 0.2 ms in other modules), which meets the requirement of real-time control.


## 8. Conclusions

In this paper, the optimal control and machine learning method are applied unitedly in the attitude control of staring imaging. Compared with the PID controller with the best coefficients, the neural network controller shows advantages in the steady-state performance (including pointing accuracy and pointing stability), which is the most important in staring imaging tasks. As for the dynamic response, the neural network controller performs better in the step response and worse in the frequency response than the PID controller. The proposed controller also shows the ability to converge when a big disturbance is applied.The calculation time of the proposed attitude controller on ARM (STM32F417) is 3.3 ms, which meets the requirement of real-time control.



---

*Source: 8822223-2020-11-17.xml*