Sei sulla pagina 1di 24

LABVIEW PID SPEED CONTROLLER FOR DC MOTOR

EFFIZUL SYAFRIN BIN ABU BAKAR

This project is submitted as partial fulfillment of the requirements for the award of the
Degree of Bachelor of Electrical Engineering (Electronics)

Faculty of Electrical & Electronics Engineering


Universiti Malaysia Pahang

17 NOVEMBER 2008

i
“All the trademark and copyrights use are property of their respective owner.
References of information from other sources are quoted accordingly; otherwise
the information presented in this report is solely work of the author.”

Signature : ………………………………..

Author : EFFIZUL SYAFRIN BIN ABU BAKAR

Date : 17 NOVEMBER 2008

ii
To my beloved parents, sister and brothers who has encouraged me along the
journey of my study

iii
ACKNOWLEDGMENT

Million of thanks I express to my supervisor, Ms. Haszuraidah Binti Ishak


for all the advices and guidance throughout my project. Without her continued
support and interest, the project may be not as best as it is done.

I also would like to thank all the UMP’s lecturers and staffs for their
corporation in assisting me at various occasions. Their views and tips are useful
indeed.

Not forget to mention the gratitude toward my colleagues, Mohd Aizuddin


Bin Abu Bakar for helping me through the whole two semesters working on this
project.

Lastly, I wish to acknowledge to the people who give the support I needed
whether direct or indirectly. I also would like to thanks to my beloved family for
hoping the best of me. Thank you very, very much.

iv
ABSTRACT

This project is about developing a PID (proportional-integration-


derivation) controller to control the speed of DC motor. The software used to
design the controller is LabVIEW 8.5. The methodology is divided into two parts
which is software development and hardware implementation. The works in
software development are calculation of DC motor transfer function, simulation to
determine the parameter value of PID and developing the software controller.
Ziegler-Nichols Closed-Loop Method is used to obtain the value for Kp, Ki and
Kd. The last part is to interface the controller with the hardware. After finish both
parts, this system can be tune by using the PID value to do the analysis on it
response.

v
ABSTRAK

Tujuan utama projek ini adalah untuk membangunkan sebuah pengawal


PID (proportional-integration-derivation) untuk mengawal kelajuan DC motor.
Perisian yang digunakan adalah LabVIEW 8.5. Metodologi projek ini terbahagi
kepada dua bahagian iaitu pembangunan perisian dan perlaksanaan perkakasan.
Antara kerja-kerja yang dilakukan untuk pembangunan perisian adalah pengiraan
fungsi pindah bagi DC motor simulasi untuk menetukan parameter PID dan
membangunkan pengawal perisian. Kaedah Ziegler-Nicoles Closed-Loop
digunakan untuk menentukan nilai Kp, Ki dan Kd. Bahagian terakhir adalah untuk
berantaramuka antara perisian dan perkakasan. Selepas kedua-dua bahagian ini
selesai, sistem ini akan ditetapkan mengunakan nilai PID untuk menganalisis graf
respon.

vi
TABLE OF CONTENTS

CHAPTER TITLE PAGE

TITLE PAGE i
DECLARATION ii
DEDICATION iii
ACKNOWLEDGEMENT iv
ABSTRACT v
ABSTRAK vi
TABLE OF CONTENTS vii
LIST OF TABLES x
LIST OF FIGURES xi
LIST OF GRAPH xii
LIST OF SYMBOLS xiii
LIST OF ABBREVIATION xiv
LIST OF APPENDICES xv

1 INTRODUCTION 1
1.1Background 1
1.2 Problem Statement 3
1.3 Objective 4
1.4 Scope of project 4
1.5 Thesis Organization 5

2 LITERATURE REVIEW 7
2.1 Proportional-Integration-Derivation Controller (PID Controller) 7
2.2 Ziegler-Nichols Method 11

vii
2.3 DC Motor 15
2.4 Data Acquisition (DAQ) Card 15
2.5 Laboratory Virtual Instrumentation Engineering Workbench
(LabVIEW) 17

3 METHODOLOGY 21
3.1 Introduction 21
3.2 System Flowchart 22
3.3 Software Development 24
3.3.1 DC Motor Modeling 24
3.3.2 Ziegler-Nichols Closed Loop Method 27
3.3.3 Simulation 30
3.3.4 LabVIEW Programming 32
3.4 Hardware Development 34
3.4.1 DC Motor 35
3.4.2 DAQ Card 36
3.4.3 Motor Driver G340 37

4 RESULTS AND ANALYSIS 40


