• Tiada Hasil Ditemukan

SLIDING MODE OBSERVER DESIGN FOR SENSOR FAULT DIAGNOSTIC OF A MECHATRONICS SYSTEM

N/A
N/A
Protected

Academic year: 2022

Share "SLIDING MODE OBSERVER DESIGN FOR SENSOR FAULT DIAGNOSTIC OF A MECHATRONICS SYSTEM "

Copied!
91
0
0

Tekspenuh

(1)

SLIDING MODE OBSERVER DESIGN FOR SENSOR FAULT DIAGNOSTIC OF A MECHATRONICS SYSTEM

MUHAMMAD AMIRUL ASYRAF BIN SAIDIN

UNIVERSITI SAINS MALAYSIA

2018

(2)

SLIDING MODE OBSERVER DESIGN FOR SENSOR FAULT DIAGNOSTIC OF A MECHATRONICS SYSTEM

by

MUHAMMAD AMIRUL ASYRAF BIN SAIDIN

Thesis submitted in partial fulfillment of the requirements for the degree of

Bachelor of Engineering (Mechatronic Engineering)

JUNE 2018

(3)

ii

ACKNOWLEDGEMENTS

I am using this opportunity to express my deepest gratitude and acknowledgement to the people who supported me and have been instrumental in the successful completion of this final year project. I am thankful for their aspiring guidance, invaluably constructive criticism and friendly advice during the project works. I am sincerely grateful to them for sharing their truthful and illuminating views on a number of issues related to the project.

Foremost, a special appreciation I give to my final year project supervisor, Dr.

Muhammad Nasiruddin Mahyuddin, whose contribution in stimulating suggestions and encouragement, helped me to coordinate my project especially in writing this thesis. Without his guidance and persistent help, this dissertation would not have been possible. With his assistance and dedicated involvement in every step throughout the process, this paper have been accomplished within the time.

I would also like to acknowledge and gratefully indebted to Dr. Wan Mohd Yusof Rahiman as the second reader of this thesis and my final year project examiner for his very valuable comments on this thesis, insightful information and encouragement. With his help and suggestions, the content of this thesis become more complete and accomplished with some added information about the related works.

A special thanks to my family, my friends and staffs that involved directly or indirectly during the process of my final year project. Words cannot express how grateful I am to my mother and father for all of the sacrifices that you’ve made on my behalf. Your prayer for me was what sustained me thus far. I would also like to thank all of my friends who supported me in writing and incented me to strive towards my goal. The guidance and support received from all the members who contributed and who are contributing to this project, was vital for the success of the project. Finally, I must express my very profound gratitude to the involving staffs, Mr. Amir Bin Hamid, Mr. Azhar Bin Zabidin and Mr.

Aswadi Bin Mohd Desa for providing me the available electrical components and suitable hardware which needed in this project to be accomplished. I am grateful for their constant support and help.

(4)

iii

TABLE OF CONTENTS

ACKNOWLEDGEMENTS LIST OF FIGURES

LIST OF TABLE

LIST OF ABBREVIATIONS LIST OF SYMBOLS

ABSTRAK ABSTRACT

CHAPTER 1 – INTRODUCTION 1.1 Overview

1.2 Motivation

1.3 Problem Statement 1.4 Objectives

1.5 Research Scope 1.6 Thesis Structure

CHAPTER 2 – LITERATURE REVIEW 2.1 Introduction

2.2 Fault detection in dynamical system 2.3 Observer as system fault detection

2.3.1 Linear Observer (Luenberger Observer) 2.3.2 Adaptive Observer

2.3.3 Robust Observer (Sliding-Mode Observer) 2.4 Other fault detection method

2.5 Observer versus other fault detection method 2.6 Summary

ii

vi

ix

x

xi

xii

xiii

1

1

3

4

4

4

5

6

6

6

7

8

10

12

14

17

17

(5)

iv

CHAPTER 3 – METHODOLOGY 3.1 Introduction

3.2 Linear Observer (Luenberger Observer) design 3.2.1 State-Space Model

3.3 Sliding-Mode Observer (Robust Observer) design 3.4 Dynamic Modelling

3.4.1 System Equation 3.4.2 Transfer Function 3.5 Hardware Platform

3.5.1 DC Motor

3.5.1.1 Physical Setup 3.5.2 Encoder

3.5.3 Arduino Mega 2560 3.5.4 L293D Motor Driver IC 3.6 Software Platform

3.6.1 Linear Observer (Luenberger Observer) 3.6.2 Sliding Mode Observer

3.7 Summary

CHAPTER 4 – RESULTS AND DISCUSSION 4.1 Overview

4.2 Response of Linear Observer (Luenberger Observer) design without noise via simulation MATLAB

4.3 Response of Linear Observer (Luenberger Observer) design with noise via simulation MATLAB

4.4 Response of Sliding Mode Observer (Robust Observer) design via simulation MATLAB via simulation MATLAB

18 18 18 20 20 22 23 23 24 24 24 25 27 28 30 30 33 37 38 38

38

42

52

(6)

v

4.5 Response of Sliding Mode Observer (Robust Observer) design via Hardware Demonstration

4.6 Summary

CHAPTER 5 – CONCLUSION 5.1 Conclusion

5.2 Future Works Bibliography

APPENDICES

Appendix A – Linear Observer design via simulation

Appendix B – Sliding Mode Observer design via simulation Appendix C – Sliding Mode MATLAB function design via simulation

Appendix D – Sliding Mode Observer design via hardware demonstration

59 64 65 65 66 67 71 72 73

75

76

(7)

vi

LIST OF FIGURES

Figure 1.1 – Model based fault detection (Mohamadi et al., 2016)………... 3

Figure 2.1 – Role of an observer in a control system (Ellis, 2002b)………. 8

Figure 2.2 – Schematic diagram of observer-based approach for fault detection of DC motor (Eissa et al., 2015)………. 10

Figure 2.3 – MRAS observer structure……….. 11

Figure 2.4 – A typical phase portrait under sliding mode control (Ehsan)……….. 14

Figure 2.5 – Framework of the fuzzy fault detection filter design over network environments (Dong et al., 2012)……… 15

Figure 2.6 – The process of FTA (Hu et al., 2003)……….. 16

Figure 3.1 – Electric equivalent circuit of the armature and the free body diagram of the rotor……… 25

Figure 3.2 – DC geared motor with encoder and its removable cover……… 26

Figure 3.3 – Connector pin of Encoder SPG30E-200K (Bhd., 2016)………. 27

Figure 3.4 – View of Arduino Mega 2560………... 28

Figure 3.5 – L293D pin layout………. 29

Figure 3.6 – Design of Luenberger observer without the present of noise……….. 31

Figure 3.7 – Design of Luenberger observer with the present of noise………... 32

Figure 3.8 – Design of sliding mode observer via simulation………. 34

Figure 3.9 – Design of sliding mode observer via hardware demonstration…………... 35

Figure 3.10 – Hardware demonstration kit……….. 36

Figure 3.11 – Overall schematic circuit connection……… 37

Figure 4.1 – Input signal (square waveform)………... 39

Figure 4.2 – Response of actual position, x2 and estimated position, x2hat (𝑥̂)……... 39 2 Figure 4.3 – Response of actual current, x1……… 40

Figure 4.4 – Response of estimated current, x1hat (𝑥̂)……….. 40 1 Figure 4.5 – Response of actual speed, x3………... 41

Figure 4.6 – Response of estimated speed, x3hat (𝑥̂)……… 41 3 Figure 4.7 – Output position error………... 42

(8)

vii

