# Application of Fuzzy PID Position Control Algorithm in Motion Control System Design of Palletizing Robot

Authors: Junjie Xu; Long Xiao; Muquan Lin; Xiaojing Tan
Journal: Security and Communication Networks
 (2022)

---

## Abstract

In view of the low efficiency in traditional palletizing robot problem of poor control precision, this paper introduces fuzzy PID position control algorithm, based on the actual operation situation of palletizing robot; determined as palletizing robot FPGA hardware platform, hardware platform based on this fuzzy PID position control algorithm is applied to implement palletizing robot motion control system design. The simulation model of fuzzy PID motion control was established by MATLAB software for testing to determine that the fuzzy PID position control algorithm reflects the time quickly in the motion control of palletizing robot, and the actual overshooting is small, which is more suitable for the motion control algorithm of palletizing robot. Under this condition, the modular method is adopted to complete the system application design on the FPGA hardware platform.


---

## Body

## 1. Introduction

Palletizing robots are important mechanized equipment in industrial automation production. With the continuous development of industrialization, the level of technical requirements for palletizing robots in industrial construction and production work is also increasing. The motion control system is the core component of the palletizing robot, and the system has a direct relationship with the efficiency of the palletizing robot [1]. The main application systems used today are PLC control systems, PC control systems, and microprocessor control systems [2–4]. The actual performance of the three types of systems in palletizing robots is shown in Table 1.Table 1
Comparison of advantages and disadvantages of three types of control systems.
System typeStrengthsDisadvantageousPLC control systemObvious I/O functions; simple programming; stable system for easy maintenanceInsufficient system real-time; poor compatibility; insufficient system control accuracyPC control systemAbundant programming methods; better real-time; high system compatibilityHigh level of system programming requires specialized technical staff; long system build cycle; high costMicroprocessor control systemMany types of functions; lower cost of construction; easy replacement of subsequent systems, easy to develop; lower power consumption of the system is compatible with high scalabilityHigh level of system specialization, requiring specialized technical staffThe effective control of various system motion modules is achieved in the PLC control system through core data processing and logic calls. As per literature [5], based on PLC control system design and development of an automated spraying mechanized equipment, PLC automatic spraying robot can automatically identify the object to be sprayed; to achieve automatic movement and workpiece spraying, the system effectively improves the efficiency of mechanical spraying work. And the application of PLC control technology spraying robot has rich functions and low cost, so it is more practical. The literature [6] designed and developed a fully automatic palletizing motion system based on PLC control technology. The system in the application can determine the size and type of goods through an automatic identification system to complete the automatic handling work. The literature [7] designed a palletizing robot system control system that can be programmed according to the actual task requirements. Through the system, human-machine interface can be designed for various types of palletizing tasks, and the system is easy to maintain and has high operational efficiency.The PC control system mainly completes the algorithm calculation and robot motion path planning through the industrial control computer. The literature [8] designed a PC palletizing robot motion control system, which combines the STM32F4 motion control system while using PC control, and the two together constitute the motion control system of the palletizing robot, and the PC control system can realize the accurate positioning of the motion trajectory in use, and the actual effect is more obvious. The literature [9] jointly used PC and CPAC controllers in the design of palletizing machine system, which can realize intelligent positioning, and the use of intelligent vision assist system can effectively improve the positioning level of the robot, and the mechanical loading efficiency is significantly improved.With the rapid development of Internet information technology, microprocessor technology is used in modern industrial daily work. At present, the more common microprocessors in industrial automation production work are FPGA, DSP, and ARM, etc. Microprocessors have made rapid progress in motion control systems in industrial production by virtue of their powerful chip processing capabilities. The literature [10] built a palletizing robot motion control system based on ARM and Linux systems. The literature [11] designed a palletizing robot motion control system with ARM microprocessor as the core, which can achieve high precision computing in operation, high efficiency of system motion control, and good stability performance.Based on the above three control system contents, combined with the control requirements of palletizing robots in industrial production, this paper applies the fuzzy PID position control algorithm to design the palletizing robot motion control system on the basis of the FPGA hardware platform, and the application of this system palletizing robots in complex space environment can realize automatic attitude position control.


## 2. Fuzzy PID Position Controller Design Flow

### 2.1. Comparison between Fuzzy PID Control and Traditional PID Control

