[IEEE ISIE '93 - Budapest: IEEE International Symposium on Industrial Electronics Conference -...

8
A Knowledge Based Intelligent Controller Abdalla, H.H. M. Farsi K. Z. Karam Department of Electrical & Electronic Engineering The University of Newcastle Upon Tyne, UK. Abstract-The paper demonstrates how AI techniques namely the expert system approach can be combined with a parallel process control scheme to implement a redundancy robust knowledge based intelligent controller. The knowledge base for this controller was designed to make a decision to select between a number of control strategies running on parallel based on specified control objectives. The parallel control structure provides both a means of reliability through redundancy and wide ranging applicability due to the variable control structure capability. 1. INTRODUCTION In order for any controller to make decisions on the choice of control algorithms and provide assessment on the effectiveness of the control system, it is desirable to incorporate the expert knowledge of control engineers. Over the past three decades or more, control theory has focused on building algorithms for process control. However, control problems can not be solved by algorithms alone and it is rather important to incorporate a substantial amount of heuristics. This has suggested the need for expert system methodologies to provide a systematic approach for dealing with such heuristics. Astrom et a1 111 have proposed an approach to improve the primary control function by introducing an expert system as part of the primary feedback loop. Their approach resulted in systems which are far more flexible and transparent than systems based on selectors and safety jackets currently in use in standard hard-wired logic. Their approach gave powerful control laws by combining conventional control algorithms with expert systems. The tuning of controller parameters also requires a considerable amount of expertise to achieve robust performance in terms of process control and energy consumption. The actuation signal required to drive a specified process to track the output variable usually differs depending on the type of control algorithm used. Many control algorithms may perform well in the face of model mismatch and disturbances, however one particular algorithm will probably give the best performance with moderate actuating signal. Use c .2ss actuating signal - - which usually translates to reducing operating expenses, motivates us to base our work on the assumption that energy consumption could be a criterion by which the selection between different controllers can be made[2]. If a particular controller is to be found, it may take many hours of trial and error and even when successhl, the selection may not be valid for many other operating points which the process may encounter. In this paper we investigate the possibility of using knowledge based techniques namely an expert system to make a decision among different controllers running in parallel where each has been tuned to meet a number of specifications. The structure of the knowledge based controller considered here is shown in Fig. 1. It is composed of a number of control strategies which include minimum variance, pole-placement ,and the proportional-integral- derivative( PID ) controller in its present form and may be extended to contain as many controllers as deemed appropriate. EXPERT IDENTIFIER SYSTEM Fig. 1 The structure of the knowledge based controller The main motivation behind a knowledge based implementation is the separation of the heuristics logic from numerical algorithms [3]. Heuristics knowledge usually 0-7803-1227-9/93/$3.0@ 1993 IEEE 535

Transcript of [IEEE ISIE '93 - Budapest: IEEE International Symposium on Industrial Electronics Conference -...

A Knowledge Based Intelligent Controller

Abdalla, H.H. M. Farsi K. Z. Karam

Department of Electrical & Electronic Engineering The University of Newcastle Upon Tyne, UK.

Abstract-The paper demonstrates how AI techniques namely the expert system approach can be combined with a parallel process control scheme to implement a redundancy robust knowledge based intelligent controller. The knowledge base for this controller was designed to make a decision to select between a number of control strategies running on parallel based on specified control objectives. The parallel control structure provides both a means of reliability through redundancy and wide ranging applicability due to the variable control structure capability.

1. INTRODUCTION

In order for any controller to make decisions on the choice of control algorithms and provide assessment on the effectiveness of the control system, it is desirable to incorporate the expert knowledge of control engineers. Over the past three decades or more, control theory has focused on building algorithms for process control. However, control problems can not be solved by algorithms alone and it is rather important to incorporate a substantial amount of heuristics. This has suggested the need for expert system methodologies to provide a systematic approach for dealing with such heuristics. Astrom et a1 111 have proposed an approach to improve the primary control function by introducing an expert system as part of the primary feedback loop. Their approach resulted in systems which are far more flexible and transparent than systems based on selectors and safety jackets currently in use in standard hard-wired logic. Their approach gave powerful control laws by combining conventional control algorithms with expert systems.

The tuning of controller parameters also requires a considerable amount of expertise to achieve robust performance in terms of process control and energy consumption. The actuation signal required to drive a specified process to track the output variable usually differs depending on the type of control algorithm used. Many control algorithms may perform well in the face of model mismatch and disturbances, however one particular algorithm will probably give the best performance with

moderate actuating signal. Use c .2ss actuating signal - -

which usually translates to reducing operating expenses, motivates us to base our work on the assumption that energy consumption could be a criterion by which the selection between different controllers can be made[2]. If a particular controller is to be found, it may take many hours of trial and error and even when successhl, the selection may not be valid for many other operating points which the process may encounter.

In this paper we investigate the possibility of using knowledge based techniques namely an expert system to make a decision among different controllers running in parallel where each has been tuned to meet a number of specifications. The structure of the knowledge based controller considered here is shown in Fig. 1. It is composed of a number of control strategies which include minimum variance, pole-placement ,and the proportional-integral- derivative( PID ) controller in its present form and may be extended to contain as many controllers as deemed appropriate.

EXPERT IDENTIFIER

SYSTEM

Fig. 1 The structure of the knowledge based controller

The main motivation behind a knowledge based implementation is the separation of the heuristics logic from numerical algorithms [3]. Heuristics knowledge usually

0-7803-1227-9/93/$3.0@ 1993 IEEE 535

appears in the form of I' if-then-else 'I logic statements, which are of symbolic logic nature in contrast with controller algorithms that are of mathematical and numerical nature. Conventional implementation tends to result in program codes where the numerical and logic parts intersected with each other. The mixture causes the program to become difficult to understand and to maintain modular development. A knowledge based approach provides an implementation structure where the heuristics and the numerics are separated. In knowledge based control, the coupling of symbolic and numerical algorithms must meet certain demands [4,5]. Rule execution in a knowledge based system is essentially a large search problem which is inherently slow and nondeterministic. On the other hand, numerical control algorithms must be able to compute an output within a fixed sampling interval and cannot be halted or delayed by a knowledge based system searching among different rules. As a result, the knowledge based systems should be implemented in an efficient way to avoid any unnecessary delays[6].

The main body of the paper may be outlined as follows. Section 2 gives a short description about the different control strategies included in the knowledge based controller. Expert systems are discussed in some generality in section 3. Some of the intelligent controller implementation details are given in section 4. This is followed by simulation results in section 5 . The paper ends with some conclusions about the knowledge based intelligent controller.

2. CONTROL STRATEGIES

The process to be controlled may be characterised by the discrete time equation

A@') y(t) = z-lr B(Z') u(t) + C(z-') c(t) (1)

Where A@'), B(zl) and C(zl) are polynomials in the backward shift operator z1 with appropriate dimensions. u(t) and y(t) are the input and the output of the process respectmely. &t) is the white-noise disturbance acting through the process dynamics. The parameters contained in A, B and C polynomials are recursively estimated using Least Squares estimation algorithm. As the convergence of these parameters in each controller space is dependent on the particular strategy, therefore the Least Squares algorithm is the internal part of all adaptive algorithms. For the sake of simplicity the argument of the polynomials (z-') is omitted in the following sections.

The intelligent controller has a number of control algorithms with Merent strategies running in parallel with

the process to be controlled. These algorithms are briefly outlined below.

a) Self-tuning PID controller