Figure 4.8 – Input signal (square waveform)………... 43 Figure 4.9 – Input signal (sinusoidal waveform)………. 44 Figure 4.10 – Response of corrupted position, x2 and estimated position, x2hat (𝑥̂) 2

(based on square waveform input signal)……… 45 Figure 4.11 – Response of actual position (based on square waveform input signal)…. 45 Figure 4.12 – Response of corrupted position, x2 and estimated position, x2hat (𝑥̂) 2

(based on sinusoidal waveform input signal)……….. 46 Figure 4.13 – Response of actual position (based on sinusoidal waveform input

signal)………... 46

Figure 4.14 – Response of actual current, x1 (based on square waveform input signal) 47 Figure 4.15 – Response of estimated current, x1hat (𝑥̂) (based on square waveform 1

input signal)………. 47

Figure 4.16 – Response of actual current, x1 (based on sinusoidal waveform input

signal)………... 48

Figure 4.17 – Response of estimated current, x1hat (𝑥̂) (based on sinusoidal 1

waveform input signal)……… 48

Figure 4.18 – Response of actual speed, x3 (based on square waveform input signal).. 49 Figure 4.19 – Response of estimated speed, x3hat (𝑥̂) (based on square waveform 3

input signal)………. 49

Figure 4.20 – Response of actual speed, x3 (based on sinusoidal waveform input

signal)………... 50

Figure 4.21 – Response of estimated speed, x3hat (𝑥̂) (based on sinusoidal waveform 3

input signal)………. 50

Figure 4.22 – Output position error (based on square waveform input signal)………... 51 Figure 4.23 – Output position error (based on sinusoidal waveform input signal)……. 51 Figure 4.24 – Input signal……… 52 Figure 4.25 – Response of actual position………... 53 Figure 4.26 – Response of corrupted position………. 53 Figure 4.27 – Response of estimated position vs corrupted position (at  = 5)……….. 54 Figure 4.28 – Response of estimated position vs corrupted position (at  = 5) for

zoom in image between 4 second until 5 second………. 54

(9)

viii

Figure 4.29 – Response of estimated position vs corrupted position (at  = 200)…….. 55

Figure 4.30 – Response of estimated position vs corrupted position (at  = 200) for zoom in image between 4 second until 5.1 second……….. 55

Figure 4.31 – Output position error using  = 5……….. 56

Figure 4.32 – Output position error using  = 200……….. 56

Figure 4.33 – Response of actual position………... 59

Figure 4.34 – Response of corrupted position (added with noise)…………... 60

Figure 4.35: Response of estimated position using sliding mode observer design toward corrupted position……… 60

(10)

ix

LIST OF TABLE

Table 3.1 – Physical parameters of DC motor………. 25 Table 3.2 – Connector pin description of Encoder SPG30E-200K……….. 27 Table 3.3 – L293D pin description………... 29 Table 4.1 – Result and observation of IAE with the different values of  and P2... 57 Table 4.2 – Result and observation of IAE with the different values of  and

fixed value of A22s (always on)………... 61 Table 4.3 – Result and observation of IAE with the different values of  and

fixed value of A22s (on-off)………. 63

(11)

x

LIST OF ABBREVIATIONS

emf Electromotive force

DC Direct Current

IAE Integral Analysis Error

Hz Hertz

CPS Cyber-physical system

MRAS Model Reference Adaptive System

T-S Takagi-Sugeno

FTA Fault tree analysis FEM Finite element method AI Artificial intelligence

(12)

xi

LIST OF SYMBOLS

T Torque

Kt Motor torque constant

i Armature current

e Back emf

Ke Electromotive force constant

̇ Angular speed

J Moment of inertia of rotor

̈ Angular acceleration

b Motor viscous friction constant

K Motor torque constant and electromotive force constant L Electric inductance

R Armature resistance

v Voltage

 Angular position

 Ohm

s Laplace variable

sgn(.) Signum function

 Real numbers

𝑛×𝑚 Set of real matrices with n rows and m columns

(13)

xii

REKA BENTUK PEMERHATI ‘SLIDING-MODE’ UNTUK DIAGNOSTIK SENSOR YANG RALAT DALAM SISTEM

MEKATRONIK ABSTRAK

Pengesanan ralat memainkan peranan yang penting dalam bidang pembuatan kerana dapat membantu pengusaha untuk mengesan sistem yang ralat lebih awal sebelum memberikan kesan pada keseluruhan proses. Pengesanan dan pampasan adalah lebih penting dalam sistem yang saling berkaitan, contohnya manipulator pelbagai robot digunakan untuk melaksanakan tugas kerjasama. Keterhubungan dalam sistem yang bermaksud setiap subsistem bergantung antara satu sama lain untuk melakukan tugasan yang diberikan, sistem anggaran harus digunakan yang dapat membantu untuk menganggarkan kesihatan keadaan subsistem. Dalam projek ini, pemerhati lurus dipelajari pada mulanya dan disimulasikan di bawah keadaan maklum balas pengekod yang tidak bagus. Kajian ini diperluaskan kepada perumusan bukan lurus yang teguh menggunakan teori ‘Sliding Mode’. Model keadaan ruang mewakili dinamik motor DC yang dikaji menukar terlebih dahulu menjadi bentuk kanonik nominal sebelum pemerhati tidak lurus yang teguh direka. Jenis ralat yang diperkenalkan terhadap maklum balas sensor pengekod adalah dalam bentuk Gaussian putih yang tidak bagus (dibatasi). Simulasi pemerhati bukan lurus yang teguh dalam membina semula maklum balas sensor yang ralat membaca semula terhadap kejayaan penumpuan kepada nilai kedudukan yang sebenar. Ini diteruskan dengan sokongan daripada eksperimen dengan menggunakan motor DC yang sebenar yang dilengkapi dengan pengekod. Ralat diperkenalkan melalui konsep perkakasan dalam gelung menggunakan set blok Simulink.

(14)

xiii

SLIDING-MODE OBSERVER DESIGN FOR SENSOR FAULT DIAGNOSTIC OF A MECHATRONICS SYSTEM

ABSTRACT

Fault detection plays an important role in the manufacturing area as it can help the manufacturer to detect the faulty system earlier before it can affect the overall processes.

Fault detection and compensation are even more crucial in an interconnected system, giving an examples of multi-robot manipulators are employed to perform cooperative task.

Interconnectedness within the system which means each subsystem is depend on each other in order to do the task given, an estimation system must be deployed which can help to estimate the health of subsystem condition. In this project, a linear observer is studied at first and simulated under a noisy encoder feedback scenario. The study is further extended to the formulation of robust nonlinear observer utilizing the theory of sliding mode. The state-space model representing the dynamic of the studied DC motor is transformed first into a nominal canonical form before the robust nonlinear observer is designed. The fault type introduced in an encoder sensor feedback is in a form of white Gaussian noise (bounded). Simulation of the robust nonlinear observer in reconstructing the corrupted sensor feedback rereads the successful convergence to the true position value. This is further supported by experimentation using the real DC motor which is equipped with an encoder. The fault is introduced via hardware-in-the-loop concept using Simulink block set.

(15)

1

CHAPTER 1

INTRODUCTION

1.1 Overview

Nowadays, the Industry 4.0 is widely regarded as the latest industry that took a place into most of industry as well as play an important role to keep track with the current technology to create an efficient system and produce a product which fulfill the customer needs. The word Industry 4.0 refer to the fourth industrial revolution. In the context of Industry 4.0, an intelligent manufacturing took place as it has the ability to create a cyber twin of the physical system, monitor physical processes, and the decisions are decided through real-time communication and cooperation with humans, machines and others (Zhong et al., 2017).