The functions of each correction link of PID controller are as follows:(a)
Proportional link. That is, it reflects the deviation signal of the system in proportion. Once the deviation occurs, the controller will immediately produce a control effect to reduce the deviation. The larger the proportional coefficient is, the faster the adjustment speed is.(b)
Integration link. It can eliminate the system's steady-state error. The strength of its effect depends on the integration constant. The greater the integration constant, the weaker the integration effect, and vice versa. It is easy to bring negative problems such as reduced system stability and intensified oscillation.(c)
The differential link reflects the change trend of the deviation signal and can introduce an effective early correction signal into the system before the deviation signal value increases so as to speed up the action speed of the system and reduce the adjustment time.Obviously, the conventional PID can not carry out online self-tuning parameters according to the field conditions, so the conventional PID control does not have self adaptability and has limited effect in practical application.


### 2.2. Design Principles

The fuzzy PID position controller is an effective combination of traditional PID control and fuzzy control. The controller will operate according to the actual operating state differences, the system error and error rate of change provided by the two-dimensional fuzzy control toec perform calculations, and finally determine the proportional (ΔKp), integral (ΔKi), and differential increments (ΔKd) of PID control. Based on the three system incremental values, the controller adjusts the control object and the control motion in real-time [12]. The overall structural framework of the fuzzy PID control system is shown in Figure 1.Figure 1
Fuzzy PID control system structure framework.


### 2.3. Input and Output Structure

The inputs to the fuzzy PID are the rate of change of the error provided by the 2D controller and the error [13]. After extrapolation to determine the output quantity ΔKp, ΔKi with ΔKd , the output quantity is finalized after the fuzzy rule is projected to determine the control, and the control parameter correction value of the system control parameter correction value is Kp,Ki,Kd. The calculation of the control parameters for the implementation of the fuzzy PID controller system is shown below:(1)Kp=Kp′+ΔKpKi=Ki′+ΔKiKd=Kd′+ΔKd.The initial value of the system for the control parameterKp,Ki,Kd in the above equation is Kp′,Ki′,Kd′, which is determined by the PID parameter adjustment method.


### 2.4. Fuzzification

Since the input error and the rate of change of the error are exact quantities that cannot be used directly, they need to be fuzzed by the following equation:(2)N=nout∗ninnlevel−1+1,N=nout∗nlevelnin.After completing the fuzzification of the input exact quantities, the determined fuzzy subsets need to be quantified in rank. Usually, when the sum of the number of elements in the thesis domain is three times the sum of the fuzzy subsets obtained after processing, it indicates that the determined fuzzy subsets have high coverage and are more effective [14]. In the present design of fuzzy PID position controller, the theoretical domain of the input quantities e and ec is determined as −30,30 , and its fuzzy domain is determined as follows:(3)−3,−2,−1,0,1,2,3.Their corresponding fuzzy subsets are denoted as a negative large, negative medium, negative small, zero, positive small, positive medium, and positive large. These are denoted as follows:(4)NB,NM,NS,ZO,PS,PM,PB.The negative large and positive large affiliation functions in the fuzzy subset are set to zmf-shaped and smf-shaped functions, respectively, and all the rest are set to trigonometric functions [15]. The resulting affiliation functions for the errors in the fuzzy input quantities and the rate of change of the errors are determined as shown in Figure 2.Figure 2
Fuzzy affiliation function of input quantity error and error rate of change.Set the output quantity system control parameter correction valueKp,Ki,Kd for the theoretical domain of −30,30, where KpKd the fuzzy theoretical domain with is −3,−2,−1,0,1,2,3 , the same will be the negative large and positive large affiliation function which are set to zmf-shaped and smf-shaped functions, others are set to triangle function; determine Ki and Kp with the Kd fuzzy affiliation degree function of the ri as shown in Figures 3 and 4.Figure 3
Ki of the fuzzy affiliation function.Figure 4
Fuzzy affiliation functionKp with Kd.


### 2.5. Controller Fuzzy Control Rules

The control rules of the fuzzy PID controller for palletizing robots adhere to the following three principles.(1)
In order to ensure that the control system has a fast response speed, it should be ensured that theKp value is larger and the value is Kd relatively smaller when the value [16] e is larger.(2)
When the values ofe and ec are kept in a moderate equilibrium range, the value of should be made Kp small to ensure that the system can be quickly corresponding [17]by Kd the value of.(3)
In order to ensure the stability of the control system performancee, the value of Kp and Ki should be taken as high as possible when the value is small, and at the same time, the value of the change Kd should be noted to ensure the stability of the system to prevent the problem of oscillation [18].A fuzzy control rule table was established in the application of the fuzzy PID position control algorithm, and the fuzzy rules for the control parametersKp,Ki,Kd are shown in Table 2.Table 2
Fuzzy PID control parameter rules.
Control parametersRise timeOvershootAdjustment timeChange in errorKpDecreaseEnlargeLess changeDecreaseKiDecreaseDecreaseEnlargeDecreaseKdLess changeDecreaseDecreaseLess change


