Optimization Design by Genetic Algorithm Controller for Trajectory Control of a 3RRR Parallel Robot

In order to improve the control precision and robustness of the existing proportion integration differentiation (PID) controller of a 3-Revolute–Revolute–Revolute (3-RRR) parallel robot, a variable PID parameter controller optimized by a genetic algorithm controller is proposed in this paper. Firstly, the inverse kinematics model of the 3-RRR parallel robot was established according to the vector method, and the motor conversion matrix was deduced. Then, the error square integral was chosen as the fitness function, and the genetic algorithm controller was designed. Finally, the control precision of the new controller was verified through the simulation model of the 3-RRR planar parallel robot—built in SimMechanics—and the robustness of the new controller was verified by adding interference. The results show that compared with the traditional PID controller, the new controller designed in this paper has better control precision and robustness, which provides the basis for practical application.


Introduction
Parallel industrial robots are essentially closed kinematic chain mechanisms, in which the end-effector is clamped onto the base through several independent kinematic chains [1].Parallel industrial robots exhibit the following obvious advantages over the serial series: no cumulative error, little movement inertia, high structural stiffness, high load capacity, and so on.They are suitable for fast and accurate operations, and have been widely applied in industrial fields such as integrated circuit manufacturing and testing, fiber docking, and flight simulators [2,3].For instance, Lee and Yien [4] set up a three degrees of freedom (3-DOF) parallel industrial robot in order to operate and carry large-scale workpieces.Another 3-DOF micro-sized planar parallel industrial robot was developed for low-torque precision positioning tasks [5].Combined with the advantages of parallel robots and their wide applications in all aspects of social life, the research on parallel industrial robots is of great significance.
A typical 3-DOF planar 3-Revolute-Revolute-Revolute (3-RRR) parallel industrial robotconsisting of a moving platform which is connected to three identical branches and a static platform-has the advantages of a simple structure, good symmetry and accurate positioning.Therefore, many scholars have conducted detailed research on it.Gutierrez [6] performed an exhaustive singularity analysis of a 3-RRR planar parallel robot.From a kinematic point of view, the optimum characteristics of the 3-DOF planar parallel industrial robot were studied by Gosselin and Angeles [7].Serdar Kucuk [8] presented an optimization problem for the 3-degrees-of-freedom RRR fully planar parallel manipulator (3-RRR) based on the actuator power consumption.The effects of clearance on the dynamics of a planar 3-RRR parallel manipulator are investigated in [9].Based on forward kinematics theory, Flavio and Ron [10] studied the singularity problem, focusing completely on the planar parallel robot.Sébastien and Ilian [11] studied the accuracy problems on several kinds of typical 3-DOF planar parallel industrial robots.Gao [12] designed a planar 3-RRR parallel industrial robot by analyzing kinematics, singularity, dynamics, and controlling problems.Zhang et al. [13] presented the first-order approximation coupling model of planar 3-RRR flexible parallel robots and considered the rigid body motion constraints, elastic deformation motion constraints, and dynamic constraints of the moving platform in the coupling model.Yu [14] presented experimental research on the dynamics of flexible 3-RRR parallel robots and compared the results between the theoretical and experimental analysis.It can be seen from the above literature that the current research on the 3-RRR parallel robot mainly focuses on the dynamics model, work space analysis, singular point analysis, and structural optimization.Good control precision also plays a crucial role in the practical application of a robot.
At present, the research on robot control algorithms mainly focuses on fuzzy control algorithms [15], adaptive robust control algorithms [16], and genetic control algorithms [17].Stanet et al. [18] proposed a fuzzy controller for a 3-DOF parallel industrial robot in medical applications, and achieved more precise results with the fuzzy-based controller than with the classic PID controller.Noshadi et al. [19,20] introduced a method by which an active force can be used to control the platform.They also designed a two-level fuzzy tuning resolved acceleration control for the platforms.In doing so, they suggested that when there is disturbance, the manipulator can still perform trajectory tracking tasks with a stable response.Pham et al. [21] proposed a robust adaptive control method based on radial basis function neural network (RBFNN), and studied the trajectory tracking control of a two-link robot cleaning detection mechanism.In research by Ku et al. [22] the model predictive control was performed to fulfill the positioning control of a 3-RRR planar parallel manipulator.Song et al. [23] proposed a new path planning method for a robot based on a genetic algorithm and the Bezier curve.Wang et al. [24] presented a double global optimum genetic algorithm-particle swarm optimization for path planning of a welding robot.Lu et al. [25,26] proposed a new method for the optimal design and tuning of a Proportional-Integral-Derivative-type interval type-2 fuzzy logic controller for Delta parallel robot trajectory tracking control.The main aims of the above literature are to improve the robot control accuracy.However, a good control program needs to not only improve the control accuracy but also have the characteristics of simplicity, applicability, robustness, and stability.
It is well known that the classic PID controllers have the advantage of simplicity, and the genetic random search algorithm has a fast search ability.A variable PID parameter controller optimized by a genetic algorithm has been designed in this paper, differing from previous research by combining both advantages.The inverse kinematics model of the 3-RRR parallel robot was established according to the vector method, and the motor conversion matrix was deduced.The control precision of the new controller was verified through the simulation model of the 3-RRR planar parallel robot-built in SimMechanics-and the robustness of the new controller was verified by adding interference.The results show that compared with the traditional PID controller, the new controller designed in this paper not only has better control precision, stability, and higher robustness but also has the characteristics of simplicity and applicability, which provides the basis for practical application.The other parts of this paper are arranged as follows: Section 2 introduces the model of the planar parallel industrial robot; Section 3 presents the virtual bench setup and genetic algorithm controller; Section 4 discusses the simulation results; finally, Section 5 is the conclusion.

