Vous êtes sur la page 1sur 13

Tikrit Journal of Engineering Sciences/Vol.19/No.

2/June 2012, ( 71-81) 17


Real Time Implementation of PID and Fuzzy PD Controllers for
DC-Servo Motor Based on Lab View Environment
Maher M. Safaa M. Z. Al-Ubaidi
F. Algreer
rerutceL
Assistant Lecturer
Department of Computer Engineering Department of Clinical Pharmacy
Mosul University

Abstract
This paper presents an implementation of conventional PID (CPID) controller using
Ziegler-Nichols rules and fuzzy PD (FPD) controller for position servo motor control based
on Lab View (Laboratory Virtual Instrument Engineering Workbench Environment) through
Data Acquisition (DAQ) Device PCI- 6521 of National Instrument's and Data Acquisition
Accessory Board Model (CB-68LP).CPID controller
is perhaps the most well-known and most widely used in industrial applications.
However, it has been known that CPID controller generally don’t work well for non-
linear systems, higher order and time-delayed linear system and particularly complex
and vague system. To overcome these difficulties, this paper proposes to use the FPD
controller for a servo motor system instead of CPID. The parameters of servo motor
used are completely unknown. The FPD structure has two-input single-output and fairly
similar characteristic to its conventional counterpart and provides good performance.
Simple rules base are used for FPD (nine rules only). Performance evaluation was
carried out via a comparison study for the proposed control scheme and other existing
control scheme, such as CPID controller. The critical point for this experiment on
position system is a steady state error and settling time. The performance showing that
the FPD has less settling time and zero steady state error over its CPID. The algorithms
of FPD and CPID controllers are implemented using PID, Fuzzy Logic and simulation
toolkits of the Lab View environment.
,Keywords: Fuzzy Logic Control, Conventional PID Control, Servo Motor System
.Fuzzy PD, Lab View Environment, Ziegler -Nichols Rules

