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.
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
can be expressed as follows [
33]:
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
and magnetic field
can be described as follows:
where
is the norm of
;
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
to the reference target position
along the reference direction
, the robot may arrive at the actual position
because of locomotion error between the actual and reference positions. Therefore, when we drive the robot to move along the control direction
to compensate for the locomotion error, the robot may reach the position
, 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
by training RBFNN. Next, when the robot arrives the position
, we can obtain the next reference target position
and the reference direction
. 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
and
are input to the RBFNN, and we obtain the actual control angles of
and
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 (
and
) and control angles (
and
) 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
and
. 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
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].
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
and
. They can be obtained by RBFNN according to
where
and
is the weight of
and
, 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
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]:
where
is the permeability of vacuum,
is number of turns of coil,
is the magnetic field coefficient of Helmholtz coil, and
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
in the reference path of the robot, and the path equation can be expressed as follows:
These reference angles were mixed with the input data of training samples, and subsequently, they were combined with the compensation angle (
,
) to obtain the control directions
with the components of
and
, as shown in
Figure 7b. Upon inputting
and
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
that includes the components of
and
, as shown in
Figure 7b.
and
can be obtained from RBFNN according to
where
,
,
,
, and
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
, and the weight of
, respectively. The parameters can be obtained after training RBFNN. When the reference angles of
and
are input to RBFNN, the control angles
and
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
,
, and
. These magnetic fields are combined into a rotating magnetic field that drive the spring-type robot to the predicted target
along the predicted direction
, as shown in
Figure 7b. Here, we calculate the predicted angles
and
based on
where
and
are the compensation angles that are generated during the sample generation process.
We can obtain the angle error ratio of
and
using
The coordinate of the predicted target
can be obtained from
Accordingly, the position error is calculated based on
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
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 (
and
) and guidance angles (
and
) were calculated as
= 76.57°,
= 93°,
= 73.71°, and
= 95.61°, respectively, as shown in
Figure 10b. Under the conditions, the three generated currents are
,
, and
, respectively. When the guidance angles of
and
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).
allows the RMF plane to rotate around the
Z-axis and the changes in the
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
and
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
,
, and
are 0.909, 0.471, and 0.975, respectively, as shown in
Table 4. From
Table 4, we can observe that the phase of
,
, and
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
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
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 of robot. We set the control direction with angle and , 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 . The simulation result for this case shows that if we want to drive the robot from to , we can set the control angle and to generate a rotating magnetic field for the movement of the robot. The direction from to is the reference direction. We can calculate the angle and of the direction from to using Equations (31) and (32). Thus, a training sample with components of ,, , and 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 and to provide as input to the RBFNN. RBFNN outputs the control angle and . 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.