The Model of the Planar 3-RRR Parallel Robot
It is essential to establish the kinematics model for researching the planar parallel industrial robot control strategies.In this section, the inverse kinematics model of the 3-RRR parallel robot is established according to the vector method, and the motor conversion matrix is deduced, which is the foundation for the subsequent control.

The Structure of the 3-RRR Planar Parallel Robot
The three-dimensional map of the 3-RRR parallel robot is shown in Figure 1.The schematic diagram of the 3-RRR planar parallel robot is shown in Figure 2. The outline of the 3-RRR planar parallel robot is composed of the regular triangle of the moving platform C 1 C 2 C 3 ; the fixed base A 1 A 2 A 3 ; and three identical branches 2 shows, the three vertices of the regular triangle are A 1 , A 2 , A 3 , where the active revolute joints are set.The points of B 1 , C 1 , B 2 , C 2 , B 3 , C 3 are the passive revolute joints, where The radius of the circle of the motor in the working platform is R.The radius of the circle of the joints in the moving platform is r.The 3-DOF planar motion can be achieved using the three driving motors in the three active joints.

The Structure of the 3-RRR Planar Parallel Robot
The three-dimensional map of the 3-RRR parallel robot is shown in Figure 1.The schematic diagram of the 3-RRR planar parallel robot is shown in Figure 2. The outline of the 3-RRR planar parallel robot is composed of the regular triangle of the moving platform C1C2C3; the fixed base A1A2A3; and three identical branches A1B1C1, A2B2C2, A3B3C3.As Figure 2 shows, the three vertices of the regular triangle are A1, A2, A3, where the active revolute joints are set.The points of B1, C1, B2, C2, B3, C3 are the passive revolute joints, where A1B1 = A2B2 = A3B3 = l1, B1C1 = B2C2 = B3C3 = l2.The radius of the circle of the motor in the working platform is R.The radius of the circle of the joints in the moving platform is r.The 3-DOF planar motion can be achieved using the three driving motors in the three active joints.

The Kinematic Model of the 3-RRR Planar Parallel Robot
According to the geometric relationships shown in Figure 2, the coordinates of the motor in the static coordinate system are shown as follows,

The Structure of the 3-RRR Planar Parallel Robot
The three-dimensional map of the 3-RRR parallel robot is shown in Figure 1.The schematic diagram of the 3-RRR planar parallel robot is shown in Figure 2. The outline of the 3-RRR planar parallel robot is composed of the regular triangle of the moving platform C1C2C3; the fixed base A1A2A3; and three identical branches A1B1C1, A2B2C2, A3B3C3.As Figure 2 shows, the three vertices of the regular triangle are A1, A2, A3, where the active revolute joints are set.The points of B1, C1, B2, C2, B3, C3 are the passive revolute joints, where A1B1 = A2B2 = A3B3 = l1, B1C1 = B2C2 = B3C3 = l2.The radius of the circle of the motor in the working platform is R.The radius of the circle of the joints in the moving platform is r.The 3-DOF planar motion can be achieved using the three driving motors in the three active joints.

