Вы находитесь на странице: 1из 25

IMPLEMENTATION OF FUZZY LOGIC CONTROLLER ON REVOLUTE CONTROL UNIVERSAL STRETCH&BENDING MACHINE (USBM)

NINA NAISHA BINTI SUHAIMI

This thesis is submitted as partial fulfillment of the requirements for the award of the Bachelor of Electrical Engineering (Hons.) (Electronics)

Faculty of Electrical & Electronics Engineering Universiti Malaysia Pahang

APRIL, 2009

I hereby acknowledge that the scope and quality of this thesis is qualified for the award of the Bachelor Degree of Electrical Engineering (Electronics)

Signature

: ______________________________________________

Name

: REZA EZUAN BIN SAMIN

Date

: 27 APRIL 2009

DEDICATION

Special dedication to my parents, my fianc, and family members that always inspire, love and stand beside me, my supervisor, my beloved friends, my fellow colleagues, and all faculty lecturers and members.

For your love, care, support and believe in me. Thank you so much.

God bless you all Amin-

ACKNOWLEDGEMENT

Alhamdulillah, His Willingness has made it possible for the author to complete the final year project in time.

I would like to take this opportunity to express gratitude to my dedicated supervisor, Mr. Reza Ezuan bin Samin for guiding me this project at every stage with clarity and that priceless gift of getting things done by sharing his valuable ideas as well as share his knowledge. Not to forget, thanks also to Mr. Syahrulnaim bin Mohamad Nawi, Mr. Nasrul bin Salim Pakheri, Mr. Muhammad Hamka bin Embong and Mr. Azlan bin Sayuti for their meaningful criticism and guidance.

I would also like to thank to all UMP lecturers and electrical technicians whom had helped directly or indirectly in what ever manner thus making this project a reality.

Not forgotten are my best colleagues for their openhandedly and kindly guided, assisted and supported and encourage me to make this project successful. My heartfelt thanks to my parents Mr. Suhaimi bin Abdul Ghani, Madam Noraini binti Abdul Ghaffar and Mr. Ahmed Faisal bin Mohammad Supian which always support and prey on me throughout this project. Their blessing gave me the high-spirit and strength to face any problem occurred and to overcome them rightly.

The great cooperation, kindheartedness and readiness to share worth experiences that have been shown by them will be always appreciated and treasured by me, thank you.

Thank You

Nina Naisha binti Suhaimi

ABSTRACT

Motor speed control is very important in rotating machinery applications. There are many applications that have been developed based on motor speed control theory such as to run the machines at most factory automation industry as well known the machines are easiest to damage without controller. The speed control of motor is very difficult to be implemented by using conventional control techniques, as it requires a very complex mathematical model. The purpose of this project is to describe the research of fuzzy logic controller (FLC) design based on programmable logic controller (PLC) in order to control the speed of the motor. The model of the PLC that has been used in this project is OMRON CJIG-CPU42P where this PLC has a build in loop control that can be made the ladder diagram quite simple using function block in Cx-process tools. In this project, the system without controller shows that is an open loop control. Therefore, when break is applied there is no feedback for the system to increase the voltage in order for the motor to maintain the desired speed output. Compare by using the controller FLC, when the breaking is applied there is a feedback for the system to increase the voltage to get the desired output that the user need. From this hardware implementation there are five rules that have been used which is five membership functions with trapezoid and triangular shape. Analysis will be done and it shows that the triangular shape is much better compare to the trapezoid shape and without controller in the system. Before the controller will be implementing in the PLC, the simulations were done using MATLAB fuzzy logic toolbox and SIMULINK. The objective of the simulation is to predict the system response of the motor in with or without controller.

ABSTRAK