Thus, the Industry 4.0 can be further explored through the Smart Product, the Smart Machine and the Augmented Operator (Mrugalska and Wyrwicka, 2017). By implementing Industry 4.0 in manufacturing process, many advantages over disadvantages had accomplished. Although it is popular among industry, the Industry 4.0 is still a comparatively new method of managing production process and there might be an error or new types of risks will occur due to some more complex part that already installed into their system (Tupa et al., 2017). In order to achieve better process efficiency, every aspect that can be influenced need to be considered and looked carefully. Moreover, a highly flexible production model and digital products or services had been constructed within Industry 4.0 as it interact between people, products and machines during the manufacturing and production process (Zhou et al., 2015).

In the context of Industry 4.0, an operation system is controlled via cyber-physical system (CPS) in a network where human supervision is least required. Thus, the total cost and amount can be reduced as it will be supported and controlled by computer-based interconnection of machines and components that will automatically operate the system based on the predetermined instructions (Marcon et al., 2017). Directly or indirectly, the

(16)

2

productivity of manufacturing industry will increase and will be a further boost to the working environment around the workers.

In order to make sure the production lines run continuously and working without any error, we need to make sure the condition or healthy of the subsystem are in a good condition. This is to prevent any further problem that will affect the whole system because it is consist of a network of several system or called interconnectedness between each subsystem. If one of the subsystem breakdown, another subsystem must be disrupted or delayed or even at critical condition, it need to be stopped. The alternative way to prevent from this happen, we need a mechanism that can detect the problem faced during the production lines and thereby, the problem can be resolved during the time of low production.

Therefore, we need an estimation system that can estimate the health of the subsystem. By employing a state-of-the-art control strategy. A state observer can be introduced and implemented to reconstruct the states of the system. At the same time, the condition of any subsystem can be known whether they are healthy or vice versa by performing state observation. An observers are algorithms that combine sensed signals with other knowledge of control system to produce observed signal which can be used to replace sensors in a control system (Ellis, 2002a). It is also defined as a dynamic system that is used to estimate the state of a system or some of the states of a system. Its purpose is to generate an estimate of the state based on measurement of a system output and system input which input and output of signal are assumed to be exactly measurable.

Hence, a state estimator or an observer can be designed to identify and detect the fault in a system by providing an estimated output which is then compared with the measured output and evaluated with a decision making algorithm (Mohamadi et al., 2016). This can be explained by looking to Figure 1.1.

(17)

3

Figure 1.1 – Model based fault detection (Mohamadi et al., 2016)

1.2 Motivation

To illustrate the concept of an observer in this project, DC motor is to be used as a platform. DC motor is regarded as a commonly actuator widely used in control applications for most industry today. As many industrial involving automation growing rapidly, the use of a machine that involving mechanical and electrical part must be widely used especially the use of DC motor which it is been use in the machine or a system to rotate or move something from one position to another position. High performance is usually demanded of dc drives. Thus, DC motor is a suitable to be investigated that act as actuator.

The actuator is actually a moving component or power device that produces the input to the plant according to the control signal that will affect the output signal to approach the reference input signal (Ogata, 2009). Together, the encoder will include in the system that act as a sensor because all industries used the encoders in machinery for motion feedback and motion control. Sometimes, if the motor running at higher speed or at a longer time, the performance of the motor maybe can be reduced or any worst case the motor can be damage. Then, a new control techniques and design approaches need to be discovered to overcome that problem so that the failing subsystem can be detect early while the overall system stability and performance can be maintain (Khosravani et al., 2011).

(18)

4

Generally, control systems are susceptible to various failure caused by actuators, sensors and unpredictable parameter that are changing in the system (Lina and Hong, 2005). For this reason, research into fault diagnosis and fault-tolerant control are being implemented for many years (Ren et al., 2015). Thus, a sliding mode observer is an alternative way to diagnosis or estimate the problem and the failure of system.

1.3 Problem Statement

In the era of Industry 4.0, fault detection in a networking system in a factory will be a challenging problem (Roth et al., 2012). Fault needs to be accurately detected through estimation so that corrective actions can be taken precisely (Zhu et al., 2016). Next, an estimation should be accomplished in a fast manner to avoid prolonged in a down-time which may affect the productivity and the whole process (Menon and Edwards, 2014, Gao et al., 2015). The conventional estimation algorithm may be lacking in terms of estimation speed and its robustness.

1.4 Objectives

 To design a sliding mode observer to detect sensor fault in a DC motor with an encoder.

 To analyze the output feedback from a DC motor with an encoder.

 To develop numerical simulation and hardware demonstration kit to illustrate the fault-detection feature at sensor part.

1.5 Research Scope

This research work will concern on designing a sliding mode observer which estimates fault on sensor part which consisting of DC motor with an encoder that act as a sensor. Then, it will consist of two main part which are from software and hardware.

On software via MATLAB, an observer is design using Simulink by applying state-space equation into the system and get the result based on simulation. While, for hardware part,

(19)

5

we implement the real application using DC motor with an encoder and make a connection with the software part to test the fault detection functionality.

1.6 Thesis Structure

This thesis consists a total of 5 chapters. Chapter 1 is the introduction of the project.

It contains the overview, motivation, problem statement, objectives and research scope.

For Chapter 2, the previous result done by other researchers are presents. The fault detection in dynamical system is reviewed as it plays a main task for this project. The concept of an observer as a system fault detection is studied in this project through the uses of different types of observer which focusses on three major observer which are linear observer, an adaptive observer and sliding mode observer. Besides that, other fault detection method is studied and investigated. Then, the observer versus other fault detection method is also reviewed.

In Chapter 3, the methodology used to accomplish this project is explained. The design for linear observer is explained through the state-space model. The sliding mode observer design is also explained in detail. The system equation and transfer function for DC motor is described in dynamic modelling. The implementation of hardware platform and software platform will be explained via this chapter.

Chapter 4 which focusses on the several test that have be done using the design or method of linear observer and sliding mode observer by using the simulation via MATLAB software. This chapter begin with the test of using the method of linear observer which implement the noise signal or without noise signal present in the system.

This chapter is continued with the test of sliding mode observer method which implement in the noise present within the system. Then, by using a method of sliding mode observer, the model consisting of DC motor with an encoder is tested and demonstrate in real time to illustrate the sensor fault detection feature. All the testing results are discussed. Most of the results are displayed in the graph.

Chapter 5 is conclusion of this project. This chapter consist of overall deduction of this project, future recommendations and proposition to improve this project. The achievement of this project is also discussed and stated.

(20)

6

CHAPTER 2

LITERATURE REVIEW

2.1 Introduction

This chapter will review work on fault detection as well as designing an observer to estimate the faulty system. This will further covering the fault detection in dynamical system which will be explain in section 2.2. While in section 2.3, the topic on an observer as system fault detector is discovered and reviewed. Together with linear observer (Luenberger observer), adaptive observer and robust observer (sliding mode observer) are discuss in subsection 2.3.1, 2.3.2 and 2.3.3 respectively. In addition, other fault detection method also be discovered in section 2.4. The most exciting and important section will be reviewed and discussed in section 2.5 which the content is covered about an observer versus other fault detection method. Finally, a quick recap for this chapter will be present in section 2.6.

2.2 Fault detection in dynamical system

The term of dynamical system refers to the big area including mechatronic, manufacturing, automotive system and others. As its application has taken place in industry, the information exchange has occurred and connected via a network in order to get the things become easily handled and save the times (Menon and Edwards, 2014).

Due to the advanced technology and its design become more complex and hard to understand, the fault in the system may occur during the production line which is needed to overcome as it will affect the whole process and system.