The Kinematic Model of the 3-RRR Planar Parallel Robot
According to the geometric relationships shown in Figure 2, the coordinates of the motor in the static coordinate system are shown as follows,

The Kinematic Model of the 3-RRR Planar Parallel Robot
According to the geometric relationships shown in Figure 2, the coordinates of the motor in the static coordinate system are shown as follows, The coordinates of the center of the moving platform in the moving coordinate system are shown as follows, The spatial transformation matrix T for transforming the moving coordinate system into the static coordinate system is shown as follows, where α, β, γ are the rotation angles around X, Y and Z, respectively.x, y, z are the distances along the X, Y and Z axes, respectively.Due to the parallel robot studied in this paper, they can only be translated along the x, y axis and rotated around the z axis, T can be expressed as follows, The coordinates of the moving platform center in the static coordinate system can be expressed as follows, Combining Equations ( 2) and ( 5), C can be expressed as follows, For any one branch A i B i C i , the parallel robot satisfies the following motion constraint of the closed-loop vector.The vector equation is expressed as follows [8], where i = 1, 2, 3.
Combined with Equation ( 8), θ Bi is the angle between the link B i C i and the positive direction of the X axis.
Equation ( 9) can be expressed as follows, where Let t i = tan(θ i /2), substituting Equation ( 10), according to the universal formula of the trigonometric function, Equation ( 10) can be expressed as follows, According to the rooting formula, the roots can be expressed as follows, Similarly, θ Bi can be obtained.
In order to build the genetic algorithm controller, it is necessary to obtain the transformation matrix of the motor physical model.The physical model of the three-phase asynchronous motor is shown in Figure 3.
Algorithms 2018, 11, 7 5 of 13 Equation ( 9) can be expressed as follows, where ) , substituting Equation ( 10), according to the universal formula of the trigonometric function, Equation ( 10) can be expressed as follows, ( ) ( ) According to the rooting formula, the roots can be expressed as follows, Similarly, Bi θ can be obtained.
In order to build the genetic algorithm controller, it is necessary to obtain the transformation matrix of the motor physical model.The physical model of the three-phase asynchronous motor is shown in Figure 3.The model of the three-phase asynchronous motor can be established by coordinate transformation.The transformation matrix from the three-phase coordinate system to the two-phase stationary coordinate system through the geometric relationship can be expressed as follows [27], The model of the three-phase asynchronous motor can be established by coordinate transformation.The transformation matrix from the three-phase coordinate system to the two-phase stationary coordinate system through the geometric relationship can be expressed as follows [27], The transformation matrix from the two-phase stationary coordinate system to the two-phase rotation coordinate system can be expressed as follows [27], cos θ e sin θ e − sin θ e cos θ e (14)

Virtual Bench Setup and Genetic Algorithm Controller
To verify the control effect of the PID controller optimized by the genetic algorithm, a virtual bench is constructed in SimMechanics.At the same time, to simulate the gap error between the two revolute joints in the actual system in the establishment of a three-dimensional model, the axis distance between the two revolute joints is set to 0.5 mm.As Figure 4 shows, the virtual bench of the planar 3-RRR parallel industrial robot is translated from its Pro/E form into Simulink in the SimMechanics toolbox.
The transformation matrix from the two-phase stationary coordinate system to the two-phase rotation coordinate system can be expressed follows [27]

