Next Article in Journal
Assessment of Sensitivity and Profitability of an Intravaginal Sensor for Remote Calving Prediction in Dairy Cattle
Previous Article in Journal
Perioperative Sensor and Algorithm Programming in Patients with Implanted ICDs and Pacemakers for Cardiac Resynchronization Therapy
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

RBFNN Design Based on Modified Nearest Neighbor Clustering Algorithm for Path Tracking Control

1
Department of Electronics Convergence Engineering, Wonkwang University, Iksan 54538, Korea
2
School of Mechanical and Intelligent Manufacturing, Jiujiang University, Jiujiang 332005, China
3
School of Mechanical Engineering, Chungnam National University, Daejeon 34134, Korea
4
Wonkwang Institute of Material Science and Technology, Wonkwang University, Iksan 54538, Korea
*
Authors to whom correspondence should be addressed.
Sensors 2021, 21(24), 8349; https://doi.org/10.3390/s21248349
Submission received: 29 November 2021 / Revised: 11 December 2021 / Accepted: 12 December 2021 / Published: 14 December 2021
(This article belongs to the Section Sensors and Robotics)

Abstract

:
Radial basis function neural networks are a widely used type of artificial neural network. The number and centers of basis functions directly affect the accuracy and speed of radial basis function neural networks. Many studies use supervised learning algorithms to obtain these parameters, but this leads to more parameters that need to be determined, thereby making the system more complex. This study proposes a modified nearest neighbor-based clustering algorithm for training radial basis function neural networks. The calculation of this clustering algorithm is not large, and it can adapt to varying densities. Furthermore, it does not require researchers to set parameters based on experience. Simulation proves that the clustering algorithm can effectively cluster samples and optimize the abnormal samples. The radial basis function neural network based on modified nearest neighbor-based clustering has higher accuracy in curve fitting than the conventional radial basis function neural network. Finally, the path tracking control based on a radial basis function neural network of a magnetic microrobot is investigated, and its effectiveness is verified through simulation. The test accuracy and training accuracy of the radial basis function neural network was improved by 23.5% and 7.5%, respectively.

1. Introduction

Path tracking control is a commonly used motion control method for vehicles and robots. Owing to its simple structure, easy operation and adjustment, and robustness, the proportion integral differential (PID, as shown in Appendix A) controller is often used for path tracking control [1,2]. However, the ability of PID in dealing with nonlinear systems is limited. Therefore, fuzzy PID control was developed. B.B. Ghosh et al. developed a fuzzy-PID-based controller to control the two degrees of freedom parallel manipulator. The control system has almost no overshoot based on the fuzzy-PID [3]. J.A. Algarin-Pinto et al. compared the fuzzy-PID with general PID for path tracking control of biomimetic autonomous underwater vehicles. The experiment results showed that path tracking control error with general PID was over 9%, but with fuzzy-PID was less than 2% [4]. T.A. Mai et al. applied fuzzy PID in path-following control of a nonholonomous mobile robot. Under the control system based on fuzzy-PID, the distance error of path-following control could be reduced from 0.172 m to 0.041 m [5]. Nonetheless, fuzzy rules require strong prior knowledge. Due to the time-varying dynamics, nonlinear uncertainty of the control object, and environmental interference, it is extremely difficult to control the high-precision path tracking for the linear state observer because it is difficult for the linear state observer to compensate errors of the nonlinear system [6]. The previous methods are incapable of addressing these issues. Although a sliding mode controller could control the trajectory tracking of a nonlinear system [7,8], it occasionally caused a large lateral acceleration in the trajectory tracking using the sliding mode control method.
To deal with nonlinear systems, C. Liu et al. proposed a nonlinear adaptive controller based on PID [9]. B. Smeresky et al. discussed a deterministic artificial intelligence-instantiated method for a nonlinear system, which stems from a lineage of nonlinear adaptive control [10]. Compared with these methods, artificial neural networks have attracted increasing interest from researchers because they do not require complex modeling process or powerful processing, and have adaptive capabilities in constantly changing and noisy environments. Utilizing the learning ability of an artificial neural network facilitates improved flexibility of controller design, particularly when the dynamics of the controlled object are complex and highly non-linear [11]. Radial basis function neural networks (RBFNN) have the advantages of fast learning convergence speed and strong approximation ability; they have been used in finite-time trajectory tracking control of n-link robotic manipulators [12], longitudinal speed tracking of autonomous vehicles [13], trajectory tracking for a robotic helicopter [14], and tracking control of a nonholonomic wheel-legged robot in complex environments [15]. In these cases, the control systems based on RBFNN showed good accuracy and stability.
Before running an RBFNN, it is necessary to determine the relevant parameters, such as the type and number of basis functions, the center and the width of the basis functions, and the weight of each hidden layer neuron. These parameters affect not only the learning time, but also the controller performance [16,17]. To optimize the relevant parameters of an RBFNN, supervised learning or unsupervised learning methods can be used. In supervised learning, other intelligent algorithms are introduced to optimize the parameters of the RBFNN. F. Fernandez-Navarro et al. investigated performance of an RBFNN based on support vector machines (VSM). The parameters of VSM should be defined [18]. H.C. Huang et al. presented an evolutionary radial basis function neural network with genetic algorithm (GA) and artificial immune system (AIS) for tracking control of autonomous robots. Although the controller based on a GAAIS-RBFNN showed better performance than the controller based on an individual genetic algorithm and artificial immune system, GAAIS-RBFNN involved more variables to be decided [19]. Z.Y. Chen et al. trained the RBFNN by particle swarm optimization and genetic algorithm. The RBFNN showed good learning performance, but the algorithm was more complex [20]. When using unsupervised learning to design and optimize the parameters of an RBFNN, the clustering algorithm is a commonly used method that can speedily converge and avoid overfitting. A. Guillén et al. developed a clustering algorithm with a possibilistic partition to get the initial center of hidden layer neurons of an RBFNN. The algorithm showed better robustness than other general RBFNNs [21]. S.K. Oh et al. applied a k-means clustering algorithm in setting the center of hidden layer neurons of RBFNN; the algorithm showed good accuracy [22]. C.C. Liao et al. introduced an RBFNN-based control system for tracking the maximum power point of a photovoltaic system. The parameters of RBFNN were determined by the modified k-means clustering algorithm. The experiment results proved the tracking method was effective [23].
However, most clustering algorithms need to determine some parameters in advance; for example, k-means requires the number of clusters and initial center of cluster to cluster the samples; density-based spatial clustering of applications with noise (DBSCAN) requires the radius of the scan and the minimum number of samples of the cluster for clustering; clustering by fast search and find of density peaks clustering (DPC) requires the threshold of distance. These parameters are extremely important and affect the results of clustering significantly, but it is necessary for users to determine and adjust the parameters based on experience, which is difficult. Moreover, common clustering algorithms often require iteration or a large calculation that reduces the efficiency of the clustering algorithm. To avoid these issues, we propose a modified nearest neighbor-based clustering (MNNC) algorithm according to the characteristics of curve fitting and path following control datasets. Unlike other clustering algorithms, MNNC clusters the samples referring to the distance between the sample and its nearest neighbor. It is easy to utilize this algorithm because it requires fewer parameters to be determined. Furthermore, MNNC improves the approach to searching for neighbors, thus it does not require iteration and requires less calculation which increases the efficiency of clustering. We evaluated the clustering results using accuracy (ACC) and adjusted Rand index (ARI); the simulation results show that ACC and ARI using MNNC are 20% and 10% higher than the common clustering algorithms, respectively. MNNC can also detect and optimize the outlier samples, and the simulation results show that the optimization of outlier samples can decrease the curve fitting errors by 10–50%. MNNC was used to set the initial parameters of RBFNN that can automatically adjust the number of hidden layer nodes according to the accuracy requirements. In particular, we applied the proposed method to a path tracking simulation of a spiral-type magnetic microrobot to generate a rotating magnetic field (RMF) to reach the desired position. Consequently, the proposed method featured 20 % lower error than conventional RBFNN.
The remainder of this study is organized as follows. Section 2 introduces the concept of RBFNN based on MNNC for path tracking. Section 3 describes a novel clustering algorithm that is applied in optimizing the samples in Section 4. Section 5 introduces the control system for the path tracking of magnetic microrobot and develops MNNC to train RBFNN for path tacking. Finally, the discussion and conclusion are presented in Section 6 and Section 7, respectively.

2. Concept of RBFNN Algorithm Based on MNNC for Path Tracking