A fault is simply defined as malfunction, unusual deviation of at least one criteria of its parameter or property which interrupt the control action and leading to system performance degradation (Gao et al., 2015). Sometimes, the word fault and failure looked the same but the meaning is different. We can differentiate this as the system failure are caused by the fault of the subsystem or machine due to its different reading from normal

(21)

7

condition (Eissa et al., 2015). To improve the whole system working operation, the fault detection process is needed to avoid something bad happen and can be prevent from any worst cases.

Consequently, fault detection is important to be include and implement in the process to identify if there is a fault. Basically, there are three methods of fault diagnosis that can be explored which are knowledge-based methods, model-based methods and signal- based methods but the model-based methods had become more useful and popular among three of them as it have been intensively investigated (Wang et al., 2014). To implement model-based methods, mathematical models based on first principle is used as describing normal operating conditions of machines.

2.3 Observer as system fault detection

Generally, fault detection has several significant methods that are based on traditional observer. The observers are design in order to estimate both states and faults. The basics idea about an observer are a dynamic system used to estimate the outputs of the system from the measurements based on measurable system input and output which lead to state observer (Heredia and Ollero, 2009, Lee et al., 2018, Sellami, 2014). This will include a measured feedback signal combining with a mainly the plant followed by the feedback system (Ellis, 2002b). This can be explained by looking to the block diagram as shown in Figure 2.1 below.

(22)

8

Figure 2.1 – Role of an observer in a control system (Ellis, 2002b)

Thus, the design an observer is based on the estimation process with can be referred to the measured feedback signal with the knowledge of the control system elements. By using the estimation process through model-based methods which are using the mathematical models, the observer can be constructed. But, with the arising issues involving unknown external noises and disturbances that are exist in unpredictable time and surrounding area, the design of control law within the closed loop system will be difficult to build that provide the desired performance. This can lead to several design of observer that will further discussed within next three subsection.

2.3.1 Linear Observer (Luenberger Observer)

Observers have been first designed based on linear system which known as linear observers that used to estimate unknown variable and states in a linear process with the presence of noise or disturbance. To describe the observer equation, the state-space representation is commonly use and the measurement equation is also included in applying a linear model-based observer. Note that the sensitivity of the estimation will be determined by looking to the number of measured variables (Mohd Ali et al., 2015).

The main advantage of conventional linear observers is that the structure is simple and not too complex. Luenberger observers is introduced by the Luenberger who is

(23)

9

started the theory of observers that state an observer can be used as long as there is any system driven by the output of given system (Radisavljevic-Gajic, 2014). The main concepts for the Luenberger observer consist of predictor which is a copy of the system is formed and the corrector which indicate the wrong portion in the estimation that is added into the model (Eissa et al., 2015). By considering linear dynamic system,

𝑥̇(𝑡) = 𝐴𝑥(𝑡) + 𝐵𝑢(𝑡) (2.1) 𝑥(𝑡0) = 𝑥0 = 𝑢𝑛𝑘𝑛𝑜𝑤𝑛 (2.2) 𝑦(𝑡) = 𝐶𝑥(𝑡) (2.3) where A,B,C are state, input and output matrices that have an appropriate dimensions, and 𝑥(𝑡), 𝑢(𝑡) and 𝑦(𝑡) are the input, state and output vector respectively. The system output variables are available at all times. The dot over a variable refers to the time derivative of the variable. By letting 𝑥̂ denote the state estimates

𝑥̂̇ = 𝐴𝑥̂ + 𝐵𝑢 (2.4) 𝑥̂(𝑡0) = 𝑥̂0 (2.5) 𝑦̂(𝑡) = 𝐶𝑥̂(𝑡) (2.6) As a result, Luenberger observer equations become as the following

𝑥̂̇(𝑡) = 𝐴𝑥̂(𝑡) + 𝐵𝑢(𝑡) + 𝐿(𝑦 − 𝐶𝑥̂(𝑡)) (2.7) From the above equation (2.1) and (2.7), the error can be estimate by using the following formula

𝑒(𝑡) = 𝑥(𝑡) − 𝑥̂(𝑡) (2.8) 𝑒̇(𝑡) = 𝑥̇(𝑡) − 𝑥̂̇(𝑡) (2.9) 𝑒̇(𝑡) = (𝐴 − 𝐿𝐶)𝑒(𝑡) (2.10) So that the error will decrease over time when using this Luenberger observer. The Figure 2.2 will illustrate on how the process of Luenberger observer will take place in the control system to estimates the state of the output of the system.

(24)

10

Figure 2.2 – Schematic diagram of observer-based approach for fault detection of DC motor (Eissa et al., 2015)

2.3.2 Adaptive Observer

Adaptive observers design for a linear class of dynamic systems receive considerable attention over the past few years as it been developing in the most of areas of control system theory field. Particularly, adaptive observers design method are based on time- varying system class (Karabutov, 2018). Adaptive observers have the ability of estimating the state with the presence of a disturbance in the system. Unknown parameters that exist in the system is modeled as a function which reflect the disturbance (Rueda-Escobedo and Moreno, 2017). Adaptive observers are widely applied in solving of different state reconstruction problems.

The conventional adaptive observer is constructed and designed as follow

𝑥̂̇(𝑡) = 𝐴𝑥̂(𝑡) + 𝐵𝑢(𝑡) + 𝐸𝑓̂(𝑡) − 𝐿(𝑦̂(𝑡) − 𝑦(𝑡)) (2.11) 𝑦̂(𝑡) = 𝐶𝑥̂(𝑡) (2.12) where 𝑥̂(𝑡) ∈ 𝑅𝑛 is the observer state vector, 𝑦̂(𝑡) ∈ 𝑅𝑝 is the observer output vector and 𝑓̂(𝑡) ∈ 𝑅𝑟 is an estimation of actuator fault, 𝑓(𝑡). Whilst A, B, C and E are known

(25)

11

constant real matrices of appropriate dimensions, and the matrix E is of full column rank and the pair (A,C) is observable. Since the pair (A,C) is observable, the observer gain matrix, L can be selected such that (𝐴 − 𝐿𝐶) is a stable matrix.

Thus, the error dynamics can be estimated by using the basic formula stated in (2.8) and (2.9) as the following

𝑒𝑥(𝑡) = 𝑥̂(𝑡) − 𝑥(𝑡) (2.13) 𝑒̇(𝑡) = 𝑥̇(𝑡) − 𝑥̂̇(𝑡) (2.14) 𝑒𝑓(𝑡) = 𝑓̂(𝑡) − 𝑓(𝑡) (2.15) 𝑒̇(𝑡) = (𝐴 − 𝐿𝐶)𝑒𝑥(𝑡) + 𝐸𝑒𝑓(𝑡) (2.16) 𝑒𝑦(𝑡) = 𝐶𝑒𝑥(𝑡) (2.17) As a result, adaptive observer can be designed by using the obtained fault information to eliminate the fault (Zhang et al., 2008). The overview of Model Reference Adaptive System (MRAS) structure can be shown in the Figure 2.3 below.

Figure 2.3 – MRAS observer structure

(26)

12

2.3.3 Robust Observer (Sliding Mode Observer)

Sliding mode control is an alternative for making the system more robust with relatively fast transients and attenuate the oscillations. There is a discontinuous function that force the behavior of the system to the sliding surface. The design of sliding mode observer that is not complex but its functional is helpful and effectual make this method is applicable and employed in considerable applications (Zhang and Wang, 2016).