Virtual Bench Setup and Genetic Algorithm Controller
To verify the control effect of the PID controller optimized by the genetic algorithm, a virtual bench is constructed in SimMechanics.At the same time, to simulate the gap error between the two revolute joints in the actual system in the establishment of a three-dimensional model, the axis distance between the two revolute joints is set to 0.5 mm.As Figure 4 shows, the virtual bench of the planar 3-RRR parallel industrial robot is translated from its Pro/E form into Simulink in the SimMechanics toolbox.According to the industrial robot structure in Figure 1, a virtual bench can be established as shown in Figure 4.The parallel industrial robot is composed of three elements, six links, one moving platform, and three driving joints.The moving platform is connected by three branches which consist of two individual links.Each of the two links are connected by revolute joints.The three driving joints on the static platform can constitute an equilateral triangle.Similarly, the three connection joints on the moving platform can also constitute an equilateral triangle.
The control scheme is significant for achieving the good stability and precise positioning needed by the 3-RRR planar parallel industrial robot.As we already know, the traditional PID controllers have good control of linear objects and their great advantages are simplicity and convenience.However, when the control reference is complicated in the trajectory tracking control, or when the dynamical parameters are changeable and complex, the classic PID control may not rapidly present a good result.In order to make the controller perform better, the genetic algorithm is introduced in this paper.It is a random search algorithm of natural selection and genetic mechanism which possesses the advantage of simplicity, versatility, robustness, and speed compared to the conventional method.The design flow chart of the genetic algorithm controller is shown in Figure 5.
The design process of the genetic algorithm is as follows: Step 1: Parameter encoding: Due to the need-tuning parameters in the real domain, the simple binary encoding and encoder, six sub-strings can be used as the six parameters influencing each According to the industrial robot structure in Figure 1, a virtual bench can be established as shown in Figure 4.The parallel industrial robot is composed of three elements, six links, one moving platform, and three driving joints.The moving platform is connected by three branches which consist of two individual links.Each of the two links are connected by revolute joints.The three driving joints on the static platform can constitute an equilateral triangle.Similarly, the three connection joints on the moving platform can also constitute an equilateral triangle.
The control scheme is significant for achieving the good stability and precise positioning needed by the 3-RRR planar parallel industrial robot.As we already know, the traditional PID controllers have good control of linear objects and their great advantages are simplicity and convenience.However, when the control reference is complicated in the trajectory tracking control, or when the dynamical parameters are changeable and complex, the classic PID control may not rapidly present a good result.In order to make the controller perform better, the genetic algorithm is introduced in this paper.It is a random search algorithm of natural selection and genetic mechanism which possesses the advantage of simplicity, versatility, robustness, and speed compared to the conventional method.The design flow chart of the genetic algorithm controller is shown in Figure 5.
The design process of the genetic algorithm is as follows: Step 1: Parameter encoding: Due to the need-tuning parameters in the real domain, the simple binary encoding and encoder, six sub-strings can be used as the six parameters influencing each other.They then formed a chromosome.The precision of the PID solution parameters is set to 4 digits after the decimal point, and the solution space of the PID parameters can be divided into (1000 − 0) × (10 4 ) = 10,000,000 points.Because 2 23 < 10,000,000 < 2 24 , 24-bit binary numbers are needed to represent these solutions.In other words, a solution code is a 24-bit binary string.
Initially, these binary strings are randomly generated.One such binary string represents a chromosome string where the length of the chromosome string is 24.
Step 2: The fitness function is the basis for evaluating the selection, where the error integral can be used as the performance of the system, such as Integrator Error (IE), Integrator Absolute Error (IAE), Integral Square Error (ISE), Integration Time and Absolute Error (ITAE), etc.Each formula has its own focus.This paper wants to achieve a smaller dynamic error, so the integral square error is used as the fitness function: Step 3: Genetic algorithm parameters: Group size n = 20, Crossover probability Pc = 0.8, Mutation probability Pm = 0.005.Step 4: If the error is minimum, then running is stopped, as the output has reached the optimal parameters.Otherwise, Steps 1 to 3 are repeated.
Algorithms 2018, 11, 7 7 of 13 other.They then formed a chromosome.The precision of the PID solution parameters is set to 4 digits after the decimal point, and the solution space of the PID parameters can be divided into (1000 − 0) × (10 4 ) = 10,000,000 points.Because 2 23 < 10,000,000 < 2 24 , 24-bit binary numbers are needed to represent these solutions.In other words, a solution code is a 24-bit binary string.Initially, these binary strings are randomly generated.One such binary string represents a chromosome string where the length of the chromosome string is 24.
Step 2: The fitness function is the basis for evaluating the selection, where the error integral can be used as the performance of the system, such as Integrator Error (IE), Integrator Absolute Error (IAE), Integral Square Error (ISE), Integration Time and Absolute Error (ITAE), etc.Each formula has its own focus.This paper wants to achieve a smaller dynamic error, so the integral square error is used as the fitness function: Step 3: Genetic algorithm parameters: Group size n = 20, Crossover probability Pc = 0.8, Mutation probability Pm = 0.005.Step 4: If the error is minimum, then running is stopped, as the output has reached the optimal parameters.Otherwise, Steps 1 to 3 are repeated.The stability of the controller is of great importance to the reliability of the control system.To further theoretically analyze the stability of the PID controller optimized by a genetic algorithm for the 3-RRR parallel robot, the Routh stability criterion is introduced for stability verification of the PID controller optimized by a genetic algorithm.The system PID closed-loop control block diagram is shown in Figure 6.The stability of the controller is of great importance to the reliability of the control system.To further theoretically analyze the stability of the PID controller optimized by a genetic algorithm for the 3-RRR parallel robot, the Routh stability criterion is introduced for stability verification of the PID controller optimized by a genetic algorithm.The system PID closed-loop control block diagram is shown in Figure 6.
Algorithms 2018, 11, 7 7 of 13 other.They then formed a chromosome.The precision of the PID solution parameters is set to 4 digits after the decimal point, and the solution space of the PID parameters can be divided into (1000 − 0) × (10 4 ) = 10,000,000 points.Because 2 23 < 10,000,000 < 2 24 , 24-bit binary numbers are needed to represent these solutions.In other words, a solution code is a 24-bit binary string.Initially, these binary strings are randomly generated.One such binary string represents a chromosome string where the length of the chromosome string is 24.
Step 2: The fitness function is the basis for evaluating the selection, where the error integral can be used as the performance of the system, such as Integrator Error (IE), Integrator Absolute Error (IAE), Integral Square Error (ISE), Integration Time and Absolute Error (ITAE), etc.Each formula has its own focus.This paper wants to achieve a smaller dynamic error, so the integral square error is used as the fitness function: Step 3: Genetic algorithm parameters: Group size n = 20, Crossover probability Pc = 0.8, Mutation probability Pm = 0.005.Step 4: If the error is minimum, then running is stopped, as the output has reached the optimal parameters.Otherwise, Steps 1 to 3 are repeated.The stability of the controller is of great importance to the reliability of the control system.To further theoretically analyze the stability of the PID controller optimized by a genetic algorithm for the 3-RRR parallel robot, the Routh stability criterion is introduced for stability verification of the PID controller optimized by a genetic algorithm.The system PID closed-loop control block diagram is shown in Figure 6.According to the closed-loop PID control block diagram shown in Figure 6, the characteristic equation of the closed-loop control transfer function can be expressed as follows, bK p K d s 3 + bK p + aK p K d s 2 + aK p + bK p K i s + aK p K i = 0 (16) The Routh-table of the characteristic equation is expressed as follows, In order to build PID controllers conveniently, the circular equation is divided into two input equations ( X P = 0.03 − 0.03 cos(50t) (Equation (a)), Y P = 0.03 sin(50t) (Equation (b))).Therefore, two PID controllers optimized by a genetic algorithm are set.The parameters in system transfer function are given as a = 0.7374, b = 0.000036.
When there is no interference added, the PID control parameters of the PID controller optimized by a genetic algorithm for Equation (Equation (a)) are K p1 = 991.1899,K i1 = 152.2033,K d1 = 9.9589.The PID control parameters of the PID controller optimized by a genetic algorithm for Equation (Equation (b)) are K p2 = 0.3, K i2 = 799.9985,K d2 = 0.0003.
When there is interference added, the PID control parameters of the PID controller optimized by a genetic algorithm for Equation (Equation (a)) are K p1 = 100, K i1 = 198.9589,K d1 = 9.7398.The PID control parameters of the PID controller optimized by a genetic algorithm for Equation (Equation (b)) are K p2 = 0.3, K i2 = 799.4141,K d2 = 0.0003.
Substituting the above parameters into the Routh-table Equation ( 17), it can be seen that none of the coefficients of the eigenvalue equation is zero, and the sign of each coefficient is positive; therefore, according to the Routh stability criterion, the system can be proved to be stable.

