# Micro-Satellite Systems Design, Integration, and Flight
## 4 Attitude Control System (ACS) Development
### Battery Voltage Offset Correction
#### 4.3.9 Temperature Offset  
The temperature of the CubeSat was another correction factor that was considered. It was observed that the IMU's offset reading goes up as the CubeSat's temperature goes down. This correlation was expected to be due to lower resistance in the IMU. Experimental data were gathered in a suitable temperature range that the CubeSat might encounter in LEO. A case study showed that CubeSats in LEO often have temperatures ranging from \(-5\) degrees Fahrenheit in the Earth's shadow to 130 degrees Fahrenheit when exposed to the sun's light (Dinh 11). Ambient conditions tend to vary a lot more. But, because of the satellite's spin, residual heat, and waste heat from the electronics, the temperature is more stable. To test for hysteresis, the experiment was divided into two different parts. In the first experiment, the CubeSat began at room temperature, 73 degrees Fahrenheit. It was wrapped in an ESD-safe bag and moved into a cooler with dry ice to observe the effects of cooling. The temperature and magnetic field were recorded. Just like the procedure used when calculating soft iron offsets, the temperature and magnetometer values were averaged over ten values. However, data was only printed to the serial monitor every ten seconds. A bigger timestep was used to fit the longer characteristic time of the test and to avoid too much data. The magnetic field strength was measured until a temperature of \(-18\) degrees Fahrenheit was reached. The next test was performed starting in the dry ice and moving the CubeSat under heat lamps. These heat lamps were meant to imitate solar radiation. The CubeSat was placed on an ESD bench and allowed to heat from \(-18\) deg to 134 deg Fahrenheit. Again, the magnetic field was recorded throughout the test process. A continuous dataset of magnetic fields from low to high temperatures was recorded. To evaluate the offsets, the magnetic field at ambient temperature was subtracted from both  
Figure 49: Motion sensor calibration tool shows hard iron offsets.  
datasets. The sets were compared to each other to check for hysteresis errors. Please see Figure 50.  
After examining the data, the error was determined to be insignificant compared to the IMU's resolution. The dataset with increasing temperature was chosen because it covered the whole range of interest from \(-18\) deg Fahrenheit to \(134\) deg Fahrenheit. A polyfit was applied to the dataset with an increasing temperature. The best degree of fit was found by gradually increasing the fit order and looking at the small diminishing returns in terms of the RMS error. A third-degree polynomial was the most effective. See Figure 51.  
The temperature model was validated in a similar way to the soft iron model. The experimental values matched the simulated ones closely. The resemblance indicated that the temperature model satisfied requirement 6.2 in Table 5. The polyfit equations shown in Figure 51 above could be combined with the soft and hard iron offsets to obtain the final offsets of the IMU magnetometer.  
Figure 50: Negligible hysteresis error in temperature offset. (**a**) x axis magnetic field offsets as a function of temperature increasing (blue) and decreasing (red); (**b**) y axis magnetic field offsets; (**c**) z axis magnetic field offsets.