Figure 1 illustrates the proposed RBFNN algorithm based on MNNC for path tracking. The entire algorithm consists of three parts: MNNC, RBFNN, and path tracking. The MNNC is used to obtain the initial parameter of RBFNN and optimize the training samples of RBFNN. First, MNNC characterizes sample Pi by distance (di, more variables are shown in Appendix B) between Pi and its nearest neighbor distance and classifies samples with similar di into one class. The datasets of curve-fitting and path-following control have obvious temporal or spatial order characteristics; when searching for the nearest neighbor, the search range can be reduced by improving the searching direction in order to reduce the calculation of the clustering algorithm, as shown in Figure 1a, where di is the minimal value of di1 and di2. Thereafter, the MNNC can detect and optimize the abnormal samples, as shown in Figure 1b. Pa is defined as an abnormal sample because Pa corresponds to the longest distance da, and there are no similar samples around Pa. We construct a triangle by Pa, Pa1, and Pa2, where Pa1 and Pa2 are the neighbors of Pa. Next, we obtain Pc, which is the center of the triangle, and replace Pa by Pc to optimize the training samples of RBFNN. MNNC can cluster datasets with different densities and shapes without specifying the number of clusters or scanning radius in advance, as shown in Figure 1c. Each cluster is displayed in a different color, and the cluster center is represented by blue circles. We construct the RBFNN based on MNNC. Each cluster corresponds to a hidden layer node, and the center of the cluster is the center of the node, as shown in Figure 1d. Thereafter, the RBFNN based on MNNC can be used to establish the relationship between the theoretical direction and reference direction of the magnetic microrobot’s locomotion. Therefore, if we obtain the theoretical driving direction of each step and input the theoretical direction into the RBFNN, the RBFNN outputs the reference direction. We can calculate the coil currents according to the reference direction, and accordingly, the microrobot moves along the theoretical direction driven by the magnetism generated by the coils. Finally, we can realize path tracking of the magnetic microrobot through the proposed method shown in Figure 1e.

3. Clustering Algorithm Based on Nearest Neighbor

3.1. Typical Clustering Algorithm

A clustering algorithm is a typical unsupervised learning algorithm that is mainly used to automatically classify similar samples into a specific category. The main clustering methods can be divided into five methods: the partitioning method, hierarchical method, grid-based method, model-based method, and density-based method [24]. The partition method decomposes the data into n clusters, such that the items in each cluster are closely related to each other, for example, K-means algorithm. The calculation procedure in this algorithm is simple, but it is necessary to know the number of clusters of data in advance [25].
Balanced iterative reducing and clustering using hierarchies (BIRCH) is a typical representative of the hierarchical method that decomposes a given dataset hierarchically until a certain condition is met. Specifically, it can be categorized into “bottom-up” and “top-down” schemes [26]. This algorithm is not particularly suitable for non-convex datasets, and owing to the limit on the number of each node, the clustering result may deviate from the actual classification.
Clustering in QUEst (CLIQUE) is a clustering algorithm based on the grid method. In this algorithm, the data space is first divided into a grid structure of finite units, and all processing is based on a single unit. This algorithm is highly sensitive to parameters and cannot handle irregularly distributed data [27]. There is no iteration required in this method, but it is difficult to determine the density threshold, an important parameter in the algorithm. Model-based methods set a model for each cluster, and subsequently detect a dataset that satisfies this model adequately. Such a model may be the density distribution function of data points in space or other. The efficiency of this algorithm also needs to be improved [28]. The model-based method incorporates the probability and statistics approach and the neural network approach.
Density-based methods attempt to determine the high-density clusters separated by sparse regions. The size and shape of these clusters may be different. The most commonly used clustering algorithm based on density is DBSCAN. Although this algorithm does not necessitate knowledge of the number of classes the data is divided into in advance, knowledge of the radius and the minimum number of points is required [29].

3.2. Modified Nearest Neighbor-Based Clustering Algorithm for Training RBFNN

When we train the RBFNN for curve fitting and path tracking to obtain the structure parameters, clustering the training data to determine the center and number of basis functions of the hidden layer is an effective approach. The dataset in this case features obvious time or space characteristics. Here, we propose a simple clustering algorithm MNNC that clusters the samples according to the distance (di) between the sample and its nearest neighbor, as shown in Figure 2 and Definition 1. Adjacent samples with similar di are categorized into the same cluster, and the method of searching for the nearest neighbor is modified. Only the distance between the sample and the preceding and the following samples needs to be calculated according to the property of the RBFNN training dataset. Thus, the calculation is significantly less than the other clustering algorithms, and only a single MNNC parameter requires to be determined.
The basic principle of the clustering algorithm is that similar samples are placed in the same cluster, where the similarity of two samples is described by the Euclidean distance of the two samples. Since the sample has the characteristics of time series, the nearest samples to sample P i are the adjacent samples P i 1 and P i + 1 , as shown in Figure 2a. The distances between the samples are d i 1 and d i 2 , respectively, thus the nearest distance, d i , of P i is the smaller of [ d i 1 , d i 2 ]. The calculation of this method is simpler than that of the other clustering algorithms. Thereafter, d i is divided into different levels, and the samples with the same d i level belong to the same cluster (Figure 3a).
If the samples in one cluster are not adjacent, as shown in Figure 3a (where P 8 and P 10 are not adjacent samples), the cluster is divided at the breakpoint (Figure 3b). Finally, the small clusters are merged with the adjacent clusters, as shown in Figure 3c,d. The merging criterion is that the total distance change ( Δ D ) between all samples and the centroid should be the least, such that the adjacent samples with the similar distance characteristic form a cluster. The related definitions are executed in Algorithm 1 for the distance (di), distance step (dstep), and distance changes ( Δ D ).
Algorithm 1. MNNC.
Input: training samples (P1,P2,……Pk), minimum samples number (Nmin) of cluster.
Output: clustering result
1. for each sample Pi do
2.  Calculate the di of Pi; // referring to Definition 1.
3. end for
4. for each sample Pi do // arrange the samples into clusters referring to the distance.
5.  if di < dmin + dstep then Pi ∈cluster1; // Definition 2
6.  else if di < dmin + 2 × dstep then Pi ∈cluster2;
7.  else if di < dmin + 3 × dstep then Pi ∈cluster3;
8.  else Pi ∈cluster4;
9. end if; end for
10. for cluster(i) do // The clusters with discontinuous sample numbers are divided into two clusters at the discontinuity.
11.  if the samples label of cluster(i) is not continuous then
12.   Divide the cluster(i) into cluster(i1) and cluster(i2) whose samples label is continuous.
13. end if; end for
14. for cluster(i) do // merge the small cluster into the adjacent clusters referring to Definition 3.
15.  if samples number of cluster(i) < Nmin then
16.  if ΔDi−1 < ΔDi+1 then cluster(i − 1) = cluster(i − 1) + cluster(i);
17.  else cluster(I + 1) = cluster(I + 1) + cluster(i);
18. end if; end for
19. Return clusters
Definition 1.
The distancediattribute of the sample, ( P 1 , P 2 , …… , P k ) is the dataset of path tracking control system that includes k samples, and P [ x 1 , x 2 x m ] T is a single sample of the dataset that consists of m dimension components. The distance between P i and P i 1 is d i 1 that can be expressed as [17]
d i 1 = ( x i 1 x i 11 ) 2 + ( x i 2 x i 12 ) 2 + …… + ( x i m x i 1 m ) 2
The distance between P i and P i + 1 is d i 2 that can be expressed as
d i 2 = ( x i 1 x i + 11 ) 2 + ( x i 2 x i + 12 ) 2 + …… + ( x i m x i + 1 m ) 2
The minimal distance d i among ( d i 1 , d i 2 ) is expressed as
d i = min ( d i 1 , d i 2 )
Definition 2.
Distance step(dstep) ( d 1 , d 2 , …… , d k ) is the distance of the sample ( P 1 , P 2 , …… , P k ) .
d max = max ( d 1 , d 2 , …… , d k )
d min = min ( d 1 , d 2 , …… , d k )
The distance step is calculated as follows, whereHis the number ofdilevel determined by the user.
d s t e p = d max d min H
Definition 3.
Distance change ( Δ D )
The total distance of Cluster 2 and Cluster 5 (Figure 3b) is calculated before the merge operation.
D 2 = i = 1 Q u a n 2 P i C 2 2
D 5 = i = 1 Q u a n 5 P i C 5 2
where Q u a n 2 and Q u a n 5 are the quantity of samples in Cluster 2 and Cluster 5, respectively, and C 2 and C 5 are the centers of Cluster 2 and Cluster 5 as shown in Figure 3b, respectively; the center of Cluster 2 can be determined using Equation (9), and we can obtain the centers of the other clusters similarly.
C 2 m = x 1 m + x 2 m + …… + x U m U
where C 2 m is the component m of the center of Cluster 2, and x 1 m is the component m of sample 1 of Cluster 2. The total distances of Cluster 2 and Cluster 5 are calculated after the merge operation. If Cluster 4 is merged into Cluster 2, the center of Cluster 2 becomes C2′, as shown in Figure 3c.
D 2 = i = 1 U P i C 2 2
If Cluster 4 is merged into Cluster 5, the center of Cluster 5 becomes C5′, as shown in Figure 3d.
D 5 = i = 1 V P i C 5 2
Therefore, the distance change ( Δ D ) is
Δ D 2 = | D 2 D 2 |
Δ D 5 = | D 5 D 5 |
Figure 4 shows the results of Algorithm 1 for clustering. To test the algorithm, we selected 101 points from the curve y = 1.1 ( 1 x + 2 x 2 ) e x 2 / 2 and combined them with random noise. We set the number of distance level H = 4, and tests were conducted twice with different datasets. Under these conditions, Algorithm 1 automatically generated seven and five clusters according to the distance properties (di, dstep, and Δ D ), implying that MNNC is adaptive to the different density and can tune the number of clusters automatically. Merging clusters with a small number of samples (the number is not limited to 1) into other clusters can reduce the number of clusters. In this manner, when the clustering algorithm is applied along with other intelligent algorithms, the speed of the intelligent algorithm can be improved.

