Implementation and experimental study of a fuzzy logic controller for dc motors

Implementation and experimental study of a fuzzy logic controller for dc motors

COMPUT[RSIN INDUSTRY ELSEVIER Computers in Industry26 (1995) 93-96 Short Note Implementation and experimental study of a fuzzy logic controller for...

201KB Sizes 0 Downloads 36 Views

COMPUT[RSIN INDUSTRY ELSEVIER

Computers in Industry26 (1995) 93-96

Short Note

Implementation and experimental study of a fuzzy logic controller for dc motors C.M. Lim

Electronic& ComputerEngineeringDepartment,NgeeAnn Polytechnic,Singapore2159 Received 15 February 1994; revised 2 August 1994

Abstract In a recent work a fuzzy PID controller has been shown to provide good system performance in the presence of a disturbance. However, these encouraging results were obtained through simulation studies. In this paper, the effectiveness of the same fuzzy PID controller is examined through real-time experimental studies instead.

Keywords:dc motor; Digital control; Fuzzy logic; PID 1. Introduction

2. Review of the fuzzy PID controller

Fuzzy logic has been applied successfully in a number of control applications [ 1,2] since its introduction by Zadeh in 1965. In general, a fuzzy logic controller utilizes fuzzy logic to convert a linguistic control strategy into an effective automatic control strategy [2]. The design framework of a fuzzy logic controller does not necessitate the use of a mathematical model to describe the dynamics of the controlled system and experience has shown that it yields results which are better than those obtained by conventional control schemes. The fuzzy PID controller reported in [ 3 ] possesses the above advantage. However, the effectiveness of this controller has been demonstrated using digital simulation studies. In this paper, the effectiveness of this fuzzy PID controller is further examined by applying it to a dc servomotor in real-time. The primary objective is to validate the robustness of this controller experimentally.

Details of the fuzzy PID controller under study have been described in [3] and are omitted here. Essentially, the output of this fuzzy PID controller is given by

uF(t) = Eun(t)

(1)

where

u~(t) =Kp~i(lel)e(t) + KllZj( f e dt ) f e dt + gD~k(l~l)~,

(la)

/x,( t) = min (lzi(lel),l~j( / e dt ),l~k(l~l) ) , (lb)

n=i+ 3 ( j - 1 ) + 9 ( k - 1 ) , for i,j,k = 1,2,3.

0166-3615/95/$09.50 © 1995 Elsevier Science B.V. All rights reserved

SSD10166-3615(94)00049-2

I.tn(t) ,

n=l

(lc)

94

CM. Lira~Computers in Industry 26 (1995) 93-96

I

Ssrvo

Amplifiers y

DC

Motor

Load

(v)

I

Position sensor

L

[Y

(deg)

F

Fig. 1. Block diagram of experimental system. In the above expressions, e is the error signal and

]/~l ( Z ), /£2 ( Z ), 12,3( Z ) are the membership functions of the signal, z, when it is in the fuzzy sets small, medium and large respectively, where z is either le[,

I f e dtl or I~1. For the purpose of real-time implementation, the above control signal must be discretized. In this paper, this control signal is discretized so that the number of signals to be measured is kept to the minimum, i.e., one which is the error signal. As such, at the mth sampling interval, the fuzzy PID controller output is given by 27

UF(m) = E U n ( m ) n=l

IXn(m) ,

(2)

=

where

Un(m) =Kplzi(lel)e(m) + Kilzj(llel)Ie(m) -+- go~k(l~l)~(m), IZn(t) = min

(~i(lel),/~j(lIel),~k(l~l)),

Ie(m) = I e ( m -

(2a)

Step 1. Sample e(m) and compute Ie(m) and ~(m). Step 2. Compute Un(m), Izn(m) and UF. Step 3. Constrain uv within physical limits and then apply it. Step 4. Set m t o m + 1. Step 5. Go to Step 1. Remarks (a) The structure of the above fuzzy PID can be readily modified. For instance, in order to avoid "derivative kicks" due to step changes in the reference value, it is desirable to use the system output as the input to the D-term instead of the error signal. In this case, the above algorithm needs to be modified by merely replacing ~(m) in (2a)-(2c) and in Step 2 by )(m). However, two signals, i.e., e(.) and y(-) need to be measured. It should be noted that the above modified structure was used throughout the experiments which will be described later. (b) The output of the I-term may be constrained to prespecified upper and lower limits to avoid integral windup.

1) + 1 T s ( e ( m - 1) + e ( m ) ) , (2b)

3. Experimental system d(m) = (e(m) - e(m - 1))/Ts,

(2c)

n = i+3(j-

(2d)

1) + 9 ( k -

1),

for i, j, k = 1,2, 3 and Ts is the sampling period. The fuzzy controller output is constrained within physical limits before it is applied, thus

Umin ~ UF(m) ~< Umax,

(3)

where Uminand Umaxare predefined limits. The above control algorithm can be summarized as follows:

3.1. Experimental setup Fig. 1 shows a block diagram of the experimental system chosen for validating the effectiveness of the above fuzzy PID controller. This system consists essentially of a dc servomotor which is coupled to an inertia load whose angular position, y(.), is to be controlled at a desired value, yr('). A microcomputer, which is equipped with a MetraByte DASH 12-bit, A/D, D/A and I/O board, is used to implement the controller using QuickBASIC.

CM. Lim/Coraputers in Industry 26 (1995) 93-96

>

%

[.__ (a)

~] _J/

~ Yr~

k

~-~ uC

k I

I

3s Fig.2.Casel--lncrfia load= J:(a)fuzzyPID;(b)conventional PID.

95

Case 1--Low inertia load Fig. 2 shows a sample of the results obtained when the above fuzzy PID controller was applied. For comparison purposes, results obtained when a conventional PID controller was applied instead are also shown in Fig. 2. The conventional PID settings were chosen so that both controllers provided almost identical performance to the system. These controller settings were kept unchanged throughout the case studies. Case 2--High inertia load The effect of increasing the inertia load on the overall system performance was first examined. Fig. 3 shows the experimental results obtained for both the conventional and the fuzzy PID controllers.

Fr \

C-

3.2. Experimental results

%

~y

0

Throughout the experimental study, the membership functions described in [ 3 ] have been chosen. The sampling period, Umin and Umax were set to 10 ms, - 2 . 5 V and 2.5 V respectively, and a square wave was chosen as the reference signal.

i

V--

(a)

(a)

Yr \ O ,--4

7--

t.~

I

I

3 s

Fig. 3. Case 2--Inertia load = 2J: (a) fuzzyPID; (b) conventional PID.

I

!

3s Fig. 4. Case 3--1nertia load = J: (a) fuzzy PID; (b) conventional PID.

96

C.M. Lira~Computers in Industry 26 (1995) 93-96

Case 3--Change in reference In this case, the effect of increasing the magnitude of the reference signal was examined. Fig. 4 shows the experimental results obtained for both the conventional and the fuzzy PID controllers. 3.3. Discussion From the results obtained, it can be seen that the fuzzy PID controller is suitable for dc motor control. Furthermore, this controller provides the overall system with a higher degree of robustness than the conventional PID in the presence a change in load or a change in the reference signal.

4. Conclusion A fuzzy PID scheme first reported in [3] has been implemented and found to be effective for dc motor control. The robustness of this controller has also been validated.

References [ 1] J.A. Bernard, "Use of a rule-based system for process control", IEEE Control Syst. 8 (1988)3-13. [21 C.C. Lee, "Fuzzy logic in control systems: Fuzzy logic controller--Parts I & II", IEEE Trans. Syst. Man Cybern. 20 (1990) 404-435. [3] C.L. Chen and P.C. Chen, "Application of fuzzy logic controllers in single-loop tuning multivariable system design", Computers in Industry 17 (1991) 33--41.

C.M. Lhn was born in Malaysia in 1952. He received the B.Eag, M.Eng and PhD degrees in Electrical Engineering from the National University of Singapore, in 1976, 1981 and 1986, respectively. He is currently a Deputy Head of the Department of Electronic & Computer Engineering, Ngee Ann Polytechnic, Singapore. His reseacrh interests include the application of fuzzy logic and self-tuning control schemes to dc drives, robot manipulators and large electric power systems. He is a senior member of IEEE and a member of IEE.