The PID controller in time domain has the following form

Where u(t) and e(t) are the control and error signals respectively. K is the proportional gain, TI and TD the integral and derivative action time respectively. As the PID controller structure has been well presented in the literature, it is not repeated here.

b) Pole-Assignment Controller

The control objective for a system will require the output y(t) to track a reference signal r(t) in some predetermined way and to reject random disturbances which may corrupt the output. In this formulation the objective of servo-following and disturbance regulation are combined. The pole assignment design for this combined objective, as presented by Wellstead et ai [7], is organised as follows. Consider the same system of (1) with a pole assignment controller of the form

F u(t) = H r(t) - G y(t) (3)

combining the controller and the system equations yields the closed loop description

The closed loop poles are then assigned to their desired locations, specified by T, by selecting F and G according to the polynomial identity

F A + z l B G = T ( 5 )

The assigned poles contained in polynomial T are given as input to the intelligent controller.

c) Generalised Minimum Variance Controller

In its basic form, minimum variance control is intended to solve the regulator problem for which the reference signal is a constant set-point [8]. The minimum variance control strategy can be extended to accommodate a servo-input r(t) and to overcome the problem associated with attempting to

536

cancel the zeros of a non minimum phase system [9]. The cost function to be minimised is the variance of the pseudo- output

J = E [(P y(t+k) + Q u(t) -R r(t))2] (6) KNOWLEDGE INFERENCE - -