3.3. Enhancement of MNNC Performance

The clustering algorithm can use the samples with a time sequence or spatial sequence, as shown in Figure 2a; the nearest neighbor of sample Pi is either Pi−1 or Pi+1. This clustering algorithm is suitable for curve fitting and path tracking control. Furthermore, the samples are randomly distributed without the time and spatial sequences, as shown in Figure 2b. In this case, the nearest neighbor of Pi may be in any direction, and we need to calculate the distances from Pi to its neighbors for determining di. The detailed calculation is shown in Definition 4. After we obtain the distances ( d 1 , d 2 , …… , d k ) , that is, the d i of the samples, we set d max = min ( d 1 , d 2 , …… , d k ) . Thereafter, the sample Pm is determined, whose distance to Pi is less than d max . These samples and Pi form a neighbor cluster of Pi. Similarly, the neighbor clusters of the other samples can be established. If the sample Pmax owns the distance attribute of dmax, and its neighbor cluster contains only two samples, we define Pmax as an abnormal sample and delete this sample. Next, we set the updated maximum distance, and subsequently establish the neighbor cluster of each sample again. If there are several neighbor clusters containing the same samples, then these neighbor clusters merge into one cluster. The execution process proceeds based on Algorithm 2.
Definition 4.Distance attribute of the sample ( d i ): To reduce the calculation, the samples are sorted byxandy, respectively.Px1andPx2are the preceding and following samples relative to samplePi, sorted by x.Py1andPy2are the preceding and following samples relative to samplePisorted byy. dx1, dx2, dy1, anddγ2are the distances betweenPiandPx1, Px2, Py1,andPy2, respectively.
d x 1 = ( x x 1 x i ) 2 + ( y x 1 y i ) 2
d x 2 = ( x x 2 x i ) 2 + ( y x 2 y i ) 2
d y 1 = ( x y 1 x i ) 2 + ( y y 1 y i ) 2
d y 2 = ( x y 2 x i ) 2 + ( y y 2 y i ) 2
di0can be expressed as
d i 0 = min ( d x 1 , d x 2 , d y 1 , d y 2 )
The samplePj; xj and yj of Pj satisfy
| x j x i | d i 0
| y j y i | d i 0
The distance betweenPj andPi:can be calculated using
d j = ( x j x i ) 2 + ( y j y i ) 2
Finally, the distance attribute of Pi is
d i = min ( d 1 , d 2 , …… , d j )
Algorithm 2. MNNC for the path tracking of magnetic microrobot.
Input: training samples (P1,P2,……Pk).
Output: clustering result.
1. for each sample Pi do
2.  Calculate the di of Pi; // referring to Definition 4.
3. end for
4. dmax = max(d1,d2,……dk); dmin = min(d1,d2,……dk);
5. dstep = (dmax + dmin)/H; //H is distance level number that is determined by user.
6. for each distance level;
7. for each sample Pi do // find the nearest neighbors of Pi and establish the neighbor clusers.
8.  Find the smaple Pm which ‖PmPi‖ ≤ dmin + H × dstep;
9.  Construct cluster(i) = (Pi, Pm);
10. end for
11. for each cluster(i) do // if clusters contain same sample, then merge these clusters into one cluster.
12.  If cluster(i) ∩ cluster(j) ≠ Ø then cluster(i) = cluster(i) + cluster(j);
13. end if; end for
14. end for
15. merge the small cluster into nearest cluster
16. Return clusters
It can be observed from the previous steps that MNNC for path tracking does not require us to pre-select important parameters based on experience. Because there is no iterative process, the calculation is not large in the algorithm. Furthermore, this clustering algorithm is also suitable for multi-dimensional samples. To verify the effectiveness of the clustering algorithm, we used MNNC, K-means, and DBSCAN to perform clustering analysis on the same samples, as shown in Figure 5.
We generated three synthetic datasets called Data 1 (Figure 5a), Data 2 (Figure 5b), and Data 3 (Figure 5c) containing 600, 1001, and 1650 samples, respectively. Data 1 consists of three clusters that are marked with ‘blue +’, ‘red +’, and ‘black +’, respectively. Data 2 also consists of three clusters that are marked with ‘blue +’, ‘red +’, and ‘black +’, respectively. Data3 consists of four clusters that are marked with ‘blue +’, ‘red +’, ‘black +’, and ‘green +’, respectively.
Figure 5d–f are the clustering results of Data 1, Data 2, and Data 3 obtained by k-means, respectively. Prior to the cluster analysis of Data 1, Data 2, and Data 3 by k-means, we set the parameter K to 3, 3, and 4, respectively, but the clustering results still remain incorrect.
Data 1 was divided into three clusters that were marked with ‘blue +’, ‘green +’, and ‘red +’, as shown in Figure 5d. As the reference result in Figure 5a shows, the samples of every cluster form a spiral. However, the cluster formations were changed when Data 1 was clustered by k-means. The changed cluster formed around each center of the clusters (C1, C2, and C3); blue cluster is the area around C1, green cluster is the area around C2, the red cluster is the area around C3. This is because of the principle of k-means that clusters the dataset based on the distance between samples and cluster centers. For example, we assume that C1, C2, and C3 are the centers of blue, green, and red clusters, respectively. Pn is any sample of the blue cluster, as shown in Figure 5d. For the sample Pn, C1 is the nearest cluster center among C1, C2, and C3. Therefore, sample Pn becomes one of the samples of the blue cluster. Similar results are shown in Figure 5e. The cluster marked with ‘red +’ consists of some samples indicated by circles and some samples indicated by “N” because C3 is the nearest cluster center for these samples. The k-means algorithm divides the samples in “N” into three different clusters that are marked with ‘blue +’, ‘green +’, and ‘red +’, respectively. However, in the reference result (Figure 5b), the samples in “N” form a single cluster (red +), and the samples in one circle form a single cluster as well. In Figure 5f, Data 3 is divided into four clusters by k-means algorithm, but the green cluster contains samples into two arcs because C2 becomes the nearest cluster center for the samples in this case. The blue cluster includes the samples of a circle and two arcs, and the samples in “I” are divided into two clusters. However, the reference result (Figure 5b) shows that the samples in one arc should form a single cluster, and the samples in circle and “I” should also form a single cluster, respectively. According to Figure 5d–f we can conclude that k-means was unsuccessful in clustering Data 1, Data 2, and Data 3.
During the simulation, we set R (scanning radius) of DBSCAN equal to the maximum distance (dmax) of MNNC, and set the same Mp (minimal points number) for Data 1, Data 2, and Data 3. The clustering results of Data 1, Data 2, and Data 3 by DBSCAN are shown in Figure 5g–i respectively. As shown in Figure 5g, DBSCAN divided Data 1 into three clusters precisely, as shown in Figure 5g; it placed the samples of one spiral in an independent cluster. DBSCAN generated three clusters for Data 2, as shown in Figure 5h; the three clusters were marked with ‘blue +’, ‘green +’, and ‘red +’, respectively. However, as shown in Figure 5i DBSCAN divided the samples in “I” into two clusters that were marked with ‘pink +’, and ‘black +’. The clustering result of Data 3 by DBSCAN is not equivalent to the reference result for Data 3 that shows that the samples in “I” belong to a single cluster. This is because DBSCAN not only depends on the parameter R, but also on the parameter Mp. However, at this time, Mp is not suitable for Data 3 anymore, implying that we should define two correct parameters of DBSCAN for different cases based on experience.
Figure 5j–l are the clustering results of Data 1, Data 2, and Data 3 usingMNNC, respectively. Figure 5j,k show that MNNC generated equivalent clusters for Data 1 and Data 2. MNNC divided the samples of Data 1 and Data 2 into three clusters that were marked with ‘blue +’, ‘green +’, and ‘red +’, respectively. MNNC almost clustered Data 3 correctly, except it regarded one sample in “I” as an abnormal sample (marked with “black ×”), as shown in Figure 5l. This is because the sample, marked with “black ×”, features the largest di, and there are no similar samples around it.
Therefore, we can conclude that MNNC features the best clustering function for these datasets. Simultaneously, MNNC does not require users to decide the parameters, whereas both DBSCAN and k-mean require users to define two parameters. To clearly describe the clustering results, we used ACC and ARI to evaluate the clustering results [30]. The results are shown in Table 1.
As shown in Table 1, the ACC and ARI of three datasets of k-means clustering are much smaller than those of DBSCAN and MNNC, implying that the clustering results by k-means are lower than those obtained by DBSCAN and MNNC. The ACC and ARI of the spiral and zigzag of DBSCAN and MNNC are all 1, indicating that both DBSCAN and MNNC cluster those two datasets precisely. The ACC index of C4 of DBSCAN and MNNC are 0.8558 and 0.9994, respectively. The ARI index of C4 by DBSCAN and MNNC are 0.9019 and 0.9994, respectively. Both indexes of DBSCAN are smaller than those of MNNC which implies that the clustering results of MNNC are better than those of DBSCAN. The result of clustering index is similar to the clustering result, as shown in Figure 5.