4.1 Introduction 40
4.2 Simulation 40
4.2.1 Result and Analysis of Uncontrolled System 41
4.2.2 Result and Analysis of Proportional Mode System 43
4.2.3 Result and Analysis of Proportional-Integration Mode
System 45
4.2.4 Result and Analysis of
Proportional-Integration-Derivation Mode System 47
4.3 Summary 49

5 CONCLUSION AND RECOMMENDATION 50


5.1 Introduction 50
5.2 Recommendations 51

viii
5.3 Cost and Commercialization 52

REFERENCES 53
Appendices A – C 55-84

ix
LIST OF TABLES

TABLE NO. TITLE PAGE

2.1 Closed-Loop Calculation of Kc, Ti and Td 13


2.2 Open-Loop Calculation of Kc, Ti and Td 14
3.1 Physical Parameter of DC Motor 24
3.2 General Ziegler-Nichols Closed-Loop Table 28
3.3 Tuned PID Controller Value 29
4.1 Analysis of the Response 49

x
LIST OF FIGURE

FIGURE NO. TITLE PAGE

2.1 A Block Diagram of a PID Controller 7


2.2 Block Diagram and Front Panel of LabVIEW 18
3.1 Basic Block Diagram of the Project 21
3.2 Flowchart of System Development 23
3.3 DC Motor Model System 24
3.4 LabVIEW Simulation Block Diagram Window 30
3.5 LabVIEW PID Controller Block Diagram Window 32
3.6 Servo Motor 35
3.7 USB DAQ Card 37
3.8 Motor Driver G340 37

xi
LIST OF GRAPH

GRAPH NO. TITLE PAGE

2.1 System Tuned Using the Ziegler-Nichols Closed-Loop


Tuning Method 13
3.1 Sustain Oscillation Response 27
4.1 Graph Response without Controller 41
4.2 Graph Response with P Mode 43
4.3 Graph Response with PI Mode 45
4.4 Graph Response with PID Mode 47

xii
LIST OF SYMBOLS

Ku - Gain Value
Pu - Period of Oscillation
Ti,Ki - Integral Time
Td,Kd - Derivative Controller
Kp - Proportional Gain
Kcr - Critical Gain
Pcr - Critical Period

xiii
LIST OF ABBREVIATION

PID - proportional-integration-derivation
DAQ - data acquisition card
USB - universal serial bus
DC - direct current
EMF - electromagnetic force

xiv
LIST OF APPENDICES

APPENDIX TITLE PAGE

A DAQ Card Manual 55


B Servo Motor Manual Installation 76
C PID.vi Block Diagram 84

xv
Chapter 1

Introduction

1.1 Background

This project basically is about designing PID controller using LabView


8.5 to control a DC motor speed. PID stands for proportional-integration-
derivative.

The chosen of PID controller is because it is the simplest controller


available. It used three element; proportional part, integration part and derivative
part. Easy to say, this controller is basically an element of mathematical
expression. In simple language, the controller willis collects the data from the
output of the applications or it is called feedback. Then, it will compare the
feedback with the setpoint (setpoint is a value of a user set initially or desired
output user want). If there is different between the two of them, even it is merely
slightest, the PID controller will try to reduce the error as best as possible to zero
Because there are no perfect controller invented yet, thus to reduce the error
completely is impossible.

1
The motor model is Cliffton Percission. There are two things of this
motor that can be controlled; speed and angular movement. This project as it
state before is about controlling the speed. For example, if 12 volts is appointed
to the motor, and it is common sense the output is also 12 volts. However it
doesn’t go that way. The output maybe less, let say 10 volts. The different 2 volts
is what is called error. This error is sends or feedback to the summing point
(some of the part in PID). Then, the PID will do its job.

Before discuss further about the job that the PID done, it is time to
explain about the software needed to develop the PID controller. LabVIEW
version 8.5 is chosen. This software, developed by National Instrument is a
platform and development environment for a visual programming language. The
graphical language is named ―G‖. This programming software used graphical
method rather than coding or whatever language. This made this software is more
understandable to use.

The purpose to design this project is to overcome the problem in industry


like to avoid machines damages and to avoid slow rise time and high overshoot.
This is because when the starting voltage is high, it is not suitable for machine
and can make machine damages. So, a controller likes PID is developed to
overcome this problem.

2
1.2 Problem Statement

There are problems when trying to run any application or plant such as to
run DC motor speed, water tank level or others. The problems are or known
better as error; lag of efficiency, loss in terms of speed, rpm or anything regards
to the output of that applications. Thus, in order to eliminate or reduce these
errors, certain controller must be constructed. This controller will try to minimize
the error to get the best output possible.