Another element of the sliding mode theory is that the time convergence is finite as well as the accuracy is high which attribute to the robust state estimation. The high gain is needed in sliding mode to make sure the trajectories is reach in finite time which is currently in the presence of unknown inputs and faults. Sliding manifold, S refers to a domain which are initially driven in a finite time or reachability phase and maintained the sliding phase within the closed-loop system dynamics but with a controlled of sliding action. The system needs to be asymptotically stable while on the sliding manifold which the sliding is needed to push the variable towards zero in a finite time. Thus, at the same time the sequential convergence of observation errors tends to converge to zero (Sharma and Aldeen, 2011).

The gain in sliding mode is designed according to the output of the system such that the error is stable in the reaching phase. Most analyses of sliding mode gains are referred to Lyapunov approach which related to the stability of the error dynamics. When the sliding mode is maintained and sliding surface is approached, the system behavior will be alike to that of a reduced-order system. A non-linear system is assumed as follows

𝑥̇ = 𝐴𝑥 +(𝑥, 𝑢) + 𝐸(𝑥, 𝑢)𝑓(𝑡) (2.18)

𝑦 = 𝐶𝑥 (2.19)

where 𝐴 ∈ 𝑅𝑛×𝑛, 𝐶 ∈ 𝑅𝑝×𝑛 with 𝑚 < 𝑝 ≤ 𝑛, 𝑥 ∈ 𝑀 𝑅𝑛 is the state vector, 𝑢 ∈ 𝑈 𝑅𝑞 (𝑈 is an admissible control set) are the bounded control inputs, 𝑦 ∈ 𝑌 𝑅𝑝 (𝑌 is the output space) are the system outputs, the unknown functions

𝑓(𝑡) = [𝑓1(𝑡) 𝑓2(𝑡) … 𝑓𝑚(𝑡)] ∈ 𝑅𝑚

(27)

13

are the faults or unknown inputs and are assumed to be bounded as ‖𝑓(𝑡)‖ ≤ 𝑓̅,(𝑥, 𝑢) is a real valued vector field on 𝑅𝑛+𝑞 and 𝐸(𝑥, 𝑢) is an 𝑛 × 𝑚–matrix with real value functions on 𝑅𝑛+𝑞.

The observability and controllability test must be performed first before commencing the sliding mode observer design. After those test is satisfy, an observer of the following form can be designed to estimate the states

𝑥̂̇(𝑡) = 𝐴𝑥̂ +(𝑥̂, 𝑢) + 𝐿(𝑦 − 𝐶𝑥̂) + 𝐸(𝑥̂, 𝑢)𝑣(𝑡) (2.20) where 𝐿 is the feedback gain and 𝑣(𝑡) is the robust term given by the sliding mode estimation

𝑣(𝑡) = −(𝐶1𝐸(𝑥̂, 𝑢))−1(. )𝑠𝑖𝑔𝑛(𝐶1𝑥̂ − 𝐶1𝑥) (2.21) where (.) is a positive scalar function to be determined.

Based on the basic formula stated in (2.8) and (2.9) before, the estimation of error dynamics can be deduced as

𝑒̇ = (𝐴 − 𝐿𝐶)𝑒 +(𝑥̂, 𝑢) −(𝑥, 𝑢) + 𝐸(𝑥̂, 𝑢)𝑣(𝑡) − 𝐸(𝑥, 𝑢)𝑓(𝑡) (2.22) As the non-linear matrix 𝐸(. ) and faults 𝑓(𝑡) are bounded, the boundedness of the error dynamics can be set with a proper selection of feedback gain, 𝐿 by referred to theory of Lyapunov (Veluvolu and Soh, 2011).

(28)

14

Figure 2.4 – A typical phase portrait under sliding mode control (Ehsan)

2.4 Other fault detection method

Others than Luenberger observer, adaptive observer and sliding mode observer that had been discussed on previous section, there are some approaches that can be used to detect the faulty system or subsystem. One of the method is via Takagi-Sugeno (T-S) fuzzy models. This fuzzy system is capable in approximating any smooth non-linear systems to any specified accuracy within any compact set through fuzzy membership functions of local linear models. Many complex nonlinear system can be considered based on this local linearity through T-S fuzzy models. Simple view about this fuzzy model can be illustrated in the Figure 2.5 below. The concept is same which the dynamic system whose contain the information of physical plant is constructed in which the residual signal is generated in order to decide if the fault is occurred or not. The process involved consist of two main things. First, a residual signal, r(k) is generated and the filter is designed to make the overall fault detection system is exponentially mean square stable with the following auxiliary H performance constraint with zero initial condition.

(29)

15

Second, the fault detection is measure with adoption of a residual evaluation stage (Dong et al., 2012).

Figure 2.5 – Framework of the fuzzy fault detection filter design over network environments (Dong et al., 2012)

There is another fault detection method which are using fault tree analysis (FTA).

This method has been practically used in many applications which involves complex diagnostic such as flight control system and spacecraft propulsion system. FTA is the shortest way to find a fault or diagnosis a fault in a complex machinery. There are several process involve in FTA in order to do the fault diagnosis. This can be referred to Figure 2.6 below which lists the process from beginning to the final stage. FTA is a fault diagnosis approach that implements to detect the causes of the system failure via hierarchy from the system level to part stages. This method is selected in the field of manufacturing system as it analyses a specific fault level by level, indicating a system fault which is related to which parts according to the fault tree. Such approach allow designers to be certain of the fault modes and success modes of the system through qualitative analysis of fault trees of a system (Hu et al., 2003).

(30)

16

Figure 2.6 – The process of FTA (Hu et al., 2003)

Actually, there are others fault detection methods besides those two aforementioned above which can be simplified into a few categories which are classical method, wavelet transform and finite element method (FEM), artificial intelligence (AI) techniques and numerical and experimental techniques. These categories, proposed by (Thatoi et al., 2012) are used for fault diagnosis which specify cracked structures and condition monitoring of machines and structural systems. Besides that, there is another method that is presented by Pandalai and Halloway (2000) which depends on the basis of event order and timed behavior of a system. Condition template is used instead of state estimation within this method which analyses the system by creating events with the right order or in the given time delays. Should there be anything wrong about its reaction in the process, a fault can be preemptively detected (Roth et al., 2012).

(31)

17

2.5 Observer versus other fault detection method

Each of the method has their own advantages and disadvantages but their main purpose is to determine and give the signal if the fault occur anywhere in the system (Gertler, 2015). We can estimate when the system is defined as a faulty system and make a preparation to overcome that problems. But, their approaches to detect the fault of the system are not the same like an observer that use a state equation by considering a dynamic system (Eissa et al., 2015, Zhang et al., 2008, Veluvolu and Soh, 2011) and fault free analysis (FTA) use several stages including algorithm (Hu et al., 2003).

2.6 Summary

In order to avoid some system from becoming faulty condition, another approach need to be taken and implemented in the system. Based on the investigated literature review, the important of fault detection has attracted many researchers to find alternative method to solve this problem as it will affect the performance of the whole system. Hence, the observer method has been introduced to be designed as it suitable in fault detection in a dynamical system. As mentioned before, linear observer is useful when involving the linear system and without having the presence of disturbance and noise in the system.

While, adaptive observer is to be employed whether the class of the system is linear or nonlinear and can adapt with the estimation of the state even though in the presence of disturbance that exist in the system. For sliding mode observer, it is more robust and fast to reconstruct back the signal.

(32)

18

CHAPTER 3

METHODOLOGY

3.1 Introduction