### 2.6. Center of Gravity Method for Defuzzification

The fuzzy inference output quantity completed under the fuzzy rule condition is still a fuzzy quantity, and the position control system needs to rely on the exact quantity as the control object in the execution operation, so it needs to complete the conversion of the fuzzy quantity into the exact quantity operation by defuzzification to complete the system control. Combined with the palletizing robot control and hardware conditions, this paper chooses to use the center of gravity method to defuzzify, and its formula is as follows:(5)ut=∑i=1nuiAui∑i=1nAui,where Aui is ui an affiliation function in the domain A of the argument.The center of gravity method is applied in defuzzification, the fuzzy implication relations are analyzed by the Mamdani method, and the fuzzy control decision table is obtained by offline calculation.


## 2.1. Comparison between Fuzzy PID Control and Traditional PID Control

The functions of each correction link of PID controller are as follows:(a)
Proportional link. That is, it reflects the deviation signal of the system in proportion. Once the deviation occurs, the controller will immediately produce a control effect to reduce the deviation. The larger the proportional coefficient is, the faster the adjustment speed is.(b)
Integration link. It can eliminate the system's steady-state error. The strength of its effect depends on the integration constant. The greater the integration constant, the weaker the integration effect, and vice versa. It is easy to bring negative problems such as reduced system stability and intensified oscillation.(c)
The differential link reflects the change trend of the deviation signal and can introduce an effective early correction signal into the system before the deviation signal value increases so as to speed up the action speed of the system and reduce the adjustment time.Obviously, the conventional PID can not carry out online self-tuning parameters according to the field conditions, so the conventional PID control does not have self adaptability and has limited effect in practical application.


## 2.2. Design Principles

The fuzzy PID position controller is an effective combination of traditional PID control and fuzzy control. The controller will operate according to the actual operating state differences, the system error and error rate of change provided by the two-dimensional fuzzy control toec perform calculations, and finally determine the proportional (ΔKp), integral (ΔKi), and differential increments (ΔKd) of PID control. Based on the three system incremental values, the controller adjusts the control object and the control motion in real-time [12]. The overall structural framework of the fuzzy PID control system is shown in Figure 1.Figure 1
Fuzzy PID control system structure framework.


## 2.3. Input and Output Structure

The inputs to the fuzzy PID are the rate of change of the error provided by the 2D controller and the error [13]. After extrapolation to determine the output quantity ΔKp, ΔKi with ΔKd , the output quantity is finalized after the fuzzy rule is projected to determine the control, and the control parameter correction value of the system control parameter correction value is Kp,Ki,Kd. The calculation of the control parameters for the implementation of the fuzzy PID controller system is shown below:(1)Kp=Kp′+ΔKpKi=Ki′+ΔKiKd=Kd′+ΔKd.The initial value of the system for the control parameterKp,Ki,Kd in the above equation is Kp′,Ki′,Kd′, which is determined by the PID parameter adjustment method.


## 2.4. Fuzzification

Since the input error and the rate of change of the error are exact quantities that cannot be used directly, they need to be fuzzed by the following equation:(2)N=nout∗ninnlevel−1+1,N=nout∗nlevelnin.After completing the fuzzification of the input exact quantities, the determined fuzzy subsets need to be quantified in rank. Usually, when the sum of the number of elements in the thesis domain is three times the sum of the fuzzy subsets obtained after processing, it indicates that the determined fuzzy subsets have high coverage and are more effective [14]. In the present design of fuzzy PID position controller, the theoretical domain of the input quantities e and ec is determined as −30,30 , and its fuzzy domain is determined as follows:(3)−3,−2,−1,0,1,2,3.Their corresponding fuzzy subsets are denoted as a negative large, negative medium, negative small, zero, positive small, positive medium, and positive large. These are denoted as follows:(4)NB,NM,NS,ZO,PS,PM,PB.The negative large and positive large affiliation functions in the fuzzy subset are set to zmf-shaped and smf-shaped functions, respectively, and all the rest are set to trigonometric functions [15]. The resulting affiliation functions for the errors in the fuzzy input quantities and the rate of change of the errors are determined as shown in Figure 2.Figure 2
Fuzzy affiliation function of input quantity error and error rate of change.Set the output quantity system control parameter correction valueKp,Ki,Kd for the theoretical domain of −30,30, where KpKd the fuzzy theoretical domain with is −3,−2,−1,0,1,2,3 , the same will be the negative large and positive large affiliation function which are set to zmf-shaped and smf-shaped functions, others are set to triangle function; determine Ki and Kp with the Kd fuzzy affiliation degree function of the ri as shown in Figures 3 and 4.Figure 3
Ki of the fuzzy affiliation function.Figure 4
Fuzzy affiliation functionKp with Kd.


