Eliminating the E ﬀ ect of Uncertainties of Cutting Forces by Fuzzy Controller for Robots in Milling Process

: This study presents a method of controlling robots based on fuzzy logic to eliminate the e ﬀ ect of uncertainties that are generated by the cutting forces in milling process. The common method to control industrial robots is based on the robot dynamic model and the di ﬀ erential equations of motion to compute the control values. The quantities in the di ﬀ erential equations of the motion of robots are complex and di ﬃ cult to determine fully and accurately. The interaction forces between the cutting tool and the workpiece are the cutting forces, which are generated during the machining process. It is di ﬃ cult to calculate the cutting force because it depends on many factors such as material of the machining part, depth of cut, feed rate, etc. This article presents the fuzzy rule system and the selection of the physical value domain of input and output variables of the fuzzy controller. The fuzzy rules are applied in this article to allow us to compute the driving forces based on the errors of input and output signals of the joint positions and velocities, thereby avoiding the calculation of cutting forces. This article shows the simulation results of the fuzzy controller and comparison with the results of the conventional controller when the dynamic model is assumed to be correctly determined. The achieved results are reliable and facilitate the research and application of a fuzzy controller to mechanical processing robots in general and milling machining in particular.


Introduction
Robots are increasingly being used in mechanical machining due to many technical and economic advantages [1][2][3][4][5]. Robots have many degrees of freedom and a structure with many links and joints enabling them to move flexibly in a large workspace. They have machine parts with complex geometric surfaces, large dimensions, and a minimum number of machining operations and simple jigs [3]. Machining by industrial robots is more economical than machine tools and according to the calculation of the COMET, the price advantage is up to 30% [6]. However, there are many difficulties and challenges in exploiting the potential of robot applications [2,7]. The structure with many links and joints will give the robot the ability to manipulate flexibly as mentioned, but it is difficult when modeling kinematics and dynamics to control the robots. The expressions of the kinematic and dynamic quantities in the differential equations of motion of the robots are often cumbersome and complex. The machining process has many factors, which are difficult to fully and accurately determine, for example, chatter, vibration, or the fact that the perturbations may appear abnormally [8][9][10]. In particular, the cutting force generated during machining is an uncertain factor and has a great effect on the determination of Normally, the machining object is clamped on a fixed platform, and a robot with 6 DOF is sufficient to obtain positions and orientations of the end effector for the machining performance. However, for the purpose of expanding the operational space of the robot, or choosing a convenient machining posture, a machining system with a two DOF clamping platform is utilized. As a result, the robot can machine large parts with many complex surfaces, reducing the number of clamping operations. Robots with a combination of two such component robots or more are often referred to Mechanism of Relative Manipulation robots-MRM [73][74][75][76][77][78][79][80][81]. For a simple presentation, the robotplatform system is hereinafter called the robot system or the robot.
The article applies the Denavit-Hartenberg convention to define the link frames and derive kinematic equations of the robot kinematic chains, using generalized coordinates to represent and calculate the kinematic chain of the platform. The coordinate systems, kinematic parameters and corresponding homogeneous coordinate transformation matrices are shown in Table 1.
In Table 1, Oixiyizi (i = 1, …, 6) is the frame that is attached to the end of link i, and represents the position and orientation of frame Oixiyizi with respect to frame Oi−1xi−1yi−1zi−1 by the Denavit-Hartenberg homogeneous coordinate transformation matrix i−1 Ai, with respect to frame O0x0y0z0 by matrix 0 Ai. O6x6y6z6 is called the end-effector frame. O0x0y0z0 is called the base frame for the entire robot-platform system, with matrix E being the 4 × 4 identity matrix that represents the position and orientation of the base frame with respect to itself. The parameters in the third column of Table 1 represent the relative positions between two consecutive frames, in which i (i = 1, …, 6), yb, xd are the joint coordinates, and the other parameters are constants.
The vector of joint coordinate is denoted by q, represented by Equation (1).

   
O0'x0'y0'z0' is the fixed frame that has the origin at position O0' and the axes parallel to the corresponding ones of the base frame, used to location the platform.
Obxbybzb is the frame that attached to link B; it is possible to translate in the direction yb//y0, corresponding to the joint coordinate yb, the coordinate transformation matrices as shown in Table 1. Odxdydzd is the frame that attached to link D; it is possible to translate in the direction xd//xb//x0, corresponding to the joint coordinate xd, the coordinate transformation matrices as shown in Table 1.
Frame Odxdydzd, hereinafter called the platform frame or the jig frame, is used to locate the workpiece. The parameters of the workpiece's machined surface and toolpath are shown in the jig frame.
In the machining process, the tool performs the relative motion with respect to the machined surface according to the law (trajectory) that is determined by the machining engineering. This trajectory is represented by parameters d xE, d yE, d zE, d αE, d βE, d ηE (Table 1) and their first and second time derivatives with respect to time. Thereby, the vector of operational coordinates is called p, represented by (2). Normally, the machining object is clamped on a fixed platform, and a robot with 6 DOF is sufficient to obtain positions and orientations of the end effector for the machining performance. However, for the purpose of expanding the operational space of the robot, or choosing a convenient machining posture, a machining system with a two DOF clamping platform is utilized. As a result, the robot can machine large parts with many complex surfaces, reducing the number of clamping operations. Robots with a combination of two such component robots or more are often referred to Mechanism of Relative Manipulation robots-MRM [73][74][75][76][77][78][79][80][81]. For a simple presentation, the robot-platform system is hereinafter called the robot system or the robot.
The article applies the Denavit-Hartenberg convention to define the link frames and derive kinematic equations of the robot kinematic chains, using generalized coordinates to represent and calculate the kinematic chain of the platform. The coordinate systems, kinematic parameters and corresponding homogeneous coordinate transformation matrices are shown in Table 1.
In Table 1, O i x i y i z i (i = 1, . . . , 6) is the frame that is attached to the end of link i, and represents the position and orientation of frame O i x i y i z i with respect to frame O i−1 x i−1 y i−1 z i−1 by the Denavit-Hartenberg homogeneous coordinate transformation matrix i−1 A i , with respect to frame O 0 x 0 y 0 z 0 by matrix 0 A i . O 6 x 6 y 6 z 6 is called the end-effector frame. O 0 x 0 y 0 z 0 is called the base frame for the entire robot-platform system, with matrix E being the 4 × 4 identity matrix that represents the position and orientation of the base frame with respect to itself. The parameters in the third column of Table 1 represent the relative positions between two consecutive frames, in which θ i (i = 1, . . . , 6), y b , x d are the joint coordinates, and the other parameters are constants.
The vector of joint coordinate is denoted by q, represented by Equation (1).
O 0' x 0' y 0' z 0' is the fixed frame that has the origin at position O 0' and the axes parallel to the corresponding ones of the base frame, used to location the platform.
O b x b y b z b is the frame that attached to link B; it is possible to translate in the direction y b //y 0, corresponding to the joint coordinate y b , the coordinate transformation matrices as shown in Table 1. O d x d y d z d is the frame that attached to link D; it is possible to translate in the direction x d //x b //x 0 , corresponding to the joint coordinate x d , the coordinate transformation matrices as shown in Table 1.
Frame O d x d y d z d , hereinafter called the platform frame or the jig frame, is used to locate the workpiece. The parameters of the workpiece's machined surface and toolpath are shown in the jig frame.
In the machining process, the tool performs the relative motion with respect to the machined surface according to the law (trajectory) that is determined by the machining engineering. This trajectory is represented by parameters d x E , d y E , d z E , d α E , d β E , d η E (Table 1) and their first and second Appl. Sci. 2020, 10, 1685 4 of 31 time derivatives with respect to time. Thereby, the vector of operational coordinates is called p, represented by (2).
Therefore, the frame O d x d y d z d is used as the operational frame.
Frame O E x E y E z E is attached to the cutting edge of the cutter on the end effector, called the tool frame.
According to the robot kinematic chain, matrix 0 A E represents the position and orientation of the tool frame O E x E y E z E with respect to the base frame O 0 x 0 y 0 z 0 , determined by (3).
According to the platform kinematic chain, 0 A E is determined by (4).
The right hand side of (5) is the matrix representing the position and orientation of the cutting tool with respect to the platform frame O d x d y d z d , whose elements are functions of the joint coordinates (1). Meanwhile, the elements of the matrix on the left hand side of (5) are functions of the operational coordinates (2). (5) is rewritten by (6).
Equation (6) is called the kinematic equation of robot in matrix form.
For each specific machining case, the requirements on shaping motion of the tool are given. That is, to the scope of this study, the operational coordinates (2) and its derivatives are known. Applying the accompanying trihedron method [68][69][70][71][72] together with the kinematic Equation (6) allows us to calculate the motion trajectory of the robot. That is, the joint coordinates (1) and their first and second time derivatives with respect to time are calculated, which are used as the set trajectories (7) for the control problem in the following section.

