## 3 Problem Domain
### Interface between ANM and Snaky  
As mentioned earlier, the ANM system has 256 IP neurons, divided into eight comparable subnets. All the IP neurons in different subnets that are similar in terms of their inter-neuronal connections and intra-neuronal structures are grouped as a bundle. The 256 IP neurons could thus also be grouped into 32 bundles. In addition, the neurons in the same bundle also have the same patterns of connections with the external inputs and with the motors (Figure 7). The above setup ensures that each subnet receives the same inputs from the receptor neurons and that the outputs of the system are the same when the firing patterns of each subnet are the same.  
Figure 6: Snake robot and two orthogonally connected servo motors.  
Figure 7: Interface between the ANM system and _Snaky_.  
In the following text, we will explain how to map (transform) the outputs of the ANM system to rotation angles for the four motors. As mentioned earlier, the IP neurons of the ANM system are grouped into 32 bundles that are further divided into four classes, with each class controlling the rotation of a single motor. In our present implementation, the rotation angle of each motor was determined by the time difference between the first two firing IP neurons of the same class. The greater the time difference is, the greater the angle at which the motor rotates. A simple implementation would involve a linear relationship between the rotation angle and the time difference. However, in such a design, changes in the angle of each motor would be very sensitive to the time difference. Therefore, our somewhat arbitrary assumption was that the motor rotation change and the time difference should exhibit a nonlinear relationship similar to a sigmoid function (Equation (1)).  
\[\textit{Rotation angle}=((1/(1+e^{-(15\,\cdot\,\Delta t)}))-0.5)*2*(\text{A}_{ max}-\text{A}_{min})+\text{A}_{min} \tag{1}\]  
where \(\Delta t\) is the time difference of the first two firing neurons of the same class, and \(\text{A}_{max}\) and \(\text{A}_{min}\) are the maximum and minimum angles of rotation, respectively, for each motor.  
Due to the limitations of the [PERSON] servo motor controller, only one motor can be activated at a time (the operating time of each motor is the same). Thus, these four motors are activated in sequence (one at a time). The activation sequence of the four motors (\(M_{1}\), \(M_{2}\), \(M_{3}\), and \(M_{4}\)) currently used in this study starts with \(M_{1}\) and proceeds to each subsequent motor, until the last motor, \(M_{4}\), is activated. The entire process from activating \(M_{1}\) to activating \(M_{4}\) is referred to as an operational step. For each run of the experiment, we observed _Snaky_'s performance after it completes four operational steps. Once the ANM system determines the set of rotation angles for the four motors, they are sequentially assigned to each motor. However, the assignment is not constant across all operation steps but instead is implemented in a rolling manner. For example, as shown in Table 1, if the ANM system determines that the angles of rotation for the four motors are \(A_{1}\), \(A_{2}\), \(A_{3}\), and \(A_{4}\), the four motors, \(M_{1}\), \(M_{2}\), \(M_{3}\), and \(M_{4}\), will be \(A_{1}\), \(A_{2}\), \(A_{3}\), and \(A_{4}\), respectively, in the first operational step, \(S_{1}\). In the second operational step (\(S_{2}\)), \(M_{1}\), \(M_{2}\), \(M_{3}\), and \(M_{4}\) will instead be assigned \(A_{2}\), \(A_{3}\), \(A_{4}