In this chapter, the method use for fault detection will be explained through its design which included linear observer and sliding mode observer that tested via simulation for both method and via hardware for sliding mode observer only. In the beginning, the design of linear observer (Luenberger observer) will be discussed in section 3.2. This will be followed by the design of sliding mode observer which discussed in section 3.3. The dynamic modelling of DC motor will be presented in section 3.4. The hardware part which covered the DC motor, a concept of an encoder, the selection of Arduino Mega 2560 and L293D motor driver IC will be discussed in section 3.5. For the software part, it will cover on design of linear observer (Luenberger observer) via simulation and sliding mode observer via simulation and experimental which will be represented in section 3.6.

3.2 Linear Observer (Luenberger Observer) design

Through this project, the system was ran into two different environment which consist of the system with a noise present and without the present of noise within the system.

For the system without the present of noise, consider the system is described by 𝑥̇(𝑡) = 𝐴𝑥(𝑡) + 𝐵𝑢(𝑡) (3.1) 𝑦(𝑡) = 𝐶𝑥(𝑡) (3.2) with the input 𝑢(𝑡) ∈ 𝑟, the state 𝑥(𝑡) ∈𝑛 and the output 𝑦(𝑡) ∈𝑚 where  denotes the real number of vector and 𝐴 ∈𝑛×𝑛, 𝐵 ∈ 𝑛×𝑟 and 𝐶 ∈𝑚×𝑛 is in the matrices form of actual plant.

While, for the system with the present of noise, the equation (3.2) above will become as follow:

𝑦(𝑡) = 𝐶𝑥(𝑡) + 𝑁𝑜(𝑡) (3.3)

(33)

19

where 𝑁0 is present as external noise (Band-Limited White Noise via Simulink MATLAB software platform). The reason this external noise is put on the output equation is because of the objective of this project which want to detect the fault at the output (sensor) only. So, by doing this, the external noise will affect the output reading from the sensor itself which for this project, an encoder is used to read the position value and will produce the corrupted position reading.

The Luenberger observer is designed as follows

𝑥̂̇(𝑡) = 𝐴𝑥̂(𝑡) + 𝐵𝑢(𝑡) + 𝐿[𝑦(𝑡) − 𝐶𝑥̂(𝑡)] (3.4) 𝑦̂(𝑡) = 𝐶𝑥̂(𝑡) (3.5) where 𝑥̂ and 𝑦̂ are the estimated system state and output respectively. L is refer to the observer gain which is designed to provide the required performance of the observer. To solve the observer gain, L, the ackermann’s rule is implemented.

For the state estimation error, 𝑒̇ can be calculated as

𝑒(𝑡) = 𝑥(𝑡) − 𝑥̂(𝑡) (3.6) 𝑒̇(𝑡) = 𝑥̇(𝑡) − 𝑥̂̇(𝑡) = (𝐴 − 𝐿𝐶)𝑒(𝑡) (3.7) Now, choose the value of L such that the eigenvalues of (𝐴 − 𝐿𝐶) can be arbitrarily placed in the complex plane which guarantees the observer errors to converge to zero for any initial conditions. But, the state equation must be controllable and observable. This can be test via controllability test and observability test. Observability is the ability to place the eigenvalues of (𝐴 − 𝐿𝐶) arbitrarily by using L. The observability matrix, 𝑂 is defined as

𝑂 = [

𝐶 𝐶𝐴 𝐶𝐴2

..

. 𝐶𝐴𝑛−1]

If the rank is equal to dimension of the A matrix, the system is observable.

Controllability matrix C remains the same and replace 𝐴 with A and 𝐵 with C to get 𝑂.

This can be easily done with using MATLAB command to get both observability and controllability which are obsv(A,C) and ctrb(A,B) respectively. From here, the gain, L is

(34)

20

identified which using MATLAB command L=acker (𝐴, 𝐶, 𝑝𝑒) which pe is referred to the vector of desired poles.

3.2.1 State-Space Model

In the state-space form, the current, i, the angular position,  and the angular speed,

̇ is chosen as the state variables. The armature voltage is selected as the input while the angular position is chosen as the output. The dynamic equations in state-space form are as the following

𝑑 𝑑𝑡[

𝑖

̇ ] = [

−𝑅/𝐿 0 −𝐾𝑒/𝐿

0 0 1

𝐾𝑒/𝐽 0 −𝑏/𝐽 ] [

𝑖

̇ ] + [ 1/𝐿

0 0

] 𝑉

𝑦 = [0 1 0] [

𝑖

̇ ]

Based on equation (3.8) and (3.9), the A, B, C and D matrices can be determined and stated as follows

𝐴 = [

−𝑅/𝐿 0 −𝐾𝑒/𝐿

0 0 1

𝐾𝑒/𝐽 0 −𝑏/𝐽 ]

𝐵 = [ 1/𝐿

0 0

] 𝐶 = [0 1 0]

𝐷 = 0

The value of 1 on C matrix is indicated that the output will give the reading of angular position because of the selected encoder that attached together with DC motor is reading the position value.

3.3 Sliding Mode Observer (Robust Observer) design

A robust observer is to be design to detect faults of the encoder attaches to a DC motor which is the actuator of the robot arm.

(35)

21

Let the state-space representation of the DC motor be define as follows:

𝑥̇(𝑡) = 𝐴𝑥(𝑡) + 𝐵𝑢(𝑡) (3.8)

𝑦(𝑡) = 𝐶𝑥(𝑡) (3.9)

where A ∈  n x n system matrix, x ∈  n system state, B ∈  n x m input matrix, u ∈  m control input signal, y ∈  p x n output of the system and C ∈  p x n.

To allow the output of the system be transformed as system state components, a change of coordinates ought to be done. Let,

𝑇𝑐 = [𝑁𝑐𝑇 𝐶 ] = [

−1 0 0

0 0 1

0 1 0

] (3.10)

where Nc ∈  n x (n-p) span the null space of C. Therefore, the resulting nonsingular transformation matrix for the output,

𝐶𝑇𝑐−1= [0 𝐼𝑝] = [0 0 1]

The subsequent transformation imposed on the system matrix and input matrix can be defined as follows:

𝑇𝑐𝐴𝑐𝑇−1= [𝐴11 𝐴12

𝐴21 𝐴22] and 𝑇𝑐𝐵 = [𝐵1

𝐵2] (3.11) where 𝐴11 = 1 × 103[ −1 0.1

−0.02 0 ] ; 𝐴12= [0

0] ; 𝐴21= [0 1]; 𝐴22= [0] and 𝐵1 = [−1000

0 ] ; 𝐵2 = [0]

Now, we are able to pursue for the robust observer design using the following transformed nominal system,

𝑥1̇ (𝑡) = 𝐴11𝑥1(𝑡) + 𝐴12𝑦(𝑡) + 𝐵1𝑢(𝑡) (3.12) 𝑦̇(𝑡) = 𝐴21𝑥1(𝑡) + 𝐴22𝑦(𝑡) + 𝐵2𝑢(𝑡) (3.13) Noting that, 𝑇𝑐𝑥 = [𝑥1 𝑦]𝑇

(36)

22

But, when there is a faults present in the output which refer to encoder position reading, the linear system is considered as

𝑥̇(𝑡) = 𝐴𝑥(𝑡) + 𝐵𝑢(𝑡) (3.14) 𝑦(𝑡) = 𝐶𝑥(𝑡) + 𝑓𝑜(𝑡) (3.15) where 𝑓𝑜(𝑡) is deemed to represent sensor faults (encoder faults for this project).

To synthesise an observer to generate a state estimate 𝑥̂(𝑡), the sliding mode is established in which the output error is forced to zero in finite time.

𝑒𝑦(𝑡) = 𝑦̂(𝑡) − 𝑦(𝑡) (3.16) Then, the sliding mode observer structure is