Kawalan kelajuan motor adalah sangat penting dalam aplikasi jentera berputar. Terdapat banyak aplikasi yang telah dibangunkan berdasarkan teori kawalan kelajuan motor seperti menggerakkan mesin dikebanyakkan kilang industri automasi, seperti yang diketahui mesin mudah mengalami kerosakkan tanpa pengawal. Kawalan kelajuan motor adalah sukar untuk dilaksanakan dengan mengunakan teknik konvensional, kerana ia memerlukan model matematik yang kompleks. Tujuan projek ini dijalankan adalah untuk menerangkan kajian berkenaan reka bentuk kawalan fuzzy logic (FLC) berdasarkan Programmable Logic Controller (PLC) untuk mengawal kelajuan motor. Model PLC yang digunakan dalam projek ini adalah OMRON CJ1G-CPU 42P yang mana PLC ini mempunyai kawalan gelungan terbina dalaman dimana ia dapat meringkaskan ladder diagram dengan menggunakan function block didalam perisian Cx-process.Dalam projek ini, sistem tanpa pengawal menunjukkan ia adalah kawalan gelungan terbuka. Oleh itu, apabila gangguan luar diberikan, tiada tindak balas terhadap sistem ini yang mana membolehkan peningkatan voltan terhadap motor bagi mengekalkan keluaran kelajuan yang diinginkan. Berbanding dengan menggunakan kawalan FLC, apabila gangguan luar diberikan, terdapat tindak balas kepada sistem yang boleh meningkatkan nilai voltan untuk mendapatkan keluaran kelajuan yang diinginkan oleh pengguna. Daripada perlaksanaan perkakas ini, terdapat lima peraturan yang digunakan iaitu fungsi keahlian dengan bentuk trapezoid dan segitiga. Analisis yang telah dilakukan menujukkan bahawa bentuk segitiga adalah lebih baik berbanding bentuk trapezoid dan tanpa pengawalan didalam sistem. Sebelum pelaksanaan pekakas pengawalan dilakukan pada PLC, sistem ini disimulasikan dengan menggunakan MATLAB Fuzzy Logic Toolbox dan SIMULINK. Objektif simulasi ini adalah untuk meramalkan respon sistem motor bersama atau tanpa pengawal.

TABLE OF CONTENTS

CHAPTER

TITLE

PAGE

DECLARATION DEDICATION ACKNOWLEDGEMENT ABSTRACT ABSTRAK TABLE OF CONTENTS LIST OF TABLE LIST OF FIGURE LIST OF SYMBOLS LIST OF ABBREVIATIONS LIST OF EQUATIONS LIST OF APPENDICES

i ii iii iv v vi ix x xiii xiv xv xvi

INTRODUCTION

1.1 Background 1.1.1 Introduction to the project 1.1.2 Problem Statement 1.1.3 Problem Solving 1.2 Objectives 1.3 Scopes of the project

1 3 4 4 5 5

LITERATURE REVIEW

2.1 Structure of Fuzzy Logic Controller 2.1.1 Preprocessing 2.1.2 Fuzzification 2.1.3 Rule Base Evaluation & Inference Engine 2.1.4 Deffuzification 2.1.4.1 Centre of Gravity (COG) 2.1.4.2 Centre of Gravity for Singletons(COGS) 2.1.4.3 Mean of Maxima (MOM) 2.1.4.4..Leftmost Max (LM), Rightmost Max (RM) 2.1.6 Postprocessing 2.2 Definition of Programmable Logic Controller (PLC) 2 2 1 Advantages using PLC 2.3 AC Motor 2.4 Encoder 2.5 High Speed Counter 2.6 Inverter 2.7 Relay

7 8 8 9 11 12 12 13 13 13 13 16 17 18 19 19 21

METHODOLOGY

22

3.1 Introduction 3.2 Flowchart for full project 3.2.1 Phase I : Project Preview 3.2.2. Phase II : MATLAB Simulation 3.2.2.1 Motor modeling without controller 3.2.2.2 Motor modeling with fuzzy logic controller 3.2.3 Phase III : Construct PLC Panel 3.2.4 Phase IV : Ladder Diagram 3.2.5 Phase V : Design Function Block

22 24 26 26 27 28 30 31 35 44 45 46

3.2.6 Phase VI : Hardware Construction 3.2.7 Phase VII : Hardware Integration with PLC 4 RESULT AND DISCUSSION

4.1 Simulation in MATLAB 4.1.1 Modeling of Motor 4.1.2 Motor Modeling without Controller 4.1.3 Motor Modeling With Fuzzy Logic Controller 4.2 Hardware Implementation 4.2.1 Hardware Implementation without Controller 4.2.2 Hardware Implementation with FLC 4.2.3 Comparisons of Speed Response

46 47 47 49 52 53 55 60

CONCLUSION AND RECOMMENDATION

62

5.1 Conclusion 5.2 Recommendation 5.3 Costing and Commercialization

62 63 64

REFERENCES

65