Simulation and Results Discussion
To verify the control effect of the PID controller optimized by a genetic algorithm, the circular trajectory which is commonly used in industrial applications is selected as the trajectory.The system control block diagram is shown in Figure 7.The trajectory equation is as follows, The radius of the circle where the active revolute joints are located is R = 0.25 m.The radius of the circle where the triangle of the mobile platform is located is r = 0.0825 m; the length of the links l 1 = l 2 = 0.16 m; the concentrated mass of the links mg = 0.2 kg; the concentrated mass of the moving platform mp = 1 kg.To better describe the trajectory tracking error, e i (i = 1, 2) are defined as the tracking errors.The control parameters of the classic PID controller are K p 1 = 10, K i1 = 100, K d1 = 5, K p2 = 0.35, K i2 = 500, K d2 = 0.0003.
where x d is the x coordinate of the desired trajectory.y d is the y coordinate of the desired trajectory.
x p is the x coordinate of the trajectory obtained by the classic PID controller.y p is the y coordinate of the trajectory obtained by the classic PID controller.
x g is the x coordinate of the trajectory obtained by the PID controller optimized by a genetic algorithm.y g is the y coordinate of the trajectory obtained by the PID controller optimized by a genetic algorithm.
The trajectory tracking errors of the classic PID and the PID optimized by a genetic algorithm are shown in Figure 8.It is found that the PID controller optimized by the genetic algorithm has a higher control accuracy.The trajectories of the end-effector using the classic PID and the PID optimized by a genetic algorithm are shown in Figure 9.It can be found that the running trajectory of the PID controller optimized by a genetic algorithm is closer to the desired trajectory; therefore, the genetic algorithm-optimized PID controller designed in this paper has a higher trajectory tracking accuracy.Moreover, the PID controller obtained by a genetic algorithm saves more time than the PID controller obtained by the trial and error method, which is simple and practical.
Algorithms 2018, 11, 7 9 of 13 xg is the x coordinate of the trajectory obtained by the PID controller optimized by a genetic algorithm.yg is the y coordinate of the trajectory obtained by the PID controller optimized by a genetic algorithm.
The trajectory tracking errors of the classic PID and the PID optimized by a genetic algorithm are shown in Figure 8.It is found that the PID controller optimized by the genetic algorithm has a higher control accuracy.The trajectories of the end-effector using the classic PID and the PID optimized by a genetic algorithm are shown in Figure 9.It can be found that the running trajectory of the PID controller optimized by a genetic algorithm is closer to the desired trajectory; therefore, the genetic algorithm-optimized PID controller designed in this paper has a higher trajectory tracking accuracy.Moreover, the PID controller obtained by a genetic algorithm saves more time than the PID controller obtained by the trial and error method, which is simple and practical.To further verify the robustness of the controller designed in this paper, an artificial disturbance is added to the model.The curve of the disturbance is as follows:  To further verify the robustness of the controller designed in this paper, an artificial disturbance is added to the model.The curve of the disturbance is as follows: x d = 0.003 cos(50t) y d = 0.003 sin(50t) (20) Algorithms 2018, 11, 7 9 of 13 xg is the x coordinate of the trajectory obtained by the PID controller optimized by a genetic algorithm.yg is the y coordinate of the trajectory obtained by the PID controller optimized by a genetic algorithm.
The trajectory tracking errors of the classic PID and the PID optimized by a genetic algorithm are shown in Figure 8.It is found that the PID controller optimized by the genetic algorithm has a higher control accuracy.The trajectories of the end-effector using the classic PID and the PID optimized by a genetic algorithm are shown in Figure 9.It can be found that the running trajectory of the PID controller optimized by a genetic algorithm is closer to the desired trajectory; therefore, the genetic algorithm-optimized PID controller designed in this paper has a higher trajectory tracking accuracy.Moreover, the PID controller obtained by a genetic algorithm saves more time than the PID controller obtained by the trial and error method, which is simple and practical.To further verify the robustness of the controller designed in this paper, an artificial disturbance is added to the model.The curve of the disturbance is as follows:   The trajectory tracking errors of the classic PID and the PID optimized by a genetic algorithm are shown in Figure 10.The maximum error is still less than 1 mm.It is found that the controller designed in this paper still has a higher accuracy when the interference is added.The trajectories of the end-effector using the classic PID and the PID optimized by a genetic algorithm are shown in Figure 11.It can be found that the running trajectory of the PID controller optimized by a genetic algorithm is closer to the desired trajectory.Therefore, the genetic algorithm-optimized PID controller designed in this paper has a higher trajectory tracking accuracy and has better robustness when the interference is added.
Figure 12 shows the torque curves produced by the classic PID controller and the PID controller optimized by a genetic algorithm.These torque curves are measured using a torque transducer built in SimMechanics.It can be found that, compared with the traditional PID controller, the torque curves produced by the PID controller optimized by a genetic algorithm are smoother at the beginning of operation; therefore, the new controller has better stability at the beginning.The trajectory tracking errors of the classic PID and the PID optimized by a genetic algorithm are shown in Figure 10.The maximum error is still less than 1 mm.It is found that the controller designed in this paper still has a higher accuracy when the interference is added.The trajectories of the end-effector using the classic PID and the PID optimized by a genetic algorithm are shown in Figure 11.It can be found that the running trajectory of the PID controller optimized by a genetic algorithm is closer to the desired trajectory.Therefore, the genetic algorithm-optimized PID controller designed in this paper has a higher trajectory tracking accuracy and has better robustness when the interference is added.
Figure 12 shows the torque curves produced by the classic PID controller and the PID controller optimized by a genetic algorithm.These torque curves are measured using a torque transducer built in SimMechanics.It can be found that, compared with the traditional PID controller, the torque curves produced by the PID controller optimized by a genetic algorithm are smoother at the beginning of operation; therefore, the new controller has better stability at the beginning.The trajectory tracking errors of the classic PID and the PID optimized by a genetic algorithm are shown in Figure 10.The maximum error is still less than 1 mm.It is found that the controller designed in this paper still has a higher accuracy when the interference is added.The trajectories of the end-effector using the classic PID and the PID optimized by a genetic algorithm are shown in Figure 11.It can be found that the running trajectory of the PID controller optimized by a genetic algorithm is closer to the desired trajectory.Therefore, the genetic algorithm-optimized PID controller designed in this paper has a higher trajectory tracking accuracy and has better robustness when the interference is added.
Figure 12 shows the torque curves produced by the classic PID controller and the PID controller optimized by a genetic algorithm.These torque curves are measured using a torque transducer built in SimMechanics.It can be found that, compared with the traditional PID controller, the torque curves produced by the PID controller optimized by a genetic algorithm are smoother at the beginning of operation; therefore, the new controller has better stability at the beginning.

