1. Introduction
In the packaging industry of industrial production, it is usually necessary to complete the classification, inspection, packaging, and other operations of light and small objects at a faster speed to improve work efficiency. It is difficult to complete the precise operation with high strength and high speed for a long time using the traditional manual operation method. Compared with the series mechanism [
1,
2], the parallel mechanism (PM) has high stiffness, small dead weight load ratios, a strong bearing capacity, high precision, and a compact structure. The PM is suitable for applications with a small working space and large load strength, and it is widely used in machine tool processing, aircraft manufacturing, and medical treatment. Artificial intelligence is used to store mathematical models and operation experience in the computer with the development of computer technologies. The established control system model aims to control the whole mechanical system easily.
Proportional-integral-derivative (PID) controllers are still widely used in the industrial process control. Engineers can tune these three gains through experience or simple principles such as classical tuning rules proposed by Ziegler-Nichols [
3]. There are many factors in the control system of PMs, such as uncertainty, nonlinearity, and external disturbance. The conventional PID controller has some problems, such as poor parameter settings and poor adaptability to variable working conditions. The combination of fuzzy control and PID control theory can solve these problems.
Li [
4] proposed a novel fuzzy logic controller (FLC) for the gap between the time response and the rule base. It performs well in both transient and steady states without using multiple decision tables. Carvajal [
5] presented a new fuzzy PID control method for nonlinear systems that are structurally difficult to model. Najafizadeh [
6] used two kinds of fuzzy inference engines to construct an adaptive fuzzy PID controller, which achieves a fast convergence time and high performance. Zhou [
7] proposed an orthogonal fuzzy PID control method to control the manipulator, which improves system accuracy and reduces the oscillation process near the steady state. Phu [
8,
9] studied some qualitative properties of fuzzy PID control systems in fuzzy number space. HuKuhara differentiability and fuzzy second-order differential equations are used to solve the multi-boundary problem, which proves the existence and uniqueness of the solution of the differential equation. Liu [
10] proposed a cascading predictive fuzzy PID (FPID) controller with weight and used the fastest descent method to calculate weight and improve the accuracy of trajectory tracking.
The quantization factor and scale factor affect the control effect of the fuzzy controller. Traditional selection methods are mostly based on expert experience and industrial knowledge, which will make the control effect unsatisfactory. Therefore, the optimization algorithm is introduced to optimize PID control parameters quickly and accurately using its global optimization ability. Tsai [
11] proposed a novel adaptive PID control method—using predictive control and outputting recursive fuzzy wavelet neural networks to process a set of nonlinear digital delayed dynamic systems. Pelusi [
12,
13,
14] previously studied the use of the GA and neuro-fuzzy techniques to design optimal control systems. The results can be used as benchmarks to compare with the proposed design. Purnama [
15] compared various controllers. The PID controller optimized by the GA has a shorter rise time, and smaller steady-state error, but higher theoretical complexity. The proposed fuzzy PID controller was applied to the servo control system [
16], showing that the fuzzy PID controller optimized by a GA has good speed control and anti-jamming ability. Chao [
17,
18] proposed that the membership function should be adjusted by nonlinear factors, which greatly improves the GA and verifies its feasibility. Moran [
19,
20] used the manual tuning PID and GA PID for comparative control experiments on DC electric machines. The genetic Algorithm PID can obtain more suitable PID parameters, but the system responds slowly.
Vijaya [
21] used a fuzzy PID speed controller based on a GA to control a permanent magnet synchronous motor. The multi-carrier PWM is used for analysis, which can achieve the required speed faster than the conventional PID controller. Dogruer [
22] optimized the fuzzy PID controller by a GA to improve the robustness of the voltage regulator. Alouache [
23] found that the fuzzy PID controller optimized by a GA controls the mobile robot for trajectory tracking in the case of interferences with good control effects.
Therefore, the optimization algorithm in the traditional fuzzy PID control was introduced in the work. The global optimization ability and parallel ability of the GA were used to optimize PID control parameters. Thus, the robustness of the control system and the trajectory tracking accuracy of the PM were greatly improved.
4. PM Control System
The servo control system of the PM is a complex, nonlinear, and strong coupling system. Since the parameters in the system are time varying, only relevant approximate models can be established, which hinders control. Therefore, the combination of a genetic algorithm and fuzzy PID controller has the reliability of PID control, the robustness of fuzzy control, rapid adjustments, and the global optimization of the GA.
4.1. Fuzzy PID Controller
The PID controller is a feedback element commonly used in industrial control [
24]. The input value can be adjusted according to the feedback value and the difference value so that the system is more accurate and stable. PID algorithms can be divided into positional PID and incremental PID.
Equations (8) and (9) are place style and increment style, respectively. represents the error. Fuzzy logic control (FLC) has the advantage of using human brains to solve problems, with its core divided into the fuzzification interface, fuzzy rule base, fuzzy decision, and defuzzification. Fuzzy inferences include membership function and rule table, and the knowledge base is obtained from expert experience.
Fuzzy PID (FPID) combines Fuzzy control and PID control, with a simple structure and strong self-adaptability [
25]. The fuzzy controller takes error
E as the input. The output is the modified values of PID parameters
,
and
through quantization factors, fuzzy control rules, and scale factors.
and
are quantization factors;
is the scale factor for
;
the scaling factor for
; and
the scaling factor for
.
Figure 4 shows the block of the fuzzy PID structure. The expression of the fuzzy PID controller is shown in Equation (10).
where
and
represent the proportional, integral, and differential initial coefficients in the traditional PID controller, respectively. Based on the fuzzy rule table, the fuzzy inference results show that
,
and
are the change values of proportion, integral, and differential coefficients, respectively.
The corresponding membership function is generated by the fuzzy toolbox of mathematical software. Correctly constructing the membership function is one of the keys to using fuzzy control.
Figure 5 shows the quantization domain and fuzzy subset. The fuzzy subset with a sharp shape of the membership function has high resolutions and a high control sensitivity. On the contrary, the shape of the membership function curve is relatively flat, with good stability.
The relationship between the three input parameters of the PID controller and the general tuning principles summed up by expert experience are as follows:
- (1)
The absolute value of the input error is large. The value is zero; the larger the value, the smaller the value taken simultaneously.
- (2)
The absolute value of the input error is the median. takes an appropriate value, and should take a small value. The value significantly affects the system.
- (3)
The absolute value of the input error is small. and values should be large, and the value depends on the absolute value of the change rate of the input error. When the change rate is small, takes an intermediate value; otherwise, takes a small value.
Table 1,
Table 2 and
Table 3 show fuzzy rules. The input fuzzy variable derivative of position errors has seven linguistic variables, namely NB (negative big), NM (negative medium), NS (negative small), ZO (zero), PS (positive small), PM (positive medium), and PB (positive big). Three points,
,
, and
, are defined as the fuzzy set in the defuzzification process.
4.2. Optimization of Fuzzy PID Parameters by the GA
A GA is an optimization method for finding the optimal solution to a problem based on Darwin’s theory of biological evolution [
26,
27,
28]. Traditional fuzzy PID has great differences in selecting rule tables and membership functions, and it is difficult to generalize according to expert experience. The quantization factor and scale factor of the fuzzy PID controller are optimized by the excellent global optimization ability of the GA. The structure diagram of fuzzy PID optimized by genetic algorithm is shown in
Figure 6, and the algorithm flow chart is shown in
Figure 7:
are the genes of individuals using the continuous GA to optimize the fuzzy PID controller. Each gene is coded in decimal notation. Fitness function Equation (11) is used to calculate the fitness values of each individual [
29]. Equation (12) calculates the probabilities of each individual to be selected [
30]:
The genetic mode is set to the high probability of crossover and the low probability of mutation and is iterated for 100 generations as the termination condition.
5. Model Building and Simulation Analysis
The Alternating Current (AC) servo motor system is a typical nonlinear controlled object, and it is necessary to comprehensively consider the characteristics of the uncertain system of the AC servo motor. It is assumed that the magnetic circuit is not saturated and the magnetic field is sinusoidal. The eddy current loss and hysteresis loss are ignored. Let
=
=
, and the state Equations (13) and (14) in the d-q coordinates are as follows:
where
, and
represent the torque coefficient, stator winding, potential coefficient, and current feedback coefficient, respectively.
Transfer function
characterizes the dynamic characteristics of the complex system under no moment of inertia and torque interferences. The transfer function is shown in Equation (15):
According to the transfer function of the AC servo motor and parameters obtained by the GA, the simulation model is established in mathematical simulation software. The fuzzy PID control system is taken as an example. According to the influence of PID controller parameters on the control effect, combined with fuzzy controller, a fuzzy PID controller is designed (see
Figure 8 for the fuzzy PID control model). The three terms used in the block diagram (
,
, and
) are gains for the proportional controller, integral controller, and derivative controller. The values of
,
, and
were 69.25, 0.993, and 10.5, respectively. The values of
,
, and
were 3, 0. 1, and 0. 1, respectively. The controller dynamically adjusts PID parameters through the GA during the system operation.
6. Analysis of Simulation Results
According to the determined structure and control method of the servo control system, a simulation experiment was carried out on the position control of the servo motor combined with the engineering tuning method. The superiority of the control strategy designed in the work was verified by comparing the control effect of the fuzzy PID (FPID) control strategy and genetic algorithm optimized fuzzy PID (GAFPID) control strategy on the position signal tracking of the servo control system.
6.1. Iterative Analysis of GAs
According to the parameters of the setting algorithm of the fuzzy PID control system structure, the population size and the iteration number were set to 30 and 100, respectively. The crossover probability and mutation probability were 0.9 and 0.1, respectively. , , and at the initial stage.
Figure 9 shows that it converged at the 52nd iteration, while traditional calculations often require thousands of iterations. The traditional method of calculation mentioned here is trial and error. Trial and error is a method of setting parameters empirically. In the closed-loop control system, the adjustment was carried out in the order of
,
and
. While adjusting the parameters, the process was observed until the requirements were met. The optimal objective function value and the optimal matching parameter value of the fuzzy PID controller could be obtained at the end of the iteration. The parameter values of the fuzzy PID controller obtained by the GA were substituted into the simulation model of the servo control system. The experimental analysis of step characteristics, sinusoidal characteristics, and joint trajectory tracking was carried out.
6.2. Simulation Analysis of Step Characteristics
PID control, fuzzy PID control, and PID control optimized by the GA were applied to the control system under the condition that the input was an 8° step signal simulating the load. The sampling time was set to 0.01 s. The dynamic and static indices of the system under different control strategies were analyzed (see
Figure 10 for simulation results).
Table 4 shows the simulation results of the step response. The rise time of the system under the control of a fuzzy PID controller optimized by the GA was reduced by about 37.91% compared with the classical PID control under the loaded step response. It was about 23.39% shorter than the fuzzy PID control. The adjustment time of the system controlled by the fuzzy PID controller optimized by the GA was about 32.46% shorter than that of the PID control and about 22.32% shorter than that of the fuzzy PID control. The steady-state error of the system under genetic fuzzy PID control was 88.67% less than that of the classical PID control, and 7.18% less than that of the fuzzy PID control in the steady-state response.
6.3. Sinusoidal Characteristic Simulation Analysis
The input was a 12° sinusoidal signal at 2 Hz to simulate the on-load condition. Four different control strategies were applied to the control system. The sampling time was set to 0.01 s. The maximum amplitude error and the maximum phase error of the system under different control strategies were compared.
Figure 11 shows the simulation results.
Table 5 shows the simulation data of frequency response under loading. The sinusoidal signal at 2 Hz and 12° was input under loading. The system under the genetic fuzzy PID control was 32.30% less than the fuzzy PID control system, 80.01% less than the pure fuzzy control system, and 60.03% less than the classical PID control system in terms of the maximum amplitude error. The system under the fuzzy PID control optimized by the GA was 33.43% less than the fuzzy PID, 86.90% less than the pure fuzzy control system, and 67.29% less than the classical PID in terms of the maximum phase error.
6.4. Input-Joint-Trajectory Simulation Analysis
The controllers of the three joints were successively optimized, and the trajectory planning was carried out in a Cartesian coordinate system. The end effector was moved along the gate-shaped trajectory, and the inverse kinematics were used to map the operation space to the joint space. The trajectories planned by interpolating quintic polynomials were used as the input. The simulation time was set to 3 s. The traditional PID control, fuzzy control, fuzzy PID control, and fuzzy PID control strategies optimized by GAs were used to control the PM. The trajectory tracking capabilities of the four control methods were compared.
Figure 12,
Figure 13 and
Figure 14 show the trajectory tracking of the three joints, respectively. The average absolute error was about 0.0327 using the GAFPID control strategy for Q1 joint motion. The enlarged partial image presents that the joint trajectory based on the GAFPID control strategy was the closest to the ideal trajectory, with the optimal control effect.
According to
Table 6 and
Table 7, the minimum integral time absolute error (ITAE) value of the joint trajectory is based on the GAFPID control strategy. The dynamic response overshoot was small and the adjustment time was short. The integral absolute error (IAE) index was the smallest, which means that small deviations in the control system can be suppressed.