APPENDIX A : Derivative of Transfer Function APPENDIX B : Calculation of the Power Consumption APPENDIX C : Circuit Diagram of Panel PLC APPENDIX D : Step to Creating the Function Block in Cx-Process APPENDIX E: Connection between High Speed Counter and Encoder APPENDIX F: Figure of Panel PLC and Hardware APPENDIX G: Data Sheets APPENDIX H: Data from Tuning Screen

LIST OF TABLES

TABLE NO

TITLE

PAGE

2.1 3.1 4.1

Advantages of PLC Actual motor parameters Performance Comparisons Response of Ac Motor

16 27 60

LIST OF FIGURES

FIGURE NO

TITLE

PAGE

1.1

Block Diagram Implementation of Fuzzy Logic Controller

2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10

Block Diagram of Fuzzy Controller Fuzzifiction Mamdani-style rule evaluation (Simulation) Sugeno-style rule evaluation (Hardware Implementation) Mamdani-style aggregation of the rule outputs Sugeno-style aggregation of the rule outputs Features of PLC CJ1G based Process Control PLC CJ1G-CPU42P AC Motor Per-phase approximate equivalents circuit of an induction motor

8 8 9 10 11 11 15 15 17 18

2.11 2.12 2.13 2.14 3.0 3.1 3.2 3.3 3.4 3.5

Encoder and dimension drawings. Dimension drawings of High Speed Counter Terminal Connection Diagram Relay OMRON MK2P-I Design without Controller Design for Fuzzy Logic Controller Flow Chart of the full Project Block Diagram without Controller Block Diagram with Fuzzy Logic Controller FIS Editor

18 19 20 21 23 23 25 27 28 29

3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 3.20 3.21 3.22 3.23 3.24 3.25 3.26 3.27 3.28 4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9

Membership Function Editor Rule Editor Running Motor Conversion of Pulse to Speed PLC IO Table Setup Analog Output Figure to active analog output using MOV block Function Block Diagram without Controller Function Block Diagram without Controller Setting for 2pos. ON/OFF Block Setting for DA 08V/C Block Setting for User Link Table Block Flow Chart of FLC Design Methodology Fuzzy Logic Controller Function Block Diagram Setting for Constant Selector Setting for Fuzzification range for trapezoidal shape Range Fuzzification for trapezoidal shape Fuzzification range for triangular shape Range Fuzzification for triangular shape Setting for rule base and output Setting for User link Table Connection between the pins PLC Design Methodology Programming in the M-file Motor Modeling without Controller Speed Response Motor without Controller Motor Modeling with Fuzzy Logic Controller Speed Response with FLC using Triangular Shape Speed Response with FLC using Trapezoidal Shape Tuning Screen without Controller Graph without Controller Response of AC Motor using FLC with Trapezoidal Shape

29 30 32 33 34 34 35 36 36 37 37 38 39 40 40 41 41 42 42 43 43 44 45 47 48 49 50 51 52 53 54

55

4.10

Response of Ac Motor using FLC with Triangular Shape Response of Ac Motor using FLC with Trapezoid

55

4.11

Shape Response of Ac Motor using FLC with Triangular

56

4.12 4.13 4.14 4.15

Shape Range for Triangular Shape Rule Base Aggregation of rules output

57 58 59 59

LIST OF SYMBOLS

Jm Dm Kt, Kb Ra La V Ia PT dE

- Equivalent Inertia by the Motor - Equivalent Viscous Density by the Motor - Motor Torque Constant - Back emf Constant - Armature Resistance - Armature Inductance - Voltage - Armature Current - Rotating Speed - Torque - Total Power - Del error

LIST OF ABBREVIATIONS

PLC FLC SP MV PV PWM

Programmable Logic Controller Fuzzy Logic Controller Set Point Manipulated Variable Process Variable Pulse Width Modulation

LIST OF EQUATIONS

1 2

- Center of Gravity (COG) Equation - Centre of gravity methods for singletons (COGs) equation

3 4 5 6

- Conversion of Pulse to Speed Equation - Derivation of Transfer Function Equation - Overshoot Percentage - Rise Time

LIST OF APPENDICES

APPENDIX

TITLE

A B C D E F G

Derivative of Transfer Function Calculation of the Power Consumption Circuit Diagram of Panel PLC Step to Creating the Function Block in Cx-Process Connection between High Speed Counter and Encoder Figure of Panel PLC and Hardware Data Sheets

CHAPTER 1

INTRODUCTION

This chapter explains the background and the introduction of this overall project which includes the introduction of project, problem statement, problem solving, objectives and scope project.