Differential Equations of Motion of the Robot
The Lagrange equation in matrix form describing the motion of the robot has form (8).
In which [M(q)] 8×8 is the mass matrix of the robot system, calculated through mass m i , translation Jacobian matrix J Ti , rotation Jacobian matrix ci J Ri and inertia tensor Ci Θ Ci of link i (9).
is the vector of the generalized forces of Coriolis and centrifugal inertial forces, calculated through the partial derivative of the elements of matrix [M(q)] with respect to the generalized coordinates q, and the generalized velocity . q (10).
(k,l;j) is Christoffel notation with 3 indexes of the first kind; m kl (k,l = 1, . . . [G(q)] 8×1 is the vector of the generalized forces of the conservative forces (11).
Π is the potential energy of the system.
[U] 8×1 is the vector of the generalized forces of the driving forces/torques (12).
τ i is the driving force at joint i. τ i is the force or torque depending on the prismatic joint or revolute joint.
[Q(q)] 8×1 is the vector of the generalized forces of the non-conservative forces, including the friction forces at the contact point between the tool and the workpiece, the forces that separate the chip from the workpiece; the acting forces between the tool and the workpiece are called the cutting forces, collectively. In addition, there are also the friction forces at the joints, the abnormal perturbation from the environment, etc., of which the value of cutting forces and the effect of cutting forces on motion are great. Therefore, this paper limits the investigation of cutting forces and other types of force are ignored. The next subsection introduces the investigation of cutting forces in milling process with the robot.

Cutting Forces in Milling
The cutting forces are generated at the cutting point of the tool and the workpiece and this is a complex process force system. However, in general, the process force system can be represented as the force system from the workpiece acting on the robot including the force and the torque (force couple) with notation (F c ,M c ). The notation (F r ,M r ) represents the force and torque vectors from a tool acting on the workpiece (13).
The generalized force components of the force F c and the torque M c are determined by the robot kinematic chain (14).
r E is the position vector of the acting point of the force F c with respect to the base frame, ω E is the angular velocity of the end effector, determined by the robot kinematic chain. The Jacobian matrices in (14) are calculated according to (15).
The generalized force components of the force F r and the torque M r are determined according to the platform kinematic chain (16).
r k is the position vector of acting point of the force F r with respect to the base frame and ω k is the angular velocity of the workpiece determined by the platform kinematic chain. The Jacobian matrices in (16) are calculated according to (17).
Note that Equation (17) is used for the general case; with the robot system investigated in this paper, the angular velocity ω k is zero because the platform carrying the workpiece has only two prismatic joints, and only performs translational motion.
It is known that on the robot kinematic chain, there are only joint coordinates q 1 ,q 2 , . . . , q 6 ; while on the platform kinematic chain, there are only joint coordinates q 7 , q 8 , therefore we have (18) and (19).
So, the sum of the generalized force components of the non-conservative forces is expressed as (20).
[Q(q)] (8×1) = Q c + Q r = [Q c1 , Q c2 , . . . , Q c6 , Q r7 , Q r8 ] T (20) Recognizing that in order to calculate the generalized forces of cutting forces, the Jacobian matrices calculated according to (15) are quite complex, because the expressions for determining the position of cutting points and the angular velocity of the end effector are often cumbersome and complex.
The cutting forces expressing as (13) appear in milling process depending on the cutting parameters, the geometric parameters of the chip geometry, cutting conditions, etc. The cutting force components are not constants because the materials are heterogeneous, and the depth of cut, the feed rate, etc., may be changed during the machining process. The cutting forces are complex distribution forces on the contact area between the surface of the cutting edge and the workpiece, with the resultant force placed at the center of the contact area (placed at the upper point of the cutting edge between the cutter entry and exit angles).
According to the authors of [25,26], the approximate method of calculating the milling forces in the x, y, z directions of the Z cutting teeth is represented by (21).
where F x,i , F y,i , F z,i are the cutting forces acting on the ith cutting edge in the x, y, z directions, respectively, calculated according to (22).
In which z j,1 (θ i (z)), z j,2 (θ i (z)) are upper and lower limitations of the cutting area of the ith cutting edge, in axial direction of the cutter shaft.
dF i x , dF i y , dF i z are the differential cutting forces acting on the infinitesimal cutting edge segment of the ith cutting edge, in x, y, z directions, respectively (23).
θ i (z) is the immersion angle for the cutting edge i at axial depth of cut z (24): κ is the angle between dF ri and the cutter axial; Z is number of cutting edge/flute/tooth of the cutter; Ψ(z) is the radial lag angle; n is spindle speed (rpm).
At instant t, at any point P of the cutting area, a segment of the ith cutting edge performs cutting, the differential cutting forces dF ti , dF ri , dF ai in tangential, radial and axial directions, respectively, acting on point P, represented in Figure 2 and determined by (25).
dF ti = K tc a i (θ i , κ)db + K te dS dF ri = K rc a i (θ i , κ)db + K re dS dF ai = K ac a i (θ i , κ)dB + K ae dS (25) Of which: K tc , K rc , K ac are tangential, radial and axial cutting force coefficients in milling. K te , K re , K ae are tangential, radial and axial edge force coefficients in milling. dS is thickness of an element of the ith cutting edge. db is length of cut in the direction of the cutting velocity vector. a i (θ i, κ) is chip thickness that cut by the segment of the ith cutting edge (26).
The force components according to (21)-(23) can be conveniently represented on the x, y, z axes of the tool frame O E x E y E z E . Summing the cutting force system with respect to the origin of the tool frame, we obtain the torques of the cutting forces. These torques are determined based on the position of the acting point of resultant force of the cutting force system with respect to the tool frame O E x E y E z E . The contact area and the state of interaction between the tool and the workpiece are difficult to determine accurately, therefore, the determination of the resultant force value of the cutting force system and their positions, as well as their torques, are complex and less accurate. This study does not aim to find out an accurate calculation of the cutting forces but rather to find out the way to eliminate its effects.
The next section represents the application of a dynamic model that is derived above for the Inverse Dynamics + PD controller.

Inverse Dynamics + PD Controller
The control of the 8 DOF robot-platform system is the coordinating movement control of the 6 DOF robot with the tool and the 2 DOF platform with the workpiece so as to ensure the tool tracking on the given form-shaping tool path in the task space. Movement of the robot system is carried out thanks to the joint driving system. The control effects are applied to the joints, so the joints are directly the control objects; the joint positions always follow to the desired positions so that the position deviations (error) are less than a specified value consistent with the required accuracy.
The Inverse Dynamics + PD controller is the common controller, popular for industrial robots, based on the rule of inverse dynamics control combined with the outer loop linear PD control.
Using the differential equations of motion of robot system (8), choosing the control rule as follows (27).
u is the chosen control signal that has the PD structure (28).
e are the vectors that represent deviations of the joint positions, velocities and accelerations at an instant machining time (29). q are the vectors of the actual joint positions, velocities, and accelerations. K P(8×8) , K V(8×8) are the diagonal matrix of the proportional gain coefficients, the derivative of each separate joint corresponding to the controller, respectively, (30) and (31).
or write in a separate form of independent equations for the joints (33). ..
The Inverse Dynamics + PD controller model is demonstrated in Figure 3. The simulation results are shown in Section 6.

The Controller Based on Fuzzy Logic
The literature on fuzzy control is very diversified, however for easy understanding this article briefly introduces fuzzy control. Some knowledge that is relevant and used in the paper is presented in Appendix A. Based on the contents presented in the Appendix A, it is easy to find out relevant issues when looking up references. Subsequent contents of the article with references (if any) in the Appendix A may help to clarify the fuzzy control base that is briefly presented below.
This section presents the fuzzy controller design for a milling machining robot. The article uses the Mamdani fuzzy controller and selects the rule of Max-Min composition, the method of central defuzzification and triangular membership functions.
The following shows the steps to design a fuzzy controller and propose fuzzy rules for the robot controller ( See also Appendix B).

Select input and output signals
Inputs are joint position errors e(t) and joint velocity errors e(t) over time of the robot system.
Outputs are the adjustment amounts of the joint driving forces/torques u(t) at each machining instant to ensure that the errors e(t), e(t) are as small as the requirement of machining accuracy.
u is the vector of the adjustment amounts of joint forces/torques of the robot and platform, which is calculated according to Formula (34),

The Controller Based on Fuzzy Logic
The literature on fuzzy control is very diversified, however for easy understanding this article briefly introduces fuzzy control. Some knowledge that is relevant and used in the paper is presented in Appendix A. Based on the contents presented in the Appendix A, it is easy to find out relevant issues when looking up references. Subsequent contents of the article with references (if any) in the Appendix A may help to clarify the fuzzy control base that is briefly presented below.
This section presents the fuzzy controller design for a milling machining robot. The article uses the Mamdani fuzzy controller and selects the rule of Max-Min composition, the method of central defuzzification and triangular membership functions.
The following shows the steps to design a fuzzy controller and propose fuzzy rules for the robot controller (See also Appendix B).

Select Input and Output Signals
Inputs are joint position errors e(t) and joint velocity errors . e(t) over time of the robot system. Outputs are the adjustment amounts of the joint driving forces/torques u(t) at each machining instant to ensure that the errors e(t), . e(t) are as small as the requirement of machining accuracy. u is the vector of the adjustment amounts of joint forces/torques of the robot and platform, which is calculated according to Formula (34), where τ d is the vector of desired driving forces/torques at the joints in accordance with theoretical computations and requirements of machining engineering, then the joint position error e(t) → 0 and the joint velocity error . e(t) → 0. τ is the vector of the actual forces/torques at the joints in accordance with the requirements of machining engineering so that the joint position errors e(t) and the joint velocity errors . e(t) approach the zero asymptotic point. u 1 , u 2 , . . . , u 8 are the adjustment amounts of forces/torques at each joint 1, 2, . . . , 6, B and D of the robot system, respectively.
At each machining instant corresponding to a pair of input signal values, which are the joint position error e(t) and the joint velocity error . e(t), the controller calculates the adjustment amount of the joint forces/torques u(t), and gives a signal u(t) to adjust the errors e(t), . e(t) approaching and converging at the zero asymptotic point:

Determine the Physical Value Domains for Control Signals
Depending on the parameters of the machining process, kinematics, dynamics and the required force/torque for the robot to perform machining motion according to the machining requirements, it will estimate the physical value domain for position errors, velocity errors, and adjustment amount of the force/torque of the ith joint (i = 1, . . . , 8) of the fuzzy controller which is shown in (35).

Build Linguistic Variables
Language variables are key elements of fuzzy control rule. Each linguistic variable consists of a linguistic value domain and physical value domain. The linguistic value domain is a set of linguistic values. The linguistic value is set up by a fuzzy set.
The number of selected linguistic values must be appropriate, not complicated and fully represent the characteristics of the control system.
Fuzzification of input and output signal data includes the name of the errors of position and velocity, and the amount of force/torque adjustment as y i (y i = e i , The physical value domain X of y i ∈ [y imin ,y imax ] is divided into five subdomains X j (j = 1, . . . , 5), the subdomains overlap and the subdomain X j is set up by fuzzy set F j . The fuzzy set F j is represented by linguistic values as in Table 2.   Figure 4) is calculated according to (36).
The membership function of yi (yi = ei, i e , ui; i = 1, …, 8) in the NS fuzzy set ( Figure 4) is calculated according to (37 The membership function of yi (yi = ei, i e , ui; i = 1, …, 8) in the Z fuzzy set ( Figure 4) is calculated according to (38).
The membership function of yi (yi = ei, The membership function of yi (yi = ei, i e , ui; i = 1, …, 8) in the PB fuzzy set ( Figure 4) is calculated according to (40).  Figure 4) is calculated according to (36).
The membership function of y i (y i = e i , . e i , u i ; i = 1, . . . , 8) in the NS fuzzy set ( Figure 4) is calculated according to (37).
The membership function of y i (y i = e i , . e i , u i ; i = 1, . . . , 8) in the Z fuzzy set ( Figure 4) is calculated according to (38).
The membership function of y i (y i = e i , . e i , u i ; i = 1, . . . , 8) in the PS fuzzy set ( Figure 4) is calculated according to (39).
The membership function of y i (y i = e i , . e i , u i ; i = 1, . . . , 8) in the PB fuzzy set ( Figure 4) is calculated according to (40).
From the above, we realize that input and output vector signals are position errors e(t), velocity errors . e(t), and amount of torque adjustment u(t) of joints of the robot system within the real (explicit) physical value domain identifying them as different, but with the same linguistic value name. e(t), as Table 3. The formula to set the fuzzy compositional rule system for the fuzzy controller (41).

Set up the Control Laws
From Table 3 and Formula (41), there is the fuzzy compositional rule system (42) including fuzzy conditional statements:  (43) and (44).
Use Rule (43) and (44), in turn, to determine the membership function value for each Compositional Rule and total Compositional Rule system. The output result of each Compositional Rule is the membership function value corresponding to the fuzzy set F' (note that each membership function value corresponds to a fuzzy set F i and the membership function value of the whole system corresponds to the general fuzzy set F'), the fuzzy set F' is in 5 fuzzy sets represented by 5 linguistic values of the domain {NB, NS, Z, PS, PB}.

Defuzzification
The defuzzification is to determine the explicit (crisp) value y' of the output (the amount of force/torque adjustment u(t) of joint) from the membership function value of the fuzzy set F'. Use the center of area method (COA) for defuzzification to the fuzzy controller of the robot system when surface shaping machining. This method is easy to apply, involving all output fuzzy sets of the Compositional Rule of Inference. The results of this method are highly accurate (45).
where y' is the actual output value taken in accordance with the abscissa of the domain central point enclosed by membership function constituting (line) with the horizontal axis and S' is the domain defining the fuzzy set F'. Figure 5 shows the principal structure of the fuzzy controller.
Use Rule (43) and (44), in turn, to determine the membership function value for each Compositional Rule and total Compositional Rule system. The output result of each Compositional Rule is the membership function value corresponding to the fuzzy set F' (note that each membership function value corresponds to a fuzzy set F′i and the membership function value of the whole system corresponds to the general fuzzy set F'), the fuzzy set F' is in 5 fuzzy sets represented by 5 linguistic values of the domain {NB, NS, Z, PS, PB}.

