UNIVERSITI TEKNIKAL
MALAYSIA MELAKA
FACULTY OF ELECTRICAL ENGINEERING
PROJEK SARJANA MUDA 2
BEKU 4983
FINAL REPORT
DESIGN OF PI, PD AND PID CONTROLLERS FOR MOTOR SPEED
CONTROLS USING SIMULATION PACKAGE SYSTEM
MOHD RAFIE BIN MOHD RAHIM
B010510004
4 BEKC 2
PANEL:
EN. FAZLLI B. PATKAR
EN. FAIRUL AZHAR BIN ABDUL SHUKUR
SUPERVISOR NAME: PN. AZRITA BT ALIAS
DUE DATE:
22nd APRIL 2009
DESIGN OF PI, PD AND PID CONTROLLERS FOR MOTOR SPEED
CONTROLS USING SIMULATION PACKAGE SYSTEM
MOHD RAFIE BIN MOHD RAHIM
B010510004
MAY 2009
“I hereby declared that I have read through this report and found that it has comply
the partial fulfillment for awarding the degree of Bachelor of Electrical Engineering
(Control, Instrumentation, & Automation)”
Signature : ………………………………………………
Supervisor’s Name : PN. AZRITA BT ALIAS
Date : ………………………………………………
DESIGN OF PI, PD AND PID CONTROLLERS FOR MOTOR SPEED
CONTROLS USING SIMULATION PACKAGE SYSTEM
MOHD RAFIE BIN MOHD RAHIM
This report is submitted in partial fulfillment of the requirements for the
Bachelor of Electrical Engineering (Control, Instrumentation and Automation)
FACULTY OF ELECTRICAL ENGINEERING
UNIVERSITI TEKNIKAL MALAYSIA MELAKA
2009
ii
“I hereby declared that this report is a result of my own work except for the excerpts
that have been cited clearly in the references.”
Signature : ………………………………………………
Name : MOHD RAFIE BIN MOHD RAHIM
Date : ………………………………………………
iii
To my beloved parents
Mr. Mohd Rahim Sahir & Mrs. Rohaya Mohamed Yin
To my beloved best friend
Haznirah Mohd Ghazali
And
Fellow Friends
iv
ACKNOWLEDGEMENT
First and foremost, I would to thank Allah SWT Most Gracious and Most
Merciful for giving me the strength to carry out this project.
I would like to thank my parents and my family for their unconditional love
and support and also motivation despite the distance.
I also would like to express my gratitude to my supervisor for assisting and
motivating me throughout the project development. “Bunches of thanks for you miss.
I do appreciate even a word of yours”
Lastly, to my beloved friends, I would like to express the highest
appreciation. I hope I am able to do the same for you as each of you my dear friends
have made a big difference to my life and I thank god for having friends like you.
ABSTRACT
The enhancement of PI, PD and PID Controllers for Motor Speed Controls
using Simulation Package System is developed in order to fulfill the Projek Sarjana
Muda (PSM) requirements. This project is developed to help students to understand
the characteristic of the PID controller in control system in simulation and real time
due to it give confusion for them because of the concepts of controller are abstract
and difficult to fully comprehend. The main objective of this project is to control the
speed of the motor using the developed simulation system of PI, PD and PID
controller using VB6 software. This project more focused on the simulation how to
control speed of the motor using these controllers. This simulation will process the
data and then show the transient response type of the output graph. The output
characteristics such as settling time, peak time, rise time, steady-state error and
percent overshoot of the motor can be determining trough this system. The interface
allows users to interact with the system. The tools and software used to develop the
system is Microsoft Visual Basic 6.0. It is hoped that this system will be enhanced
and developed in the future in order to make it more efficient to be used.
v
ABSTRAK
Penghasilan projek PI, PD and PID Controllers for Motor Speed Controls
using Simulation Package System adalah sebuah sistem yang dibuat atas tujuan
memenuhi keperluan Projek Sarjana Muda (PSM). Projek ini dibangunkan untuk
membantu pelajar agar lebih memahami ciri-ciri pengawal PID di dalam sistem
kawalan simulasi dan sebenar disebabkan oleh ia memberi kekeliruan kepada mereka
kerana konsep – konsep pengawal tersebut adalah abstrak dan sukar untuk difahami
sepenuhnya. Objektif utama projek ini adalah untuk untuk mengawal kelajuan motor
menggunakan pengawal PI, PD dan PID simulasi sistem yang telah dibangunkan
menggunakan perisian computer VB6. Projek ini lebih tertumpu kepada simulasi
untuk mengawal kelajuan motor menggunakan kesemua pengawal tersebut. Simulasi
ini akan memproses data dan akan ditunjukkan melalui jenis tindak balas di graf
keluaran. Sifat keluaran motor seperti settling time, peak time, rise time, steady-state
error dan percent overshoot boleh ditentukan melalui sistem ini. Perantara muka
pula membenarkan pengguna saling bertindak dengan sistem ini. Peralatan dan
perisian computer yang digunakan untuk membangunkan sistem ini adalah Microsoft
Visual Basic 6.0. Diharapkan sistem ini dapat diperbaiki dan dibangunkan dengan
lebih baik lagi pada masa depan untuk menjadikannya lebih efisyen untuk
digunakan.
vi
vii
TABLE OF CONTENTS
CHAPTER SUBJECT PAGE
DECLARATION i
DEDICATION iii
ACKNOWLEDGEMENT iv
ABSTRACT v
ABSTRAK vi
TABLE OF CONTENTS vii
LIST OF TABLES x
LIST OF FIGURES xi
LIST OF APPENDICES xii
CHAPTER I INTRODUCTION
1.1 Introduction 1
1.2 Problem statements 1
1.3 Objectives 2
1.4 Scopes 2
1.5 Layout of Thesis 3
CHAPTER II LITERATURE REVIEW AND PROJECT
BACKGROUND
2.1 Introduction 5
2.2 Control System 5
2.3 DC Motor 8
2.3.1 Principal of Operation 9
2.3.2 DC Motor Equation 10
2.3.3 DC Motor Speed Characteristic 12
2.3.4 DC Motor Armature Control 13
viii
2.3.5 DC Motor Speed Control with
PID Controller 17
2.4 PID Compensator 18
2.4.1 Proportional Controls 21
2.4.2 Integral Controls 21
2.4.3 Derivative Controls 22
2.4.4 Proportional plus Integral plus
Derivative Controls 22
2.5 Microsoft Visual Basic 6 (VB6) 23
CHAPTER III METHODOLOGY
3.1 Introduction 24
3.2 Overview Description 26
3.3 PI Controller Design 26
3.4 PD Controller Design 27
3.5 PID Controller Design 27
3.6 Analysis 28
3.7 Interfacing to Hardware 28
CHAPTER IV RESULTS AND DISCUSSION
4.1 User Interface Design 29
4.2 Testing and Analysis 32
4.2.1 Comparing with MATLAB 32
4.2.2 Finding the Best Value of Kp, Ki
and Kd 37
4.2.3 System Sample 39
4.3 Discussion 46
CHAPTER V CONCLUSION AND RECOMMENDATION
5.1 Conclusion 47
5.2 Recommendation 48
ix
REFERENCES 49
APPENDICES 50
x
LIST OF TABLE
NO TITLE PAGE
4.1 Comparing the Characteristics of the System 33
4.2 Comparing the Characteristics of the System
(PI Controller Implemented) 34
4.3 Comparing the Characteristics of the System
(PD Controller Implemented) 35
4.4 Comparing the Characteristics of the System
(PID Controller Implemented) 36
4.5 Characteristics of the Sample System with PI Controller 41
4.6 Characteristics of the Inserted Transfer Function 43
4.7 Characteristic of the System with PID Controller 45
xl
LIST OF FIGURES
NO TITLE PAGE
2.1 Closed-Loop Control System 7
2.2 Schematic Represents of an Electric Motor 9
2.3 Schematic of the Basis Principles of DC Motor Equation 10
2.4 Armature Controlled DC Motor with Load 14
2.5 Block Diagram of a DC Motor 16
2.6 Block Diagram of the Closed Loop with PID Controller 17
2.7 PID Compensator Block Diagram Representation of
Equation (2.24) 19
3.1 Flow Chart 24
3.2 Flow Chart (continued) 25
4.1 Layout of Form 1 30
4.2 Layout of Form 2 31
LIST OF APPENDICES
NO TITLE PAGE
A Gantt Chart (Project Planning) 50
B Command for Layout Form 1 51
C Command for Layout Form 2 53
D Command for Module Layout 55
xii
CHAPTER I
INTRODUCTION
1.1 Introduction
Control system is a system or a device or set of device to manage, conduct
command, order and direct or regulate the behaviors of the other device or one
system. With it we can control or change the speed of the motor to our own desired
one. The controllers that can be used are Ideal Integration Compensator (PI), Ideal
Derivative Compensator (PD) and Ideal Integration-plus-Derivative Compensator
(PID).
So, this proposed project is about to develop a graphical user interface (GUI)
of these controllers for controlling the speed of the motor. Means user can control the
motor’s speed via Personal Computer (PC). The development of GUI will be
implementing using Microsoft Visual Basic 6 (VB6) software. This produced system
will incorporate interactive and graphical for convenience and user-friendly.
1.2 Problem Statements
Proportional integral derivative (PID) control is the most commonly used
control algorithm in the industry today. PID controller popularity can be attributed to
the controller’s effectiveness in a wide range of operation conditions, its functional
simplicity, and the ease with which engineers can implement it using current
computer technology. Besides, it give confusion for lecturer and student, who are
implementing and study the PID controller in control system because of the concepts
of controller are abstract and difficult to fully comprehend.
For more understanding purpose, it is advantageous to learn and apply the
PID controller effectively through empirical study. Dc motor speed control using
simulation PID controller is a good application that can help students to understand
the characteristic of the PID controller in control system. These equipments are a
direct application that can visualize the theoretical in real time.
1.3 Objectives
Regarding this project, there are precise objectives to be accomplished. In
completing this project, objectives are the basic in selection or designing base in
order to provide a means in organizing efforts toward accomplishment those
objectives.
1. To develop simulation system of PI, PD and PID controller using VB6
software.
2. To develop interfacing interacts between hardware and software.
3. To study the effect of applying PI, PD and PID controller to the Motor
System; speed.
4. To differentiate between PI, PD and PID controller through the result
obtained.
1.4 Scopes
The preparation of a detailed project scope statement is critical to project
success and builds upon the major deliverables, assumptions, and constraints that are
documented during project initiation in the preliminary project scope statement.
Scope will be described as the characteristics of the product, service, or result that
the project was undertaken to create. These characteristics will generally have less
detail in early phases and more detail in later phases as the product characteristics are
2
progressively elaborated. While the form and substance of the characteristics will
vary, the scope description should always provide sufficient detail to support later
project scope planning.
Scopes of this project consist of:
1. Design the simulation package using the software Microsoft Visual basic 6.0
to develop the Graphical User Interface (GUI) to make the user become
easier to find the controller for the motor speed controller.
2. The controller in this system is PI, PD PID controller and it also shows the
output response and the characteristics of each controller output response.
3. The GUI will produce the output response for the motor system by putting
the value of motor parameter into the simulation system.
4. User will know the type of output response whether it in open loop or in
closed loop system.
5. User will know the characteristics of each output response such as settling
time Ts, rise time Tr, percent overshoot %OS, Final Value, Peak time Tp, and
steady state error of the system.
6. User can choose the type of controller they want to make the system more
stable.
1.5 Layout of Thesis
Layout of the thesis will tell the flow of the whole thesis and its contents.
This could be the referring section for this project.
Chapter 1 shows the introduction of the project, the abstract as the initial
summary for whole project. Then it also contains a brief introduction that gives the
idea of the whole project. Problems that bring the idea to implement this project also
stated in this chapter. This chapter also includes the main objectives of the project
and the scope of whole project.
3
Chapter 2 contains the theory of the whole project. It comprises the control
system, DC motor and the parameter calculation of the motor to get the transfer
function for the motor. The transfer function consist open and closed loop transfer
function. Then, the characteristic of the output response for the motor system also
include such as rise time, settling time, percent overshoot, and frequency response
for the system. It also presents the theory of PID compensator that consists of
proportional controls, integral controls, derivative controls and proportional plus
integral plus derivative controls. At the end it covers about Microsoft Visual Basic 6
(VB6).
Chapter 3 indicates the methodology to complete and success the project.
Project methodology is about defining fundamental principles, rules and manners to
complete the project. It is a way to use all available techniques, tools and approaches
used to achieve predetermined objectives. It shows the flow of the project from the
beginning and illustrates with the flow chart that review the important methods that
should be considered by developers before a project is carried out. It is important for
a developer to demonstrate an awareness of methodological tools available and the
understanding that is suitable for the project.
Chapter 4 likewise point out the results and analysis of the project. The
developed simulation system will be shown in the result part. Simulation system here
means the controller panel of the motor. For the analysis part, the system will be test
and compare with MATLAB software to make sure it is in accurate condition. The
best value of Kp, Ki and Kd also will be determined and show in this part. Sample of
the system also included in this part.
Chapter 5 shows the final conclusion and suggestion for future work for this
project. The suggestion includes the idea how to make this simulation package more
reliable and efficient in the future.
4
CHAPTER II
LITERATURE REVIEW AND PROJECT BACKGROUND
2.1 Introduction
This chapter will briefly review the important methods that should be
considered by developers before a project is carried out. Literature review aims to
research as many resources as possible to help developers to get ideas to develop the
project. This will provide a clearer understanding of the system and its design. The
activities involved are searching, collecting, analyzing and drawing conclusion from
all issues raised in relevant body of literature. For this PC Based Weight Scale
System project, the literature needs to be researched and collected pertaining to
related information.
2.2 Control System
Control system is a system or a device or set of device to manage, conduct
command, order and direct or regulate the behaviour of the other device or one
system. In Control system there are two type of system. Open loop system and closed
loop system.
One type of control system is Open Loop control system. It also called linear
control system or non-feedback control system. This type of system may compute its
input into a system using only the value of set point from the input and its model of
the system.
A characteristic of the open-loop controller is that it does not use feedback to
determine if its input has achieved the desired goal. This means that the system does
6 not observe the output of the processes that it is controlling. Consequently, a true
open-loop system can not engage in machine learning and also cannot correct any
errors that it could make.
It also may not compensate for disturbances in the system. Open-loop control
is useful for well-defined systems where the relationship between input and the
resultant state can be modeled by a mathematical formula. For example determining
the voltage to be fed to an electric motor that drives a constant load, in order to
achieve a desired speed would be a good application of open-loop control. If the load
were not predictable, on the other hand, the motor's speed might vary as a function of
the load as well as of the voltage, and an open-loop controller would therefore not be
sufficient to ensure repeatable control of the velocity. An open-loop controller is
often used in simple processes because of its simplicity and low-cost, especially in
systems where feedback is not critical. A typical example would be a conventional
washing machine, for which the length of machine wash time is entirely dependent
on the judgment and estimation of the human operator. Generally, to obtain a more
accurate or more adaptive control, it is necessary to feed the output of the system
back to the inputs of the controller. This type of system is called a closed-loop
system.
A closed-loop control system is one in which an input forcing function is
determined in part by the system response. The measured response of a physical
system is compared with a desired response. The difference between these two
responses initiates actions that will result in the actual response of the system to
approach the desired response. This in turn drives the difference signal toward zero.
Typically the difference signal is processed by another physical system, which is
called a compensator, a controller, or a filter for real-time control system
applications. A closed-loop control system can be represented by the general block
diagram shown in Figure 2.1:
7
Figure 2.1: Closed-Loop Control System
In this configuration a feedback component is applied together with the input
R. The difference between the input and feedback signals is applied to the controller.
In responding to this difference, the controller acts on the process forcing C to
change in the direction that will reduce the difference between the input signal and
the feedback component. This, in turn, will reduce the input to the process and result
in a smaller change in C. This chain of events continues until a time is reached when
C approximately equals R. A closed-loop system is able to regulate itself in the
presence of disturbance or variations in its own characteristics. In this respect, a
closed-loop system has a distinct advantage over an open-loop system.
A proportional integral derivative controller (PID controller) is a generic
control loop feedback mechanism widely used in industrial control systems. A PID
controller attempts to correct the error between a measured process variable and a
desired set point by calculating and then outputting a corrective action that can adjust
the process accordingly. 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
determines the reaction based on the sum of recent errors and the Derivative
determines the reaction to 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
element such as the position of a control valve or the power supply of a heating
element. By "tuning" the three constants in the PID controller algorithm the PID can
provide control action designed for specific process requirements.
The response of the controller can be described in terms of the responsiveness of the
controller to an error, the degree to which the controller overshoots the set point and
8 the degree of system oscillation. Note that the use of the PID algorithm for control
does not guarantee optimal control of the system or system stability. Some
applications may require using only one or two modes to provide the appropriate
system control. This is achieved by setting the gain of undesired control outputs to
zero. A PID controller will be called a PI, PD, P or I controller in the absence of the
respective control actions. PI controllers are particularly common, since derivative
action is very sensitive to measurement noise, and the absence of an integral value
may prevent the system from reaching its target value due to the control action.
2.3 DC Motor
Electric motor can be of many types, such DC motor, AC motor, wound,
brushless, synchronous, asynchronous, stepper, brushless permanent magnet servo
and switch reluctant, but their basis function is the same. Motor of all types serve to
convert electrical energy to mechanical energy.
DC motors are motor that runs on Direct Current from battery or D.C power
supply. Direct Current is the term used to describe electricity at a constant voltage.
When a battery or dc power supply is connected between DC motor and electric
leads, the motor convert electrical energy to mechanical work as the output shafts
turn.
9 2.3.1 Principal of Operation
(a) (b)
Figure 2.2: Schematic Represents of an Electric Motor
(a) End View (b) Side View
Consider a simple Direct Current motor consisting of a wound rotor and
permanent stator (Figure 2.2). Voltage is applied across the motor terminal and
current flow through the motor from the positive terminal to the negative terminal.
The system consists brushless and collectors transfer the current from the stationary
terminal of the rotor coils. Current flowing through the rotor coils interacts with the
magnetic fields of the permanent magnet stator, generator and electromagnetic force.
In accordance with ampere’s Law the electromagnetic force turn the rotor and sets
the DC motor into action.
In order to keep the DC motor rotating in the same direction, the collectors
switches (commutates) the rotor coils as the rotor turns. The rotation of the rotors
causes its coils to intersect the magnetic fields lines. Thus, electromotive force (emf)
is induced in the coils in accordance with Faraday’s Law. The induced emf is
referred to as a counter emf (back emf ) because it oppose the applied voltage . In
Figure 2.2, internal resistance of DC motor (R), its represent the resistance of rotor
winding, brushes, collector, etc, the internal resistance is the cause of power loss in
the electrical motor. As current flows through the motor, energy is converted into
heat through the Joule effect. The resulting power must be dissipated; otherwise the
DC motor overheats which may result in burn out the insulation and short circuit.
+V +V