# Development of Automatic Electric Drive Drilling System for Core Drilling
## 3 Design and Development
### Software System
#### 3.2.2 Sensors and Data Flow  
Due to core drilling miniaturization characteristics, sensors play an essential role in developing automated drilling systems. Sensors must meet the installation requirements of the drilling system while ensuring that the computer relies on the data provided by the sensors to make decisions and provide valuable advice to the user. Core drilling is challenging to measure during drilling (MWD) owing to its small hole diameter. Instead of MWD, the system uses sensors installed near the bit in the drill string system to monitor the working face torque and WOB in real time. As shown in Figures 3 and 4, the drilling system has five sensors, including a pressure sensor capable of providing measurements for the central axis, and a torque sensor that measures the torque at the drill string. Drill string vibration is a complex phenomenon formed by the coupling of axial, lateral, and torsional vibration modes. In small-bore vertical drilling, the primary vibration direction can be considered axial; thus, vibration monitoring can be realized by measuring instantaneous changes in the WOB. When the vibration is too large, the operator can adjust the drilling parameters (WOB and RPM) to mitigate the vibration. In traditional core drilling rigs, core drilling data acquisition has always been a missing link. Because there is no data accumulation in the drilling parameter database, the database can only be expanded through an experiment with the drilling system. In each drilling experiment, the sensors collected the time-stamped data throughout the drill. During each drilling experiment, the sensors collected time-stamped data throughout the drilling  
Figure 5: Control system layers and data flow with PLC and sensor. process. These data were recorded using a high-frequency data acquisition (DAq) module in real time or post analysis. The sampling frequency of the PLC acquisition module was 10,000 Hz, and the digital signal collected by the program was recorded and saved at a frequency of 100 Hz. In this process, high-frequency noise is aliased into low-frequency noise owing to the signal aliasing. To determine the cutoff frequency of filtering, the fast Fourier transform of the MATLAB software was used for spectrum analysis of the data collected after the motor was turned on, as shown in Figure 6.  
The basic theoretical formula for a low-pass filter is as follows:  
\[y(t)=K*u(t)+(1-K)*y(t-1)=y(t-1)+K*[u(t)-y(t-1)] \tag{21}\]  
where \(K\) is \(dT/T\), \(dT\) is step size, \(T\) is the time constant, \(u(t)\) is input signal, and \(y(t)\) is output signal. Generally, for a certain controller, its operation period is certain, so only the time constant can be adjusted to change the filtering effect. Therefore, the data sampled in real time were filtered using a 15 Hz low-pass filter and calibrated with zero drift. The sensor acquisition data of the motor power-off, power-on, and rotation at cutoff frequencies of 5 kHz, 2 kHz, 100 Hz, 50 Hz, 15 Hz, and 1 Hz were collected to verify the filtering effect. The results are shown in Figure 7.  
SQL is a computer-based structured query language that is used to store, manipulate, and retrieve data in relational databases. This database system was created using MySQL, a well-known RDBMS. To simplify the data collection process, different data were sampled at different frequencies. The torque and pressure were sampled at a high frequency of 100 Hz, whereas the pump pressure, pump volume, and encoder were sampled at a low frequency of 1 Hz. The MySQL database requires two different databases, one for high-frequency sensor data and the other for low-frequency sensor data. MySQL not only uses the characteristics of the RDBMS, but also provides a good query means for time-stamped data. To facilitate the management of data stored in the database, a Django-based web client acts as an interface between the user and the database. The collected data can be saved in the CSV format in computer files and stored on the CF card of the PLC as a backup.