Defuzzification
The defuzzification is to determine the explicit (crisp) value y' of the output (the amount of force/torque adjustment u(t) of joint) from the membership function value of the fuzzy set F'. Use the center of area method (COA) for defuzzification to the fuzzy controller of the robot system when surface shaping machining. This method is easy to apply, involving all output fuzzy sets of the Compositional Rule of Inference. The results of this method are highly accurate (45).
where y' is the actual output value taken in accordance with the abscissa of the domain central point enclosed by membership function constituting (line) with the horizontal axis and S' is the domain defining the fuzzy set F'. Figure 5 shows the principal structure of the fuzzy controller. Applying the fuzzy logic as presented, this paper proposes to set up a fuzzy controller for a robot in a milling process based on the incomplete dynamic model, which means ignorance of the cutting force determination. The control block of the robot controller has a double structure consisting of an outer loop that is a fuzzy control block to determine the adjustment value based on the erroneous information of joint positions and velocities; and the inner loop is the inverse dynamics calculation block from the robot dynamic model, in which there is no cutting force component. Figure  6 shows a SIMULINK model representing the fuzzy controller for the robot system. Figure 7 shows a double-loop structure of the control block in the fuzzy controller, enabling the calculation of driving force. Applying the fuzzy logic as presented, this paper proposes to set up a fuzzy controller for a robot in a milling process based on the incomplete dynamic model, which means ignorance of the cutting force determination. The control block of the robot controller has a double structure consisting of an outer loop that is a fuzzy control block to determine the adjustment value based on the erroneous information of joint positions and velocities; and the inner loop is the inverse dynamics calculation block from the robot dynamic model, in which there is no cutting force component. Figure 6 shows a SIMULINK model representing the fuzzy controller for the robot system. Figure 7 shows a double-loop structure of the control block in the fuzzy controller, enabling the calculation of driving force.

