50 Table 4.5 Statistics table of fuzzy rules leading to output membership function values .... Figure 1.1 2D gantry cranes system used in farm warehouse Trang 18 is easy to operate, eve
MINISTRY OF EDUCATION AND TRAINING HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAINING GRADUATION THESIS AUTOMATION AND CONTROL ENGINEERING CONTROL SIMPLIFIED SYSTEM BASED ON THE 2D GRANTRY CRANE MOTION ADVISOR : NGUYEN VAN DONG HAI, PHD STUDENTS: TRAN QUOC CUONG TRAN THI THANH THUY SKL010849 Ho Chi Minh City, July 2023 MINISTRY OF EDUCATION AND TRAINING HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAINING -o0o GRADUATION PROJECT CONTROL SIMPLIFIED SYSTEM BASED ON THE 2D GRANTRY CRANE MOTION Student name: TRAN QUOC CUONG Student ID : 16151008 Student name: TRAN THI THANH THUY Student ID : 18151130 Major : CONTROL ENGINEERING AND AUTOMATION Advisor : NGUYEN VAN DONG HAI, PhD Ho Chi Minh City, July 2023 THE SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom– Happiness -Ho Chi Minh City, July 13th, 2023 GRADUATION PROJECT ASSIGNMENT Student name: Tran Quoc Cuong Student ID: 16151008 Tran Thi Thanh Thuy Major: Control Engineering and Automation 18151130 Tel: 0392346356 Email: 16151008@student.hcmute.edu.vn Advisor: PhD Nguyen Van Dong Hai Project information Project’title: Control simplified system based on the 2d grantry crane motion Project’purpose: Research and application of control algorithms Initial materials Advisor provides a number of research papers available for research purposes Content of the project: Learn the dynamic equation of the 2D gantry crane’s system Build PID and Fuzzy control algorithms for the system on simulation and experiment (on available model) Survey to find the optimization parameters so that the system is stable quickly to meet the requirements Final product: Model of the 2D gantry crane’s system Simulation program and Embedded program that stabilizes the 2D gantry crane’s system Ho Chi Minh City, July 13th, 2023 CHAIR OF THE PROGRAM ADVISOR (Sign with full name) THE SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom– Happiness -Ho Chi Minh City, August 13th, 2022 ADVISOR’S EVALUATION SHEET Student name: Tran Quoc Cuong Student ID: 16151008 Tran Thi Thanh Thuy Major: Control Engineering and Automation 18151130 Tel: 0392346356 Email: 16151008@student.hcmute.edu.vn Advisor: PhD Nguyen Van Dong Hai EVALUATION Content of the project: Strenghths: Weaknesses: Approval for oral defense? (Approved or denied) Overall evaluation: (Excellent, Good, Fair, or Poor) Mark: (in words: ) Ho Chi Minh City, July 13th, 2023 CHAIR OF THE PROGRAM ADVISOR (Sign with full name) SOCIALIST REPUBLIC OF VIETNAM Independence – Freedom – Happiness CONFIRMATION OF GRADUATION PROJECT EDITION Student’s name: Tran Quoc Cuong Student’s ID: 16151008 Tran Thi Thanh Thuy 18151130 Project’s name: Control simplified system based on the 2d grantry crane motion Edited Content Edit request 1: Student needs to change the title of the topic (Talk about the design, instead of talking about the survey) Answer: Student changed the name of project to “Control Simplified System Based on The 2D Grantry Crane Motion” Edit request 2: Student needs to modify some figures in the comparation part Answer: Student modified some figures in the comparation part in Chapter 5: Experiment result, figure 5.19 and 5.20 from page 71 to page 72 Student also added the comment for each figures Edit request 3: Students needs to present clearly about the object Answer: Student presented clearly about the object in Chapter 2: Fundamental theory, page 6, and Ho Chi Minh City, July 30th, 2023 Confirmation of Advisor Student (Sign and specify full name) (Sign and specify full name) ACKNOWLEDGMENTS First of all, we would like to express our deep gratitude to PhD Nguyen Van Dong Hai, who directly supported and guided the research of the graduation project with full of enthusiasm and encouragement Always consult and give advice on equipment, control algorithms, and support to lend necessary equipment available from the laboratory during the implementation of the project My team would like to thank the teachers in the Faculty of High-Quality Training and in the Technology of Control Engineering and Automation in particular, and the University of Technical Education in general for their warm teaching gave us knowledge not only specialized but also subjects with high practical application, to help us have a solid foundation for further development My team also would like to especially thank Ms Nguyen Tran Minh Nguyet for encouraging and giving us advice on studying in the most difficult times The project has been completed but errors will not be avoided, my team hopes to receive suggestions and comments to help the team complete the project better Ho Chi Minh City, July 13th, 2023 Students i SUMMARY Today's human society is developing dramatically with the help of modern and advanced technologies Any industry field has more or less the presence of machinery and electrical appliances, and electronic components However, not just putting them together will get the product we want, we need to make adjustments to suit the needs of each purpose, each object Since then, control algorithms were born to apply many different methods and ways of operating mechanical devices so that they can achieve the smoothest operation However, not any control method can affect the desired object, so choosing the object as well as the control method is extremely necessary Through research and comparison, students have decided to choose the 2D gantry crane's system motion as the based control target to introduce simplified system, and the control methods will be basic PID, Fuzzy, and Neuron Fuzzy as their graduation project ii TABLE OF CONTENTS ACKNOWLEDGMENTS i SUMMARY ii TABLE OF CONTENTS iii LIST OF FIGURES vi LIST OF TABLES ix CHAPTER 1: INTRODUCTION 1.1 Give problem 1.2 Purpose 1.3 Content 1.4 Limit 1.5 Research methods and means CHAPTER 2: FUNDAMENTAL THEORY 2.1 Mathematical equations 2.1.1 Introduction about the 2D gantry cranes system 2.1.2 Mathematical equation of 2D Gantry Crane system 2.2 Control method 12 2.2.1 PID Controller 13 2.2.2 Fuzzy controller 14 2.2.2.1 Development history 14 2.2.2.2 Fuzzy set 15 2.2.2.3 Operations on fuzzy sets 15 2.2.2.3.1 Intersection 15 2.2.2.3.2 Union 16 2.2.2.3.3 Complement 16 iii 2.2.2.4 Fuzzy relationship 16 2.2.2.5 Fuzzy inference method 17 2.2.2.6 Fuzzy system 19 2.2.3 The Neuron System 20 2.2.3.1 Definition 20 2.2.3.2 Nerve cells 20 2.2.3.3 A neural network 21 2.2.4 ANFIS Controller (Adaptive Neuro-Fuzzy Inference System) 24 2.2.4.1 Definition 24 2.2.4.2 Training for the ANFIS network 27 CHAPTER 3: HARDWARE AND SOFTWARE 30 3.1 Understanding hardware 30 3.1.1 Hardware overview 30 3.1.2 Devices 30 3.1.2.1 Microcontroller STM32F4 DISCOVERY 30 3.1.2.2 Omron Rotary Encoder E6B2-CWZ6C 1000P/R 32 3.1.2.3 Minertia Motor UFFMED-03SRI21 33 3.1.2.4 Sharp rotary encoder 34 3.1.2.5 H-Bridge IBT_2 34 3.1.2.6 UART XP2102 converter circuit 36 3.1.2.7 Source of beehives 36 3.1.3 Hardware connection diagram 37 3.2 Flowchart of control algorithm 38 3.3 Simulation software 38 3.3.1 Matlab/Simulink 38 3.3.2 Waijung blockset library 39 iv CHAPTER 5: SIMULATION AND EXPERIMENT After that, we will start to reduce the value of Kp1 and keep the rest of the parameters as shown in Table 5.3 and obtain the control result as shown in Figure 5.9 Table 5.3 PD parameters after Kp1 reduction PD position PD angle Kp1 0.75 Kp2 0.8 Kd1 0.08 Kd2 0.005 Figure 5.9 Control results with PD parameters after reducing Kp1 From Figure 5.9 we can see that after reducing Kp1 the system will stabilize after about 2.2s for the position and after about 3s for the deviation angle The error of the position is 6.5cm For the deviation angle, it fluctuates between 17 degrees and -10 degrees before 3s Continuing to reduce Kp1 and keeping the parameters as shown in Table 5.4, we obtain the control results as shown in Figure 5.10 63 CHAPTER 5: SIMULATION AND EXPERIMENT Table 5.4 PD parameters after further reduction of Kp1 PD position PD angle Kp1 0.6 Kp2 0.8 Kd1 0.08 Kd2 0.005 Figure 5.10 Control results after further reduction of Kp1 From Figure 5.10 we see that with PD parameters as Table 5.4, the system stabilizes quickly The position has a settling time of about 2s and for the deviation angle it is after 3.5s The error from the setpoint (desired position) is about 4.5cm The deviation angle ranges from 14 degrees to -8 degrees before 3.5s Next we will reduce Kp2 and keep the remaining parameters as Table 5.5 and get the result as shown in Figure 5.9 Table 5.5 PD parameters after Kp2 reduction PD position PD angle Kp1 0.855 Kp2 0.52 Kd1 0.08 Kd2 0.005 64 CHAPTER 5: SIMULATION AND EXPERIMENT Figure 5.11 Control results after reducing Kp2 With the decrease of Kp2, we see that the position stabilizes after about 2.4s and the deviation angle stabilizes after about 4s The position has an error of 6.3cm The deviation angle ranges from 22.6 degrees to -16.8 degrees before 4s Continue to reduce Kp2 and keep the remaining parameters as Table 5.6 we will get the result as Figure 5.12 Table 5.6 PD parameters after further reduction of Kp2 PD position PD angle Kp1 0.855 Kp2 0.3 Kd1 0.08 Kd2 0.005 65 CHAPTER 5: SIMULATION AND EXPERIMENT Figure 5.12 Control results after further reduction of Kp2 From Figure 5.12 it can be seen that with a sharp decrease in Kp2, the position takes more than 3s to start to stabilize, and the deviation angle stabilizes after about 6s The error of the position is 4.4cm The deviation angle ranges from 26.3 degrees to -23.6 degrees before stabilizing After that, we will reduce Kd1 and keep the remaining PD parameters as shown in Table 5.7 and obtain the control result as Figure 5.13: Table 5.7 PD parameters after Kd1 reduction PD position PD angle Kp1 0.855 Kp2 0.8 Kd1 0.05 Kd2 0.005 66 CHAPTER 5: SIMULATION AND EXPERIMENT Figure 5.13 Control results after reducing Kd1 After reducing Kd1, the system will be stable after about 1s but will not reach the desired value for the position and the angle will fluctuate and may be stable but for a long time The error from the desired position is 10cm and stays the same after that For the deviation angle, there is oscillation between 22 degrees and -14 degrees for the first 2s and then the amplitude of oscillations gradually decreases in the following time intervals Finally increase Kd2 and keep the remaining parameters as shown in Table 5.8 Table 5.8 PD parameters after increasing Kd2 PD position PD angle Kp1 0.855 Kp2 0.8 Kd1 0.08 Kd2 0.055 We get the control result as shown in Figure 5.12: 67 CHAPTER 5: SIMULATION AND EXPERIMENT Figure 5.14 Control results with PD parameters after increasing Kd2 After increasing Kd2, the system will still be stable after about 1s, but it will not reach the desired value for the position and the angle will also fluctuate The error from the desired position is 11cm and remains constant after that The deviation angle has oscillations ranging from 13 degrees to -16 degrees for the first 4s and then decreasing amplitude in subsequent time intervals After adjusting the four parameters of the PD controller, when Kp1 and Kp2 are increased, the system is gradually stable with respect to the position and angle of deviation, but if it is increased too much, overshoot and the oscillation will be increased, and the deviation angle will also be large Increasing Kd1 to reduce overshoot and settling time, while for kd2 has less impact on the system and much increase, it will destabilize the system 5.3.2 ANFIS controller After using the ANFIS controller for the gantry crane system with the desired position of 30cm and the desired deviation angle of Testing with the number of input membership functions as 5, the students obtained the results as shown in Figure 5.15 below: 68 CHAPTER 5: SIMULATION AND EXPERIMENT Figure 5.15 Result when using ANFIS controller According to Figure 5.15, we can easily see that the position has stabilized after about 0.7s, but it does not reach the value of the desired position but is about 10.1cm higher Meanwhile, the deviation angle has an amplitude ranging from 50.7 degrees to -52.6 degrees in the first seconds and tends to decrease after that but very slowly After that, students proceed to reduce the number of membership functions to 3, increase the number of samples and train for another 20 cycles, for a total of 120 training cycles The results are shown in Figure 5.16: Figure 5.16 Result when using ANFIS controller with membership functions 69 CHAPTER 5: SIMULATION AND EXPERIMENT As shown in Figure 5.16, we can see that the position reaches the set value only after 2s The position error is 5.6cm The deviation angle ranged from 15.4 degrees to -10.8 degrees for the first 2.4 seconds and then stabilized and reached the desired value When the system has stabilized, if we act on the system by hand, the system will oscillate for a few seconds, but then the system still returns to the steady state as shown in Figure 5.17 below: Figure 5.17 Control result after acting system by hand 5.3.3 Fuzzy controller Table 5.9 Fuzzy controller parameters Pretreatment Post-processing K1 K2 0.35 0.01 K5 60 K3 0.45 K6 40 K4 0.01 70 CHAPTER 5: SIMULATION AND EXPERIMENT Figure 5.18 Fuzzy controller result With the Fuzzy controller, the control signal is not too fast, the system will stabilize after about seconds, and the fluctuation amplitude of the deviation angle and the overshoot position is not too high 5.4 Compare controllers 5.4.1 Position To have an overview, the group controls the model with all three control methods PD, Fuzzy, and ANFIS, respectively From there, the group obtained the position control results of all three methods as shown in Figure 5.19 below: Figure 5.19 Control position results of methods 71 CHAPTER 5: SIMULATION AND EXPERIMENT From Figure 5.19, we can easily see that all three control methods give pretty good results The PD controller has an error of 7.1cm from the desired position and the settling time is 2.1s The Fuzzy controller has an error of 2.3cm from the initial desired position and a settling time of 3.1s The ANFIS controller has a settling time of about 2s and has an error of 5.6cm from the initial desired position In general, although the Fuzzy controller has the lowest overshoot, it also has the longest setting time, and after setting it still has not been able to stick to the initial desired position The PD controller has the highest overshoot, but the settling time is relatively faster than the Fuzzy controller As for the ANFIS controller, it has a relatively low overshoot but has the fastest setup time among the three controllers 5.4.2 Angle Figure 5.20 below is the result of angular control of controllers, respectively PD controller, Fuzzy controller, and ANFIS controller: Figure 5.20 Control angle results of methods From Figure 5.20 we can see that the PD controller has a theta angle ranging from 19.3 degrees to -11.9 degrees and stabilizes after about 4.6s The Fuzzy controller has a theta deviation that ranges from -9.2 degrees to 4.9 degrees and starts to stabilize after about 5s As for the ANFIS controller, the theta angle ranges from 15.4 degrees to -10.8 degrees and stabilizes after about 3.1s In general, the theta deviation angle of the PD controller fluctuates the most while the theta deviation angle of the Fuzzy controller fluctuates the smallest, and the ANFIS controller has a relative oscillation deviation angle At the same time, the 72 CHAPTER 5: SIMULATION AND EXPERIMENT ANFIS controller makes the theta deviation stable the earliest, while the Fuzzy controller's deviation angle stabilizes the longest 73 CHAPTER 6: CONCLUSION AND DEVELOPMENT ORIENTATIONS CHAPTER 6: CONCLUSIONS AND DEVELOPMENT ORIENTATIONS 6.1 Conclusions Through the process of implementing the project, the group of students realized that: Both PID , Fuzzy and ANFIS control methods meet the objectives of the study However, the ANFIS controller still reaches the desired position value earlier than the other controllers Despite the low overshoot and the relatively small theta deviation, the settling time of the system is the longest The PD controller has a relatively fast settling time, but has the largest overshoot and the largest variation of theta deviation The ANFIS controller has a relatively low overshoot and theta deviation range but has the fastest setup time among the three controllers The model of the 2D gantry cranes system is not too complicated, so it is quite convenient and easy to apply control methods to prevent load fluctuations Gain more knowledge about Waijung library, which is used to support STM32F4 microprocessor control more easily through Matlab software - a fairly popular software in the automation industry 6.2 Development orientations Gantry cranes system can be upgraded from 2D to 3D for control Apply more control methods such as SMC, LQR, sliding control to find the optimal control method 74 REFERENCES REFERENCES [1] Omar, H.M (2003) Control of gantry and tower cranes, PhD Dissertation, Virginia Polytechnic Institute and State University Blacksburg, Virginia [2] Singhose, W.E., Porter, L.J & Seering, W.P (1997) Input shaped control of a planar gantry crane with hoisting, Proceedings of the American Control Conference pp 97-100 [3] Park, B.J., Hong, K.S & Huh, C.D (2000) Time-efficient input shaping control of container crane systems, Proceedings of IEEE International Conference on Control Application pp 80–85 [4] Gupta, S and Bhowal, P (2004) Simplified open loop antisway technique Proceedings of the IEEE India Annual Conference (INDICON), pp.225-228 [5] Zhao, Z.Y., Tomizuka, M and Isaka, S (1993) Fuzzy Gain Scheduling of PID Controllers IEEE Transactions on System, Man and Cybernetics Vol 23, no [6] Xu, J and Feng, X (2004) Design of Adaptive Fuzzy PID tuner Using Optimization Method Proceedings of The 5th World Congress on Intelligent Control and Automation [7] Huỳnh Thái Hồng (2014) Hệ thống điều khiển thơng minh, Nhà xuất Đại học Quốc gia TP.HCM [8] Nguyen Van Dong Hai, Nguyen Thien Van, Nguyen Minh Tam(10/2017) Ứng dụng giải thuật mờ PID điều khiển cần trục Journal of Technical Education Science No.44A [9] Stefan Bruins, Comparison of Different Control Algorithms for a Gantry Crane System, Journal of Intelligent Control and Automation, pp 68-81, 2010 [10] Chengyuan Chang, Shiwei Hsu, Kuohung Chiang, A practical fuzzy controllers scheme of overhead crane, Volum 3, Issue 3, pp 266-270, Journal of Control Theory and Applications, 2005 75 REFERENCES [11] Najib K Dankadai, Ahmad Athif Mohd Faudzi, Amir Bature, Suleiman Babani, Muhammad I Faruk (2015) Position Control of a 2D Nonlinear Gantry Crane System using Model Predictive Controller [12] Lifu Wang, Hongbo Zhang, Zhi Kong (2015) Anti-swing Control of Overhead Crane Based on Double Fuzzy Controllers [13] Hussien, S Y S., Jaafar, H I., Ghazali, R., and Razif, N R A 2015 “The Effects of Auto-Tuned Method in PID and PD Control Scheme for Gantry Crane System,” 6: 121-125 [14] JITENDRA SINGH, Inverted Pendulum Energy Based Collocated Partial Feedback Linearization Control for Swing up & LQR Control for Balance [15] Nguyễn Thanh Nguyên, Nguyễn Phong Lưu, Nguyễn Văn Đông Hải ĐIỀU KHIỂN HỆ PENDUBOT SỬ DỤNG DẠNG TỒN PHƯƠNG TUYẾN TÍNH DỰA TRÊN LOGIC MỜ [16] Nguyễn Sơn Hà, Trần Thu Hà TỐI ƯU HÓA ĐIỀU KHIỂN PID CHO HỆ BALL AND BEAM DÙNG GIẢI THUẬT GENETIC ALGORITH [17] Hayder M.Albeahdili, Tony Han, Naz E Islam, Hybrid Algorithm for the Optimization of Training Convolutional Neural Network 76 S K L 0