# Micro-Satellite Systems Design, Integration, and Flight
## 4 Attitude Control System (ACS) Development
### Fluctuation Test
#### 4.3.7 Kane Damper Tuning  
The ACS performance was improved by adjusting the Kane damper. A rough trial-and-error estimate was used to find the approximate convergence range of the CubeSat system. These initial values were also the starting point for the search algorithm discussed later. After choosing stable Id and c values, the controller was tested for robustness by changing the initial kinematic conditions. The controller showed robustness at different initial conditions. Lastly, a MATLAB(r) algorithm was written to fine-tune the Kane damper. The Kane damper was tuned with nested loops. The loops changed the scalar moment of inertia, Id, and the damping constant, c, of the damper. Since both values are directly proportional to the angular velocity, it was assumed that the surface plot would be smooth and continuous based on the plot made by [PERSON] (Carabellese 39). The Kane tuner optimized computational time using a very coarse search. Instead of finding a precise array of damping constants and moments of inertia, the code would find a region with the fastest convergence time. For example, the parameters could be set up to find 25 values by increasing each variable (Id and c) by 5. A minimum rise time of the controller would be  
Figure 38: The gyrocompass measuring the magnetic field of the torque coil. found for the coarse search. The nearby region would be zoomed in on and further searched. This convergence region would avoid wasting computational time finding precise solutions that are clearly not in the optimal region. This confining search optimization technique is only possible because the surface plot is known to be smooth and continuous based on linearity. The plot referenced can be seen in [PERSON]'s thesis [19]. A visual representation of the first step of the confining search optimization formula can be seen below in Figure 39.  
The 25 solutions are displayed as dots in Figure 39, with the best one in red. A zoom can be used to search more finely in the chosen area. The region closest to the red dot (half a deviation in each direction) becomes the new search region. The answer is bound to be in this region since both Id and c are related to the angular velocity. This means that the max and min are set to be half a deviation above or below the optimal solution. The updated search region is displayed below in Figure 40.  
The zoom goes on until the required level of accuracy is reached. But if the best solution is on the edge of the search area, the problem becomes more complicated. Look at Figure 41.  
Figure 40: Zoomed-in search region. The red square symbolizes the region in which the optimal solution lies. Figure 39: Confining search algorithm. The red dot symbolizes optimal result, within resolution of the search algorithm. In this situation, the answer might be right at the edge, or it might be outside of the search area. The MATLAB(r) script will show a popup window for the operator to choose. The program can either keep searching along the edge or it can independently enlarge its search area. If independently enlarged, the search area will increase by the same interval as originally set. But it will also keep a half unit inside the old area in case the operator is mistaken and the answer is near the edge. See Figure 42.  
Because the zoom did not succeed, the zoom factor will not increase by one. The operator might pick the other option if they must enlarge the search region or if they think that the best solution is inside the original definition. If they choose to keep the original search parameters, they will maintain the same search area and keep zooming in on the edge. See Figure 43.  
Figure 41: Optimal solution found on the border. This is shown by the red dot. Figure 42: Borderline search region with autonomous search region expansion. The red square symbolizes a growth in the search region in order to search beyond the boarder. Figure 43 shows that the zoom will follow the border.