Simulation Results
In order to verify the quality of the designed controller, this section presents the application of a robot carrying out the down milling process of a mold prototype of a hydraulic pump's central housing, which is made of Ti6Al4V titanium alloy material. The machining trajectory is the path Li, which represents the milling path of the cutter head moving from outside to inside to complete the machining surface ( Figure 8). The cutter is an end mill cutter that has four cutting edges/flutes, with a 20 mm diameter ( Figure 9).

Simulation Results
In order to verify the quality of the designed controller, this section presents the application of a robot carrying out the down milling process of a mold prototype of a hydraulic pump's central housing, which is made of Ti6Al4V titanium alloy material. The machining trajectory is the path Li, which represents the milling path of the cutter head moving from outside to inside to complete the machining surface ( Figure 8). The cutter is an end mill cutter that has four cutting edges/flutes, with a 20 mm diameter ( Figure 9).

Simulation Results
In order to verify the quality of the designed controller, this section presents the application of a robot carrying out the down milling process of a mold prototype of a hydraulic pump's central housing, which is made of Ti6Al4V titanium alloy material. The machining trajectory is the path L i , which represents the milling path of the cutter head moving from outside to inside to complete the machining surface ( Figure 8). The cutter is an end mill cutter that has four cutting edges/flutes, with a 20 mm diameter (Figure 9).

