Intelligent control method and system for handheld electric drill based on data glove
Through an intelligent control system based on data gloves, pressure data is collected and analyzed in real time, and the parameters of electric drills are adjusted using machine learning algorithms, the problem of unstable drilling quality of handheld electric drills is solved, and efficient and safe drilling operations are achieved.
Patent Information
- Application Number
- CN202510395933.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-07-22
AI Technical Summary
The drilling quality of existing handheld electric drills is greatly affected by the operator's skills and environment, resulting in fluctuations in the size and shape of the holes, and the operation process requires high skills.
Design a handheld electric drill intelligent control system based on data gloves, collect pressure data in real time through smart gloves, use machine learning algorithms to predict drilling quality, and adjust drill parameters in real time, including drill speed and torque to optimize drilling quality.
It improves the stability and operating efficiency of drilling quality, reduces the requirements for operator skills, simplifies the operation process, and improves safety.
Smart Images

Figure CN120353160A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control and image recognition, and particularly to a method and system for intelligent control of a handheld electric drill based on a data glove. Technical Background
[0002] In recent years, the deep integration of technologies such as artificial intelligence (AI), the Internet of Things (IoT), and big data has been accelerating the transformation of mechanical engineering towards the intelligent direction. Through the integration of sensors, machine learning algorithms, and autonomous control systems, intelligent technologies have significantly enhanced the adaptive capabilities and production efficiency of mechanical equipment. Among numerous power tools, the electric drill has become a key direction for intelligent upgrading due to its wide range of application scenarios and convenient operation methods. Firstly, for intelligent sensing and automatic regulation, an electric drill can be equipped with intelligent sensors and control systems to automatically adjust the rotation speed and torque according to different material characteristics and operation requirements, improving operation accuracy and usability. Secondly, for multi-functional integration, an electric drill can integrate functions such as wrenches and pliers to achieve multi-purpose use, broaden the scope of tool application, reduce the need for frequent tool replacement, and improve work efficiency. Finally, for automated operation functions, the electric drill can achieve functions such as automatic tool changing and intelligent identification of screw models, reducing manual intervention and enhancing operation efficiency and safety.
[0003] However, there has been relatively little research on the control of hand-held electric drills. Most research has focused on optimizing aspects such as the shape, size, and weight of hand-held electric drills, paying attention to ergonomic requirements, user experience, and control of usage fatigue, etc. Zhang Jiumei optimized and improved the structure of the hand-held electric drill in the article to address various repetitive cumulative injury diseases such as hand pain or deformation that may be caused by long-term use of the electric drill, meeting the ergonomic requirements to ensure the safety and comfort of the product. [Zhang Jiumei. Research on the Ergonomic Design of Electric Hand Drills [J]. Packaging Engineering, 2013, 34(16): 50 - 54. DOI: 10.19554]. Chen Lin proposed a design idea for hand-held electric drills based on the user experience of female users. She believed that hand-held electric drills traditionally targeted male users as the main user group, so their design and functions often favored the needs of male users, ignoring problems such as comfort and safety that female users may encounter during use. She proposed optimizing the handle shape and size of the electric drill to make it more suitable for the hand size of females; adopting reasonable weight distribution and shock absorption design can effectively reduce the impact of vibration on the hands of females. [Chen Lin, Qian Feng, Wang Wenguang. Research on the Design of Hand-held Electric Drills Based on the User Experience of Female Users [J]. Industrial Design, 2020, (09): 157 - 158.].
[0004] In traditional handheld electric drill operations, the drilling quality is often affected by the operator's skills, pressure control, and drilling environment, resulting in significant fluctuations in the size and shape of the holes. Force sensors or pressure feedback sensors help the electric drill sense the operator's operating force during use and provide real-time feedback to the user. This design not only improves the accuracy of operation but also avoids fatigue or injury caused by incorrect operation methods.
[0005] With the rapid development of artificial intelligence and sensor technology, the prospect of intelligent control of electric drills has become clearer. Sensors are not only shrinking in size but also gradually reducing in cost. As one of the key pillars of artificial intelligence, machine learning technology has made significant progress in recent years. With the continuous optimization of algorithms, the computational accuracy of machine learning has been continuously improved, and the application fields have also been continuously expanded, providing strong support for data glove technology based on sensors and machine learning. By collecting and processing pressure data in real time through data gloves, the working state of the electric drill can be adjusted in real time, thereby improving the stability of drilling quality. Traditional electric drill control systems require manual adjustment of various parameters, and have high requirements for operator skills. The intelligent control system based on data gloves simplifies the operation process and reduces the requirements for operator skills by automatically adjusting the electric drill parameters. Summary of the Invention
[0006] The object of the present invention is to take the handheld electric drill as the research object and explore the innovative application of intelligent control and data-driven optimization. Based on data gloves, an intelligent control system suitable for handheld electric drills is designed. This system can collect working condition data in real time when using the electric drill, and classify different drilling conditions of the electric drill through the analysis and prediction of the data processing system on the computer side and machine learning algorithms, and then match the optimal electric drill speed, torque and other parameters.
[0007] To achieve the above object, the present invention is realized through the following technical solutions:
[0008] An intelligent control method for a handheld electric drill based on data gloves, comprising the following steps:
[0009] Control the electric drill to drill holes by wearing intelligent gloves and collect corresponding pressure data;
[0010] Control the electric drill to drill holes and collect corresponding pressure data;
[0011] Input the pressure data into a trained prediction model to predict the drilling quality under different working conditions, and send the prediction results to the single-chip microcomputer to adjust the electric drill parameters in real time and optimize the drilling quality;
[0012] The training of the prediction model includes the following steps:
[0013] Step 1: Collect the pressure data and image data of the electric drill under different working conditions;
[0014] Step 2: Preprocess the collected data;
[0015] Step 3: Extract features from the preprocessed dataset. Feature extraction includes time-domain feature extraction and frequency-domain feature extraction;
[0016] Step 4: Based on the contour information extraction method of OpenCV, extract the contour information of the hole from the image as the quality assessment of the hole;
[0017] Step 5: Use the time-domain and frequency-domain feature data extracted in Step 3 to train the machine learning algorithm model: perform grid search on the parameters of the model and then conduct cross-validation, and output the bar chart of the determination coefficient and root mean square error evaluation indexes of the model, and select the model with the best prediction effect as the prediction model;
[0018] Step 6: Based on the prediction results, the control system matches the best electric drill parameters of the electric drill in real time to improve the operation efficiency and safety.
[0019] Furthermore, in Step 1, the preprocessing includes the processing of missing values and outliers, and import the motor parameters and external information under different working conditions to perform dimensionless and normalization of the data and data encoding processing.
[0020] Furthermore, in Step 2, the motor parameters and external information include material type, drill bit diameter, and material thickness. Furthermore, in Step 3, the time-domain features include mean, root mean square value, variance, skewness, and impulse value, and the frequency-domain features include fast Fourier transform;
[0021] Mean:
[0022]
[0023] where Mean represents the mean, x i is the i-th data point in the time series, and n is the total number of data points;
[0024] Root Mean Square Value RMS:
[0025]
[0026] where, x i is the i-th data point in the time series, and n is the total number of data points;
[0027] Variance:
[0028]
[0029] where: x iis the i-th data point in the time series; μ is the mean of the data; n is the number of data points;
[0030] Skewness:
[0031]
[0032] where n is the total number of data points; x i is the i-th data point in the time series; μ is the mean of the data; σ is the standard deviation of the sample;
[0033] Pulse value Peak Value:
[0034] Peak Value = max(|x1|,|x2|,…,|x n |);
[0035] Fast Fourier Transform:
[0036]
[0037] where N is the length of the signal, x[i] is the i-th sample of the time-domain signal, X[k] is the k-th frequency component of the frequency-domain signal, and j represents the imaginary unit.
[0038] Further, in step 4, the contour information extraction method based on OpenCV extracts the contour information of the hole as the image Canny algorithm edge detection method, extracts the contour information, and obtains the circumradius of the control group circle and the circumradius and inradius of the actual hole contour:
[0039]
[0040] R out = r * r out ;
[0041] R in = r * r in ;
[0042]
[0043] where R is the ideal radius of the actual hole, R ideal is the radius of the control group hole, r is the ratio of the two, R out is the circumradius of the actual hole, R in is the inradius of the actual hole, r out is the circumradius of the hole obtained by contour extraction, r in is the inradius of the hole obtained by contour extraction, and S is the matching degree between the actual hole radius and the ideal hole radius, which is used to evaluate the quality of the hole.
[0044] Further, in step 5, the machine learning algorithm models include KNN, random forest, SVM and XGBoost algorithm models, and the model with the best prediction effect in the confusion matrix and the evaluation index histogram is selected as the prediction model.
[0045] Furthermore, in step 6, the best XGBoost model is selected from the multiple trained machine learning algorithm models and used for the prediction of the intelligent electric drill control system. For different working conditions, the model will give prediction results, and the prediction results will be sent to the microcontroller via Bluetooth communication; the microcontroller adjusts the current supply of the motor based on the prediction results, thereby controlling the speed of the electric drill.
[0046] A system for realizing the intelligent control method of a handheld electric drill based on intelligent data gloves comprises intelligent gloves, a motor, a single chip microcomputer, a Bluetooth communication module, and a computer.
[0047] The smart gloves include sensors and ordinary gloves;
[0048] The sensor is attached to an ordinary glove in the shape of a human hand, corresponding to the thumb, base of the thumb, four fingers and palm of the human hand, and is used to collect pressure signals. The sensor sends the collected data to the microcontroller through the Bluetooth communication module. The computer classifies the prediction results according to the deviation degree, and then sends them to the microcontroller through the serial port. The microcontroller communicates with the prediction module through Bluetooth.
[0049] The computer is equipped with a high-accuracy prediction model based on a machine learning algorithm, which is used to predict the drilling quality under different working conditions. The information collected by the sensor can be used to adjust the electric drill parameters in real time, optimize the drilling quality, and predict the results of the prediction model. The prediction results are sent to the microcontroller, and the microcontroller adjusts the motor speed according to the received information.
[0050] Furthermore, the sensor is a ZNS-01 thin film pressure sensor.
[0051] A computer device of the present invention comprises: a memory and a processor and a computer program stored in the memory. When the computer program is executed on the processor, a handheld electric drill intelligent control method based on a data glove as described in any one of claims 1 to 8 is implemented.
[0052] Compared with the prior art, the present invention has the following beneficial effects:
[0053] The method of the present invention is applicable to the intelligent control system of a hand-held electric drill. It not only promotes the intelligent upgrade of the electric drill, but also provides new ideas for the development of intelligent power tools, facilitating the development process of intelligent manufacturing and industrial automation. At the same time, the sensors relied on by the present invention and the components of the integrated intelligent control system hardware are of low price and easy to obtain, having certain application value and popularization prospects. Through the present invention, an important thinking direction is provided for the research and development of future intelligent tools, promoting the development of the electric tool industry towards high-end, intelligent, and refined directions. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 FIG. is a flowchart of an intelligent control method for a hand-held electric drill based on a data glove in an embodiment;
[0055] Figure 2 FIG. is a data acquisition system diagram based on a data glove in an embodiment;
[0056] Figure 3 FIG. is an image contour recognition flowchart in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0057] In order to enable those skilled in the art of the present technology to better understand the solution of the present invention, the following will further elaborate on the present invention in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the scope of protection of the present invention.
[0058] As Figure 1 shown, an intelligent control method for a hand-held electric drill based on a data glove in an embodiment of the present invention includes the following steps: real-time collection of pressure data of the hand-held electric drill under different drilling conditions by wearing an intelligent glove, inputting the pressure data into a trained prediction model to predict the drilling quality under different conditions, sending the prediction result to a single-chip microcomputer to adjust the electric drill parameters in real time, and optimizing the drilling quality;
[0059] The training of the prediction model includes the following steps:
[0060] Step 01, build a data glove through a single-chip microcomputer and a ZNS-01 thin-film pressure sensor. In terms of the use of external devices of the single-chip microcomputer, write corresponding motor control codes to control the electric drill to drill under different conditions and collect the corresponding pressure data and image data as the original data set.
[0061] As an embodiment, the experimental working conditions of this embodiment are three kinds of experimental materials, namely plastic board, acrylic board and wooden board, and the variables are set to different thicknesses, different drill diameters and different rotation speeds; the collected pressure data is the pressure data collected by the sensor of the electric drill under different working conditions. The original data set is the pressure change information of different parts of the human hand collected by the four channels of the sensor of the smart glove, including the thumb, base of the thumb, four fingers and palm of the human hand. The experimental data is the voltage value between 0 and 3.3V, which is obtained by converting the analog signal collected by ADC into a discrete voltage signal. The overall original data set has 4 columns, corresponding to four channels.
[0062] After the experiment was completed, the actual drilled circular hole was photographed using an optical magnifying glass and a customized standard circular sheet. The thickness of the circular sheet was about 0.1 mm, which effectively avoided the large difference between the two circular holes due to thickness issues. After the photo was taken, the hole contour information was extracted using the OpenCV image module.
[0063] Step 02. Transfer the collected data to the computer through the Bluetooth module to complete the data preprocessing, including the processing of missing values and outliers (missing value processing: during the collection process, the data collection process may be interrupted due to unstable connection of the DuPont line, or loose Bluetooth and serial ports, resulting in missing values and outliers. For missing values, the missing values are mean-filled on the original data set through Python software. When garbled data is detected in the data set, it is deleted to avoid abnormalities in subsequent feature data calculations.), and import motor parameters and external information under different working conditions, including material type, drill diameter, material thickness, etc. to perform dimensionless data normalization and data encoding processing (machine learning algorithms cannot directly process text data or category data, so data encoding is required. Data encoding The main purpose of is to convert non-numeric data into numerical data that the model can process. For unordered categorical data, such as the type of experimental board, user gender and other data, label encoding may introduce unnecessary order relationships, causing the model to misunderstand the size relationship between categories. For example, label encoding may map "plastic board" to 0, "acrylic board" to 1, and "wooden board" to 2, which will cause the model to believe that the importance of the plastic board category feature is greater than the acrylic board category feature, but in fact they have no order relationship. Therefore, it is necessary to convert the type and category of the experimental board into the data encoding corresponding to the unordered data, such as "plastic board, wooden board" —> [[1,0], [0,1]], converted into a matrix of 2 rows and 2 columns, 1 indicates the presence of a plastic board, 0 indicates the absence of a plastic board, and one column of data is converted into two columns. When it exists, the corresponding column is set to 1, and when it does not exist, it is set to 0), that is, Figure 1 The main work of Part II.
[0064] To ensure the accuracy and comprehensiveness of the experimental results, it is necessary to preprocess the original dataset and consider the recording and analysis of other key experimental parameters, including the diameter of the drill bit, the rotation speed of the electric drill, the material type and thickness. Since the intelligent glove is mainly used to record the pressure changes generated by different parts of the hand during the drilling experiment and cannot directly obtain these important actual physical characteristics, supplementation and improvement are required.
[0065] Step 03: Extract features from the preprocessed dataset. Feature extraction includes time-domain feature extraction and frequency-domain feature extraction; including time-domain features such as mean, root mean square value, variance, skewness, impulse value, etc. and frequency-domain features such as fast Fourier transform, and extract the feature data, that is Figure 1 the main work of part II in
[0066] The mean is used to describe the central tendency of the dataset and represents the average level of all numerical values in the dataset. It is often used to evaluate the overall level of the signal and reflects the overall change trend of the signal.
[0067]
[0068] where Mean represents the mean, and x i is the i-th data point in the time series, and n is the total number of data points; the root mean square value RMS describes the "effective value" or "average amplitude" of the signal and is particularly suitable for evaluating the energy or intensity of the signal. RMS is the square root of the mean square value of the signal over a time interval and is often used to measure the intensity of periodic or irregular signals.
[0069]
[0070] where x i is the i-th data point in the time series, and n is the total number of data points.
[0071] Variance is a statistic that describes the degree of dispersion of data and represents the average squared difference between the data and the mean. The larger the variance, the stronger the dispersion of the data; conversely, the smaller the variance, the more concentrated the data.
[0072]
[0073] where: x i is the i-th data point; μ is the mean of the data; n is the number of data points.
[0074] Skewness is a statistic used to measure the asymmetry or skewness of the data distribution. It describes the shape of the data distribution, especially its symmetry and the bias of the tails. The value of skewness provides information about how the data distribution deviates from the normal distribution.
[0075]
[0076] where n is the number of data points; x i is the i-th data point in the time series; μ is the mean of the data; σ is the standard deviation of the sample.
[0077] The peak value of the pulse is used to measure the maximum instantaneous amplitude of the signal at a certain time point. It is usually used to represent the limit intensity or extreme value of the signal, especially when dealing with signals with strong instantaneous changes (such as pulse signals or spike signals). Peak value of discrete signal: For discrete time series data x1, x2, …, x n , the peak value is the value with the largest absolute value among these data, that is:
[0078] Peak Value = max(|x1|, |x2|, …, |x n |)
[0079] The fast Fourier transform (FFT) is an efficient computational algorithm for the Fourier transform, which is used to transform the signal from the time domain to the frequency domain. The Fourier transform essentially decomposes a time-domain signal into a combination of sine waves of different frequencies, and the FFT accelerates this process by reducing the amount of calculation, especially suitable for the processing of large-scale data. The discrete Fourier transform (DFT) is the basic method for performing the Fourier transform on discrete signals, and the formula is:
[0080]
[0081] where N is the length of the signal, x[i] is the i-th sample of the time-domain signal, X[k] is the k-th frequency component of the frequency-domain signal, and j represents the imaginary unit, j 2 = -1.
[0082] Step 04: The method for extracting contour information of the acquired image based on OpenCV. Extracting the information of the hole contour is a crucial step in evaluating the shape and size of the hole. By accurately identifying and extracting the contour information of the hole, the size parameters of the hole can be precisely quantified, and the morphological characteristics of the hole can be further analyzed, thereby providing a basis for quality assessment. Extract the contour information of the hole from the image for the quality assessment of the hole;
[0083] Preprocess the image before extraction, including image segmentation, image denoising, grayscale conversion, contrast enhancement, binarization, edge detection, contour extraction, etc. (Image segmentation: By means of image cropping, etc., the actually captured image is divided into left and right parts as evenly as possible. The left part corresponds to the image of the ideal circular contour in the control group, and the right part corresponds to the image of the actual hole contour. Image denoising: The image may be affected by various noises during the acquisition process. The presence of noise will interfere with subsequent processing and analysis. Using Gaussian filtering to smooth the image through the Gaussian function can effectively remove random noise. Grayscale conversion: Grayscale conversion can convert a color image into a grayscale image, simplify the image processing process, reduce the computational complexity, and improve the processing efficiency at the same time. By the weighted average method, the three color channels of RGB are combined into a grayscale value according to certain weighting coefficients. Contrast enhancement: In the captured image, the contrast between the hole and the background may be low, resulting in unclear contours. Contrast enhancement can effectively improve this situation and make the edges of the holes more prominent. Through histogram equalization, the gray level distribution of the image is equalized, and the global contrast of the image is enhanced, making the details in the image clearer. Binarization processing: Convert the pixel values in the image into two categories of black and white, making the target object and the background of the image more obvious. By the local threshold method, a fixed threshold is set, and the pixels higher than the threshold are set to white, and the pixels lower than the threshold are set to black. Canny algorithm: Set upper and lower thresholds to identify the edges in the image and provide clear edge information.)
[0084] Adopt the Canny algorithm edge detection method of the image to extract the contour: Apply the external contour recognition function in OpenCV, which can recognize the closed edges and return the coordinate information of a series of contours.), that is Figure 3 The main process. Use the Canny algorithm edge detection method of the image to extract the contour information and obtain the radius of the circle in the control group and the radii of the circumscribed circle and inscribed circle of the actual hole contour:
[0085]
[0086] R out = r * r out ;
[0087] E in = r * r in ;
[0088]
[0089] Among them, R is the ideal radius of the actual hole, R ideal is the radius of the hole in the control group, r is the ratio of the two, R out is the radius of the circumscribed circle of the actual hole, R in is the radius of the inscribed circle of the actual hole, r outis the radius of the circumscribed circle of the hole obtained by contour extraction, r in is the radius of the inscribed circle of the hole obtained by contour extraction. S is the matching degree between the actual hole radius and the ideal hole radius, which is used to evaluate the quality of the hole.
[0090] Step 05: For the feature data extracted after the extraction of the feature data, the extracted feature data includes the time-domain and frequency-domain feature data calculated from the original data in Step 3, including variance, mean, skewness, kurtosis, impulse value, and fast Fourier transform fft, as well as feature data such as the type, thickness, drill bit diameter, and duty cycle of the experimental board; while the feature data proposed by the image processing in Step 4 is the deviation degree between the inscribed and circumscribed circles of the actual hole and the standard circle, which is used as the target for model prediction, that is, the index of quality evaluation and the label value, and machine learning algorithm model training is carried out: After grid search for the parameters of the model, cross-validation is performed, and the confusion matrix and evaluation index histogram of the model are output, and the model with the best prediction effect in the confusion matrix and evaluation index histogram is selected; including the selection and parameter optimization of algorithm models such as KNN, random forest, SVM, and XGBoost, that is Figure 1 the main part of the work in II.
[0091] KNN is a widely used machine learning algorithm that can be applied to both classification problems and regression tasks. The core idea is to make predictions based on the distance relationship between samples, that is, given a data point to be predicted, find the K most similar samples in the training set (from the original data set after time-domain and frequency-domain feature calculations, and supplemented with actual features, including feature data such as the material, thickness, drill bit diameter, and duty cycle of the experimental board, as well as the radius deviation between the contour information extracted from the image and the ideal hole, defined as the deviation degree as the prediction target. That is, the data set and the label. When performing machine learning training, including algorithms such as KNN, SVM, random forest, and XGBoost, the data set is divided into 70% training set and 30% test set.). Then, based on the categories or values of these neighboring samples, predict the label or value of this data point. In a regression problem, KNN predicts the value of the test sample by calculating the average or weighted average of the target values of the K nearest neighbors; the Euclidean distance is a common method for measuring the straight-line distance d(b, c) between two points in a metric space, and the calculation formula is as follows:
[0092]
[0093] where b i is the i-th data point in sample b, c1 is the i-th point in sample c, each sample contains multiple feature data and target values, and by calculating the distance between the two of them, the category of the sample is defined, and m is the total number of samples.
[0094] Random Forest is an ensemble learning model that makes final predictions by constructing multiple decision trees and combining their output results. Each tree is trained based on a random subset of the original data, and when building each tree, a randomly selected subset of features is used, thus enhancing the generalization ability of the model. In the hyperparameter tuning of Random Forest, cross-validation can be used to perform combined training on the number of trees n_estimators, maximum number of features max_features, maximum depth max_depth, minimum number of samples min_samples_split, and class weight class_weight;
[0095] SVM is a supervised learning model widely used in machine learning, especially suitable for classification problems, and can also be used for regression analysis. The core idea of SVM is to map data points to a high-dimensional space, and in this space, find an optimal hyperplane to maximize the margin between classes. Different kernel functions can be selected for training and hyperparameter tuning. Linear kernel function: The simplest kernel function, when the data is linearly separable, the linear kernel is very effective. It directly calculates the inner product between input samples without any mapping.
[0096] K(x,x ′ )=x·x ′ ;
[0097] where K(x,x ′ )=x·x ′ is the linear kernel function, that is, the dot product between two sample points x and x ′ .
[0098] Polynomial kernel function: The polynomial kernel is a way to extend the linear kernel. It maps data to a high-dimensional space through polynomial mapping. The form of the polynomial kernel function is:
[0099] K(x,x ′ )=(x·x ′ +p) d ;
[0100] where p is the constant term and d is the degree of the polynomial. Adjusting h and d can control the complexity of the mapping.
[0101] Radial Basis Function kernel RBF: Defines similarity by calculating the Euclidean distance between input samples. The form of the RBF kernel function is:
[0102]
[0103] where, ‖x - x ′ ‖ is the Euclidean distance between sample x and x ′The Euclidean distance between them, where h is the width parameter of the RBF kernel. When the data distribution is complex and non-linear, the RBF kernel can map the data to a higher-dimensional space through non-linear mapping, making the data linearly separable in this space.
[0104] XGBoost is a machine learning algorithm based on the Gradient Boosting Decision Tree (GBDT). It generates a strong learner by enhancing the performance of weak learners, featuring higher computational efficiency and better performance. The core idea of XGBoost is to build a new decision tree step by step through iterative means to "correct" the prediction errors of the previous tree, and finally combine the prediction results of these trees through weighted summation. In the parameter tuning of XGBoost, cross-validation can be used to combine and train the number of weak estimators n_estimators, learning rate learning_rate, maximum depth max_depth, minimum sample weight min_child_weight on each leaf node, subsample ratio of samples used for training each tree, colsample_bytree ratio of features used for training each tree, lambda L2 regularization term, and alpha L1 regularization term.
[0105] The four evaluation metrics are accuracy, precision, recall, and F1-score. Let T (True) represent correct, F (False) represent incorrect, P (Positive) represent classification result 1, and N (Negative) represent classification result 0. TP represents the quantity of data correctly classified as result 1, TN represents the quantity of data correctly classified as result 0, FP represents the quantity of data misclassified as result 1, and FN represents the quantity of data misclassified as result 0. The accuracy Acc is the percentage of correctly predicted results in the total data volume, and the calculation formula is as follows:
[0106]
[0107] Precision Pre is the probability of actual positive data among all data predicted as positive, and the calculation formula is as follows:
[0108]
[0109] Recall Rec is the probability of data predicted as positive among actual positive data, and the calculation formula is as follows:
[0110]
[0111] The F1 Score is a comprehensive indicator considering the balance between the two, and the calculation formula is as follows:
[0112]
[0113] The best XGBoost model is selected from multiple trained algorithm models for prediction of the intelligent electric drill control system. For different working conditions, the model will give prediction results, which will be sent to the single-chip microcomputer through Bluetooth communication. The single-chip microcomputer controls the motor through the L298N motor driver based on the prediction results. After receiving the PWM signal sent by the STM32F103C8T6 single-chip microcomputer, the L298N driver adjusts the current supply of the motor to control the speed of the electric drill. Specifically, the duty cycle of the PWM signal determines the power output of the motor, which in turn affects the rotation speed and drilling efficiency of the electric drill.
[0114] Step 06: Based on the predicted results, the microcontroller controls the electric drill to reach the optimal speed, which improves the operating efficiency and safety. Figure 1 The main work of Part III in the PWM signal is as follows. Specifically, the duty cycle of the PWM signal determines the power output of the motor, which in turn affects the rotation speed and drilling efficiency of the electric drill. The microcontroller converts the received prediction results into control signals and generates corresponding PWM waveforms to adjust the working state of the electric drill in real time.
[0115] like Figure 2 As shown, this embodiment also provides a system for implementing the data glove-based handheld electric drill intelligent control method, including smart gloves, motors, single-chip microcomputers, Bluetooth communication modules, and computers. The smart gloves include ZNS-01 thin film pressure sensors and ordinary gloves; the ZNS-01 thin film pressure sensors are attached to ordinary gloves in the shape of human hands, corresponding to the thumb, base of the thumb, four fingers and palm of the human hand, and are used for collecting pressure signals; the sensor is connected to the single-chip microcomputer through the Bluetooth communication module, and the collected data is sent to the single-chip microcomputer, and the single-chip microcomputer adjusts the motor speed according to the received information.
[0116] The data gloves are built by using a single-chip microcomputer and a ZNS-01 thin film pressure sensor. The ZNS-01 thin film pressure sensor is thin, light, highly sensitive, resistant to bending, and has low power consumption. The ZNS-01 thin film pressure sensor is in the shape of a human hand. The sensor contains four independent channels, corresponding to the thumb, base of the thumb, four fingers, and palm of the human hand, for collecting pressure signals. It is adhered to an ordinary rubber glove using high-temperature glue B-7000 to make a prototype of the data glove.
[0117] The single-chip microcomputer is the STM32 F103C8T6 single-chip microcomputer. By setting the GPIO port to the analog input mode for ADC acquisition, the selected ports in this embodiment are PA4 - PA7, which are respectively connected to the four channels of the ZNS-01 thin-film pressure sensor, constituting the data acquisition system of the data glove. The DMA module assists the ADC module in collecting the pressure data of the four channels. Data is transmitted to the computer terminal through the serial port USART and Bluetooth communication for subsequent data analysis, and the corresponding motor control code is written. As shown in Table 1, the computer terminal will classify the prediction results according to the deviation degree: when the deviation degree is between 0 and 0.1, hexadecimal 1 is sent; when the deviation degree is between 0.1 and 0.2, hexadecimal 2 is sent; when the deviation degree is between 0.2 and 0.3, hexadecimal 3 is sent; when the deviation degree is between 0.3 and 0.4, hexadecimal 4 is sent; when the deviation degree is between 0.4 and 1, hexadecimal 5 is sent; and then it is sent to the single-chip microcomputer through the serial port. The single-chip microcomputer adjusts the motor speed according to the received information.
[0118] Table 1 Motor control code
[0119]
[0120]
[0121] According to the needs of experimental acquisition, the ADC module selects the GPIO ports of PA4 - PA7 to be multiplexed for ADC acquisition. The single-chip microcomputer can read the voltage value of the analog signal converted into a digital signal. In the single-chip microcomputer program, corresponding configurations are made for the ADC, including enabling the ADC clock to ensure the normal operation of the ADC and enabling the ADC function; in order to reduce the burden on the CPU, the DMA module enables the DMA function to assist the ADC in completing data acquisition. In the single-chip microcomputer program, corresponding configurations are also made for the DMA, including initialization, setting the ADC to enable the DMA function, enabling the DMA clock, etc., to control the electric drill to drill under different working conditions and collect the corresponding pressure data; among them, the ADC module and the DMA module are used for data acquisition, that is Figure 1 the main work in part Ⅰ and Figure II the data acquisition shown in
[0122] In the microcontroller part, the STM32F103 C8T6 single-chip microcomputer is adopted, which has low power consumption, fast response time, low cost, good stability and relatively rich peripheral resources. In the sensor part, the ZNS-01 thin-film pressure sensor is selected. In the pressure range of 0 to 5N, the resistance value shows a relatively significant change, meeting the mechanical requirements of the human hand during slapping or other actions. Through experimental design, the pressure data of the electric drill under different working conditions is collected.
[0123] The ZNS-01 thin-film pressure sensor is designed based on the piezoresistive effect. Its core principle is that the deformation of the semiconductor material causes a change in the internal resistance value, thereby achieving the precise capture of pressure signals. In the pressure range of 0 to 5N, the ZNS-01 sensor shows a relatively significant change in resistance value, which exactly meets the mechanical requirements of the human hand during slapping or other actions, and helps to achieve the precise perception and monitoring of hand movements.
[0124] The data collected is transmitted to the computer through the Bluetooth module to complete the preprocessing of the data, including the handling of missing values and outliers, and the import of motor parameters and external information under different working conditions, such as material type, drill bit diameter, material thickness, etc. for data dimensionless processing and data coding processing. Using Bluetooth communication for data transmission has the advantages of high cost performance, easy integration, good compatibility, and security, realizing wireless communication. The collected original data set needs to be preprocessed due to the influence of instrument disturbance, noise interference, etc., to ensure that the trained model not only performs well on the training set but also maintains a high accuracy on new data.
[0125] The prediction module includes a prediction model with high accuracy constructed based on machine learning algorithms, which can predict the drilling quality under different working conditions and adjust the electric drill parameters in real time through the intelligent glove.
[0126] Specifically, the intelligent glove collects data under different working conditions of drilling, sends it to the computer for data processing, and trains and predicts the data through a machine learning regression model. The prediction target is the deviation degree. The computer end classifies the prediction results according to the deviation degree and then sends them to the single-chip microcomputer through the serial port. The single-chip microcomputer adjusts the motor speed according to the received information. The single-chip microcomputer has written relevant motor control codes, matches different PWM control logics according to the classification results of the computer, and controls the motor through the L298N motor drive module according to the PWM. The L298N motor drive module can be used to control DC motors and supports the single-chip microcomputer to control the motor through PWM. L298N belongs to the motor control module. Subsequent machine learning predicts different working conditions of the electric drill, and the predicted results will be sent to the single-chip microcomputer. The single-chip microcomputer has a built-in parameter matching function, and the single-chip microcomputer adjusts the PWM output according to the predicted results and controls the motor through L298N. Connection of L298N: The power supply pins of L298N are connected to the positive and negative poles of the 12V power supply, the motor output pins are connected to the PWM output pins (configuring the GPIO port of the single-chip microcomputer as the PWM output pin), and the motor control pins are connected to the GPIO output pins. The single-chip microcomputer configures to control the start and stop of the motor. 1 represents high level to start the motor, and 0 represents low level to stop the motor to optimize the drilling quality. The prediction results of the prediction model are sent to the single-chip microcomputer through the Bluetooth communication module.
[0127] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the present invention, so that those skilled in the art can well understand and utilize the present invention. The present invention is only limited by the claims and their full scope and equivalents.
Claims
1. A handheld electric drill intelligent control method based on a data glove, characterized in that, It includes the following steps: Control the electric drill to drill holes by wearing intelligent gloves and collect corresponding pressure data; Input the pressure data into the trained prediction model to predict the drilling quality under different working conditions, and send the prediction results to the single-chip microcomputer to adjust the electric drill parameters in real time and optimize the drilling quality; The training of the prediction model includes the following steps: Step 1: Collect the pressure data and image data of the electric drill under different working conditions; Step 2: Preprocess the collected data; Step 3: Extract features from the preprocessed data set. Feature extraction includes time-domain feature extraction and frequency-domain feature extraction; Step 4: Based on the contour information extraction method of OpenCV, extract the contour information of the hole from the image as the quality evaluation of the hole; Step 5: Use the time-domain and frequency-domain feature data extracted in Step 3 to train multiple machine learning algorithm models: perform grid search on the parameters of the models and then conduct cross-validation, and output the bar charts of the determination coefficient and root mean square error evaluation indexes of the models, and select the model with the best prediction effect as the prediction model; Step 6: Based on the prediction results, the control system matches the best electric drill parameters of the electric drill in real time to improve the operation efficiency and safety.
2. The intelligent control method of a hand-held electric drill based on a data glove according to claim 1, wherein: In Step 1, the preprocessing includes the processing of missing values and outliers, and import the motor parameters and external information under different working conditions for dimensionless and normalization of the data and data coding processing.
3. The intelligent control method of a handheld electric drill based on a data glove according to claim 1, wherein: In Step 2, the motor parameters and external information include material type, drill bit diameter, and material thickness.
4. The intelligent control method of a handheld electric drill based on a data glove according to claim 1, characterized in that, In Step 3, the time-domain features include mean value, root mean square value, variance, skewness, and peak value, and the frequency-domain features include fast Fourier transform; Mean value: where Mean represents the mean value, and x i is the i-th data point in the time series, and n is the total number of data points; Root mean square value RMS: where x i is the i-th data point in the time series, and n is the total number of data points; Variance: where: x i is the i-th data point in the time series; μ is the mean of the data; n is the number of data points; Skewness: where n is the total number of data points; x i is the i-th data point in the time series; μ is the mean of the data; σ is the standard deviation of the sample; Peak Value: Peak Value=max(|x1|,|x2|,…,|x n |); Fast Fourier transform: Wherein, N is the length of the signal, x[i] is the i-th sample of the time-domain signal, X[k] is the k-th frequency component of the frequency-domain signal, and j represents the imaginary unit.
5. A handheld electric drill intelligent control method based on a data glove according to claim 1, characterized in that, In Step 4, the method for extracting the contour information of the hole based on the contour information extraction method of OpenCV is the edge detection method of the image Canny algorithm. Extract the contour information to obtain the radius of the control group circle and the inscribed and circumscribed circle radii of the actual hole contour; R out =r*r out ; R in =r*r in ; Among them, R is the ideal radius of the actual hole, R ideal is the hole radius of the control group, r is the ratio between the two, R out is the actual circumradius of the hole, R in is the actual inradius of the hole, r out is the circumradius of the hole obtained by contour extraction, r in is the inradius of the hole obtained by contour extraction, S is the matching degree between the actual hole radius and the ideal hole radius, which is used to evaluate the quality of the hole.
6. A handheld electric drill intelligent control method based on a data glove according to claims 1 to 6, characterized in that, In Step 5, the machine learning algorithm models include KNN, random forest, SVM, and XGBoost algorithm models, and select the model with the best prediction effect in the confusion matrix and the evaluation index bar chart as the prediction model.
7. The intelligent control method of a hand-held electric drill based on an intelligent data glove according to claim 6, characterized in that, In Step 6, select the model with the best effect from the trained multiple machine learning algorithm models for the prediction of the intelligent electric drill control system. For different working conditions, the model will give prediction results, and send the prediction results to the single-chip microcomputer through Bluetooth communication; the single-chip microcomputer adjusts the current supply of the motor through the prediction results, thereby controlling the rotation speed of the electric drill.
8. A system for implementing the intelligent control method of a hand-held electric drill based on an intelligent data glove as described in claims 1 to 7, characterized in that, It includes an intelligent glove, a motor, a single-chip microcomputer, a Bluetooth communication module, and a computer, The intelligent glove includes a sensor and an ordinary glove; The sensor is adhered to an ordinary glove in the shape of a human hand, corresponding to the four parts of the thumb, the thumb web, the four fingers and the palm of the human hand, and is used for collecting pressure signals; the sensor sends the collected data to the single-chip microcomputer through the Bluetooth communication module, the computer classifies the prediction results according to the deviation degree, and then sends them to the single-chip microcomputer through the serial port, and the single-chip microcomputer communicates with the prediction module through Bluetooth; A prediction model with high accuracy is built in the computer based on the machine learning algorithm, which is used to predict the drilling quality under different working conditions, and the drill parameters are adjusted in real time through the information collected by the sensor to optimize the drilling quality, and the prediction results of the prediction model are sent to the single-chip microcomputer, and the single-chip microcomputer adjusts the motor speed according to the received information.
9. The system according to claim 8, wherein The sensor is a ZNS-01 thin film pressure sensor.
10. A computer device, characterized in that, It includes: a memory, a processor and a computer program stored on the memory. When the computer program is executed on the processor, it realizes a handheld electric drill intelligent control method according to any one of claims 1 to 8.