4. Adjustment of Training Samples Based on MNNC

The abnormal samples can be optimized by unsupervised methods before the intelligent algorithm parameters are defined. Therefore, the unsupervised methods can significantly improve the predictive ability of intelligent algorithm models [31]. Abnormal training samples always affect the operating efficiency of neural networks [32]; it is necessary to detect the abnormal samples and treat them. Training samples for the path tracking system with abnormal samples are shown in Figure 6a. The abnormal samples are marked as stars that reduce the learning effect of the algorithm for path tacking such as RBFNN. We can detect the abnormal samples by MNNC that requires fewer parameters than the other algorithms. After defining the abnormal samples, we can delete them directly, but it is not particularly effective for curve fitting or path tracking control.
Particularly, when the number of training samples is not large, insufficient training samples also reduce the accuracy of RBFNN. It is effective to adjust the abnormal samples to normal samples. The process of detecting and adjusting abnormal samples is performed by MNNC. First, the training samples are clustered by MNNC. There are some independent samples because they are far away from the neighbors, such as P1 and P2 that are the abnormal and normal samples, respectively. We should distinguish between P1 and P2. Therefore, a triangle is formed by the samples of P 1 , P f , and P b . The samples P f and P b are neighbors of P 1 , as shown in Figure 6a. Thereafter, we calculate the distance from the center of the triangle ( P c ) to P1, P f , and P b , respectively. On one hand, if the distance (dc_1) between P c and P1 is not larger than that of P f and P b , we define P1 as a normal sample. On the other hand, when the dc_1 is larger than that of P f and P b , the sample P1 becomes the abnormal sample and moves to P c .
We tested the effect of training sample adjustment. The training samples were obtained from different curves that were combined with random noise or some specific noise. The results are shown in Figure 6b and summarized in Table 2. From Figure 6b and Table 2, we can observe that the fitting errors of the 2D curve mixed with random noise are 3.0793 when the abnormal samples are not adjusted; but the fitting errors of the same dataset are only 2.8145 after the abnormal samples are adjusted. Furthermore, the fitting errors of the 2D curve mixed with six noise points without and with abnormal sample adjustment are 2.7281 and 1.3292, respectively. The modified effect of the 3D curve is not comparable to that of the 2D curve; the fitting errors decrease from 516.6542 to 485.3374. Therefore, we can conclude that the adjustment of abnormal samples can improve the curve fitting accuracy. Particularly, the accuracy is improved by approximately 50% when there are only six abnormal samples. Because these six abnormal samples deviate far from the normal samples, these six samples change considerably after they are adjusted to normal samples. Therefore, the accuracy of the entire curve fitting is significantly improved. All the simulations were performed in Matlab.

5. Application of RBFNN in Path Tracking for a Spiral-Type Magnetic Microrobot

