MINISTRY OF EDUCATION AND TRAINING HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAINING CAPSTONE PROJECT AUTOMATION AND CONTROL ENGINEERING POSITION CONTROL FOR BALL AND BEAM UNDER LINEAR ALGORITHMS LECTURER: NGUYEN VAN DONG HAI, PhD. STUDENT: PHAM VAN CHINH HOANG DUY TAN SKL009732 Ho Chi Minh City, December 2022 HCM CITY UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAINING GRADUATION THESIS POSITION CONTROL FOR BALL AND BEAM UNDER LINEAR ALGORITHMS Students: PHAM VAN CHINH 18151005 HOANG DUY TAN 18151034 Major: AUTOMATION AND CONTROL ENGINEERING Advisor: Nguyen Van Dong Hai, PhD. Ho Chi Minh city, December 29, 2022 SOCIALIST REPUBLIC OF VIETNAM Independence-Freedom-Happiness ****** Ho Chi Minh City, December 29, 2022 SUBJECT PROJECT ASSIGNMENT Student name: Pham Van Chinh Student ID: 18151005 Student name: Hoang Duy Tan Student ID: 18151034 Major: Automation and control engineering Class: 18151CLA Advisor: PhD. Nguyen Van Dong Hai Date of assignment: 6/9/2022 Date of submission: 30/12/2022 1.
Project title: Position control for Ball and Beam system under linear algorithms 2. Initial materials: They are provided by the advisor. Content of the project: Calculation of the dynamical equation of the Ball and Beam system. Simulating the ball and beam system on matlab.
Calculating the dynamics equation of the engine to apply to the real model. Model building: Select hardware, select motor, H-bridge, 12V DC Power, Ball. Run the PID algorithm: select the appropriate PID parameter. Run the LQR algorithm: calculate the LQR and select the Q, R matrix values.
Optimize PID and LQR by GA algorithm. Simulation and verification on real models. Final product: Ball and Beam system in real model. Graduation report book.
CHAIR OF THE PROGRAM ADVISOR (Sign with full name) (Sign with full name) SOCIALIST REPUBLIC OF VIETNAM Independence-Freedom-Happiness ****** Ho Chi Minh City, December 29, 2022 ADVISOR’S EVALUATION SHEET Student name: Pham Van Chinh Student ID: 18151005 Student name: Hoang Duy Tan Student ID: 18151034 Major: Automation and control engineering Class: 18151CLA Advisor: PhD. Nguyen Van Dong Hai Project title: Position control for Ball and Beam system under linear algorithms EVALUATION 1. Content of the project:. Approval for oral defense? (Approved or denied) .) Ho Chi Minh City, December 29, 2022 ADVISOR (Sign with full name) SOCIALIST REPUBLIC OF VIETNAM Independence-Freedom-Happiness ****** Ho Chi Minh City, December 29, 2022 EVALUATION SHEET OF DEFENSE COMMITTEE MEMBER Student name: Pham Van Chinh Student ID: 18151005 Student name: Hoang Duy Tan Student ID: 18151034 Major: Automation and control engineering Class: 18151CLA Project title: Position control for Ball and Beam system under linear algorithms Name of Defense Committee Member: EVALUATION 1.
Content and workload of the project: .) Ho Chi Minh City, December 29, 2022 COMMITTEE MEMBER (Sign with full name) GRADUATION THESIS Disclaimer Students hereby declare that this is my own research work and is under the scientific guidance of PhD. Nguyen Van Dong Hai. The research contents and results in this topic are honest and have not been published in any form before. If I find any fault, I will take full responsibility for the content of my graduation thesis.
Ho Chi Minh City University of Technology and Education is not related to copyright and copyright infringements (if any) caused by me during the implementation. Ho Chi Minh City, December 29, 2022 STUDENTS i GRADUATION THESIS Acknowledgements At the beginning, our group would like to express our sincere thanks to the teacher - PhD. Nguyen Van Dong Hai for directly guiding us to carry out the graduation project, he enthusiastically guided,encouraged us throughout the process of implementing the topic and creating favorable conditions for us to successfully complete the graduation project. Our group would also like to express our sincere thanks and deep gratitude to the teachers of the University of Technology Education, especially the teachers of the Faculty of High Quality Training for creating conditions for our group have time to do projects.
Finally, our team would like to wish the teachers good health, success in their teaching path and bring many values to the next generations. ii GRADUATION THESIS Table of Contents Disclaimer. ii Table of Contents. vi Ball and beam system.
vi Linear-Quadratic Regulator. vi Proportional Integral Derivative.vi List of Figures. vii List of Tables. Decription about B&b system.
Model and research completed over the world.3 CHAPTER 2: THEORETICAL BASIC AND SOLUTION CONTROL. Analyze and build mathematical models.3 Analyze and build mathematical models of motor. 17 iii GRADUATION THESIS 2. HARDWARE AND SOFTWARE DESIGN.
CP2102 USB to UART Bridge. Modeling The Ball and Beam system with Deviated Axis and mechanical processing. Programming STM32F407 by Waijung library on Matlab software. BUILDING THE CONTROLLERS ON THE SIMULATION.
Building the PID controller. PID rule results and comments. Building LQR controller. LQR rule results and comments.
Building GA algorithm for PID controller. GA rule for PID controller results and comments. GA rule for LQR controller results and compare GA-PID and GA-LQR. Building GA algorithm for LQR controller.
BUILDING THE CONTROLLERS ON THE REAL MODEL. Building the PID controller. PID rule results and comments. Building the LQR controller.
66 iv GRADUATION THESIS 5. LQR rule results and comments. GA rule for PID controller results and comments.1 GA-PID vs GA-LQR in real model. Compare PID with PID-GA.
86 v GRADUATION THESIS ABBRIVIATION Symbols Meaning B&b system Ball and beam system LQR Linear-Quadratic Regulator PID Proportional Integral Derivative vi GRADUATION THESIS List of Figures Fig 1. 1 Ball and beam system from Quanser [4]. DC Motor block. The transfer function of DC motor.
LQR control system diagram. PID Controller Block Diagram. Discrete PID Block Diagram. Changing proportional term.
Changing integral term. Changing derivative term. Nisca NF5475E DC encoder motor. Operating specifications Nisca Motor.
Kit STM32F407 Discovery. Circuit diagram of H bridge circuit (forward). Circuit diagram of H bridge circuit (reverse). IR2184 H-bridge pinout.
The actual model of the ball and beam system with Deviated Axis. Wiring diagram system. Install the Waijung Blockset library.16: Nema 17 stepper motor. Torque holding of nema 17.
DC motor jgb37-520. Table testing Jgb37-520. Servo Motor Jgb37-520 wiring diagram. Ultra sonic sensor HC SR04.
Simulate the PID controller of the ball and beam system. Result of simulation PD algorithm. Result of simulation PD algorithm when increase Kp_ball. Result of simulation PD algorithm when increase Kp_beam.
Result of simulation PD algorithm when increase Kd_ball. Result of simulation PD algorithm when increase Kd_beam. Result of simulation PID algorithm. Result of simulation PID algorithm when increase Ki.
39 vii GRADUATION THESIS Fig 4. Simulate the LQR controller of the ball and beam system. Result of simulation LQR algorithm. Voltage response of simulation LQR algorithm.
Result of simulation LQR algorithm when decrease R. Voltage response of simulation LQR algorithm when decrease R. Result of simulation LQR algorithm when increase R. Voltage response of simulation LQR algorithm when increase R.
Result of simulation LQR algorithm when increase Q1. Voltage response of simulation LQR algorithm when increase Q1. Result of simulation LQR algorithm when increase Q2. Voltage response of simulation LQR algorithm when increase Q2.
Result of simulation LQR algorithm when increase Q3. Voltage response of simulation LQR algorithm when increase Q3. Result of simulation LQR algorithm when increase Q4. Voltage response of simulation LQR algorithm when increase Q4.
Simulate the GA-PID controller of the ball and beam system. PID simulation result of genetic algorithm: The eighth generation. PID simulation result of genetic algorithm: The ninth generation. PID simulation result of genetic algorithm: The third generation.
PID simulation result of genetic algorithm: The sixty-fifth generation. PID controller on the real ball and beam model. Real model PID standard parameter results. Result 1 of increase Kp_ball.
Result 2 of increase Kp_ball. Result 1 of reduce Kp_ball. Result 2 of reduce Kp_ball. Result 1 of increase Kd_ball.
Result 2 of increase Kd_ball. Result 1 of increase Kp_beam. Result 2 of increase Kp_beam. Result 1 of increase Kd_beam.
Result 2 of increse Kd_beam. LQR controller on the real ball and beam model. Real model LQR standard parameter result. Result reduce R real model LQR.
Result increase Q1 real model LQR. Result increase Q2 real model LQR. Result increase Q3 real model LQR. Result increase Q4 real model LQR.
Manually calibrated PID result. The eighth generation result: PID parameter from genetic algorithm applied to the real model. The ninth generation result: PID parameter from genetic algorithm applied to real model. 72 viii GRADUATION THESIS Fig 5.
The third generation result: PID parameter from genetic algorithm applied to real model. The sixty-fifth generation result: PID parameter from genetic algorithm applied to real model. Result of changing setpoint: PID parameter from genetic algorithm applied to real model. System response with sine wave setpoint.
Result 1 of median filter (standard median filter). Result 2 of median filter (increase median filter). Result 3 of median filter (increase median filter). Result 4 of median filter (increase median filter).
Result 5 of median filter (increase median filter). Result of changing the pass band lowpass filter. Result of changing the stop band lowpass filter. Result of changing the ripple lowpass filter.
Result of changing the atennuation lowpass filter. The interface to observe the operation of system. 82 ix GRADUATION THESIS List of Tables Tab 2. System parameters and variables of B&B.
Blocks in simulation program. Blocks in simulation of B&B block .The eighth generation: PID parameter from genetic algorithm .The ninth generation: PID parameter from genetic algorithm .The third generation: PID parameter from genetic algorithm .The sixty-fifth generation: PID parameter from genetic algorithm. INTRODUCTION The purpose of this chapter is to provide information about an overview of the topic, the necessity of this project, the goals and approaches to solving problems encountered in the working process. In addition, the chapter also suggests the development method of the topic that can be applied in the future to solve remain problems and improve control quality.
Necessary Nowaday, the country is in the process of transforming labor methods, from manual labor to machine labor and moving to a new level of automation. Especially, automatic control systems with the support of robots help to do a series of complex jobs with high accuracy during a short time, bringing a lot of benefits to humans. For example: Vinamilk dairy factory in My Phuoc 2 industrial zone, Binh Duong province which was using almost fully automatic robots with high precision or a series of robots developed to perform repetitive tasks such as picking and place, sorting products, drawing or tracking with high speed and accuracy, many times higher than humans such as: scara, delta, magician. These robots, to be able to run smoothly and work with incredible speed and accuracy, need to be carefully programmed using complex algorithms.
Therefore, there is a problem that if you want to control, repair and upgrade these robots, you need not only understanding of the structure of the robot but also basic fundamental of control algorithms and robot control programs. However, these robots have a very high cost, so it is not reasonable to buy them and bring them to schools to teach the knowledge of control algorithms to pupils and students, standardized close to actual manufactured models, with low cost, compactness and ease of use, these models are widely used for teaching, doing research about the control rules of old algorithms and developing new algorithms. Decription about B&b system The Ball and Beam system with Deviated Axis(single-input and multi-output system) is commonly used in laboratories to prove the positivity of control algorithms. It is a simple and low-cost model that is easily accessible in the teaching environment at universities.
Some algorithms have been successfully applied on this model such as PID [1], LQR [2],. PID and LQR are two simple algorithms, having a simple structure makes the above controllers easy to design, are supported to be embedded in the microprocessor for experimentation.