## 2.5. Controller Fuzzy Control Rules

The control rules of the fuzzy PID controller for palletizing robots adhere to the following three principles.(1)
In order to ensure that the control system has a fast response speed, it should be ensured that theKp value is larger and the value is Kd relatively smaller when the value [16] e is larger.(2)
When the values ofe and ec are kept in a moderate equilibrium range, the value of should be made Kp small to ensure that the system can be quickly corresponding [17]by Kd the value of.(3)
In order to ensure the stability of the control system performancee, the value of Kp and Ki should be taken as high as possible when the value is small, and at the same time, the value of the change Kd should be noted to ensure the stability of the system to prevent the problem of oscillation [18].A fuzzy control rule table was established in the application of the fuzzy PID position control algorithm, and the fuzzy rules for the control parametersKp,Ki,Kd are shown in Table 2.Table 2
Fuzzy PID control parameter rules.
Control parametersRise timeOvershootAdjustment timeChange in errorKpDecreaseEnlargeLess changeDecreaseKiDecreaseDecreaseEnlargeDecreaseKdLess changeDecreaseDecreaseLess change


## 2.6. Center of Gravity Method for Defuzzification

The fuzzy inference output quantity completed under the fuzzy rule condition is still a fuzzy quantity, and the position control system needs to rely on the exact quantity as the control object in the execution operation, so it needs to complete the conversion of the fuzzy quantity into the exact quantity operation by defuzzification to complete the system control. Combined with the palletizing robot control and hardware conditions, this paper chooses to use the center of gravity method to defuzzify, and its formula is as follows:(5)ut=∑i=1nuiAui∑i=1nAui,where Aui is ui an affiliation function in the domain A of the argument.The center of gravity method is applied in defuzzification, the fuzzy implication relations are analyzed by the Mamdani method, and the fuzzy control decision table is obtained by offline calculation.


## 3. Fuzzy PID Position Control Simulation Analysis

The Simulink function module in MATLAB software is applied to simulate and analyze the fuzzy PID controller. The Simulink simulation model of fuzzy PID for palletizing robots is shown in Figure5.Figure 5
Simulink simulation model of fuzzy PID.The fuzzy PID control is in the form of a package in the system application and its internal structure is composed of the structure shown in Figure6.Figure 6
Internal structure of fuzzy PID controller.In the simulation analysis, sine signal and unit step signal are tested as input signals, respectively. The simulation results for both types of input signals are shown in Figures7 and 8.Figure 7
Unit step signal simulation results.Figure 8
(a) Sine signal simulation results. (b) Partial image of sine simulation results.
(a)(b)From the above figure, it can be seen that the fuzzy PID controller can run stably and the robot running state and response speed are better when the simulation input information number is unit step signal and sinusoidal signal, which meets the requirements of palletizing robot position control system. Through the curve change, it can be seen that the stabilization time of fuzzy PID control is shorter compared with the traditional PID control, which also indicates that it can transition to the stable operation state in a shorter time and the system accuracy level is higher, and the fuzzy PID controller is more effective in the palletizing robot position motion control system.


## 4. Fuzzy PID Motion Controller Component Module Based on FPGA Platform

The design module of fuzzy PID controller on palletizing robot FPGA hardware platform contains error module, fuzzy quantization and address generation module, lookup table generation and output module, and arithmetic module. The following system application of fuzzy PID position motion control algorithm is implemented through modular design.


### 4.1. Error Module

