# In-Orbit Results and Attitude Analysis of the SNUGLITE CubeSatellite
## 2 Materials and Methods
### Attitude System of SNUGLITE
#### 2.3.3 Attitude Estimation Analysis Method  
The full beacon from the SNUGLITE CubeSat includes estimated satellite attitude, as described in Table 2. However, it is required to generate any reference for the performance analysis of the attitude estimation. In this paper, the amount of power generated on each side of the CubeSat was utilized to form the reference sun vector in the body frame. The reference sun vector by power generation is compared to the estimated sun vector generated by the estimated attitude, as well as the positions of the satellite and the sun at each epoch. Detailed steps are described below in Equations (19)-(27). The reference sun vector can be generated as  
\[\mathbf{s}_{\text{meas. }}^{\text{body}}=\left[ \begin{array}{c}\text{sign}(T_{ x+}-T_{x-})\frac{P_{\text{meas.}}^{x}}{\text{$\mathbf{\hat{v}}$}^{x}}\\ \text{sign}(T_{y+}-T_{y-})\frac{P_{\text{meas.}}^{x}}{\text{$\mathbf{\hat{v}}$ }^{y}}\\ -\frac{P_{\text{meas.}}^{x}}{\text{$\mathbf{\hat{c}}$}^{z}}\end{array} \right]^ {T} \tag{19}\]  
\[\mathbf{\hat{s}}_{\text{meas.}}^{\text{body}}=\frac{\mathbf{s}_{\text{meas.}} ^{\text{body}}}{\|\mathbf{s}_{\text{meas.}}^{\text{body}}\|} \tag{20}\]  
where \(\mathbf{s}_{\text{meas. }}^{\text{body}}\) is a reference sun-vector and \(\mathbf{\hat{s}}_{\text{meas. }}^{\text{body}}\) is a unit reference sun-vector. \(P_{\text{meas.}}^{x},\,\,P_{\text{meas. }}^{y}\), and \(P_{\text{meas. }}^{z}\) denote generated powers at each axis calculated using the solar-panel input voltages and currents listed in Table 2. \(T_{x+},\,\,T_{x-},\,\,T_{y+}\), and \(T_{y-}\) denote the temperatures of each solar panel in the body-frame, as described in Table 2.'sign' in Equation (19) is a function to return the sign of a number. According to the power module structure in the full beacon, ground users would know the amount of power generation at each axis. The temperatures of the solar-panel are needed to distinguish the side of the axis that is facing the sun. It is primarily correct to assume that the temperature of the solar panel facing the sun is high. As there is no solar panel in the z+ side, power generation at the z-axis is always from the z- solar panel. \(C_{x},\,C_{y},\,\text{and}\,C_{z}\) are the number of solar cells on each side. They were used to normalize the power generation on each side to generate the unit sun-pointing vector. \(C_{x}\) is four, and \(C_{z}\) is one because there is only one solar cell in z\(-\) solar panel, as shown in Figure 1. \(C_{y}\) is selected based on which side between y+ and y- is facing the sun as in Equation (21) because there is one less solar cell in the y+ direction on which to mount the GPS antenna. \[ \begin{split} C_{x}&=4\\ C_{y}&=\left\{\begin{array}{ll}3&\text{if }T_{y+}>T_{y-} \\ 4&\text{else}\\ C_{z}&=1\end{array}\right.\end{split}  \tag{21}\]  
The estimated sun vector is derived as equations:  
\[\hat{\mathfrak{s}}^{\text{ECI}}=\frac{\mathbf{x}_{\text{sun,DE405}}^{\text{ ECI}}-\mathbf{x}_{\text{sat,GPS}}^{\text{ECI}}}{\|\mathbf{x}_{\text{sun,DE405}}^{ \text{ECI}}-\mathbf{x}_{\text{sat,GPS}}^{\text{ECI}}\|} \tag{22}\]  
\[\hat{\mathfrak{s}}^{\text{body}}_{\text{estm.}}=R^{\text{body}}_{\text{ECI}} \mathfrak{s}^{\text{ECI}} \tag{23}\]  
where \(\hat{\mathfrak{s}}^{\text{ECI}}\) is a unit sun vector in the Earth-centered inertial (ECI) frame and \(\hat{\mathfrak{s}}^{\text{body}}_{\text{estm. }}\) is a sun vector estimated in the body frame. \(\mathbf{x}_{\text{sun,DE405}}^{\text{ECI}}\) is the position of the sun calculated using the DE405 model, and \(\mathbf{x}_{\text{sat,GPS}}^{\text{ECI}}\) is the position of the SNUGLITE in the ECI frame that is found by using the output of the GPS receiver mentioned in Table 2. \(R^{\text{body}}_{\text{ECI}}\) is a rotation matrix from the ECI to the body-frame.