Simulation Results
In order to verify the quality of the designed controller, this section presents the application of a robot carrying out the down milling process of a mold prototype of a hydraulic pump's central housing, which is made of Ti6Al4V titanium alloy material. The machining trajectory is the path Li, which represents the milling path of the cutter head moving from outside to inside to complete the machining surface ( Figure 8). The cutter is an end mill cutter that has four cutting edges/flutes, with a 20 mm diameter ( Figure 9).

Simulation Results
In order to verify the quality of the designed controller, this section presents the application of a robot carrying out the down milling process of a mold prototype of a hydraulic pump's central housing, which is made of Ti6Al4V titanium alloy material. The machining trajectory is the path Li, which represents the milling path of the cutter head moving from outside to inside to complete the machining surface ( Figure 8). The cutter is an end mill cutter that has four cutting edges/flutes, with a 20 mm diameter ( Figure 9).  The parameters of geometric, kinematic and dynamic of the robot, platform and workpiece are determined and created as the input parameter file.
The cutter parameters and the milling process parameters are shown in Table 4, where Z is the number of cutting edges (flutes) of the cutter, v c is cutting speed, v r is the relative velocity between the tool and the workpiece, S z is the feed rate on a cutting edge, B is milling width (B = 2.2 mm) and h is milling depth (h = 15 mm). Assume that with the two methods of calculation and selections, the cutting force coefficients in (25) are shown in Table 5 and the results of cutting force calculation according to the empirical formula are shown in Figure 10. In particular, Figure 10 (a)÷(d), respectively, represent cutting forces in the x, y, z directions and the torque in z direction of the tool frame. The small torque components in x and y directions should be ignored. Table 5. Cutting force coefficients in milling.  The parameters of geometric, kinematic and dynamic of the robot, platform and workpiece are determined and created as the input parameter file.

Case K tc (N/mm 2 ) K rc (N/mm 2 ) K ac (N/mm 2 ) K te (N/mm) K re (N/mm) K ae (N/mm)
The cutter parameters and the milling process parameters are shown in Table 4, where Z is the number of cutting edges (flutes) of the cutter, vc is cutting speed, vr is the relative velocity between the tool and the workpiece, Sz is the feed rate on a cutting edge, B is milling width (B = 2.2 mm) and h is milling depth (h = 15 mm). Table 4. The cutter parameters and the milling process parameters.

Cutter's Material D1 (mm) D2 (mm) L1 (mm) L2 (mm) Z (tooth) vc (m/min) vr (mm/s) Sz (mm/tooth) h0 (mm) Cooling Liquor
Carbide 20  Assume that with the two methods of calculation and selections, the cutting force coefficients in (25) are shown in Table 5 and the results of cutting force calculation according to the empirical formula are shown in Figure 10. In particular, Figure 10 (a)(d), respectively, represent cutting forces in the x, y, z directions and the torque in z direction of the tool frame. The small torque components in x and y directions should be ignored. Table 5. Cutting force coefficients in milling.

Simulation of Inverse Dynamics + PD controller
The Inverse Dynamics + PD controller is designed as shown in Section 4. Here, the coefficient matrices of proportional gain KP and derivative KV are selected in accordance with (46) and (47).

Simulation of Inverse Dynamics + PD Controller
The Inverse Dynamics + PD controller is designed as shown in Section 4. Here, the coefficient matrices of proportional gain K P and derivative K V are selected in accordance with (46) and (47). K P = diag{22500, 22500, 22500, 22500, 16900, 16900, 16900, 16900} (46) K V = diag{300, 300, 300, 300, 260, 260, 260, 260} In order to illustrate this, suppose that in the output block (robot block) of the Inverse Dynamics + PD controller in Figure 3, the cutting forces are precisely determined in accordance with the cutting force coefficients in case 1 of Table 5. The simulations are carried out for two cases where the cutting force in the input control block is calculated according to the corresponding coefficients in the two cases of Table 5, respectively. For more convenience, the simulation results that correspond to the above two cases are called PD1 and PD2.
The simulation results are shown in Figure 11. In particular, Figure 11a represents the position error of first joint in comparison with the desired trajectory. Similarly, Figure 11b-h represent the position errors of the second, third,..., eighth joints respectively. The graphs that represent the errors of joint positions show the different errors corresponding to each joint. The errors of the joints that are near the end effector are greater than that of the far ones. Summarizing the joint position errors, we get the errors of the operational point of the cutting point of the tool with respect to the toolpath. Figure 12 shows the error of trajectory of the cutting point of the tool in comparison with the set trajectory as the toolpath. We realize that the trajectory error of PD1 is smaller than that of PD2 because PD1 is corresponding to the assumption of calculating cutting forces precisely.   Thus, with the analysis and the choice of different cutting force coefficients, the control results will be different and affect the machining precision of the robot significantly.

Simulation of the Fuzzy Controller
Depending on the given data of the kinematic, dynamic, etc., parameters, the physical value domain of input and output terms of the fuzzy controller are estimated as shown in Table 6.  Thus, with the analysis and the choice of different cutting force coefficients, the control results will be different and affect the machining precision of the robot significantly.

Simulation of the Fuzzy Controller
Depending on the given data of the kinematic, dynamic, etc., parameters, the physical value domain of input and output terms of the fuzzy controller are estimated as shown in Table 6.  Figure 13 is the graph representing the comparison of joint position errors of the robot between the fuzzy controller and the two cases of the Inverse Dynamics + PD controller.
will be different and affect the machining precision of the robot significantly.

Simulation of the Fuzzy Controller
Depending on the given data of the kinematic, dynamic, etc., parameters, the physical value domain of input and output terms of the fuzzy controller are estimated as shown in Table 6.  Figure 13 is the graph representing the comparison of joint position errors of the robot between the fuzzy controller and the two cases of the Inverse Dynamics + PD controller. Figure 14 shows    One can see that the joint position errors of the fuzzy controller are smaller than that of the PD1 and PD2 controllers.  One can see that the joint position errors of the fuzzy controller are smaller than that of the PD1 and PD2 controllers. Figure 15a shows the trajectory of the cutting point of the tool in the operational frame. Due to small errors, the desired and actual trajectories of the fuzzy controller and Inverse Dynamics + PD controller are approximately coinciding. To verify the adjustment capability of the fuzzy controller, the simulation of the fuzzy controller is performed by the initial value of the trajectory as a deviation of the desired values. Figure 15(b) shows the asymptotical and convergent process of the trajectory of the cutting point from the initial deviation to coincide with the toolpath (desired trajectory) in the milling process. Figure 16 shows the simulation result of the fuzzy controller with initial trajectory error, time history of the joint positions, with the splines that represent the desired, actual trajectories and errors.
From the results, it can be seen that the fuzzy controller is able to control the system to the required state when there are perturbations. To verify the adjustment capability of the fuzzy controller, the simulation of the fuzzy controller is performed by the initial value of the trajectory as a deviation of the desired values. Figure 15b shows the asymptotical and convergent process of the trajectory of the cutting point from the initial deviation to coincide with the toolpath (desired trajectory) in the milling process. Figure 16 shows the simulation result of the fuzzy controller with initial trajectory error, time history of the joint positions, with the splines that represent the desired, actual trajectories and errors.
From the results, it can be seen that the fuzzy controller is able to control the system to the required state when there are perturbations.
In general, the simulated results show that with the assumption of ideal computed cutting forces, the Inverse Dynamics + PD explicit controller and fuzzy controller give accurate control results. Figure 15(b) shows the asymptotical and convergent process of the trajectory of the cutting point from the initial deviation to coincide with the toolpath (desired trajectory) in the milling process. Figure 16 shows the simulation result of the fuzzy controller with initial trajectory error, time history of the joint positions, with the splines that represent the desired, actual trajectories and errors.
From the results, it can be seen that the fuzzy controller is able to control the system to the required state when there are perturbations.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 21 of 32 Figure 16. The simulation result of the fuzzy controller with initial trajectory error.
In general, the simulated results show that with the assumption of ideal computed cutting forces, the Inverse Dynamics + PD explicit controller and fuzzy controller give accurate control results.