This module provides criticale and ec numerical values for the proper operation of the controller. The input variables in the module contain the deviation of the system at the current moment ek, the rate of change of the deviation, the eck error values for the previous 1 and 2 moments of the system ek−1, and ek−2. The principle of operation of the error module at each moment is shown in Figure 9.Figure 9
Error module schematic.The palletizing robot fuzzy PID controller contains two input variables, and the error module is continuously adjusted according to the actual call of the two variables to meet the requirements of the system position motion control. The macro function is applied in the error module circuit diagram design to complete the structure as shown in Figure10.Figure 10
Error module circuit RTL diagram.Thert7..0 with yt7..0 in the circuit diagram provides the input variables and input values for the controller. The values are determined and fed to the subtractor, and the amount of deviation in them is determined. From Figure 11, it can be seen that the e0, e1 quantity provided in the error module corresponds to ek−1 and ek respectively. And the actual difference between rt and yt is e0, and the actual difference between rt and yt under the previous 1 moment is e1, ec which is obtained as the difference between e0 and e1. The following figure shows the simulation test results of the error module, from which, it is determined that the module meets the design requirements of the fuzzy PID algorithm.Figure 11
Simulation results of meter reading output.


### 4.2. Fuzzy Quantization and Address Generation Module

In this paper, the input quantity theoretical domain has been determined in the design-in session according to the fuzzy PID processing requirements of the palletizing robot as−30,30; in the mode structure combined with the seven-level coding mechanism, the theoretical domain is subdivided into −30,−25, −25,−15, −15−5, −5,5, 5,15, 15,25 and 25,30. The −3,−2,−1,0,1,2,3. After that, the quantization is performed using the Verilog HDL language, and the processed errors and error variations correspond to the elunyu and eclunyu variables, respectively. The theoretical domain values correspond to the binary numbers 0000-0110.The address generation module in the system mainly completes the fuzzy coding and address combination of the input quantities. Based on the output requirements of the three parameters in fuzzy reasoning, the output lookup table addresses need to be produced to ensure that the system storage unit can operate properly. The addresses provided by the address generation module are composed of error and error rate of change as eight-bit addresses. In the eight-bit address code, the error and the rate of change of the error each occupy four bits.The same simulation analysis is performed in the fuzzy quantization and address generation module design. The error in the simulation analysis plot is denoted ase , ec where the error encoding value and the error rate of change after fuzzy quantization are elunyu and eclunyu, respectively. The two values together form the system theory domain (lunyu). The Founder’s analysis shows that the fuzzy PID position motion algorithm will adjust the output content in time according to the change of the input value, where the output value after processing by fuzzification e with and the ec final result of the encoded value in the program. When ec is 0, the coded value eclunyu is 0011, and when e is −5, its coding is 0011; then the argument domain address can be generated as 00110011, which also shows that the module design meets the practical requirements of fuzzy PID control.


### 4.3. Look-Up Table Generation and Output Module

This application of the fuzzy PID motion algorithm in the lookup table generation design is selected to complete the system fuzzy inference to satisfy the fuzzy rules by the offline query. The lookup table generation in this module uses MATLAB software to complete the vector of input values, and the data completed by the inference is imported into the ROM in the FPGA hardware platform. Since the fuzzy PID control contains three parameter values, three ROM storage units in the system need to be called at the same time. According to the fuzzy rules set in advance, the input variables aree with ec; to determine the precise output values of the three parameters, the specific output results are shown in Table 3.Table 3
Results of the output values of the three parameters.
ΔKpec−3−2−10123e−32.41.91.81.30.70.40−21.91.91.40.70.30−0.6−11.81.40.90.3−0.1−0.3−1.101.30.80.30.1−0.3−0.8−1.311.10.30−0.3−0.7−1.4−1.820.6−0.1−0.3−0.8−1.4−1.4−1.930−0.5−0.8−1.7−1.8−1.9−2.4ΔKdec−3−2−10123e−31−0.4−1.5−2.4−1.9−0.41−20.6−0.4−1.5−1.4−1.4−0.34−10.4−0.4−1.4−1.4−1.1−0.6000−0.7−0.7−0.7−0.7−0.6010.60.20000.26210.10.30.70.70.8132.41.81.71.31.11.22.4ΔKiec−3−2−10123e−3−0.5−0.4−0.4−0.3−0.1−0.10−2−0.5−0.3−0.3−0.1−0.100.1−1−0.4−0.3−0.2−0.100.10.10−0.4−0.2−0.100.10.20.31−0.2−0.100.10.20.30.4200−0.10.10.30.30.5300.10.10.30.40.40.5Once the primary information data for the fuzzy rule table has been determined, the following steps need to be followed to complete the information storage.(1)
Store the information generated by the three-parameter lookup tables separately, using the mif. file format. Subsequently, if relevant data is generated, it is entered into the corresponding file in turn.(2)
Use the macro function to save the ROM file of the fuzzy rule table and complete the storage space and clock design procedure at the same time.(3)
Scaling the saved file.The lookup table output of this module also applies the offline query to complete the defuzzification work; combined with the address module, query the data address to complete the lookup table information output. The lookup table output will get a parameter value based on the input address information stored in the lookup table, and the lookup table output module is shown in Figure12.Figure 12
RTL diagram of the lookup table output module.The simulation analysis of the table lookup output module is carried out, and the simulation results of the fuzzy PID table lookup output module are shown in Figure11. In the simulation analysis, the value provided by the address generation module is 0000100 when the three-parameter values are 7, −1, and −19, which are consistent with the values in the system storage unit, indicating that this module meets the requirements of the fuzzy PID controller motion.