1.1 Background

In the industrial automation there are many types of machines that are used for production such as stretch and bending machines. These machines can work more efficiently if both of them are combined together. Currently, Lewa Attendorn Company has employed a panel PC and soft-PLC to conveniently teach its universal sheet metal and profile stretch-bending machines complex three dimensional program with 12 to 16 axes. The PLC functionality of the entire machine is handled by a Simatic WinAC RTX soft-PLC. This is a very fast solution without communication slowing hardware between the HMI system and the programmable logic control (PLC). Their universality expands the field of the stretch-bending machine by Lewa Attendorn for beyond the automotive realm.[1]

Stretch machines are an engineered for all purpose of applications and suitable for stretch bundling application. Normally, it is used in industries such as for wrapping, packaging and tapping products. Packaging machinery usually uses to package products or components including equipment that forms, fills, seals, wraps, cleans and packages at a different levels of automation.

Bending machines have a variety of functions and specifications which are normally use to bend and fold metal by pressing it into a die. There are several types of press brakes and bending machines such as a hydraulic press brake, folding equipment, bending machine, press brake tooling, CNC brake press, and a sheet metal press brake. It is used in many industries including automotive and aircraft industries where the metal parts are a constant need. The controller is much important to make sure the stretch and bending machine are smoothly and reliable functionality in industrial automation.

Fuzzy logic control is an effective approach for systems which are difficult to model. This controller is suitable for stretch and bending machine where the fuzzy logic control methods a rather new approach to the problems of controlling complex nonlinear systems, the systems whose mathematical model is difficult or impossible to describe, and the systems with multiple inputs and outputs characterized by hardly defined internal interference. It must be said that fuzzy logic control techniques earned respect from the engineering population after numerous applications on technical and non-technical systems, especially complex systems in industry, economy, and medicine.

Fuzzy logic and the theory of fuzzy sets are the result of a broader comprehension of practical control problems and control actions, performed by human operators, which could not have been correctly interpreted by using classical bivalent logic and conventional methods of automatic control. In the beginning of his globally successful professional career the father of fuzzy logic, Professor Lotfi A.Zadeh, affiliated with the University of California at Barkeley, USA, realized that the existing control theory was very limited and that it did not provide real solutions for the abovementioned classes of the systems. In the 1960s Professor Zadeh made an ingenious shift from standard thinking and interpretation and created the fundamentals of a new control theory, which got full recognition and obtained numerous followers, after almost 20 years of struggle with fuzzy control opponent.[2]

1.1.1

Introduction to the project

Nowadays, most of factory automation industry used machines where most of the machines are easier to damage without the controller. The question is, how to control the machine to ensure that it is economic and reliability system using in industry plant.

In developing of this project, a simulation of the revolute control of a motor using Fuzzy Logic Control (FLC) will be done in MATLAB environment. The Fuzzy Logic Controller designed in this study applies the required control voltage based on motor speed. The simulation results show that the control with Fuzzy Logic Controller (FLC) can improve in terms of percentage overshoot and steady state error.

Programmable Logic Controller (PLC) ladder diagram programming will be constructed with fuzzy logic control (FLC) implementation then construct the hardware of revolute control USBM. To make the PLC ladder diagram would be simpler the PLC Omron CJ1G will be used where the loop process is build in up and using the function block in Cx-Process tools it can make the ladder diagram simpler.

1.1.2

Problem Statement

Generally, machine in factory are easily damage without implementation of revolute control in it system. The desired performance characteristics of control system are specified in term of the transient response. The transient response of a

practical control system usually exhibits damped oscillation before reaching steady state. For example, as a machine it having a high overshoot is an undesired condition since the motor starting current is very high.

1.1.3

Problem Solving

To solve the problem statement, control methodology such as a fuzzy logic controller is used to limit the overshoot as well to reduce the starting motor current of the machine. The Fuzzy Logic Controller is chosen to interface with the motor because it is suitable for application which has nonlinearities such as speed of the motor. The figure below shows the block diagram of an USBM (motor) with implementation of Fuzzy Logic Controller.

Figure 1.1: Implementation of Fuzzy Logic Controller 1.2 Objective

The overall aim of the whole project is to control the motor speed in USBM using Programmable Logic Controller (PLC) and to design the Fuzzy Logic Controller (FLC) in the Programmable Logic Controller (PLC) for better performance system of the revolute control USBM.