Stability Analysis
As mentioned, the designed fuzzy controller is a Mamdani type fuzzy controller, in which the development of fuzzy rule is based on the rules of the PD controller. In general, such a controller has good stability except perturbations.
The input signals of the controller include the joint position errors e(t) and the joint velocity errors e(t) , and the output signal of the controller is the adjustment amounts of the joint driving forces/torques u(t) at each machining instant. A good fuzzy control rule system including the abovementioned rules will ensure that the calculation of the output value is consistent with the change of input signal and there is less possibility of overshoot. The numerical simulation results show this fact.

Stability Analysis
As mentioned, the designed fuzzy controller is a Mamdani type fuzzy controller, in which the development of fuzzy rule is based on the rules of the PD controller. In general, such a controller has good stability except perturbations.
The input signals of the controller include the joint position errors e(t) and the joint velocity errors . e(t), and the output signal of the controller is the adjustment amounts of the joint driving forces/torques u(t) at each machining instant. A good fuzzy control rule system including the above-mentioned rules will ensure that the calculation of the output value is consistent with the change of input signal and there is less possibility of overshoot. The numerical simulation results show this fact. On the other hand, the input signal that can greatly change the output quantity is the physical value domain of driving force. Numerical experiments show that when the physical value domain of the driving force is selected at a smaller level than the value to be reached, the control simulation results are not good, with large errors, which are understandable. When the domain of physical values is expanded, the errors decrease, and when the physical value domain is large enough to cover all the necessary values of the driving force, the control accuracy will be good, as shown by the simulation results. The next question will be whether increasing the input signal by expanding the domain of physical values without control, i.e., when the value domain is selected as too large, the value of the output driving force may greatly increase? The fuzzy Inference and Defuzzification show that the output physical value of a variable depends on the input physical value domain and the membership function value of such variable. As the physical value domain increases, the output value increases but non-linearly. Numerical experiments in the direction of gradually expanding the domain of input physical values so that the physical value of the output u(t) increases gradually to the appropriate value, we realize: The error of e(t), . e(t) reduction; the membership value of linguistic variables corresponding to the large value of the output u(t) decreases; membership values of linguistic variables with small values increase. In the fuzzy set [NB, NS, Z, PS, PB], the membership value of u(t) corresponding to Z is fast progressing to 1, other values decrease and even the NB, PB values almost go to 0 in the first steps. Based on this and based on the fuzzy inference formula, it is easy to see that the growth rate of the physical value of the output u(t) decreases and the slope of the graph decreases. The slope of the graph gradually reaches 0, the graph is horizontal, then u(t) does not increase. Above that limit, if the physical value domain of the input u(t) continues to rise too high, the physical output value u(t) does not continue to increase, but the controller error will increase again. Figure 17 shows the membership function values corresponding to [NB, NS, Z, PS, PB] of the fuzzy set u(t), with the physical value domain of u(t) selected as in Table 6. The membership function value corresponding to NB, PB is almost zero, with Z close to 1. The membership function values corresponding to NS and PS of the physical value u(t) are opposite the sign and adjust the physical output value u(t).   Table 6.
An increase of the physical value domain of u(t) by 3 times obtains the results shown in Figure  18. Membership function values corresponding to NS, PS are about 3 times smaller than the values shown in Figure 17.  Table 6.
An increase of the physical value domain of u(t) by 3 times obtains the results shown in Figure 18.
Membership function values corresponding to NS, PS are about 3 times smaller than the values shown in Figure 17.  Table 6.
An increase of the physical value domain of u(t) by 3 times obtains the results shown in Figure  18. Membership function values corresponding to NS, PS are about 3 times smaller than the values shown in Figure 17.  Table 6.
Therefore, thanks to the integration of expert knowledge, the fuzzy rules are chosen, then there will be a reasonable upper bound value for the physical value domain of control output signal. At that time, it is possible to arbitrarily select the input physical value domain to get good control results without fear of instability because there is no excessive increase of driving force. Numerical experiments are carried out when control accuracy is almost the best. In this case, when expanding the physical value domain of the driving force by 5 times, the result shows that there are some early points of the control process, when the system is in the start-up phase, that the driving force increases by about (35%45%). However, with the entire control process on the operating trajectory, the driving force has no significant change and control accuracy is guaranteed. Thus, with the experiment mentioned above, it is feasible to select a value domain smaller than the upper bound limit.
In addition, through the mentioned numerical simulation results, the controller can return the system to trajectory when there are errors by disturbance.
Compare the fuzzy controller (FZ) with a fuzzy controller integrated with PID (FZ + PID) shown in Figures 19 and 20.  Table 6.
Therefore, thanks to the integration of expert knowledge, the fuzzy rules are chosen, then there will be a reasonable upper bound value for the physical value domain of control output signal. At that time, it is possible to arbitrarily select the input physical value domain to get good control results without fear of instability because there is no excessive increase of driving force. Numerical experiments are carried out when control accuracy is almost the best. In this case, when expanding the physical value domain of the driving force by 5 times, the result shows that there are some early points of the control process, when the system is in the start-up phase, that the driving force increases by about (35%÷45%). However, with the entire control process on the operating trajectory, the driving force has no significant change and control accuracy is guaranteed. Thus, with the experiment mentioned above, it is feasible to select a value domain smaller than the upper bound limit.
In addition, through the mentioned numerical simulation results, the controller can return the system to trajectory when there are errors by disturbance.
Compare the fuzzy controller (FZ) with a fuzzy controller integrated with PID (FZ + PID) shown in Figures 19 and 20.  The result shows that the accuracies of Fuzzy and Fuzzy + PID controllers are almost the same. On the other hand, with noise increasing the external load (cutting force) within 50%, the accuracy is still guaranteed and the errors are negligible. Figures 19 and 20 also show the simulation results of the Inverse Dynamics + PD controller (no perturbation, Figure 19), and Inverse Dynamics + PID (with perturbation, Figure 20). The adjustment capability of the Inverse Dynamics + PID controller is found to be slower.
Thus, among many methods of ensuring the stability and accuracy of the fuzzy controller, it is possible to say: -the fuzzy controller has an integrated PID control unit, -the fuzzy controller without integrated PID unit can still be stable and ensure the accuracy, by choosing a good fuzzy rule and physical value domain of appropriate input and output variables.  The result shows that the accuracies of Fuzzy and Fuzzy + PID controllers are almost the same. On the other hand, with noise increasing the external load (cutting force) within 50%, the accuracy is still guaranteed and the errors are negligible. Figures 19 and 20 also show the simulation results of the Inverse Dynamics + PD controller (no perturbation, Figure 19), and Inverse Dynamics + PID (with perturbation, Figure 20). The adjustment capability of the Inverse Dynamics + PID controller is found to be slower.
Thus, among many methods of ensuring the stability and accuracy of the fuzzy controller, it is possible to say: -the fuzzy controller has an integrated PID control unit, -the fuzzy controller without integrated PID unit can still be stable and ensure the accuracy, by choosing a good fuzzy rule and physical value domain of appropriate input and output variables.