## 4.1. Error Module

This module provides criticale and ec numerical values for the proper operation of the controller. The input variables in the module contain the deviation of the system at the current moment ek, the rate of change of the deviation, the eck error values for the previous 1 and 2 moments of the system ek−1, and ek−2. The principle of operation of the error module at each moment is shown in Figure 9.Figure 9
Error module schematic.The palletizing robot fuzzy PID controller contains two input variables, and the error module is continuously adjusted according to the actual call of the two variables to meet the requirements of the system position motion control. The macro function is applied in the error module circuit diagram design to complete the structure as shown in Figure10.Figure 10
Error module circuit RTL diagram.Thert7..0 with yt7..0 in the circuit diagram provides the input variables and input values for the controller. The values are determined and fed to the subtractor, and the amount of deviation in them is determined. From Figure 11, it can be seen that the e0, e1 quantity provided in the error module corresponds to ek−1 and ek respectively. And the actual difference between rt and yt is e0, and the actual difference between rt and yt under the previous 1 moment is e1, ec which is obtained as the difference between e0 and e1. The following figure shows the simulation test results of the error module, from which, it is determined that the module meets the design requirements of the fuzzy PID algorithm.Figure 11
Simulation results of meter reading output.


## 4.2. Fuzzy Quantization and Address Generation Module

In this paper, the input quantity theoretical domain has been determined in the design-in session according to the fuzzy PID processing requirements of the palletizing robot as−30,30; in the mode structure combined with the seven-level coding mechanism, the theoretical domain is subdivided into −30,−25, −25,−15, −15−5, −5,5, 5,15, 15,25 and 25,30. The −3,−2,−1,0,1,2,3. After that, the quantization is performed using the Verilog HDL language, and the processed errors and error variations correspond to the elunyu and eclunyu variables, respectively. The theoretical domain values correspond to the binary numbers 0000-0110.The address generation module in the system mainly completes the fuzzy coding and address combination of the input quantities. Based on the output requirements of the three parameters in fuzzy reasoning, the output lookup table addresses need to be produced to ensure that the system storage unit can operate properly. The addresses provided by the address generation module are composed of error and error rate of change as eight-bit addresses. In the eight-bit address code, the error and the rate of change of the error each occupy four bits.The same simulation analysis is performed in the fuzzy quantization and address generation module design. The error in the simulation analysis plot is denoted ase , ec where the error encoding value and the error rate of change after fuzzy quantization are elunyu and eclunyu, respectively. The two values together form the system theory domain (lunyu). The Founder’s analysis shows that the fuzzy PID position motion algorithm will adjust the output content in time according to the change of the input value, where the output value after processing by fuzzification e with and the ec final result of the encoded value in the program. When ec is 0, the coded value eclunyu is 0011, and when e is −5, its coding is 0011; then the argument domain address can be generated as 00110011, which also shows that the module design meets the practical requirements of fuzzy PID control.


## 4.3. Look-Up Table Generation and Output Module