Conclusions
In this paper, a variable PID parameter controller optimized by a genetic algorithm controller is proposed.The inverse kinematics model of the 3-RRR parallel robot was established according to the vector method, and the motor conversion matrix was deduced.The gap error between the two revolute joints in the actual system was simulated by the establishment of a three-dimensional model; the axis distance between the two revolute joints was set to 0.5 mm.The simulation model of the 3-RRR planar parallel robot-built by SimMechanics-was used to verify the new controller.The results show that, compared with the traditional PID controller, the new controller designed in this paper has better control precision, and when interference is added to the system, the new controller has better robustness and stability, which provides the basis for practical application.

Figure 3 .
Figure 3. Physical model of the three-phase asynchronous motor.

Figure 3 .
Figure 3. Physical model of the three-phase asynchronous motor.

Figure 4 .
Figure 4.The virtual bench of the planar 3-RRR parallel industrial robot.

Figure 4 .
Figure 4.The virtual bench of the planar 3-RRR parallel industrial robot.

Figure 5 .
Figure 5.The design flow chart of the genetic algorithm controller.

Figure 5 .
Figure 5.The design flow chart of the genetic algorithm controller.

Figure 5 .
Figure 5.The design flow chart of the genetic algorithm controller.

Figure 8 .
Figure 8.The trajectory tracking errors of the classic PID and the PID optimized by a genetic algorithm.

Figure 8 .
Figure 8.The trajectory tracking errors of the classic PID and the PID optimized by a genetic algorithm.

Figure 8 .
Figure 8.The trajectory tracking errors of the classic PID and the PID optimized by a genetic algorithm.

Figure 9 .
Figure 9. Trajectories of the end-effector using the classic PID and the PID optimized by a genetic algorithm.

Figure 10 .Figure 9 .
Figure 10.The errors of using the classic PID and the PID optimized by a genetic algorithm in the presence of disturbances.

Algorithms 2018, 11 , 7 10 of 13 Figure 9 .
Figure 9. Trajectories of the end-effector using the classic PID and the PID optimized by a genetic algorithm.

Figure 10 .Figure 10 .
Figure 10.The errors of using the classic PID and the PID optimized by a genetic algorithm in the presence of disturbances.

Figure 11 .
Figure 11.Trajectory of the end-effector using the classic PID and the PID optimized by a genetic algorithm in the presence of disturbances.

Figure 12 .Figure 11 . 13 Figure 11 .
Figure 12.The torque curves produced by the classic PID control and the GA-PID control.

Figure 12 .Figure 12 .
Figure 12.The torque curves produced by the classic PID control and the GA-PID control. ,