Conclusions
The results show that the controller based on fuzzy logic can meet the requirements of accuracy and reliability. Furthermore, by neglecting the calculations of the cutting forces, it is more convenient to deal with only linear algebraic calculations in fuzzy control rules, which in turn help to greatly reduce the time and computation load and increase the efficiency of the robot control system.
From the simulation results, the fuzzy controller may be even more accurate than the explicit controller, although this is only relative because the presented controllers have not been optimized. The parameters of the above controllers have been selected "quite randomly" in simulation cases.
Theoretically, the explicit controller is accurate when the dynamic model is accurate and contains no perturbations. However, in practice, it is difficult to determine precisely all the system parameters. This leads to errors in the calculation of the control signals.
Meanwhile, the fuzzy controller computes the control law based on the input and output signal errors and the fuzzy rule. Thus, the calculation results can be flexibly adjusted based on the input and output signal errors. This explains the possibility that the fuzzy controller may be more accurate than the explicit controller. In addition, the last simulation result with initial deviation of the trajectory shows that the fuzzy controller is able to control the system to the required state when there are perturbations.
The method of developing fuzzy rules and determining the physical value domain implemented in the article gives good simulation results of the fuzzy controller, which can be applied for designing the fuzzy controller for milling robots.
Difficulties in cutting force calculation and accurately determining the dynamic quantities for complex structural robot systems are always a challenge. Besides, one cannot compensate for all the perturbations such as noise and vibrations occurring due to interactions when the robot is machining or from the environment. Therefore, it is not possible to design an ideal explicit controller. Finding methods to eliminate the aforementioned factors when applying robots in machining is indispensable and compulsory. The controller based on fuzzy logic has been validated to be feasible and reliable via simulation results. It can be developed in practise to overcome the aforementioned uncertainty. Funding: This research received no external funding.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. Summary Fuzzy Logic
Unlike the crisp control that works based on a crisp logic, i.e., binary logic, the fuzzy controller works based on fuzzy logic, implementing many-valued or infinite-valued logic. The basis of crisp logic is that the crisp set has rigid boundaries while the fuzzy logic depends on fuzzy set with soft boundaries. The fuzzy set enables us to represent the real world easily and closely to human thinking. Crisp logic and fuzzy logic are mathematical languages, crisp sets and fuzzy sets include objects, elements, etc., and they are the basis for the mathematical operations. In the theories of fuzzy set, fuzzy logic develops a pretty large mathematical basis for performing mathematical operations on fuzzy sets. Accordingly, firstly, the fuzzy set elements are assigned a linguistic variable in which the linguistic values represented by the element's membership function on the fuzzy set. Based on the universe of discourse, by quantitative or qualitative inferences, the linguistic value of a linguistic variable is determined. In fuzzy control, this process is called fuzzification process. In order for fuzzy inference to be performed with linguistic variables on fuzzy sets, the tools are developed. Firstly, characteristic parameters of fuzzy set; membership function to determine membership grade of a variable of an element in a fuzzy set. The Inferences: fuzzy relations; fuzzy rule base; Compositional Rule of Inferences . . . In fuzzy control, these tools are used to perform two main functions: implication and composition of fuzzy rules to come to desired results. This process plays an important role in the fuzzy controller (Appendix B and Figure A1). The physical system only receives and performs commands by physical values, therefore, defuzzification is the process of converting linguistic values into physical (crisp) values based on fuzzy inferences. Accordingly, the fuzzy controller operates in a process with three above-mentioned modules (Appendix B).
Fuzzy logic is a language, a mathematical language, like any other language we know. The elements on which fuzzy logic depend is called fuzzy set and it is also alternatively called the fuzzy algebra. Fuzzy logic is essentially a mixture of various mathematical languages to define another new language as fuzzy logic. Let X be a non-empty set (called the universal set or the universe of discourse or simply domain), which is a set that has all possible members of a particular domain.
A Fuzzy Set F is determined in universal set X in which each element is an ordered pair (x, µF(x)), where: µF: X → [0, 1]. Logical mapping µF is considered as membership function of fuzzy set F.
Characteristic parameters of fuzzy set: The support (defined domain) of fuzzy set F (defined on the set X) is the crisp subset and defined as The core (trusted domain) of a fuzzy set F (defined on the set X) is the crisp subset and defined as The height (h) of fuzzy set F (defined on the set X) is the maximum membership function value attained by any point: An α-cut of a fuzzy set F (defined on the set X) is a crisp set which its each membership function value in F are greater than or equal to α.
A strong α-cut of a fuzzy set F (defined on the set X) is a crisp set which its each membership function value in F are strictly greater than α.
It is easy to see that: The crossover point of a fuzzy set F (defined on the set X) is a point x in X such that Typical Membership Function: There are many methods of establishing membership functions to determine the membership grade of an x element on a fuzzy set F, such as: triangular membership function, trapezoidal form, Gaussian form, Sign form, Sigmoidial form, Campanulate form. In fuzzy logic control, the triangular and trapezoidal membership functions are often used.
Operations on fuzzy sets: There are many operations on fuzzy sets, but in this paper we introduce three basic operations: unions, intersection of two fuzzy sets and fuzzy complementation. Consider two fuzzy sets A, B on the universe of discourse X. For a given element x of the X, these operations are introduced. Based on the definition of fuzzy union and intersection, there are many formulas that can be applied to calculate the membership function of the union or intersection of two fuzzy sets, such as the formula based on maximum rule, Lukasiewicz rule, direct sum formula, etc. Here, the formulas based on maximum and minimum rules are introduced: Unions (max rule): Intersection (min rule): Linguistic variable: A linguistic variable is a variable that represents a physical quantity by words or sentences in natural or artificial language. A linguistic value is a natural language term which is derived using quantitative or qualitative reasoning. A fuzzy linguistic variable x will take values that are linguistic values. Thus, a variable can both be represented by physical values and linguistic values. For example, velocity variables can be represented by two value domains. The physical value domain: The linguistic value domain: Here, the universal set is the velocity set V, the fuzzy set L V is defined on set V. With a physical value x ∈ V, the membership function can be determined, corresponding to subsets of L V, and represented by vector µ as follow: x → µ = [µ VL (x), µ L (x), µ M (x), µ F (x), µ VF (x)] T (A13) The above mapping is called the fuzzification process, in which the physical value of a variable is transformed into linguistic value.
A relation R between fuzzy sets A and B denotes composition of A and B R = (x, y), µ R (x, y) : µ R (x, y) = min(µ A (x), µ B (y)) or µ R (x, y) = µ A (x)•µ B (y) Composition of fuzzy relations R and S: Let R, S, T be fuzzy relations on the Cartesian spaces X × Y, Y × Z, and X × Z, respectively, x ∈ X, y ∈ Y, z ∈ Z.
Union: µ R∪S (x, y) = max µ R (x, y), µ S (x, y) = µ R (x, y) ∨ µ S (x, y) (A16) Intersection: µ R∩S (x, y) = mix µ R (x, y), µ S (x, y) = µ R (x, y) ∧ µ S (x, y) (A17) Max-Min composition: T = R • S = (x, y), max y min(µ R (x, y), µ S (y, z)) : x ∈ x, y ∈ y, z ∈ z (A19) Max-Product composition: T = R • S = (x, y), max y (µ R (x, y)•µ S (y, z)) : x ∈ x, y ∈ y, z ∈ z (A20) Max-Average composition: T = R • S = (x, y), max y (µ R (x, y) + µ S (y, z)) : x ∈ x, y ∈ y, z ∈ z (A21) Fuzzy rules and implications: The fuzzy implication (also known as fuzzy rule, fuzzy If-Then rule, or fuzzy conditional statement) is defined in form: "If x is A then y is B", where A and B are two linguistic variables defined by fuzzy sets A and B on the universal sets X and Y, respectively. There are two well-known fuzzy implication rules, widely used in fuzzy system and fuzzy control: Min operation rule (Mamdani implication rule): The fuzzy membership function of fuzzy implication µ A→B (x, y) = min µ A (x), µ B (y) = µ A (x) ∧ µ B (y) Product operation rule (Larsen): Fuzzy compositional rules: In this paper, the method Mamdani is introduced. The method Mamdani uses a minimum operator as a fuzzy implication operator, and max-min operator for the composition. Suppose fuzzy rule is Single-Input/Single-Output (SISO) Rule Base as R: if x is A then z is C, infer result C for another rule if x is A then z is C , where A, C, A are known. When input data is a singleton such as A = x 0 , When input data is fuzzy set A , C = A • R; µ C (x) = max min(α, µ C (z)) = max(α ∧ µ C (z)); where α = min(µ A (x), µ A (x)) (A25) The α is called the "matching degree", "satisfaction degree", or "firing strength". Multi-Input/Single-Output (MISO) Rule Base: R i : if x is A i and y is B i then z is C i , i = 1, 2, . . . , n. Where A i , B i , C i , i = 1, 2, . . . , n and A , B are known, the output C is obtained as follow: When input data are singletons such as x = x 0 and y = y 0 , When input data are fuzzy sets, A and B , Defuzzification: In practical applications, the control commands work by crisp value. Therefore it is necessary to defuzzify the result of the fuzzy inference. Defuzzification is the process where the mapping is done to convert the fuzzy results into crisp values. There are many methods for defuzzification technique. This paper introduces two well-known and widely used methods in fuzzy system and fuzzy control.
where, the first formula for the case y is continuous; S is the Support (defined domain) of fuzzy set C ; n is the number of quantization levels of the output; C is a fuzzy set defined on the output dimension (y). Mean of maximum method (MOM): where, yj is the control action whose membership functions reach the maximum; k is the number of such control actions.