BASE ENGINE

The closed loop equation of the process described by (1) under minimum variance control is given by

WORKING - - MEMORY

T(t> (7) BE + QC r ( t ) +- PB + QA

Z - ~ B R Y ( 0 = - PB + QA

Given A and B in the characteristic equation of the closed loop response ,we could calculate the parameters of the polynomials P and Q through the solution of this identity[ 101

In minimum variance control it is critical that the time delay integer k be correctly selected. Incorrect values of k can destabilize the controller or at least cause the regulation error to be much larger than expected.

3. KNOWLEDGE BASED EXPERT SYSTEMS

Expert systems seek to model the knowledge and procedures used by a human expert in solving problems within a well defined domain. Knowledge representation is a key issue in expert systems. Many different approaches have been attempted such as first order predicate calculus, procedural representation, semantic networks, production system (rule-based) and frames [ 1 11.

Production systems or rule-based expert systems have some very desirable features for a process control applications [l]. A typical rule-based expert system has four essential components:

(1) System knowledge base,

(2) Working memory,

(3) Inference engine,

(4) User interface.

BP + AQ = T,

where T is a user specified polynomial which can be chosen based on user specifications in terms of overshoot rise time and settling time. For a minimum variance strategy T is best set to unity.

537

These are shown in Fig. 2.

< = - Fig. 2. Structure of a knowledge based expert system.

( I ) Knowledge Base The knowledge base contains the domain knowledge needed to solve the control problems coded in the form of rules. A typical rule is as follows

if < antecedent > then < consequence >.

The "antecedent" represents facts, evidence, hypotheses and goals from the working memory. The "consequence" represents the action which has to be taken, for instance, to modify the working memory or to activate a controller algorithm.

(2) Working memory The working memory is the global data base of facts, evidence, hypotheses and goals. For a process control applications, the facts would include alarm levels, constraints, plant confguration etc. Evidence includes input and output measurements, energy consumption, output variance. In an expert system hypotheses are also generated and stored in the working memory to cope with limitations in known facts or measured evidence.. For instance, the various parameter estimates made by an estimation algorithm is an important class of hypotheses. Goals would include performance objectives such as transient accuracy and stability.

(3) Inference engine It is essentially an interpreter program to control the order in which the production rules are fired and resolve conflicts if more than one rule is applicable. This could be done by prioritising the satisfied rules, and executing the rule with the highest priority. Two general methods of inferencing are commonly used: forward chaining and backward chaining as the problem solving strategies of expert systems. Forward chaining is reasoning from facts to the conclusions resulting from those facts. Backward chaining involves reasoning in reverse from a

hypothesis, a potential conclusion to be proved, to the facts which support the hypothesis.

(4) User interface It is the mechanism by which the user and the expert system communicate. This includes explanation facilities that makes it possible to question how a certain fact was concluded, why a certain controller is executed etc. In addition it may include asking the user to provide more information about the process under control or to modLfy certain specifications if they are unreachable.

The knowledge based approach offers several distinct advantages. Separation of heuristics and numerics not only facilitates prototype development, debugging and maintenance but it is also relatively easy to extend the system with new functionality by introducing new algorithms and logic in an incremental and modular manner. In addition, expert system techniques provide interesting possibilities in user interface. Embedded knowledge can be inspected and modified on-line. In comparison, outdated knowledge in conventional programs is difficult to handle.

The idea of expert control was first presented by Astrom (1985) [12]. It is defined as having a collection of algorithms for control, supervision and adaptation which are all supervised by an expert system. The expert system should have the interesting ability to explain its reasoning. We can thus get answers to questions like what control strategy should be used? Why was this control strategy chosen? What is the current knowledge of the process and its environment? Is the variance of the process output normal? Is the energy consumption reasonable?

4. CONTROLLERS TUNING AND SELECTION

Both heuristics and quantitative measures are considered to make a decision for the selection among dfierent control algorithms. For instance, the user specifications about transient accuracy which are usually given in terms of required overshoot, rise time and settling time can give a good measure about which control algorithm will give the best performance compared with the others. To find out the effectiveness of different control strategies, it is relevant to ask: how to translate these specifications into controller parameters to guarantee that each controller will meet these specifications. First we need to translate the transient specifications from the time description to an s- plane pole-location requirement. A specification on percent overshoot can be translated into a specification of the damping factor c. The overshoot also depends on the existence of extra zeros. We must consider both and the zero locations to help meet specifications for transient

response on percent overshoot. The other time-domain feature of importance is the settling time. The requirement of a given settling time may be translated into a requirement of natural frequency on at certain damping factor. For further details refer to Appendix A.

In order to make the decision among the different controllers &er tuning them based on the user specifications, a performance criteria should be defined. For instance, the performance of each controller is then evaluated based on a number of different factors which could be specified as follows:

(1) Energy consumption,

(2) Output variance,

(3) Error in meeting the user specifications.

In this case a set of sub-scores could be allocated to each controller based on its ability (relative to the other controllers) to minimise each factor. This set of sub-scores is multiplied by an additional set of weightings specified by the user to reflect the importance of minimising each factor. An overall score for each controller is then obtained by summing the weighted sub-scores. The highest scoring controller (outside a 'score deadband') is then selected as having the best performance in terms of the above mentioned performance criteria.

Table.1 may help to clarrfy the idea and depicts a hypothetical example where performance of three controllers has been assessed over a defined period of operation. The performance has been evaluated in terms of the three factors mentioned above. In the table W represents the weighting given to each performance criterion. In this example the PPC controller appears to have provided the 'best' performance and would be chosen as the running controller.

5.. IMF'LEMENTATION

The expert system described in this paper is developed using an expert system tool written in, and fully integrated with the C language called CLIPS( C Language Integrated Production System). This production system was designed specifically to provide high portability, low cost, and easy integration with the existing or conventional software systems, besides it can run on IBM PC computers [13]. CLIPS is a forward chaining rule-based language that has inferencing and representation capabilities similar to those of OPS5. The numerical algorithms for control strategies and identification were implemented in C in order to achieve best performance in terms of speed and integration. CLIPS

538

is designed to be embedded within other programs. When CLIPS is used as an embedded application, the user must

provide a main program from which calls to CLIPS are made like any other subroutines.

performance

criteria

controllers

PID

PPC

GMY

TABLE 1

PERFORMANCE ASSESSMENT FOR THREE DIFFERENT CONTROLLERS

measure of error in

specification

W = 0.3

energy consumption output variance total score

W = 0.4 W = 0.3

absolute normalised absolute normalised absolute normalised ( w w t e d M-

mplised sum)

103 I 0.679 I 100 1 1 I 10 I 0.1 1 0.6016 98 0.714 120 0.833 1 1 0.8355

70 1 150 0.667 5 0.2 0.6601

The expert system incorporates the intelligence for choosing the right control strategy at every one hundred sample intervals to attain the desired performance objectives. This period is chosen arbitrarily and may be varied whenever it becomes necessary. The decision is made according to extracted process information and performance criteria. These criteria include the evaluation of energy consumption, the output variance and meeting the desired user specifications in terms of overshoot and settling time.

Typical rules of the expert system are as follows:

(defrule ppc-excluded (phase initial-selection) (zeros-near-the-unit-circle ?h&:(numberp ?h)&:( > ?h 0)) ?controller <- (controller ppc on)

(retract ?controller) (assert (controller ppc om))

=>

(defrule run-gmv (phase final-selection) (best-performance gmv) (controller gmv on) ?controller-not-running <- (controller-running no)

(retract ?controller-not-running) (assert (controller-running yes)) (assert (controller gmv running)))

=>

The first rule is about excluding a PPC controller from the set of control algorithms available. This rule is fired whenever there is at least one zero of the process to be controlled near the unit circle. The action of this rule is to prevent this controller from running any more. The second rule is to run a GMV controller provided that it has the best performance among other controllers. The other two conditions are to make sure that the GMV controller has not been excluded and no other controller is running at that moment. The action of this rule is to insert the fact that the GMV controller is running and to modify the working memory according to that.

The expert system runs through different phases. The input phase is the first, during which facts about prior process information and the user specifications are loaded to the data base. The second phase is the initial selection phase. Some control strategies have to be excluded during this phase depending on the information given by the user or the identification results. For example, a generalised minimum variance GMV algorithm will generally exhibit poor control if the time delay of the controlled process is under estimated, while the performance of a pole-placement algorithm is sensitive to zeros near the unit circle. Acknowledging facts like these is important in order to choose the best control algorithm in a given case[l4]. The third phase is called the analysis phase which includes the analysis and evaluation of data given to the expert system during the running of a specified process. These data may include the energy consumption for different control strategies and the output

539

variance of the process in each case. It includes also the transient information (overshoot, rise time and settling time) of the process under control. In the final phase, a decision has to be made to select one of the remaining control algorithms. During this phase information, about which controller has been excluded and which has been selected to control the process, has to be passed from the expert system to the main program.

6. SIMULATION RESULTS

The results obtained from running the knowledge based intelligent controller with a certain discrete time transfer hnction are shown in Figs. 3-6. The transfer function model has the following form

u(t - 1)

&t)

1 + 0.5.7-'

1-1.52-' + 0 . 7 ~ - ~ Y ( t ) =

1 + 0.52-'

1-1.52-' + 0 . 7 ~ - ~ +

. ,

Three different control algorithms are used in the knowledge based controller to control the process. Figs. 3-5 show the running of each individual control algorithm with the identified process model. Both input and output signals are shown for each controller. The user specifications are given as follows

desired overshoot in percent <= 10 YO, desired settling time in sec <= 20 sec,

These specifications are translated into the following desired closed loop characteristic equation

T = 1 - 1.35z-l + 0 . 7 3 6 ~ - ~ (9)

The assessment of each controller performance is based in this case on the three previously mentioned criteria namely energy consumption, output variance and the error in meeting the user specifications for transient accuracy. Clearly from Fig. 5 the GMV controller has much worse performance compared to the self-tuning PID and PPC. However, the distinction between the latter two cannot easily be seen from Figs. 3 2r.d 4 but obtained more readily from the performance criteria index which indicates a value of 2.99 for the PID controller and a value of 2.80 for the PPC controller. The choice of the PID controller under these circumstances was traced to the fact that it had better performance in terms of energy consumption and meeting the user specifications but not the best output variance.

Fig. 6, shows the performance of the knowledge based controller which illustrates the switching between the PPC and the PID controllers after 100 samples.

6, I

-6#

I no. of samples (x 100)

Fig. 3a system input signal for PID loop

15

-5 c no. of samples (x 100)

Fig. 3b system output signal for PID loop

no. of samples (x 100) i -21

Fig. 4a system input signal for PPC loop

4 2 4 6 8

no. of samples (x 100)

Fig. 4b. system output signal for PPC loop

540

I no. of samples (x 100)

c_ c _ - - - - y_ - c_

2 4 6 8 13 B

-4- Q)

-6 2

no. of samples (x 100)

pig. >a system input signal ror C ~ M V loop

control, Lund Institute of Technology, 1987, Sweden. [4] Koztmiller, C.T. and J.S. Kowalik, Coupling symbolic &

numerical computing in knowledge-based systems, AI magazine, 1987.

and numeric processing in CADCS, Proc. IFAC Symp. on Computer-Aided Design in Control Systems, Beijing,

(61 Yue, P.K., T.H. Lee, C.C. Hang and W.K. Ho, Realisation of an expert system based PID controller using industry standard sofiare and hardware

[ 5 ] James, J.R., Expert system shells for combining symbolic

1988, pp.347-352.

I

20 15-

2 4 6 8 10 0 -5 !

-1 04

no. of samples (x 100)

7. CONCLUSIONS

[7] Wellstead, P.E., D. Prager and P. Zanker, Pole assignment self-tuning regulator, Proc. IEE, 1979, vo1.126, no. 8, pp.781-787.

[8] Astrom, K.J. and B. Wittenmark, On self-tuning regulators, Automatica, 1973, vol. 9, pp. 185-199.

[9] Clarke, D.W. and P.J. Gawthrop, Self-tuning controller, Proc. IEE, 1975, ~01.122, no.9, pp.929-934.

[IO] Allidina, A.Y. and F.M. Hughes, Generalised self- tuning controller with pole assignment, IEE Proc., 1980,

[ 111 Firebaugh, M.W., Artificial Intelligence: a Knowledge- ~01.127, pt.D, n0.1, pp.13-18.

Employing expert systems in decision making to select between different control strategies in order to achieve robust performance, has opened up significant application areas in process control. The knowledge based controller described in this paper has the task of selecting between different control algorithms to fulfil a number of performance criteria which include meeting some user specifications in terms of overshoot and settling time and some constraints on energy consumption and output variance. The simulation results show that the knowledge based controller approach considered here provides more effective performance than could be achieved by individual controllers, and also provides a route towards the single unit multifunctional reliable controller.

541

[13] Giarratano, J. and Riley G., Expert Systems: Principles and Programming, PWS-KENT Pub]., 1989.

[ 141 Foss, B.A. and 0. Ogard, Choosing the settings of an adaptive controller using an expert ystem. Prac. IFAC Symp. on Computer-Aided Design in Control System, Beijing, 1988, pp.335-339.

9. APPENDIX A

The analysis given below shows how to convert the specifications in terms of overshoot and settling time into

where In( ) denotes the natural logarithm.

The settling time f for an error-tolerance of 1% is

4.6 t, = - < o n

(A41

Given the required settling time, a, is obtained as follows

4.6 (A51 guidelines on the placement of poles in the zdomain in

order to guide the design of digital controllers to meet these 0 =-

9, specifications.

The poles in sdomain in terms of C, and w, are For simplicity, we consider the case without an extra

zero. Consider the following second-order system in the s- domain P,, = -<on +- j o n J G 7

Y ( S ) - 4 pS2 = -Ton - io,, Jq (A61 (All --

U ( S ) s2 +25iu,s+w; In order to transform these poles into the zdomain z = eSTo is used. Where To is the sampling time. The poles -& in the zdomain are The percent overshoot, M p = e

Given a requirement on overshoot, the required C, is p,, = (cosbT, + j sin bT,),

pZz = e-"r"(cosbT, - jsin bT,)

where a = -<on,, b = on,/=

043)

542