This application of the fuzzy PID motion algorithm in the lookup table generation design is selected to complete the system fuzzy inference to satisfy the fuzzy rules by the offline query. The lookup table generation in this module uses MATLAB software to complete the vector of input values, and the data completed by the inference is imported into the ROM in the FPGA hardware platform. Since the fuzzy PID control contains three parameter values, three ROM storage units in the system need to be called at the same time. According to the fuzzy rules set in advance, the input variables aree with ec; to determine the precise output values of the three parameters, the specific output results are shown in Table 3.Table 3
Results of the output values of the three parameters.
ΔKpec−3−2−10123e−32.41.91.81.30.70.40−21.91.91.40.70.30−0.6−11.81.40.90.3−0.1−0.3−1.101.30.80.30.1−0.3−0.8−1.311.10.30−0.3−0.7−1.4−1.820.6−0.1−0.3−0.8−1.4−1.4−1.930−0.5−0.8−1.7−1.8−1.9−2.4ΔKdec−3−2−10123e−31−0.4−1.5−2.4−1.9−0.41−20.6−0.4−1.5−1.4−1.4−0.34−10.4−0.4−1.4−1.4−1.1−0.6000−0.7−0.7−0.7−0.7−0.6010.60.20000.26210.10.30.70.70.8132.41.81.71.31.11.22.4ΔKiec−3−2−10123e−3−0.5−0.4−0.4−0.3−0.1−0.10−2−0.5−0.3−0.3−0.1−0.100.1−1−0.4−0.3−0.2−0.100.10.10−0.4−0.2−0.100.10.20.31−0.2−0.100.10.20.30.4200−0.10.10.30.30.5300.10.10.30.40.40.5Once the primary information data for the fuzzy rule table has been determined, the following steps need to be followed to complete the information storage.(1)
Store the information generated by the three-parameter lookup tables separately, using the mif. file format. Subsequently, if relevant data is generated, it is entered into the corresponding file in turn.(2)
Use the macro function to save the ROM file of the fuzzy rule table and complete the storage space and clock design procedure at the same time.(3)
Scaling the saved file.The lookup table output of this module also applies the offline query to complete the defuzzification work; combined with the address module, query the data address to complete the lookup table information output. The lookup table output will get a parameter value based on the input address information stored in the lookup table, and the lookup table output module is shown in Figure12.Figure 12
RTL diagram of the lookup table output module.The simulation analysis of the table lookup output module is carried out, and the simulation results of the fuzzy PID table lookup output module are shown in Figure11. In the simulation analysis, the value provided by the address generation module is 0000100 when the three-parameter values are 7, −1, and −19, which are consistent with the values in the system storage unit, indicating that this module meets the requirements of the fuzzy PID controller motion.


## 5. Palletizing Robot Motion Control System Integrity Testing and Experimental Verification

### 5.1. Fuzzy PID Control Algorithm Module and System Integrity Test

The fuzzy PID control operator module for palletizing robot contains 1 subtractor, 1 adder, and 3 multipliers. The LMP function in the macro function is applied in the design to implement the custom design. The fuzzy PID control arithmetic module uses incremental scheme content in motion control. The input parameters are modularly processed through the three-parameter values providedα0,α1,α2, and the error values of the three parameters are determined, and the values of the parameter product terms can be determined through the multipliers in the arithmetic module and with the use of adder and subtractor operations to derive the final result Δuk. The design in the arithmetic module is done only for the RTL diagram of the fuzzy PID control algorithm, as shown in Figure 13. The input result[15..0] in the graph corresponds to, α0ek,α1ek−1,α2ek−2, respectively. The simulation and analysis results are shown in Figure 14 and the results remain consistent.Figure 13
RTL diagram of fuzzy PID control algorithm.Figure 14
Simulation of the output results of the fuzzy PID operation module.After completing the design of each module in the palletizing robot fuzzy PID controller, the practical application of the fuzzy PID position motion algorithm was tested by holistic simulation, and the results are shown in Figure15. This simulation result was determined to be correct by the test, which shows that the fuzzy PID controller basically achieves the requirements for the working operation of the palletizing robot, and the fuzzy PID algorithm works better in the application of the palletizing robot system.Figure 15
Fuzzy PID holistic simulation test chart.


### 5.2. Control Experiments of the Palletizing Robot Motion Control System

The palletizing robot is shown in Figure16.Figure 16
Degree of freedom palletizing robot.In order to test the practical performance of the fuzzy PID control algorithm in the palletizing robot control system, the motion parameters under the conventional PID control rain fuzzy PID control were collected using the Turbo PMAC Clipper motion control card, and the position step response curves of the palletizing robot for the two PID control motion parameters are shown in Figures17 and 18.Figure 17
Experimental curve of step response under conventional PID control.Figure 18
Experimental curve of step response under fuzzy PID control.Table4 shows the relevant data collected in the palletizing robot control experiment, where the rise time of the position step response is Tr, the overshoot is, the Mp peak time is, the Tp regulation time is, and the Ts maximum following error of the velocity parabolic response is expressed as Mfeer.Table 4
Data related to palletizing robot control experiments.
General PID controlFuzzy PID controlTr/s0.1250.020Mp5.1%1.1%Tp/s0.3120.076Mfeer/cts−1.7783−1.0964From the experimental data of conventional PID control and fuzzy PID control above, it can be seen thatTr, Mp, Tp and Ts indicators of the palletizing robot feed motor under fuzzy PID control are better than those of conventional PID control, and the dynamic state of the system can be judged by combining the Mfeer indicator data in the control experiments. The data related to the control experiments in Table 4 show that the maximum following error of the palletizing robot feed motor under fuzzy PID control is significantly lower than that of the conventional PID control. It can be seen that the dynamic following error of the palletizing robot motor under fuzzy PID control is less volatile, and this result can be combined with the final judgment that the fuzzy PID position control algorithm has an obvious dynamic stability effect in the palletizing robot motion control.