Appendix B. Fuzzy Logic Controller
In general, a fuzzy controller has three main components ( Figure A1): 1.
The interface consists of a fuzzification module and some additional ones for solving problems such as generating trajectories of motion, differentiation, integration . . . Fuzzification is the method of translating a crisp quantity into a fuzzy quantity.

2.
The compositional device consists of two main modules that are fuzzy rules and the inference mechanism. Two approaches for construction of fuzzy logic control are Mamdani and Takagi-Sugeno's approaches. This paper uses the Mamdani approach in developing fuzzy rules as well as fuzzy inference. In order to develop fuzzy rule systems, the essential nature and key characteristics of the object being controlled are analyzed based on expert knowledge and experience. The effectiveness of these based on the fuzzy approach are the most important factors, i.e., deciding whether fuzzy rules are good or not, to ensure good quality control.

3.
Defuzzification is the operation process that inverses the process of fuzzification, where the fuzzy results are converted into crisp values for the controller to perform physical operations.
such control actions.

Appendix B. Fuzzy Logic Controller
In general, a fuzzy controller has three main components ( Figure B1): 1. The interface consists of a fuzzification module and some additional ones for solving problems such as generating trajectories of motion, differentiation, integration… Fuzzification is the method of translating a crisp quantity into a fuzzy quantity. 2. The compositional device consists of two main modules that are fuzzy rules and the inference mechanism. Two approaches for construction of fuzzy logic control are Mamdani and Takagi-Sugeno's approaches. This paper uses the Mamdani approach in developing fuzzy rules as well as fuzzy inference. In order to develop fuzzy rule systems, the essential nature and key characteristics of the object being controlled are analyzed based on expert knowledge and experience. The effectiveness of these based on the fuzzy approach are the most important factors, i.e., deciding whether fuzzy rules are good or not, to ensure good quality control. 3. Defuzzification is the operation process that inverses the process of fuzzification, where the fuzzy results are converted into crisp values for the controller to perform physical operations. Figure B1. A general fuzzy controller. Figure A1. A general fuzzy controller.