𝑥̂̇(𝑡) = 𝐴𝑥̂(𝑡) + 𝐵𝑢(𝑡) − 𝐺𝑙𝑒𝑦(𝑡) + 𝐺𝑛𝑣 (3.17) 𝑦̂(𝑡) = 𝑥̂(𝑡) (3.18) where the linear gain

𝐺𝑙 = 𝑇𝑐−1[ 𝐴12

𝐴22− 𝐴22𝑠 ] (3.19)

the nonlinear gain

𝐺𝑛 = 𝑇𝑐−1[0

𝐼𝑝] (3.20)

the discontinuous vector

𝑣 = − 𝑃2𝑒𝑦

0.01+‖𝑃2𝑒𝑦 (3.21) and 𝐴22𝑠 is a stable design matrix,  is scalar function and P2 ∈ ℜ𝑝×𝑝 is symmetric positive definite Lyapunov matrix for 𝐴22𝑠 .

3.4 Dynamic Modelling

(37)

23

In this section, the dynamic modelling of DC motor was presented which covered of its system equation and its transfer function.

3.4.1 System Equation

Generally, a DC motor will produce the torque that is proportional to the armature current and the strength of the magnetic field. By assuming the magnetic field is constant, then the motor torque is proportional to only armature current, i by a constant factor, Kt. This is referred to as an armature-controlled motor.

𝑇 = 𝐾𝑡𝑖 (3.22) Then, the back emf, e is proportional to the angular speed of the shaft by a constant factor, Ke

𝑒 = 𝐾𝑒̇ (3.23) But, for motor torque constant, Kt and electromotive force constant, Ke, its SI units are equal. Hence, K is used to represent both motor torque constant and electromotive force constant.

From Figure 3.1, the following equation can be derive by using Newton’s 2nd law and Kirchhoff’s voltage law.

𝐽̈ + 𝑏̇ = 𝐾𝑖 (3.24)

𝐿𝑑𝑖

𝑑𝑡+ 𝑅𝑖 = 𝑉 − 𝐾̇ (3.25)

3.4.2 Transfer Function

After the above equation has been derived, the modelling equations can be expressed in terms of Laplace variable, s by applying the Laplace transform.

𝑠(𝐽𝑠 + 𝑏)(𝑠) = 𝐾𝐼(𝑠) (3.26) (𝐿𝑠 + 𝑅)𝐼(𝑠) = 𝑉(𝑠) − 𝐾𝑠(𝑠) (3.27)

(38)

24

The equations (3.26) and (3.27) are needed to obtain the transfer function in (3.28) by eliminating I(s) in those two equation where the angular speed is considered as the output and the armature voltage is considered as the input.

𝑃(𝑠) =̇ (𝑠)

𝑉(𝑠) = 𝐾

(𝐽𝑠+𝑏)(𝐿𝑠+𝑅)+𝐾2 [𝑟𝑎𝑑/𝑠𝑒𝑐

𝑉 ] (3.28)

3.5 Hardware Platform

A several part or component had been chosen and selected for this research of works.

Mainly, the DC motor that attached with an encoder is work as a plant that can be measured of its faulty dynamic system. The encoder is act as a sensor that read the number of pulses and converted to the angular position by using the formula that will mentioned in this subsection later. Next, the Arduino MEGA 2560 is used to interface between the DC motor with an encoder and the Simulink MATLAB. Finally, L293D is used to drive the DC motor which is then an encoder will rotated eventually.

3.5.1 DC Motor

The most common device used as an actuator in mechanical control is the DC motor.

Despite of that, the DC motor is a suitable device to be used to investigate its performance when it working in the uncertainty environment as it receive a lot of disturbance during operation. Taking a DC motor as the research subject, its physical characteristics and system equation must be discovered so that its mathematical modelling can be model.

3.5.1.1 Physical Setup

A DC motor directly provides rotary motion and coupled with wheels or drums and cables, and also can provide translational motion. The equations defining a DC motor motion can be expressed in both mechanical and electrical ways. A simple overview on electrical equivalent circuit of the armature and the free body diagram of the rotor are shown in Figure 3.1.

(39)

25

Figure 3.1 – Electric equivalent circuit of the armature and the free body diagram of the rotor

Based on Figure 3.1, voltage source, v is assumed as the input of the system which apply to the motor’s armature part while the angular speed of the shaft motor, d/dt is assumed as the output of the system. Noted that the rotor and shaft of motor are assumed to be rigid. The physical parameters of DC motor in this project is listed on Table 3.1 below.

Table 3.1 – Physical parameters of DC motor

Parameters Values

Electric resistance, R 1 

Electric inductance, L 5 x 10-3 H Motor viscous friction constant, b 10-4 N. m / A

Moment of inertia of rotor, J 0.3856 kg . m2 Electromotive force constant, Ke 6.740679 V / rad / sec

Motor torque constant, Kt 6.740679 N . m . s

3.5.2 Encoder

Encoders are found in machinery in all industries for the purpose of motion control and motion feedback. An encoder is a sensing device that provide feedback as it convert motion to an electrical signal that can be used to determine position, count, speed or

(40)

26

direction. In this project, a rotary encoder is used as it is a type of position which is used for determining the angular position of a rotating shaft. Encoder SPG30E-200K is used and attached together with DC geared motor which is designed to fit on the rear shaft of SPG-30 Geared Motor series as shown in the Figure 3.2 below.

Figure 3.2 – DC geared motor with encoder and its removable cover

This encoder provides three counts per revolution of the rear shaft. Two hall effect sensor are placed 90 degree apart to sense and produce two output A and B which is 90 degree out of phase and allowing the direction of rotation to be determined. The number of pulses counted can be converted to angular position by using the following formula

𝐴𝑛𝑔𝑢𝑙𝑎𝑟 𝑝𝑜𝑠𝑖𝑡𝑖𝑜𝑛 (𝑟𝑎𝑑𝑖𝑎𝑛) =𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑝𝑢𝑙𝑠𝑒𝑠 𝑐𝑜𝑢𝑛𝑡𝑒𝑑

𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 × 2 (3.29) Features of Quadrature Hall Effect Encoder including 600 counts per main shaft revolution is produced for this ratio of 1:200 geared motor and the resolution is 3 pulses per rear shaft revolution for single channel output. The Figure 3.3 below show the view of connector pin of Encoder SPG30E-200K and its pin descriptions are listed on Table 3.2 below.

(41)

27

Table 3.2 – Connector pin description of Encoder SPG30E-200K

Pin Name Description

1 Motor - Output of motor driver

2 Motor + Output of motor driver

3 Hall effect sensor Vcc Supply voltage for sensor circuit (4.5V-5.5V)

4 Hall effect sensor GND Ground

5 Channel A Output of the encoder

6 Channel B Output of the encoder

Figure 3.3 – Connector pin of Encoder SPG30E-200K (Bhd., 2016)

3.5.3 Arduino Mega 2560

Arduino Mega 2560 is implemented in this project which acts a microcontroller that give and receive the signal. It has 54 digital I/O pins, 16 analog pins and a larger space which has larger memory space that can store your larger file project inside it memory space location. It also gives the fast reaction when the signal is upload to the

(42)

28

microcontroller board which can save the time usage. To be implement via the Simulink MATLAB in real-time (external mode), this Arduino mega 2560 is suitable which support the package of Arduino inside MATLAB add-on package. Figure 3.4 shows the layout of the Arduino Mega 2560 board.

Figure 3.4 – View of Arduino Mega 2560

3.5.4 L293D Motor Driver IC