Figure 7a shows the control method of a spiral-type magnetic microrobot using rotating magnetic field (RMF) control. The robot is synchronized by the applied RMF and driven by magnetic torque. A rotation of the robot generates propulsive force via the screw mechanism. The driving magnetic torque T m can be expressed as follows [33]:
T m = V M × B
where V is the volume of microrobot, M is the magnetization, and B is the external magnetic flux density. The magnetized direction of the robot is the radial direction. The external magnetic field is a uniform RMF and is generated by a three-axis Helmholtz coil. We assume that a magnetic field B generated by 3D Helmholtz coils rotates in plane P. Thus, the normal vector (nB) of plane P represents the movement direction of the robot. In addition, because the control angles of γ and α determine the position of plane P, the control of two angles determines the steering of the robot. The normal vector n B and magnetic field B can be described as follows:
n B = [ sin ( γ ) cos ( α ) , sin ( γ ) sin ( α ) , cos ( γ ) ] T
B = [ B x B y B z ] = B 0 [ cos ( γ ) cos ( α ) sin ( ω t ) + sin ( α ) cos ( ω t ) cos ( γ ) sin ( α ) sin ( ω t ) cos ( α ) cos ( ω t ) sin ( γ ) sin ( ω t ) ]
where B 0 is the norm of B ; γ is the polar angle, and α is the azimuthal angle.
We assume that there are control errors resulting from various environmental factors. When we plan to drive the robot from the present position P o to the reference target position P r e f 1 along the reference direction d r e f 1 , the robot may arrive at the actual position P a c t because of locomotion error between the actual and reference positions. Therefore, when we drive the robot to move along the control direction d a c t 1 to compensate for the locomotion error, the robot may reach the position P r e f 1 , as shown in Figure 7b. If there is no error between the actual and reference positions, the control direction dc1 is matched to the reference direction d r e f 1 by training RBFNN. Next, when the robot arrives the position P r e f 1 , we can obtain the next reference target position P r e f 2 and the reference direction d r e f 2 . Because the locomotion error is different in each locomotion step, we can obtain the corresponding compensation by driving the robot along the control direction. Therefore, driving the robot to move along the control direction dci, the robot can reach each reference position Pr along the reference path. To decide the steering direction of the robot along the reference direction, the two angles of γ r e f and α r e f are input to the RBFNN, and we obtain the actual control angles of γ c o n t and α c o n t by RBFNN for the controlling plane of RMF. To achieve this aim, it is necessary to develop a locomotion control system for the robot that is a nonlinear system. For nonlinear locomotion control systems, some researchers use RBFNN to simulate dynamic models [34,35]. However, the large number of parameters of these methods make the control system highly complicated. The neural network controller is a nonlinear mapping system; it has been proved that any smooth function can be represented by a three-layer neural network with sufficient hidden neurons [36]. Finally, RBFNN can be used to establish the relationship between the reference ( γ r e f and α r e f ) and control angles ( γ c o n t and α c o n t ) after it is trained.
Generally, RBFNN includes three layers: input, hidden, and output layers, as shown in Figure 8a. In this study, we used MNNC to train the RBFNN to develop its structure.
The input layer of RBFNN includes two neurons: reference angle γ r e f and α r e f . The number of neuron and center of hidden layer are determined by MNNC after the RBFNN is trained. Accordingly, the output of the hidden layer can be obtained as
Q n = e ( ( γ r e f , α r e f ) c n 2 2 σ 2 )
where cn is the center of hidden layer neurons that is decided by the MNNC. σ is the width of basis function that can be expressed as [37].
σ = d c 2 n
where dc is the maximum distance among the neuron centers of hidden layer; n is the quantity of neuron units of the hidden layer, and both of them can be obtained by MNNC.
The output layer includes two neurons: control angles of γ c o n t and α c o n t . They can be obtained by RBFNN according to
{ γ c o n t = i = 1 n Q i w i γ α c o n t = i = 1 n Q i w i α
where w i γ and w i α is the weight of γ c o n t and α c o n t , respectively, that can be obtained by training the RBFNN based on the training samples.
Thus, when we input the reference angle into RBFNN, we can obtain the control angle from the output layer. Next, we calculate the driving current to generate RMF, as shown in Figure 8b. Using Equations (24) and (25), we obtain the driving magnetic field B that is the uniform magnetic field generated in the Helmholtz coils; the relationship between the magnetic field and coil current can be expressed as follows [33]:
B = μ 0 N K B I
where μ 0 is the permeability of vacuum, N is number of turns of coil, K B is the magnetic field coefficient of Helmholtz coil, and I is the coil current.
To verify the ability of the proposed method for path tracking, we performed simulation using RBFNN with MNNC for path tracking. We generated 600 training samples to train the RBFNN to compare the performance of the clustering using MNNC, DBSCAN, and k-means applied to the path tracking simulation, as shown in Figure 9. The 600 samples were composed of 59 clusters for comparison under the same conditions. Thus, we could determine the neuron number and center of the hidden layer of the RBFNN, and obtain the width of each basis function of the RBFNN hidden layer.
Although the suitable k and accuracy of k-means are set, there are still some problems in the clustering result obtained by k-means algorithm. For example, there are many clusters (marked with circles) included for only one sample, as shown in Figure 9a. These clusters are closely spaced and could be merged into a large cluster. Although we adjusted the scanning radius and minimal sample number of DBSCAN for a long time, the clustering result was still not satisfactory. For example, there is a sample (marked with a red circle) far away from another sample in Cluster 1 that should be categorized as a neighboring cluster, as shown in Figure 9b. There are also samples far away from the other samples in Cluster 2 and Cluster 3, as shown in Figure 9b. Nonetheless, the similar data were placed in the same cluster by MNNC, as shown in Figure 9c.
As described above, after the training data were clustered, the neuron number was set as the cluster number of training data, and the cluster center was set as the neuron center of the hidden layer. We calculated and adjusted the width of basis function and weights between the hidden layer neurons and output layer neurons while training the RBFNN. Hence, the relationship between reference direction and control direction are established by RBFNN.
After the relationship between the control and reference angles are established, if we place any reference angle into RBFNN, we can obtain the corresponding control angle. To obtain the reference angle, we should obtain the reference target position first. We selected 30 points as the target points P t ( x t , y t , z t ) in the reference path of the robot, and the path equation can be expressed as follows:
{ x = 4 cos ( t ) y = 4 sin ( t ) z = 3 t / π
γ r e f = a r c cos ( z t z i ( x t x i ) 2 + ( y t y i ) 2 + ( z t z i ) 2 )
α r e f = a r c cos ( x t x i ( x t x i ) 2 + ( y t y i ) 2 )
These reference angles were mixed with the input data of training samples, and subsequently, they were combined with the compensation angle ( α c o m p , γ c o m p ) to obtain the control directions d c o n t with the components of α c o n t and γ c o n t , as shown in Figure 7b. Upon inputting γ r e f and α r e f to RBFNN, the control angles were obtained. Nonetheless, because of the fitting error of RBFNN, there was some deviation between the output data and control directions. The output of RBFNN at this time acts as the guidance direction d g u i d that includes the components of α g u i d and γ g u i d , as shown in Figure 7b. α g u i d and γ g u i d can be obtained from RBFNN according to
γ g u i d = i = 1 n e ( ( α r e f , γ r e f ) c i 2 2 σ i 2 ) w i γ
α g u i d = i = 1 n e ( ( α r e f , γ r e f ) c i 2 2 σ i 2 ) w i α
where n , c i , σ i , w i γ , and w i α are the neuron number of the hidden layer, the neuron center of the hidden layer, the width of the basis function of the hidden layer, the weight of γ g u i d , and the weight of α g u i d , respectively. The parameters can be obtained after training RBFNN. When the reference angles of γ r e f and α r e f are input to RBFNN, the control angles γ c o n t and α c o n t are obtained for the path tracking of the spiral-type magnetic microrobot. Comparing the guidance and control directions, the test errors of radial basis function neural network, representing its accuracy, can be obtained. We trained and tested the RBFNN based on k-means, DBSCAN, and MNNC, respectively. These tests were based on the same learning rate, iteration number, the momentum factor, training samples, and test samples. The iteration number, learning rate, and momentum factor of the training process are 5000, 0.09, and 0.03, respectively. The results are shown in Table 3.
As can be observed from Table 3, the cluster numbers of all clustering algorithms are 59, and the training parameters are the same, but the training and test errors are different. The training errors of radial basis function neural network based on k-means, DBSCAN, and MNNC are 2.27°, 2.22°, and 2.10°, respectively, and the test errors of the radial basis function neural networks based on k-means, DBSCAN, and MNNC are 2.89°, 2.24°, and 2.21°, respectively. Therefore, the radial basis function neural network based on MNNC provides the best test result. Accordingly, we can conclude that MNNC is the best algorithm for training the RBFNN for establishing the relationship between the control angle and the reference angle.
Based on the guidance direction angles, the coil current can be obtained from the calculator of the control system, as shown in Figure 8b. We selected seven positions of the test samples evenly, the coil current equations of which are shown in Table 4.
After current is input into the coils, the coils generate the magnetic field B x , B y , and B z . These magnetic fields are combined into a rotating magnetic field that drive the spring-type robot to the predicted target P p r e along the predicted direction d p r e , as shown in Figure 7b. Here, we calculate the predicted angles α p r e and γ p r e based on
{ α p r e = α g u i d α c o m p γ p r e = γ g u i d γ c o m p
where α c o m p and γ c o m p are the compensation angles that are generated during the sample generation process.
We can obtain the angle error ratio of α and γ using
{ e r r a l p h a = α p r e α r e f α r e f × 100 % e r r g a m m a = γ p r e γ r e f γ r e f × 100 %
The coordinate of the predicted target P p r e can be obtained from
{ x p r e = P r e f P 0 sin ( γ p r e ) cos ( α p r e ) y p r e = P r e f P 0 sin ( γ p r e ) sin ( α p r e ) z p r e = P r e f P 0 cos ( γ p r e )
Accordingly, the position error is calculated based on
e r r p o s i t i o n = P p r e P r e f P r e f P 0 × 100 %
The simulation result of seven positions are shown in Table 5 and Figure 10.
Because the control angles determine the steering direction, the two control angles automatically generate three current signals to produce an RMF and determine the position of the plane of RMF, as shown in Figure 10. Figure 10a shows the reference path and the simulation result of the path tracking on the reference path using RBFNN along with MNNC. Figure 10b–h shows the seven positions of the robot and their control conditions according to the changes in the control angles. There are the coordinates of position, reference path (green curve), plane of RMF (blue circle plan), movement direction (red arrow), or the direction of the normal vector of the plane of the rotating magnetic field, the control angles, and the generated currents in one cycle of the three-axis Helmholtz coils. At the seven positions on the path, the generated current signals for the RMFs are summarized in Table 4. We assumed that the frequency of RMF was 1 Hz and the coefficients μ 0 N K B of the coil were normalized as 1. In addition, the robot has a right-handed screw mechanism, and the rotating direction of the magnetic field is clockwise. In this case, the direction of normal vector becomes the movement direction of the robot, and the control angles become the steering direction of the robot.
When the starting position of the robot was at point (4,0,0), the driving angles ( γ r e f and α r e f ) and guidance angles ( γ g u i d and α g u i d ) were calculated as γ r e f = 76.57°, α r e f = 93°, γ g u i d = 73.71°, and α g u i d = 95.61°, respectively, as shown in Figure 10b. Under the conditions, the three generated currents are I x = 0.999 sin ( 360 t + 90.69 ° ) , I y = 0.238 sin ( 360 t + 12.72 ° ) , and I z = 0.973 sin ( 360 t ) , respectively. When the guidance angles of γ g u i d and α g u i d are 77.22° and 115.27°, the robot reaches Position c, as shown in Figure 10c. Moving from Position b to c, we can confirm that the current profiles are changed by the variation of the guidance angles (steering angles). α g u i d allows the RMF plane to rotate around the Z-axis and the changes in the γ g u i d cause the RMF plane to rotate around X-axis or Y-axis or both (Figure 7a). Therefore, when there is no angular change in the moving path of the robot, the generated current profiles are constant, while the current profiles are changed when there is an angular change in the moving path. Through the phase difference and amplitude of the currents, the movement direction of the robot is determined.
In Figure 10c, the present position of the microrobot is (3.47, 2.00, 0.51). The guidance angle γ g u i d and α g u i d are 77.22° and 115.27°, respectively, that were obtained by RBFNN. The control system calculated the corresponding coils current along the x-axis, y-axis, and z-axis indicated by the blue, red, and green curves, respectively, as shown in Figure 10c. The amplitudes of I x , I y , and I z are 0.909, 0.471, and 0.975, respectively, as shown in Table 4. From Table 4, we can observe that the phase of I x , I y , and I z are 95.96°, 64.89°, and 0, respectively. Comparing Figure 10b,c the current in the z-axis coils of these two cases are similar because the angle γ g u i d changes negligibly. However, there are large changes in the curve corresponding to the current in the x-axis and y-axis coils because the angle α g u i d changes significantly; therefore, we can obtain the results using Equations (24) and (25). The similar control process was implemented for the other positions, and the corresponding results are shown in Figure 10c–g and Table 5. The error ratios of path tracking are shown in Table 5. When the microrobot is at Position c, the reference target position and actual position coordinates are (3.5, 2.0, 0.5) and (3.47, 2.00, 0.51), respectively. We calculated the reference distance from the starting position to the reference target position for each step, and calculated the deviation between reference target and predicted position. Accordingly, the path tracking error ratios at Positions c, d, e, f, g, and h, are obtained as shown in Table 5. Because Position b is the initial position of the entire path tracking, there is no error at this time. The error ratios are primarily less than 5%. Finally, the microrobot realized the locomotion along the reference path as shown in Figure 10h. The standard deviation of position is 0.0145 mm. According to the result, we can conclude that the control system based on RBFNN can provide the control direction of each position. Subsequently, the corresponding coil currents can be calculated to generate the rotating magnetic field for driving the robot to move along the reference direction.
In the actual experiment, it is necessary to obtain some training samples for RBFNN learning, to establish the relationship between the reference angle and control angle. First, we can obtain the present position P 0 of robot. We set the control direction with angle γ c o n t and α c o n t , and calculate the currents of the Helmholtz coils. Thereafter, the Helmholtz coils generate the rotating magnetic field and drive the spring-type robot to the position P r e f . The simulation result for this case shows that if we want to drive the robot from P 0 to P r e f , we can set the control angle γ c o n t and α c o n t to generate a rotating magnetic field for the movement of the robot. The direction from P 0 to P r e f is the reference direction. We can calculate the angle γ r e f and α r e f of the direction from P 0 to P r e f using Equations (31) and (32). Thus, a training sample with components of γ r e f , α r e f , γ c o n t , and α c o n t is obtained. In this manner, we can obtain many training samples and train the RBFNN.
After the RBFNN is trained, we can apply the control system based on RBFNN to path tracking control. We can obtain the reference target position and present position of each step, and subsequently calculate the reference angle γ r e f and α r e f to provide as input to the RBFNN. RBFNN outputs the control angle γ c o n t and α c o n t . Next, the control system can derive the current of Helmholtz coils, and subsequently generate the RMF to drive the robot to the reference target position.

6. Discussion

Clustering algorithms can classify similar samples into the same cluster, but the conventional clustering algorithms often require the determination of several important parameters based on experience in advance, thus leading to inconvenience. Moreover, when conventional clustering algorithms are applied in some specific situations, the clustering algorithms can be improved to increase efficiency and accuracy. MNNC determines the samples with the highest similarity based on the determination of the nearest neighbors. Because the data of curve fitting and path following control have the characteristics of obvious time or spatial sequence, the performance of the MNNC is considerably improved for this type of data. MNNC reduces the range of determining the nearest neighbor that reduces the computation cost, thereby requiring few parameters to be set. Furthermore, it can adaptively adjust the number of clusters. Moreover, MNNC can determine the abnormal samples in the dataset and adjust them. After the adjusted data is used for curve fitting, the fitting accuracy can be improved by 50%; particularly, the adjustment effect is more prominent when there are not many outliers because the adjustment is performed on the samples with the largest outliers, and the sample adjustment is a gradual process. The abnormal sample adjustment of MNNC can avoid misjudgment and over-adjustment of outliers. For cases with a large number of outliers, the adjustment effect can be enhanced by increasing the number of optimizations.
RBFNN is commonly used in nonlinear systems for curve fitting and path tracking control. Using a clustering algorithm to obtain the initial parameters of RBFNN is a relatively simple method. When MNNC is used to train RBFNN, the number of hidden nodes of RBFNN can be changed by automatically adjusting the number of clusters according to the accuracy requirements of RBFNN, to improve the accuracy of RBFNN. The simulation results show that the curve fitting accuracy of RBFNN trained by MNNC is up to 60% higher than that of other RBFNNs.
When the magnetic microrobot is moving, it is difficult to reach the target position accurately due to the interference of various factors. In this study, the motion mechanism of the magnetic robot is analyzed, and a locomotion control system based on RBFNN is proposed. The system uses RBFNN to determine the reference target of the theoretical locomotion target, and controls the magnetic microrobot to reach the theoretical motion target by moving to the reference target. In order to use MNNC to establish the parameters of RBFNN better, this study enhanced the function of MNNC on the basis of the previous analysis. The simulation results show that the enhanced MNNC demonstrates an improved performance over traditional clustering algorithms in clustering analysis, and there are fewer parameters to be determined in advance. The simulation results show that a better control effect can be obtained after applying RBFNN based on MNNC in the path tracking control of the magnetic robot.
Although MNNC has only been applied in clustering 2D data in this study, it can adapt to multidimensional datasets. This will be verified in future research, and the algorithm will be improved to increase the clustering accuracy and generalization ability.

7. Conclusions

A modified nearest neighbor-based clustering algorithm is proposed in this study that does not necessitate the setting of important parameters relying on past experience, and can perform cluster analysis on samples of different densities and shapes. The abnormal samples can be found, and the adjustment of the sample can be realized by this clustering algorithm. The simulation results show that the curve fitting accuracy of the samples optimized by the clustering algorithm is increased by 50%. The number and center of basis functions can be automatically determined by applying this clustering algorithm on the training samples of RBFNN. The simulation results proved that the RBFNN trained in this manner has a higher operating accuracy than the conventional RBFNN; the accuracy in curve fitting is improved by 60%. The simulation result showed that the RBFNN based on the clustering algorithm could improve the accuracy in the path tracking simulation by 20%.

Author Contributions

Conceptualization, D.Z. and S.K.; methodology, D.Z.; validation, W.J. and S.K.; investigation, D.Z.; writing—original draft preparation, D.Z.; writing—review and editing, W.J. and S.K.; supervision, S.K. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by the Korea Medical Device Development Fund grant funded by the Korea government (the Ministry of Science and ICT, the Ministry of Trade, Industry and Energy, the Ministry of Health & Welfare, the Ministry of Food and Drug Safety) (Project Number: KMDF_PR_20200901_0130, 9991006803), and in part by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. 2020R1A4A3079595 and 2018R1C1B6003491).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data can be requested from the corresponding authors.

Conflicts of Interest

The authors declare no conflict of interest.

Appendix A

Table A1. List of acronyms.
Table A1. List of acronyms.
RBFNNRadial basis function neural network
MNNCModified nearest neighbor-based clustering
PIDProportion integral differential
SVMSupport vector machines
GAGenetic algorithm
AIArtificial immune
DBSCANDensity-based spatial clustering of applications with noise
DPCDensity peaks clustering
ACCAccuracy
ADIAdjusted Rand index
RMFRotating magnetic field
BIRCHBalanced iterative reducing and clustering using hierarchies
CLIQUEClustering in QUEst

Appendix B

Table A2. List of variables.
Table A2. List of variables.
diDistance between sample and its nearest neighbor
HThe number of di level
PiSample
Δ D Distance change
dstepDistance step
DTotal distances between samples and centroid of cluster before merged
D’Total distances between samples and centroid of cluster after merged
QuaniQuantity of samples of cluster i
CCenter of cluster
RScanning radius of DBSCAN
TmMagnetic torque
VVolume of microrobot
MMagnetization of microrobot
BExternal magnetic field
γPolar angle
αAzimuthal angle
nBNormal vector of plan P
PcontControl position
PrefReference position
PactActual position
PguidGuidance position
PprePredicted position
γrefReference polar angle
αrefReference azimuthal angle
γcontControl polar angle
αcontControl azimuthal angle
γguidGuidance polar angle
αguidGuidance azimuthal angle
γprePredicted polar angle
αprePredicted azimuthal angle
γcompCompensation of polar angle
αcompCompensation of azimuthal angle
dcontControl direction
dguidGuidance direction
drefReference direction
dprePredicted direction
dactActual direction
QiOutput of hidden layer neuron of RBFNN
ciCenter of hidden layer neuron of RBFNN
wiWeight between hidden layer and output layer of RBFNN
σWidth of hidden layer neuron of RBFNN
μ0Permeability of free space
NTurns number of coil
KBMagnetic field coefficient of Helmholtz coil
ICoil current
IxCoil current of x-axis
IyCoil current of y-axis
IzCoil current of z-axis
errgammaError of polar angle
erralphaError of azimuthal angle
errpositionError of position

References

  1. Rout, R.; Subudhi, B. Inverse optimal self-tuning PID control design for an autonomous underwater vehicle. Int. J. Syst. Sci. 2017, 48, 367–375. [Google Scholar] [CrossRef]
  2. Xiang, H.B.; Li, M.W.; Zhang, T.L.; Wang, S.J.; Zhang, M.; Song, Y.; Huo, W.X.; Huang, X. Motion characteristics of untethered swimmer with magnetoelastic material. Smart Mater. Struct. 2021, 30, 075030. [Google Scholar] [CrossRef]
  3. Ghosh, B.B.; Sarkar, B.K.; Saha, R. Realtime performance analysis of different combinations of fuzzy-PID and bias controllers for a two degree of freedom electrohydraulic parallel manipulator. Robot. Comput.-Integr. Manuf. 2015, 34, 62–69. [Google Scholar] [CrossRef]
  4. Algarin-Pinto, J.A.; Garza-Castanon, L.E.; Vargas-Martinez, A.; Minchala-Avila, L.I. Dynamic modeling and control of a parallel mechanism used in the propulsion system of a biomimetic underwater vehicle. Appl. Sci. 2021, 11, 4909. [Google Scholar] [CrossRef]
  5. Mai, T.A.; Dang, T.S.; Duong, D.T.; Le, V.C.; Banerjee, S. A combined backstepping and adaptive fuzzy PID approach for trajectory tracking of autonomous mobile robots. J. Braz. Soc. Mech. Sci. Eng. 2021, 43, 156. [Google Scholar] [CrossRef]
  6. Xu, B.J.; Ji, S.; Zhang, C.R.; Chen, C.; Ni, H.P.; Wu, X.J. Linear-extended-state-observer-based prescribed performance control for trajectory tracking of a robotic manipulator. Ind. Robot. 2021, 44, 544–555. [Google Scholar] [CrossRef]
  7. Li, Q.X.; Zhou, Y.S. Precise trajectory tracking control of ship towing systems via a dynamical tracking target. Mathematics 2021, 9, 974. [Google Scholar] [CrossRef]
  8. Wu, Y.; Wang, L.; Zhang, J.; Li, F. Path following control of autonomous ground vehicle based on nonsingular terminal sliding mode and active disturbance rejection control. IEEE Trans. Veh. Technol. 2019, 68, 6379–6390. [Google Scholar] [CrossRef]
  9. Liu, C.; Cheah, C.C.; Slotine, J. Adaptive Jacobian PID regulation for robots with uncertain kinematics and actuator model. In Proceedings of the 2006 IEEE/RSJ International Conference on Intelligent Robots and Systems, Beijing, China, 9–15 October 2006; pp. 3044–3049. [Google Scholar] [CrossRef]
  10. Smeresky, B.; Rizzo, A.; Sands, T. Optimal learning and self-awareness versus PDI. Algorithms 2020, 13, 23. [Google Scholar] [CrossRef] [Green Version]
  11. Juang, J.G. Intelligent trajectory control using recurrent averaging learning. Appl. Artif. Intell. 2001, 15, 277–296. [Google Scholar] [CrossRef]
  12. Chen, Z.; Yang, X.; Liu, X. RBFNN-based nonsingular fast terminal sliding mode control for robotic manipulators including actuator dynamics. Neurocomputing 2019, 362, 72–82. [Google Scholar] [CrossRef]
  13. Nie, L.; Guan, J.; Lu, C. Longitudinal speed control of autonomous vehicle based on a self-adaptive PID of radial basis function neural network. IET Intell. Transp. Syst. 2018, 12, 485–494. [Google Scholar] [CrossRef]
  14. Lee, C.T.; Tsai, C.C. Improved nonlinear trajectory tracking using RBFNN for a robotic helicopter. Int. J. Robust Nonlinear Control 2010, 20, 1079–1096. [Google Scholar] [CrossRef]
  15. Li, J.; Wang, J.; Wang, S. Neural approximation-based model predictive tracking control of non-holonomic wheel-legged robots. Int. J. Control Autom. Syst. 2020, 19, 372–381. [Google Scholar] [CrossRef]
  16. Guillen, A.; Rojas, I.; Gonzalez, J. Output value-based initialization for radial basis function neural networks. Neural Process. Lett. 2007, 25, 209–225. [Google Scholar] [CrossRef]
  17. Juang, J.G. Effects of Using Different Neural Network Structures and Cost Functions in Locomotion Control. In Lecture Notes in Computer Science, Proceedings of the 2nd International Conference on Natural Computation (ICNC 2006), Xian, China, 24–28, September 2006; Springer: Berlin/Heidelberg, Germany, 2006. [Google Scholar] [CrossRef]
  18. Fernandez-Navarro, F.; Hervas-Martinez, C.; Gutierrez, P.A. Generalised gaussian radial basis function neural networks. Soft Comput. 2013, 17, 519–533. [Google Scholar] [CrossRef]
  19. Huang, H.C.; Chiang, C.H. An evolutionary radial basis function neural network with robust genetic-based immunecomputing for online tracking control of autonomous Robots. Neural Process. Lett. 2016, 44, 19–35. [Google Scholar] [CrossRef]
  20. Chen, Z.Y.; Kuo, R.J. Combining SOM and evolutionary computation algorithms for RBF neural network training. J. Intell. Manuf. 2019, 30, 1137–1154. [Google Scholar] [CrossRef]
  21. Guillén, A.; Rojas, I.; Gonzalez, J. A possibilistic approach to RBFN centers initialization. In Lecture Notes in Computer Science, Proceedings of the 10th International Conference on Rough Sets, Fuzzy Sets, Data Mining and Granular Computing (RSFDGrC 2005), Regina, SK, Canada, 31 August 2005; Springer: Berlin/Heidelberg, Germany, 2005. [Google Scholar] [CrossRef]
  22. Oh, S.K.; Kim, W.D.; Pedrycz, W. Design of k-means clustering-based polynomial radial basis function neural networks (pRBF-NNs) realized with the aid of particle swarm optimization and differential evolution. Neurocomputing 2012, 78, 121–132. [Google Scholar] [CrossRef]
  23. Liao, C.C. Genetic k-means algorithm based RBF network for photovoltaic MPP prediction. Energy 2010, 35, 529–536. [Google Scholar] [CrossRef]
  24. Dogan, A.; Birant, D. Machine learning and data mining in manufacturing. Expert Syst. Appl. 2021, 166, 114060. [Google Scholar] [CrossRef]
  25. Fan, Y.K.; Bai, J.R.; Lei, X.; Lin, W.G.; Hu, Q.; Wu, G.D.; Guo, J.M.; Tan, G. PPMCK: Privacy-preserving multi-party computing for K-means clustering. J. Parallel Distrib. Comput. 2020, 154, 54–63. [Google Scholar] [CrossRef]
  26. Khalid, A.; Hammed, A. Genetic divergence in wheat genotypes based on seed biochemical profiles appraised through agglomerative hierarchical clustering and association analysis among traits. Pak. J. Bot. 2021, 53, 1281–1286. [Google Scholar] [CrossRef]
  27. Fang, X.J.; Wu, Y.J.; Liao, S.S.; Xue, L.Z.; Chen, Z.; Yang, J.N.; Lu, Y.M.; Ling, K.; Hu, S.Y.; Kong, S.Y. Division of crustal units in China using grid-based clustering and a zircon U-Pb geochronology database. Comput. Geosci. 2020, 145, 104570. [Google Scholar] [CrossRef]
  28. Montanari, G.E.; Doretti, M.; Marino, M.F. Model-based two-way clustering of second-level units in ordinal multilevel latent Markov models. Adv. Data Anal. Classif. 2021, 1–29. [Google Scholar] [CrossRef]
  29. Luo, S.; Liu, H.W.; Qi, E. Recognition and labeling of faults in wind turbines with a density-based clustering algorithm. Data Technol. Appl. 2021. [Google Scholar] [CrossRef]
  30. Li, C.Z.; Zhang, Y.Z. Density peak clustering based on relative density optimization. Math. Probl. Eng. 2020, 2020, 2816102. [Google Scholar] [CrossRef]
  31. Syarrudin, M.; Alfian, G.; Fitriyani, N.L. Performance analysis of IoT-based sensor, big data processing, and machine learning model for real-time monitoring system in automotive manufacturing. Sensors 2018, 18, 2946. [Google Scholar] [CrossRef] [Green Version]
  32. Minimol, P.V.; Mishra, D.; Gorthi, R.K.S.S. Guided MDNet tracker with guided samples. Visual Comput. 2021, 1–15. [Google Scholar] [CrossRef]
  33. Jeon, S.; Kim, S.; Ha, S.; Lee, S.; Kim, E.; Kim, S.Y.; Park, S.H.; Jeon, J.H.; Kim, S.W.; Moon, C. Magnetically actuated microrobots as a platform for stem cell transplantation. Sci. Robot. 2019, 4, eaav4317. [Google Scholar] [CrossRef]
  34. Chen, X.Z.; Hoop, M.; Mushtaq, S.F.; Hu, E.C.Z.; Nelson, B.J.; Pane, S. Recent developments in magnetically driven micro- and nanorobots. Appl. Mater. Today 2017, 9, 37–46. [Google Scholar] [CrossRef] [Green Version]
  35. Li, J.; Li, X. Development of a magnetic microrobot for carrying and delivering targeted cells. Sci. Robot. 2018, 3, eaat8829. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  36. Yan, X.H.; Zhou, Q.; Vincent, M.; Deng, Y.; Yu, J.F.; Xu, J.B.; Xu, T.T.; Tang, T.; Bian, L.M.; Wang, Y.X.J.; et al. Multifunctional biohybrid magnetite microrobots for imaging-guided therapy. Sci. Robot. 2017, 2, eaaq1155. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  37. Yang, C.; Wang, X.; Cheng, L. Neural-learning-based telerobot control with guaranteed performance. IEEE Trans. Cybern. 2017, 47, 3148–3159. [Google Scholar] [CrossRef] [PubMed] [Green Version]
Figure 1. Concept of an RBFNN algorithm based on MNNC for path tracking: (a) calculation of the distance to obtain the nearest neighbor; (b) detection of the abnormal samples based on nearest neighbor method; (c) clustering of the samples based on the nearest neighbor; (d) construction of the RBFNN based on MNNC; (e) obtaining the reference position by the MNNC-based RBFNN in the path tracking system.
Figure 1. Concept of an RBFNN algorithm based on MNNC for path tracking: (a) calculation of the distance to obtain the nearest neighbor; (b) detection of the abnormal samples based on nearest neighbor method; (c) clustering of the samples based on the nearest neighbor; (d) construction of the RBFNN based on MNNC; (e) obtaining the reference position by the MNNC-based RBFNN in the path tracking system.
Sensors 21 08349 g001
Figure 2. Sample distribution: (a) the training samples are dispersed with spatial sequence; (b) the training samples are dispersed without spatial sequence.
Figure 2. Sample distribution: (a) the training samples are dispersed with spatial sequence; (b) the training samples are dispersed without spatial sequence.
Sensors 21 08349 g002
Figure 3. Clustering process of MNNC: (a) clustering result of training samples; (b) division of the cluster with discontinuous sample label into independent clusters; (c) Cluster 4 is merged into Cluster 2; (d) Cluster 4 is merged into Cluster 5.
Figure 3. Clustering process of MNNC: (a) clustering result of training samples; (b) division of the cluster with discontinuous sample label into independent clusters; (c) Cluster 4 is merged into Cluster 2; (d) Cluster 4 is merged into Cluster 5.
Sensors 21 08349 g003
Figure 4. Clustering results: (a) the training samples are divided into seven clusters; (b) the training samples are divided into five clusters.
Figure 4. Clustering results: (a) the training samples are divided into seven clusters; (b) the training samples are divided into five clusters.
Sensors 21 08349 g004
Figure 5. Clustering results of different clustering algorithms: (ac) are the reference results; (df) are clustered by k-means; (gi) are clustered by DBSCAN; (jl) are clustered by MNNC.
Figure 5. Clustering results of different clustering algorithms: (ac) are the reference results; (df) are clustered by k-means; (gi) are clustered by DBSCAN; (jl) are clustered by MNNC.
Sensors 21 08349 g005
Figure 6. (a) Scheme of analysis of abnormal sample; (b) curve fitting results.
Figure 6. (a) Scheme of analysis of abnormal sample; (b) curve fitting results.
Sensors 21 08349 g006
Figure 7. (a) Magnetic field vector; (b) scheme of path tracking: the green arrow is the guidance direction, the red arrow is the desired direction, the yellow arrow is the predicted direction, the blue arrow is the control direction, and the black arrow is the actual directions.
Figure 7. (a) Magnetic field vector; (b) scheme of path tracking: the green arrow is the guidance direction, the red arrow is the desired direction, the yellow arrow is the predicted direction, the blue arrow is the control direction, and the black arrow is the actual directions.
Sensors 21 08349 g007
Figure 8. Scheme of RBFNN and control system: (a) structure of RBFNN for path tracking; (b) flow chart of control system.
Figure 8. Scheme of RBFNN and control system: (a) structure of RBFNN for path tracking; (b) flow chart of control system.
Sensors 21 08349 g008
Figure 9. Clustering results of training data: (a) clustered by K-means;.(b) clustered by DBSCAN; (c) clustered by MNNC.
Figure 9. Clustering results of training data: (a) clustered by K-means;.(b) clustered by DBSCAN; (c) clustered by MNNC.
Sensors 21 08349 g009
Figure 10. Path tracking of magnetic microrobot by RBFNN: (a) simulation results of path tracking by MNNC-based RBFNN; (bh) show the rotating plan of the magnetic field and the movement direction at different positions of the path, and the coil current of X, Y, and Z-axis in one cycle; the rotating frequency of magnetic field is 1 Hz. For improved visualization of the parameters, the view angle for each figure is different.
Figure 10. Path tracking of magnetic microrobot by RBFNN: (a) simulation results of path tracking by MNNC-based RBFNN; (bh) show the rotating plan of the magnetic field and the movement direction at different positions of the path, and the coil current of X, Y, and Z-axis in one cycle; the rotating frequency of magnetic field is 1 Hz. For improved visualization of the parameters, the view angle for each figure is different.
Sensors 21 08349 g010
Table 1. Clustering index of the clustering results.
Table 1. Clustering index of the clustering results.
Clustering AlgorithmPerformance IndexDataset
Data 1Data 2Data 3
K-meansACC0.33330.66830.4891
ARI0.02330.31210.3010
DBSCANACC110.8558
ARI110.9019
MNNCACC110.9994
ARI110.9994
Table 2. Errors of curve fitting with/without the adjustment of abnormal samples.
Table 2. Errors of curve fitting with/without the adjustment of abnormal samples.
Curve Type2D Curve3D Curve
Noise styleRandomly distributedSix points with noiseRandomly distributed
Errors without adjustment3.07932.7281516.6542
Errors with adjustment2.81451.3292485.3374
Table 3. Test results of RBFNN based on different clustering algorithms.
Table 3. Test results of RBFNN based on different clustering algorithms.
AlgorithmCluster NumberTraining ErrorTest Error
K-means592.27°2.89°
DBSCAN592.22°2.24°
MNNC592.10°2.21°
Table 4. Coil current equation corresponding to Figure 10b–h.
Table 4. Coil current equation corresponding to Figure 10b–h.
Position I x ( A ) I y ( A ) I z ( A )
b I x = 0.999 sin ( 360 t + 90.69 ° ) I y = 0.238 sin ( 360 t + 12.72 ° ) I z = 0.973 sin ( 360 t )
c I x = 0.909 sin ( 360 t + 95.96 ° ) I y = 0.471 sin ( 360 t + 64.89 ° ) I z = 0.975 sin ( 360 t )
d I x = 0.592 sin ( 360 t + 109.57 ) I y = 0.84 sin ( 360 t + 80.86 ° ) I z = 0.971 sin ( 360 t )
e I x = 0.234 sin ( 360 t + 160.18 ° ) I y = 0.997 sin ( 360 t + 89 ° ) I z = 0.975 sin ( 360 t )
f I x = 0.481 sin ( 360 t + 245.64 ° ) I y = 0.904 sin ( 360 t + 96.15 ° ) I z = 0.975 sin ( 360 t )
g I x = 0.838 sin ( 360 t + 261.24 ° ) I y = 0.592 sin ( 360 t + 108.55 ° ) I z = 0.974 sin ( 360 t )
h I x = 0.997 sin ( 360 t + 268.84 ° ) I y = 0.272 sin ( 360 t + 163.4 ° ) I z = 0.965 sin ( 360 t )
t is time (s).
Table 5. Path tracking error ratio of position b–h.
Table 5. Path tracking error ratio of position b–h.
PositionReference
Angle (°)
Predicted Angle (°)Angle Error Ratio (%)Reference
Coordinate (mm)
Predicted
Coordinate (mm)
Position Error Ratio (%)
α r e f γ r e f α p r e γ p r e γ α
b9376.579376.57 (4, 0, 0)(4, 0, 0)0
c11776.57115.7875.791.04%1.02%(3.46, 2.0, 0.5)(3.47, 2.00, 0.51)2.48%
d14776.57144.4079.891.77%4.34%(2.0, 3.46, 1.0)(2.01, 3.48, 0.98)7.31%
e17776.57172.3477.902.63%1.74%(0, 4.0, 1.5)(−0.00, 4.03, 1.49)8.26%
f20776.56208.6976.300.81%0.35%(−2.0, 3.46, 2.0)(−1.99, 3.45, 2.00)2.90%
g23776.57237.5676.970.24%0.53%(−3.46, 2.0, 2.5)(−3.46, 1.99, 2.49)1.19%
h26776.56269.6176.390.98%0.23%(−4, 0, 3)(−3.98, 0.01, 3.01)4.44%
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Zheng, D.; Jung, W.; Kim, S. RBFNN Design Based on Modified Nearest Neighbor Clustering Algorithm for Path Tracking Control. Sensors 2021, 21, 8349. https://doi.org/10.3390/s21248349

AMA Style

Zheng D, Jung W, Kim S. RBFNN Design Based on Modified Nearest Neighbor Clustering Algorithm for Path Tracking Control. Sensors. 2021; 21(24):8349. https://doi.org/10.3390/s21248349

Chicago/Turabian Style

Zheng, Dongxi, Wonsuk Jung, and Sunghoon Kim. 2021. "RBFNN Design Based on Modified Nearest Neighbor Clustering Algorithm for Path Tracking Control" Sensors 21, no. 24: 8349. https://doi.org/10.3390/s21248349

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop