Experimental implementation of a fuzzy logic control scheme for a servomotor

Experimental implementation of a fuzzy logic control scheme for a servomotor

Mechatromcs Vol. 3. No. 1. pp. 3q-..47. 1903 Printed in Great Britain ~57--tI58/93 $6.00+0.00 ~ 19q2 Pergamon Prc~s Lid EXPERIMENTAL IMPLEMENTATION ...

339KB Sizes 4 Downloads 57 Views

Mechatromcs Vol. 3. No. 1. pp. 3q-..47. 1903 Printed in Great Britain

~57--tI58/93 $6.00+0.00 ~ 19q2 Pergamon Prc~s Lid

EXPERIMENTAL IMPLEMENTATION OF A FUZZY LOGIC CONTROL SCHEME FOR A SERVOMOTOR C. M. Lt,~t* and T. HIYAMA~ *Department of Electronic Engineering, Ngee Ann Polytechnic. Singapore 2159 and "l'Department of Electrical Engineering and Computer Science, Kumamoto University, Kumamoto 860. Japan

(Received 20 October 1991: accepted 24 June 1992) Abstract--This paper describes the experimental implementation and evaluation of a rule-based. fuzzy logic control scheme applied to a d.c. servomotor. The advantages of the proposed scheme for servosystems are highlighted. Specifically,it is shown that the proposed scheme is simple in structure and can therefore be readily implemented as it requires the measurement of only one system variable. Typical experimental results obtained are presented and, for compari~n purposes, results corresponding to a P.D. control scheme are also included. The.~ results show that the proposed scheme is effective in controlling the shaft position of the servomotor under light and heavy load conditions.

I. INTRODUCTION Two groups, one within the Department of Electrical Engineering and Computer Science at Kumamoto University and the other the Department of Electronic Engineering at Ngee Ann Polytechnic, have embarked on collaborative research work since 1988 to examine the effectiveness of rule-based, fuzzy logic systems for the control of large electric power systems and robot manipulators. Until recently the scope of this research work has been confined to simulation studies which have confirmed repeatedly the effectiveness of combining rule-based and fuzzy logic techniques for control purposes [1-6]. Motivated by the encouraging results that have been achieved thus far, we decided to proceed with the experimental validation of the fuzzy logic control schemes proposed by both groups. T o this end, a d.c. servomotor set and a microcomputer system are chosen for experimental implementation and evaluation. The primary objective of this paper is to present typical results obtained for an experimental study that involves the application of a rule-based, fuzzy logic control scheme to a d.c. servomotor. The significance of this study is that although the problems associated with the control of a d.c. servomotor are not too complicated, nevertheless the work presented here represents a preparatory step towards the more difficult future objectives of controlling a laboratory-scale power system and robot manipulators. 39

40

C.M. LIM and T. HIYAMA 2. EXPERIMENTAL SYSTEM

Figure 1 shows the configuration of the overall experimental system. Essentially, it consists of a Feedback MS150 d.c. servomotor whose output shaft position, y(t), is to be regulated at a desired or reference value, yr(t), using a rule-based, fuzzy logic control scheme. To this end, the shaft position is measured and fed-back for comparison with the desired value to produce an error signal, e(t). On the basis of a set of simple control rules and fuzzy logic, and with the error signal as the input, the microcomputer computes the desired control signal, u(t), which is then applied to the servomotor. The microcomputer, an IBM compatible PC/AT, is equipped with a MetraByte DASH 16F 12-bit A/D, D/A and I/O board, and it can be readily used to implement a given digital control scheme using QuickBASIC.

3. FUZZY LOGIC CONTROL SCHEME In this paper, the fuzzy logic control scheme first reported in [1-6] is adapted for the implementation and evaluation. Some details of this scheme are as follows.

3. !. Control rules In order to measure the condition of the d.c. servomotor, a phase plane, as shown in Fig. 2, is utilized to describe its state p(k) at the k"' sampling time which is dcfincd as follows p(k) = [e(k), f~d'(k)l,

(1)

e ( k ) = y,(/~) - y(/~),

(2)

o(k) = [e(k)

- e(k -

I)i/T,

(3)

where F, is a positive scaling factor and T is the sampling period. In Eqn (1), e(k) and E(k) are the error and rate of change of error of the servomotor output shaft position, respectively, it should be noted that Eqn (3) is defined so that only the

M~cro computer

servo om~oLifter

Servo motor

F~SJUO~ sensor

Fig. 1. Experimcntal system.

Fuzzy. logic servomotor control

41

i [e(k}-- e(k-l)]/Y

/9=0 O*

Sect.or A /

/'~

@(k)

e(k) • A3

Sector B

Fig, 2. Phase phme.

present and one past measurcmcnts of the error signal arc required to detcrminc p(k) and the control signal to bc described later. For a step change in the reference signal, y,(t), the equilibrium point or desired state of the servomotor is the origin, O, of the phase plane. Therefore, the control signal should be generated such that the servomotor state, p(k), is brought back to the origin of the phase plane as soon as possible after a disturbance or a change in the reference signal. To this end, the phase plane is divided into sectors A and B. On the basis that the application of a positive control signal will produce a positive torque which will cause a change in both the motor shaft speed and position in the positive direction, the control rules adopted here for sample points A1, A2 and A3 in sector A are as follows. (1) A positive, small control signal should be applied to the servomotor at sample point A l to prevent excessive shift of its position error to the positive side because this error is approaching the desired value, i.e. zero value, at a relatively high speed. (2) A positive, large control signal should be applied to the servomotor at sample point A2 because both the position error and the rate of change of this error are relatively large on the positive side. (3) A positive, small control signal should be applied to the servomotor at sample point A3 in order to shift the servomotor position error smoothly to the desired

42

C.M. LIM and T. HIYAMA

value. This is required because the servomotor rate of change of position error is slightly negative, large but its position error is still large on the positive side. (4) In sector B, all the situations are completely opposite to those in sector A. Therefore, the above control strategies should be reversed and the control signal should be negative in sector B.

3.2. Control algorithm Two fuzzy membership functions N[O(k)] and P[O(k)], as shown in Fig. 3, are defined to represent sectors A and B, respectively where O(k) indicates the phase angle of the point, p(k), as shown in Fig. 2. In general [7. 8], the control action of a rule-based, fuzzy logic system is achieved by first measuring the relevant parameters and then determining their membership grades. For every rule there is an outcome and an associated membership grade which is the rule's degree of fulfilment [8]. Finally, the resultant control action is computed as a linear combination of the outcomes of all rules weighted by their respective degree of fulfilment. Using the two membership functions of Fig. 3, the control signal is determined to be

u(k) = G(k)[N(O) - P(O)]Ur.,,x/[N(O) + P ( 0 ) l,

= O(k)[2N(0)-

(4)

where P(O) = 1 -

G(k)

(5)

N(O).

= n(k)/t¢

.....

for R(k) <- R.,.~,

(6)

for R(k) > Rm. x,

= 1.0

(7)

R(k) = Ip(k)r.

In the above expressions, G(k) indicates the gain factor at the k t" sampling interval. It is defined such that for a given O(k), the control effort required to shift the servomotor state to the origin of the phase plane is proportional to the distance of the state from the origin. However, in view of the physical limits of the system, G(k) is

N(B)

P(8 a = 20 °

/5' =-30 o

~ B

! 0o

95 °

~15 °

,0

w 135 °

27'5 =

Fig. 3. Membership functions.

295"

3GO"

Fuzzy, logic servomotor control

43

restricted to one beyond the pre-specified distance Rmax and, as such, the control signal is constrained to lu(k)[ <- Uma,.

(8)

where Um~., is a pre-specified positive constant. Remarks 1. If the control rules and fuzzy reasoning are treated as a nonlinear mapping from e(k) and ~(k) to u(k), then u(k) can be represented as u(k) = f ( e , ~).

(9)

The above implies that u is the output of a nonlinear P.D. controller [8]. 2. A fuzzy logic control scheme for servo systems has been proposed in [9] which made use of rectangular coordinates to measure the system state. Moreover, more than two membership functions and two lookup tables of quantized variables one for coarse control and the other for fine control, are required. The fuzzy logic control scheme proposed here exploits polar co-ordinates to measure the system state, and at any given state (R, 0) there are only three outcomes, viz. N(0), P(O) and G(R). Moreover, the three outcomes are readily determined and easily combined to yield the resultant control action. 3. In view of the above discussion, the computational requirement of the proposed fuzzy logic control scheme is quite low. 4. Further details on fuzzy logic control can be found, for example, in [91 which also provides a comprehensive list of references.

4. EXPERIMENTAl. STUDIES 4. I. Settings of control algorithn~ The above rule-based, fuzzy logic control algorithm has been implemented using the set-up shown in Fig. 1. Throughout the studies, the reference sigmd was chosen to be a square wave with a peak-to-peak value of 60* and a period of 8s. Furthermore, based on past experience and a few experimental runs, the parameter settings of this control scheme were chosen as in Table 1. 4.2. Experimemal results for light load Figure 4 shows the experimental results obtained when a load of low inertia was attached to the servomotor shaft, in order to provide a basis for comparison, the experimental results obtained when a digital P.D. control algorithm, see Appendix for Table 1. Parameter',citing,, +-lima, = +2.5 V T = 25 mr a = 20.(P

R ..... = 15 /-', = T / 2 . 0 I~ = - 3 0 . 0

o

°lj

44

C.M. LIM and T. HIYAMA

_30o

V

-2V 45

- 50*

I 3, -2V :I 45 Fig. 4. System rcsl~mScs (light load). (a) Fuzzy logic control. (b) P.D. control.

details, was implemented are included in Fig. 4b. The parameter settings of this P.D. controller were chosen such that the servomotor position response was as close as possible to that of the fuzzy logic controller.

4.3. Experimental results ]br heavy load Figure 5 shows the experimental results obtained when a load of high inertia was attached to the servomotor shaft. The experimental results of both the fuzzy logic and the PD control schemes are shown in Fig. 5.

4.4. Effects of gain factor on system response It is possible to increase the amount of damping provided by the fuzzy logic controller to the overall system by changing only its gain factor. Figure 6 shows the system output response when the controller parameter R,,,,x was set to 24 instead of 15 while the other parameter settings remain unchanged at the values shown in Table I.

Fuzzy logic servomotor control

45

Y

3°°1 - 30 ° ._J

4-< -2V 4s

30 °

AA

_30 o I

iv

Y'/

llt~

V

-2V L 4~ Fig. 5. System responses (heavy load). (a) Fuzzy logic control. (hi P.D. control.

5. DISCUSSION

5.1. Effectiveness of proposed control scheme From the results shown in Figs 4-6 it can be seen that the proposed rule-based. fuzzy logic control scheme is effective for controlling the position of the d.c. servomotor. It is able to provide a better performance to the d.c. servomotor than the P.D. control scheme in the presence of a change in the motor load. One effective way of varying the damping characteristic provided by the rule-based. fuzzy logic control scheme is to change the gain function parameter Rm,,,; the remaining parameter settings (a. IL T, F,. U,,,,~) should remain at the values shown in Table 1 for the particular d.c. servomotor under study.

46

C.M. LIM and T. HIYAMA

_iii11

l I v

-2V

V

4s

30°

-30° 1

_L -2V

7-

L~

l/

L_

I.

4s Fig. h. System rc,,ponscs R,,,~,, = 24). (a) l.ight load. (h) Heavy load.

5.2. Future experimental study This experimental study has provided valuable experience to the authors on the implementation of rt, le-based, fuzzy logic control systems. Motivated by the results obtained, the group at the Kum~,moto University h~,s started applying the proposed fuzzy logic control scheme, with slight modifications, to a micromachine system whose characteristics are highly nonlinear, and subjecting the overall system to large disturbance tests such as a short-circuit fauh. Experimental results obtained from this work will be reported in a separate paper.

5.3. A drawback of fuzzy logic control syswms h is interesting to take note of the ability of fuzzy logic control schemes to provide superior performance than conventional control schemes that make use of a mathematical model to describe the controlled system dynamics [10J. However, a drawback of fuzzy logic control schemes lies in the lack of rigorous stability and robustness analysis techniqt,es [10]. Owing to this drawback, it is not possible to assess the

Fuzzy logic servomotor control

47

stability o f t h e o v e r a l l s y s t e m w h e n it is u n d e r t h e c o n t r o l o f the p r o p o s e d fuzzy logic controller.

6. C O N C L U S I O N A r u l e - b a s e d , fuzzy logic c o n t r o l s c h e m e has b e e n successfully i m p l e m e n t e d for the c o n t r o l o f a d.c. s e r v o m o t o r . E x p e r i m e n t a l s t u d y s h o w s that the s c h e m e is r e a d i l y i m p l e m e n t e d a n d is effective in c o n t r o l l i n g t h e p o s i t i o n o f the d.c. s e r v o m o t o r shaft even in the p r e s e n c e o f a c h a n g e in its l o a d .

REFERENCES L. Hiyama T. and Lira C. M., Reprints of IFAC International Symposium on Power Systems and Power Plant Control, Seoul. Korea (1989). 2, Hiyama T. and Lira C. M.. Proc of the International Conference on Automation, Robotics and Computer Vision, Singapore (1990). 3. Hiyama T.. Sameshima T. and Lira C. M.. Proe. of tire blternational Conference on Automation. Robotics and Computer Vision, Singapore (1990). 4. Hiyama T.. Sameshima T. and Lira C. M., Proc. of the 3rd Symposium on Expert Systems Application to Power Systems, Tokyo-Kobe (1991). 5. Hiyama T. and Lira C. M., Proc. of Intcrnatiomd Conference on Power System Technology, Beijing (tg~t). 6. Lira C. M. and Hiyama T., IEEE Trans. Robotics and Automation 7, 5 (It'll}. 7. Bernard J. A.. IEEE Control Systems Magazine 8.4 (1988). 8. Li Y. F. and Lau C. C., IEEE Control Systems Magazine 9, 3 (1989). 9. Lee C. C., IEEE S vstet~t~. Alan and (.;vbernetics 20, 2 (19911). IlL Chiu S., Chand S., Mt~re D. and Chaudhary A., IEEE Control System 11, 4 (1991).

AI'PENDIX P.D. algorithm

The output of the P.D. controller used in this paper is given by ttpu(k) = Kre(k) + Kale(k) - e ( k - l ) l / T P o ,

(At)

and it is constrained within physical limits as follows l,,.D.(k) [ "-: U . . . . The numerical values of the above algorithm are

Kp =0.9, Tj, D = 20 ms, K,dTr.u = 1.2 and + Um~, = + 2.5 V.

(A2)