The L293D is used as a motor driver of DC geared motor with encoder (SPG30E- 200K). it has a quadruple high current half-H drivers. L293D can provide bidirectional drive currents of up to 600-mA at voltages range from 4.5V to 36V. The following figure shows the layout of L293D Motor Driver IC.

(43)

29

Figure 3.5 – L293D pin layout

This L293D consists of two H-bridge which can control two DC motor

simultaneously. H-bridge is the simplest circuit for controlling a low current rated motor. Overally, L293D has 16 pins. Drivers are enabled in pairs, with drivers 1 and 2 are enabled by 1,2EN while drivers 3 and 4 are enabled by 3,4EN. Below shows the table of L293D pin description.

Table 3.3 – L293D pin description (cont.)

Pin

No Function Name

1 Enable pin for Motor 1; active high Enable 1,2

2 Input 1 for Motor 1 Input 1

3 Output 1 for Motor 1 Output 1

4 Ground (0V) Ground

5 Ground (0V) Ground

6 Output 2 for Motor 1 Output 2

7 Input 2 for Motor 1 Input 2

8 Supply voltage for Motors; 9-12V (up to 36V) Vcc

(44)

30

Table 3.3 – L293D pin description

9 Enable pin for Motor 2; active high Enable 3,4

10 Input 1 for Motor 1 Input 3

11 Output 1 for Motor 1 Output 3

12 Ground (0V) Ground

13 Ground (0V) Ground

14 Output 2 for Motor 1 Output 4

15 Input2 for Motor 1 Input 4

16 Supply voltage; 5V (up to 36V) Vcc

3.6 Software Platform

This section will covered on designing Luenberger Observer first and then designing of Sliding-mode Observer. Both design will be test without and with the presence of noise which required in using the Simulink MATLAB. Through modelling by using Simulink, the simulation can be done by looking to its output graphically with using an output blocks of Scope.

3.6.1 Linear Observer (Luenberger Observer)

The design for Luenberger Observer is shown in the following figures. For the Figure 3.6, the noise will not be included while for the Figure 3.7, the design will included the noise within the system.

(45)

31

Figure 3.6 – Design of Luenberger observer without the present of noise

(46)

32

Figure 3.7 – Design of Luenberger observer with the present of noise

For the signal generator, the square waveform is used as an input signal for the system for both Figure 3.6 and Figure 3.7 but in a meanwhile, sinusoidal waveform is also applied to the Figure 3.7 by changing the type of waveform in the signal generator block.

The input can be in the form of any signal as long as it is bounded signal. The reasons for the Figure 3.7 used two different type of waveform signal as an input to the system is because to see the effect on the output signal formed when the system included the external noise. The frequency of 0.5 Hertz and amplitude of 100 was implemented in the system for both type of waveform used. For the state-space block function of model (actual plant, DC motor with an encoder) of both Figure 3.6 and Figure 3.7, the following parameters is used

A = A, B = B, C = eye(3), D = zeros(3,1), Initial conditions = [0;0;0]

(47)

33

where A refer to A matrix and B refer to B matrix in the state-space constructed in the early stages. C is identity matrices, [

1 0 0

0 1 0

0 0 1

] and D is [ 0 0 0

].

For the system with the present of noise as shown in the Figure 3.7, the following parameters is selected within the block of Band-Limited White Noise

Noise power = [10], Sample time=0.01s, Seed=23341

But, for the value of noise power, it can be change according to the situation. If the value increased then the effect of noise will be greater that will affect the overall system and vice versa.

Next, the scope block is used to get the graphical output via simulation. But, before that, .m file was built first as a reference to the parameters (saved into workspace) that been implemented in the Simulink that can be referred to the Appendix A.

3.6.2 Sliding Mode Observer

Within the design of sliding mode observer, there will be two different design as different platform will be tested which are through simulation and hardware. For the Figure 3.8, it will tested on simulation only. The design for simulation part is not too complex as design for hardware part which required additional block function to get the output results.

(48)

34

Figure 3.8 – Design of sliding mode observer via simulation

For the input signal, three different sine wave is used with the different values of amplitude and frequency. Then, these three signal is added together to formed one signal as an input for the system. By using the signal of an input, it will go through the state- space model which is then three output can be formed. These three output consist of current, position and speed. In this project, we want to detect the fault at the position reading only. This is call sensor fault. Then, this sensor which referred to an encoder will give the position reading only. But, using state-space model, it will give the reading of current and speed together. Thus, a noisy signal is added to the output actual position to produce corrupted position (sensor fault). The sliding mode observer is design in the MATLAB function block and compare the signal received at the input and corrupted position.

For the first sine wave, an amplitude is 5 and the frequency is 0.25 rad/sec. Second sine wave used an amplitude equal to 1 and the frequency equal to 2 rad/sec. Third sine wave used an amplitude of 2 and 0.1 rad/sec as the frequency value. For the state-space model, it contains the parameters of A=A, B=B, C=eye(3), D=[0 0 0]’ with initial conditions [0;0;0]. The values of A, B and C can be referred to the Appendix B.

(49)

35

Figure 3.9 – Design of sliding mode observer via hardware demonstration

For the hardware demonstration kit, the Figure 3.9 above is used to illustrate the fault detection feature. This design is slightly different compared with Figure 3.8 as this design will communicate to the hardware in the real-time using external mode. So, a few additional block is used within this design like manual switch, Encoder MATLAB system, PWM Arduino block, output digital pin Arduino block, zero-order hold block, double block and memory block. This additional block is added to avoid some error faced to communicate with the hardware part. But first, before communicate with the hardware, the Arduino hardware must be setup in the MATLAB and installing the Arduino hardware support package from MATLAB add-on. This setup is needed for the first time using the Arduino hardware and no need to repeat it again as the Arduino hardware is no changing.

(50)

36

Figure 3.10 – Hardware demonstration kit

Figure 3.10 show the overall hardware demonstration kit that will used in this project and communicate it with MATLAB software in real-time. The Arduino Mega 2560 is used to communicate with the MATLAB in order to send the signal and receive the signal at the same time. While, for the Figure 3.11 show below is the overall schematic circuit connection of the main hardware which are DC motor with an encoder are connected to the others hardware used in this project.

(51)

37

Figure 3.11 – Overall schematic circuit connection 3.7 Summary

Both linear observer and sliding mode observer design is started from obtaining the transfer function of DC motor and modelling the DC motor in state-space model. The state-space is implemented in both linear observer and sliding mode observer design to get other state variable which are current as a first state and speed as a third state beside position as a second state. But, for the sliding mode observer design, the state-space mod

Rujukan

DOKUMEN BERKAITAN

To study the effect of molecular weights of palm oil-based polymeric plasticizers on the properties of plasticized PVC film, which includes thermal.. stability, permanence

Reducing Carbon Footprint at a Cement Casting Premise using Cleaner Production Strategy... Field

Exclusive QS survey data reveals how prospective international students and higher education institutions are responding to this global health

The Halal food industry is very important to all Muslims worldwide to ensure hygiene, cleanliness and not detrimental to their health and well-being in whatever they consume, use

In this research, the researchers will examine the relationship between the fluctuation of housing price in the United States and the macroeconomic variables, which are

Hence, this study was designed to investigate the methods employed by pre-school teachers to prepare and present their lesson to promote the acquisition of vocabulary meaning..

Taraxsteryl acetate and hexyl laurate were found in the stem bark, while, pinocembrin, pinostrobin, a-amyrin acetate, and P-amyrin acetate were isolated from the root extract..

The construction of numbers will be started with natural numbers, and then extended to the integers, rational numbers and finally the real numbers...