‫ لمحركات التيار المستمر مستندة على برامج‬PD ‫ وأجهزة السيطرة الضبابية‬PID ‫تطبيق الوقت الحقيقي لزمن العينة‬
‫المحاكاة المختبرية‬
‫الخالصة‬
‫أجهزة التحكم في‬ FPD ‫ نيكولز ومتحكم‬-‫ باستخدام قواعد زيلفر‬CPID( PID( ‫في هذا البحث تم تنفيذ وحدة التحكم التقليدية‬
‫المحركات الموضعية استناد اا الى عرض المختبر االفتراضي لالت الهندسية وكذلك من خالل‬
)CB-68 LP(. ‫ ونمـوذج لوحـة جمع البيانات المساعد‬PCI-6521 ‫( بواسطة االلـة‬DAC) ‫جهاز اكتساب البيانات‬
ُُ
‫ فقد كان معروف ا ا‬، ‫ ومع ذلك‬.‫ ربما االكثر شهرة واالكثر استخدام اا على نطاق واسع في التطبيقات الصناعية‬CPID ‫يعتبر جهاز السيطرة‬

‫ وارتف اع الطل ب وزم ن الت أخير للنظم ة الخطي ة وخاص ة النظ ام‬، ‫ عموم اا ال يعمل بشكل جيد للنظمة غير الخطي ة‬CPID ‫ان جهاز‬

‫ ب دال‬servo ‫ لنظ ام محرك ات‬FPD ‫ تم في هذا البحث اقتراح استعمال جهاز ســيطرة‬، ‫ للتغلب على هذه الصعوبات‬.‫المعقد والغامض‬

‫ ل ه ادخ الين واخ راج واح د‬FPD ‫ وان تركي ب‬.‫ المس تخدمة ه ي مجهول ة تمام ا‬servo ‫ ان خص ائص محرك ات ال‬CPID . ‫مــن‬
‫وخصائصه مماثلة جدا لنظيره التقليدي‬
‫‪27‬‬ ‫)‪Tikrit Journal of Engineering Sciences/Vol.19/No.2/June 2012, ( 71-81‬‬

‫ويقدم اداء جيدا‪ .‬تم استخدام قواعد بسيطة ل ‪( FPD‬تسع قواعد فقط)‪ .‬واجري تقييم االداء من خالل دراسة مقارنة‬
‫اُ‬
‫لنظام الرقابة المقترح وغيرها من مخطط السيطرة القائمة‪ ،‬مثل وحدة تحكم ‪ CPID .‬ان النقطة الحرجة لهذه التجربة‬
‫بان ‪ FPD‬لديه وقت اقل والخطأ‬ ‫النظام نالحظ‬ ‫خالل اداء‬ ‫على نظام الموقع هو خطأ ثابت ويحل وقتيا‪ .‬من‬

‫‪ FPD‬و اجهزة السيطرة ‪CPID‬‬ ‫خوارزميات‬ ‫وتم تطبيق‬ ‫للحالة المستقرة تساوي صفر بالنسبة ل ‪CPID.‬‬
‫باستخدام ‪ PID ,‬المنطق الضبابي و برامج المحاكاة المختبرية‪.‬‬
‫الكلمات الدالة‪ :‬التحكم المنطقي الضبابي ‪ ،‬وحدة التحكم التقليدية ‪ ،PID‬نظام محركات التيار ‪ ،‬االجهزة الضبابية ‪ ،PD‬برامج‬

‫المحاكاة المختبرية ‪ ،‬قواعد زيلفر‪ -‬نيكولز‪.‬‬


is difficult to FPD scheme
I estimate, ,controller that make it instead
a particularly
of the
ntroduction A therefore, a attractive choice
[4] conventional
special subset of complex design .applications Summaries some this
PID controller
continuous steps may be :advantages as flow
for a dc servo
motors is the involved in the Fuzzy .1 logic is motor system
servo motor, controller through DAQ
which in where, it can be programmed
designing, as devicetoPCI-
fail
ty99pical cases well as the final safely if a feedback
combines a 6521 of
control target is .lost National
continuous dc not guarantee It is .2
motor with [3] Instrument's.
. For that development The control
feedback loop reason, other user- the
to ensure algorithm of
strategies defined FPD and CPID
the accurate
positioning of should be deifidom controllers were
[1] employed to it rules, and implemented
the motor . control be can using Lab View
Servo motor are uncertain
generally easily change E
system to nvironment. Lab
controlled by
conventional knowledge. One system improve View is a
Proportional – example, expert performgraphical
– Integral systems .ance program
Deriv strategies can be It can be .3 designed to
ative (PID) used, since make
developed for
[2] accurate models interfacing with
controller . multi-input-
are not any
The simplicity multi-output
essential in this measurement
in the design system, since it
type of hardware. Lab
and [3] is
implementation, controller . operation, View provides
the robustness Nowadays, depend on assistances
of the system, fuzzy controller rule-based. which make
and flexibility, is one However, the data acquisition
successful [5]
make the system quite simple .
conventional methods of becomes As well as, Lab
PID controller expert system complicated View provides
(CPID) as a and it is widely functions those
and more
most controller used in different are
complex if
used in the application; one
example is many inputs
industry, where and outputs are
it estimated that, unknown
.system model
chosen. 4.
90% of the Fuzzy controller
controllers Generally, fuzzy
can be
employed in the control has
employed for
industry are number
non-linear
controller PID of htiw
[3] systems that
. However, advantages,
would be
if the compare
difficult or
model eht conventional
(transfer impossible to
controller,
function) model
as such
of m
PID
controlled athematically.
system (plant) is This paper
not available or presents the
Tikrit Journal of Engineering Sciences/Vol.19/No.2/June 2012, (71-81) 73
controller is 2) The integral
often expressed term reduces
designed to in the ideal form Ziegler –
steady-state
extract useful [6] Nichols Tuning
: errors [7]
information through low- Methods
from the GPID  K P (1  1 frequency Again, the
acquired data to TS compensatio mathematical
analyze I
n. model of a
measurements Where GPID(s) controlled is
is the control 3) The
and processing signal acting on essential to
derivative
signals. Lab error signal design the
term controller and
View E(s), KP is the
improves tune the gains.
environment proportional
transient On the other
can be used for gain, TI is the response hand, if the
data integral time through high- system model
visualization, constant, TD is frequency cannot be
user interface the derivative
design, and compensatio modeled,
time constant,
software n. systematic and
and s is the
connectivity. argument of the analytical
Laplace design methods
Thus, Lab View
transform. The cannot be used.
can create
control signal Therefore, well
applications
can also be known Ziegler-
which can be Nichols tuning
expressed in
used to collect, three terms as: methods can be
analyze and used to find the
share data with optimal gains
ease and with U (s)  K P E(s)  K I
and design the
higher accuracy. overall
Lab View controllers. The
makes it easier Where KI= KP /
procedure to
to connect to TI is the integral tune the PID
I/O and gain and KD is controller in (1)
integrate with the derivative is pretty easy
software which gain. The three- using Ziegler
makes easier to term approach.
functionalities
compare data [6] Firstly, the
from a process include : derivative and
with the 1) The integral
theoretical proportional coefficients are
[5] term set to zero; and
models .
provides an the proportional
Convention overall gain is increased
al PID control from zero to
Controller action critical gain
The transfer proportional value (Kc)
to the error where the
function signal system exhibits
of through the sustained
a all pass gain oscillations.
PID factor. Then, based on
oscillation
period of converted into
oscillation (Pc) information that
and critical gain the rule based
mechanism can
(Kc) value the easily use to
parameters KP, activate.
TI, TD can be The fuzzy
determined controller is
according to the composed of the
formulas given following three-
in Table (1): elements as
Fuzzy Logic shown in
[8]
Control Design Fig.1.b :
Fuzzy logic
control
developed here
as shown in
Fig.1.a is a two-
input single-
output
controller. The
two inputs are
derivation from
set point error
(e) and change
of error
(Δe).The error
is defined as:

e(t)  r (t)
c (t)
…………….
...(3)

Change of
error as
follows:

e(t)  d e(t) ……………...…….(4)


dt

Where θr(t) is
the reference
input signal,
θc(t) is the
output signal.
The tracking
error signal
(position) and
change of the
error signal
(velocity) are
74 Tikrit Journal of Engineering Sciences/Vol.19/No.2/June 2012, (71-81)

[9]
then :
n
(i )i action is
 conversional
Uf i1
n
1) Fuzzification:  1 (i )i proportional The
This converts i gain, and when computation of
input data into Td is gradually the fuzzy
suitable Where μ(uj) increased, the control action
linguistic system start to signal
member ship
values. The grad of the composed many
third triangular steps. These
element uj, Uƒ is
input and output steps can be all
the fuzzy
member ship combined
control output, n
functions of the is the number of together in what
fuzzy logic discrete values is called control
control are on the universe surface because
shown in the of discourse. the system has
Fig. (2). For the Derivative of two inputs and
system under the Fuzzy PD one output. The
study the Structure shape of this
universe of surface shows
Derivative
discourse for how the output
controller is an
both e(t), e(t) value varies
intelligent part
with different
and for output of PID
combination of
may be controller, the two inputs
normalized where it can values. Fig (3)
from [-1 , 1], predict the shows the rule
and the changes in the surface viewer
linguistic labels error signal and [8]
are{ Negative, it can improve of the FPD .
Zero , Positive}, closed-loop 3) Defuzzificati
and are referred stability, where on: The input
to in the rules for
the phase
defuzzificati
base as {N, Z, P margin of the on is the
}. system may be member ship
2) Rule base: A increased by aid (certainty)
decision making of derivative
µ(ui) from
logic which is, gain. The basic
implied
simulating a structure of a
fuzzy sets
human decision PD controller is
resulted from
process, inters can be present
premise rules
fuzzy control as [9]:
and the
action from the u n  K P (e  T e output is a
knowledge of crisp
the control rules n d
number. The
and linguistic most popular
variable As describe method,
definitions. For in (6), the center of
given input and control action of gravity or
output linguistic derivative part center of
label table (2) is relative to the area is used
shows the prediction of the for
error signal. defuzzificati
control rules
base that used Now, for Td= 0, on :
[8]

for FPD. the control


damply
oscillations. If
Td becomes too
large the system
becomes over
[9]
damped and
it will start to
oscillate again.
Input to the
FPD controller
is the error and
derivative of
[8]
error :

e e
e(n)   n n1

 T
S

This is a
discrete
approximation
to the
differential
quotient using a
backward
difference.
Other
approximations
are possible.
The controller
output is a
nonlinear
function of
error and
change of error
[9]
:

U f (n)  f (Ke * en 

Where ƒ is
input-output map
of fuzzy
controller, using
the linear
approximation
Ke* en + K Δe*
Δe(n),

U f (n)  (Ke * en  K

U f (n)  K e * K f * en


75
Tikrit Journal of Engineering Sciences/Vol.19/No.2/June 2012, (71-81)
Hardware, Upon the
software design
By comparison, Software of control DAQ Device
the gain in (4) Specifications
algorithm in
and (7) are Setup To create
Lab View, The
related the a
output signal
following way: and communication
will sent to the between the
System plant (servo
Ke * K f  KR Description process and the
motor) from the computer
K e  T The
……………..……(12) computer
experiment part National
through D/A Instruments
K
d can be divided converter of the
e
into two levels: provides
DAQ device. different
Hardware
The FPD input/output
Level Design
controller may cards which are
The
be applied when further
the performance apparatus of the
supported by
of the system is servo control DAQ assistance.
not enhanced system shown in DAQ assistance
using Fig (4) consists is a simulation
proportional of an internal of data
part only. A/D and D/A acquisition
Finally, conversions device. The
derivative term based computer DAQ assistance
improves by using NI creates different
response; and it PCI-6251 DAQ channels for
can reduce device, which is measurement
overshoot, connected to the and transfer
however, it is plant (servo signals from one
more sensitive motor). The form to other so
[9] positing was
to noise ; in that a computer
addition, fast sensing by using can process .
[5]
changes in the a potentiometer. In this
system, such as The experiment the
abrupt change potentiometer National
in target signal; and gear box are Instrument PCI-
can be leads to embedded into a 6251DAQ
derivative kick dc motor. The device is used.
in control parameters of This device has
action. this dc motor the following
However, are completely specifications:
number of unknown. 1- 16 Channels
method can be The feedback Analog Input.
apply to signal will pass 2- 1.25 MS/s
overcome this to the A/D
limitation, for Sample Rate.
converter of a 3- 16 Bits
instance output DAQ device,
signal can Resolution.
and into the 4- (-10V to
be used in computer,
derivative part 10V)
where will be Maximum
instead of the used to control
[9] I/O Voltage
error . the position of Range.
the servo motor.
5- (-100 to 100 potentiometer
mV) Minimum signal.
Input Voltage
Ranges.
6- Two
Channels
Analog Output.
7- (-5V to 5V)
Minimum
Output
Voltage
Ranges.
8- 24 Digital
I/O Channels.
9- Two Counter/
Timers.
10- 80 MHz
Maximum
Source
Frequency.
Positing Sensor
Calibration
The
sensing signal
for feedback is a
potentiometer.
The signal was
calibrated to
convert the
voltage signal to
position. The
feedback rang
(voltage input)
from -2 V to 2
V and it was
digitized by a
DAQ device.
2V
corresponding
to 20 degree and
-2 V to 340
degree.
Regression
equation was
derived as
follows:

Position= (V  2) *
feedback

Where V
feedback is a

Vous aimerez peut-être aussi