Application or plant likes machines are tending to damage without


implementation of control methodology in it system. It is known that the
characteristic of control system is specified in term of transient response. The
transient response of a practical control system usually exhibits damped
oscillation before reaching steady state. As for machines, having a high
overshoot is an undesired condition since the starting current is very high. Thus,
control methodology such as PID controller is used to limit the maximum
overshoot as well as to reduce the starting current of the machine. Therefore, the
power used can be reduced as well as avoid machine from damaged due to bad
system performance.

A DC motor can be control by computer (any software available) even


without applying the controller. However, it is ineffective and inefficient because
of the slow response system as the desired output is hardly to achieve. So, PID
controller is implemented as a control system to obtain precise numerical
information input, and yet capable of highly adaptive control.

3
1.3 Objective(s)

The objectives of the project are:

i. to develop the PID controller to control the speed of DC motor using


LabVIEW,
ii. to evaluate and analyze the performance of the controller.

1.4 Project Scope(s)

The scopes of the project are:

i. to derive mathematical model of DC motor and develop PID controller


for the motor,
ii. to develop LabVIEW program to applied as the PID controller for the
motor,
iii. perform computer simulation of the PID controller to investigate the
effectiveness of the PID controller.

4
1.5 Thesis Organization

This thesis is composed of five chapters consisting introduction, literature


review, methodology, analysis and result and the last chapter is a conclusion and
recommendation in future work.

Chapter 1 explains the background and a simple overview of a


proportional-integration-derivation controller or known as PID controller, and
also LabVIEW. It also consists of the problem statement, objectives and also
scopes of the project.

Chapter 2 discusses recent literature reviews on PID controller, Ziegler-


Nichols method, DC motor, motor driver, DAQ card and LabVIEW. All the
journals and the books that have some attachment to this project are used as a
reference to guide and help completing this project. Each of this part is explain
based on this finding.

Chapter 3 explains about the methodologies that have been used in order
to complete this project. The methodology consists two part; software and
hardware. The parameters of the PID controller and the tuning methods were
including in this chapter.

5
Chapter 4 gives a detail result and analysis on the design aspects for the
systems, which consists the simulation of DC motor and also discussion on PID
controller development using LabVIEW.

Chapter 5 presents the overall conclusion of development of the project.


This chapter also discuss on the suggestion and recommendation for future work
or modification.

6
Chapter 2

Literature Review

2.1 Proportional-Integration-Derivative Controller (PID Controller).

A proportional–integral–derivative controller (PID controller) is a generic


control loop feedback mechanism (controller) widely used in industrial control
systems. A PID controller attempts to correct the error between a measured
process variable and a desired setpoint by calculating and then outputting a
corrective action that can adjust the process accordingly.[1][2][4]

Figure 2.1: A block diagram of a PID controller

7
The PID controller calculation (algorithm) involves three separate
parameters; the Proportional, the Integral and Derivative values. The
Proportional value determines the reaction to the current error, the Integral value
determines the reaction based on the sum of recent errors, and the Derivative
value determines the reaction based on the rate at which the error has been
changing. The weighted sum of these three actions is used to adjust the process
via a control; the motor speed

The PID control scheme is named after its three correcting terms, whose
sum constitutes the manipulated variable (MV). Hence:

(2.1)

where Pout, Iout, and Dout are the contributions to the output from the PID
controller from each of the three terms, as defined below.[3]

i. Proportional

The proportional term makes a change to the output that is


proportional to the current error value. The proportional response can
be adjusted by multiplying the error by a constant Kp, called the
proportional gain. The proportional term is given by:

Pout = Kp e(t) (2.2)

8
Where
Pout: Proportional term of output
Kp: Proportional gain, a tuning parameter
e: Error = SP − PV
t: Time or instantaneous time (the present)

ii. Integration

The contribution from the integral term is proportional to both the


magnitude of the error and the duration of the error. Summing the
instantaneous error over time (integrating the error) gives the
accumulated offset that should have been corrected previously. The
accumulated error is then multiplied by the integral gain and added to
the controller output. The magnitude of the contribution of the
integral term to the overall control action is determined by the integral
gain, Ki. The integral term is given by:

Iout= Ki ∫ e(τ) dτ (2.3)

Where
Iout: Integral term of output
Ki: Integral gain, a tuning parameter
e: Error = SP − PV
τ: Time in the past contributing to the integral response

Potrebbero piacerti anche