1.3

Scopes of Project

This project is to design a fuzzy logic controller that can be use to control the speed of a motor. As a machine performance is a vital factor for a big production line, this project will examine the efficiency and performance of a motor with implementation of control methodology. Thus, the focuses of this project are stated below:-

i.

MATLAB simulation of speed control motor using Fuzzy Logic Toolbox. Comparisons of simulation performance of uncontrolled and controlled speed are examined.

ii.

Design, construct, wiring Panel PLC and Configure I/O card of PLC CJ1G-CPU42P.

iii.

Construct the hardware of revolute control USBM. Consist of motor, inverter, relay and encoder.

iv.

Studies of PLC Programming consist of Cx-Programmer (Version 7.2 ) and Cx-Process (Version 5.1)

v.

Design PLC ladder diagram programming + function block in Cx-process tools with Fuzzy Logic Controller implementation.

CHAPTER 2

LITERATURE REVIEWS

This chapter focused on the literature review for each component in this project. All the component is describe in details based on the finding during completion of this project. This chapter review about the structure of Fuzzy Logic Controller (Mamdani Style and Sugeno Style), Programmable Logic Controller (PLC), Ac Motor, Encoder, High Speed Counter, Inverter and Relay.

2.1

Structure of Fuzzy Logic Controller

There are specific components characteristic of a fuzzy controller to support a design procedure. In the block diagram in Figure 2.1, the controller is between a preprocessing block and a post-processing block. The following explains the diagram block by block. [3]

Figure 2.1: Blocks of Fuzzy Controller

2.1.1 Preprocessing

The inputs are most often hard or crisp measurement from some measuring equipment rather than linguistic. A preprocessor, the first block in Figure 2 shows the conditions the measurements before enter the controller.[3]

2.1.2 Fuzzification

The first block inside the controller is fuzzification as shown in Figure 2.2, the first step is to take the crisp inputs, x1 and y1 (project funding and project staffing), and determine the degree to which these inputs belong to each of the appropriate fuzzy sets.[4]
Crisp Input x1
1 0.5 0.2 0 1 0.7 0.1 0 (y = B1)

Crisp Input y1
A3 B1 B2

A1

A2

x1

y1

= 0.5 (x = A2) = 0.2


(x = A1)

= 0.1 (y = B2) = 0.7

Figure 2.2: Fuzzification 2.1.3 Rule Base Evaluation & Inference Engine

The second step is to take the fuzzified input, (x=A1) = 0.5, (x=A2) = 0.2, (y=B1) = 0.1 and (y=B2) = 0.7, and apply them to the antecedents of the fuzzy rules. If a given fuzzy rule has multiple antecedents, the fuzzy operator (AND or OR) is used to obtain a single number that represents the result of the antecedent evaluation. [4]

To evaluate the disjunction of the rule antecedents, the OR fuzzy operation will use. Typically, fuzzy expert systems make use of the classical fuzzy operation union:

A B(x) = max [ A(x), B(x)]

Similarly, in order to evaluate the conjunction of the rule antecedents, the AND fuzzy operation intersection will apply:

A B(x) = min [ A(x), B(x)

A3
0.0 0 x1 X 0

B1
0.1 y1 Y OR (max) 0.1 0

C1

C2

C3
Z

Rule 1: IF x is A3 (0.0)
1

OR
1

y is B1 (0.1)
0.7

THEN
1 AND (min) Y 0.2 0

z is C1 (0.1)
C1 C2 C3
Z

A2
0 x1 X

0.2 0 y1

B2

Rule 2: IF x is A2 (0.2) AND y is B2 (0.7)


1

THEN

z is C2 (0.2)
1 0.5 C1

A1

0.5

C2

C3

x1

Rule 3: IF x is A1 (0.5)

THEN

z is C3 (0.5)

Figure 2.3: Mamdani-style rule evaluation (Simulation) Sugeno-style fuzzy inference is very similar to the Mamdani method. Sugeno changed only a rule consequent. Instead of a fuzzy set, he used a mathematical function of the input variable. The format of the Sugeno-style fuzzy rule is:

IF x is AND y is B THEN z is f (x, y). [4]

Where x, y and z are linguistic variables A and B is fuzzy sets on universe of discourses X and Y, respectively; and f (x, y) is a mathematical function. The most commonly used zero-order Sugeno fuzzy model applies fuzzy rules in the following form:

Вам также может понравиться