## 5.1. Fuzzy PID Control Algorithm Module and System Integrity Test

The fuzzy PID control operator module for palletizing robot contains 1 subtractor, 1 adder, and 3 multipliers. The LMP function in the macro function is applied in the design to implement the custom design. The fuzzy PID control arithmetic module uses incremental scheme content in motion control. The input parameters are modularly processed through the three-parameter values providedα0,α1,α2, and the error values of the three parameters are determined, and the values of the parameter product terms can be determined through the multipliers in the arithmetic module and with the use of adder and subtractor operations to derive the final result Δuk. The design in the arithmetic module is done only for the RTL diagram of the fuzzy PID control algorithm, as shown in Figure 13. The input result[15..0] in the graph corresponds to, α0ek,α1ek−1,α2ek−2, respectively. The simulation and analysis results are shown in Figure 14 and the results remain consistent.Figure 13
RTL diagram of fuzzy PID control algorithm.Figure 14
Simulation of the output results of the fuzzy PID operation module.After completing the design of each module in the palletizing robot fuzzy PID controller, the practical application of the fuzzy PID position motion algorithm was tested by holistic simulation, and the results are shown in Figure15. This simulation result was determined to be correct by the test, which shows that the fuzzy PID controller basically achieves the requirements for the working operation of the palletizing robot, and the fuzzy PID algorithm works better in the application of the palletizing robot system.Figure 15
Fuzzy PID holistic simulation test chart.


## 5.2. Control Experiments of the Palletizing Robot Motion Control System

The palletizing robot is shown in Figure16.Figure 16
Degree of freedom palletizing robot.In order to test the practical performance of the fuzzy PID control algorithm in the palletizing robot control system, the motion parameters under the conventional PID control rain fuzzy PID control were collected using the Turbo PMAC Clipper motion control card, and the position step response curves of the palletizing robot for the two PID control motion parameters are shown in Figures17 and 18.Figure 17
Experimental curve of step response under conventional PID control.Figure 18
Experimental curve of step response under fuzzy PID control.Table4 shows the relevant data collected in the palletizing robot control experiment, where the rise time of the position step response is Tr, the overshoot is, the Mp peak time is, the Tp regulation time is, and the Ts maximum following error of the velocity parabolic response is expressed as Mfeer.Table 4
Data related to palletizing robot control experiments.
General PID controlFuzzy PID controlTr/s0.1250.020Mp5.1%1.1%Tp/s0.3120.076Mfeer/cts−1.7783−1.0964From the experimental data of conventional PID control and fuzzy PID control above, it can be seen thatTr, Mp, Tp and Ts indicators of the palletizing robot feed motor under fuzzy PID control are better than those of conventional PID control, and the dynamic state of the system can be judged by combining the Mfeer indicator data in the control experiments. The data related to the control experiments in Table 4 show that the maximum following error of the palletizing robot feed motor under fuzzy PID control is significantly lower than that of the conventional PID control. It can be seen that the dynamic following error of the palletizing robot motor under fuzzy PID control is less volatile, and this result can be combined with the final judgment that the fuzzy PID position control algorithm has an obvious dynamic stability effect in the palletizing robot motion control.


## 6. Conclusion

In this study, based on the defects and shortcomings of the traditional motion control mechanical structure, the fuzzy PID motion control algorithm is introduced in the robot motion of the FPGA hardware platform with a palletizing robot as the research object. In the controller design first simulation analysis of the fuzzy PID controller design content through MATLAB software, the results show that the type of design is suitable for palletizing robot control system, and further proposed a modular design of the controller based on FPGA hardware platform, fuzzy PID control in the main modules to design, through the integrity test shows that the design to meet the basic use requirements.



---

*Source: 8720960-2022-03-16.xml*