## 4 CPS Framework Implementation and Experimentation
### Case 1: The Prediction of Spindle Motor Rotation Error
The force sensor collected the load force to realize the closed-loop control of the load spectrum; the speed sensor measured the spindle speed to realize closed-loop control; and the eddy current sensor was used to detect the spindle displacement. The rotation error could be obtained by a spindle check machine capability tester. A detailed description of the smart connection layer components is provided in Table 4, including the key components of the smart connection layer: specification, communication mode, and function. These constitute the smart connection layer of CPS. \begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Key Components of** **Smart Connection Layer** & **Specification** & **Communication Mode** **and Function** \\ \hline Spindle and & & PXIe-1082 communicates with spindle driver through RS485-USB interface to control spindle torque, acceleration and deceleration \\ \hline Vibration sensor & PCB 256A14 & Connect with PXIe-1082 through Integrated Electronic Piezo-Electric interface to collect vibration signals \\ \hline Force sensor & DYMH-104 & The 4-line difference signal is fed back to the analog input channel of PXIe-1082 \\ \hline Spindle check machine capability tester & Lion & The output digital signal of the tester is directly connected with the NI PXIe-1082 through the USB interface, three eddy current sensors and one speed sensor are integrated in the tester \\ \hline Data acquisition and control unit & NI PXIe-1082 & Data acquisition and spindle control \\ \hline Pneumic loading unit & AirTac-100 & PXIe-1082 controls the pneumatic loading unit through analog output channel \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Detailed description of the Smart Connection Layer components. Figure 8: The spindle experimental platform. PXIe-1082: A data acquisition and control unit is the core component of the system and is mainly used to realize the loading control of air pump, multi-sensor data acquisition, data transmission to the analysis platform, spindle drive, and feedback control. The configuration layer of the CPS is realized in this part. Data analysis platform: This part is based on MATLAB and Python. The acquisition and control unit sends the data to the analysis platform to support the PEM layer, MLM layer, and cognition layer of CPS, which is the core part of the data processing and rotation error prediction. After the data acquisition, it is necessary to preprocess the vibration signal and the corresponding rotation error. The spindle speed ranges from 1000 r/min to 4000 r/min; the experiment shows that the variation range of rotation error is 5-14.5 \(\upmu\)m. After discretization, the rotation error data are rounded to the nearest 0.5. Therefore, there are 20 types of rotation error and the number class is set to 20. Two datasets of each class for a total of 40 datasets were selected for the experiment; each dataset contained 200,000 x 3 (x3 means 3 sensors) raw data points. The former 70% of data points were selected as the training data, while the last 30% were used as testing data. In this paper, the sample length was 1024 data points and the shift length [61] was 320 data points. Hence, the total number of samples in each class was 870 and the total number of training samples was \(20\times 870\). Data augmentation was not used in the testing set, and the total number of testing samples was \(20\times 116\).