# Micro-Satellite Systems Design, Integration, and Flight
## 4 Attitude Control System (ACS) Development
### Attitude Control
#### 4.3.3 The Controller Software
Calculating the Amplification Factor of the Mu-Metal Core  
To measure the magnetic strength of the torque coils precisely, we needed to know how much the mu metal rod amplified it. We had used an estimated amplification factor before based on values from material charts, but we had never tested it experimentally for our system. To achieve the amplification factor of the torque coils on the CubeSat, we had to find the magnetic dipole. We used the IMU magnetometer to measure the dipole. Figure 36: True convergence of Kane controller. Dr. [PERSON] derived the equation we used to calculate the magnetic dipole of the coil [41]. See Equation (10). \[M=\frac{4\pi}{\mu_{0}}\cdot\left[\frac{\frac{R_{X}}{L}-\frac{1}{2}}{\left({R_{x}} ^{2}-R_{x}L+\frac{L^{2}}{4}\right)^{3/2}}-\frac{\frac{R_{X}}{L}+\frac{1}{2}}{ \left({R_{x}}^{2}-R_{x}L+\frac{L^{2}}{4}\right)^{3/2}}\right]^{-1} \tag{10}\]  
\(R_{x}\) is the distance between the coil and the magnetometer, and \(L\) is the coil's length. The units for the magnetic field, \(B\), are Teslas. By knowing the magnetic dipole of the magnetorquer, the amplification factor could be calculated from the current that was applied (\(I\)), the coils that were used (\(N\)), and the area of the cross-section (\(A\)). Refer to Equation (11):  
\[AF=\frac{M_{dipole}}{NIA} \tag{11}\]  
An Arduino program was created to switch the magnet coils on and off. The coil's radius and length were measured. The coil's distance from the IMU was also recorded. The magnetic field was found to be 55 \(\mu\)T. This was derived to be a magnetic dipole of 0.0619 amps\(\cdot\)m\({}^{2}\). The amplification factor was calculated using Equation (11) to be \(\sim\)13.5 to 14. The experimental result for the amplification factor was much lower than the theoretical one. The amplification factor was about 10% of what was expected before. ACS Verification Conclusion  
The controller code was checked and confirmed, and the results are shown below. The x, y, and z axes were given initial tumble angular speeds of 0.06, \(-\)0.05, and 0.07, respectively. Refer to Figure 36.  
[PERSON]'s coupled equations of motion were used to mathematically verify the model. The rotational motion along the \(x\) and \(y\) axes is not relevant for the \(z\) axis rotational motion since they are both zero. The simplified equation yields an asymptotic exponential increase function. The velocities along the \(x\) and \(y\) axes, on the other hand, are very interrelated. The general solution to these coupled equations shows sinusoidal behavior. This matches the prediction, as seen in Figure 36. The convergence time is more acceptable. The controller is expected to take 25-35 min to stabilize the CubeSat. The oscillations can also be theoretically explained by the damping of the system. Looking at Figure 36, the system appears to be nearly critically damped. A critically damped solution satisfies requirements 1.0 and 2.0 since the system is successfully detumbled and spin stabilized. The TRL of the control system increased from a three to a five due to the measures discussed above. The improvements in TRL were achieved through adding traceability of the model to the respective requirements, verifying the constants, and conducting a rigorous validation of the parameters. Further technological development could be performed by testing the controller experimentally in an air-bearing environment and ultimately launching a CubeSat into low-earth orbit (LEO) to test the rotational kinematics.