Open Collections

UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

A qualitative modeling facility for intelligent supervisory control systems (ISCSs) Cifuentes, Edgardo Ivan 1995

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata


831-ubc_1995-059367.pdf [ 4.25MB ]
JSON: 831-1.0088312.json
JSON-LD: 831-1.0088312-ld.json
RDF/XML (Pretty): 831-1.0088312-rdf.xml
RDF/JSON: 831-1.0088312-rdf.json
Turtle: 831-1.0088312-turtle.txt
N-Triples: 831-1.0088312-rdf-ntriples.txt
Original Record: 831-1.0088312-source.json
Full Text

Full Text

A QUALITATIVE MODELING FACILITYFORINTELLIGENT SUPERVISORY CONTROL SYSTEMS (ISCSs)byEdgardo Ivan CifuentesB.Sc., University of Concepción, Chile, 1980A THESIS SUBMITTED iN PARTIAL FULFILLMENT OFTHE REQUIREMENTS FOR THE DEGREE OFDOCTOR OF PHILOSOPHYinTHE FACULTY OF GRADUATE STUDIESDepartment ofMining and Mineral Process EngineeringWe accept this thesis as conformingto the required standardTHE UNIVERSITY OF BRITISH COLUMBIAJune 1995© Edgardo Ivan Cifuentes, 1995In presenting this thesis in partial fulfillment of the requirements for an advanced degree at theUniversity of British Columbia, I agree that the Library shall make it freely available for referenceand study. I further agree that permission for extensive copying of this thesis for scholarly purposesmay be granted by the head of my department or by his or her representatives. It is understood thatcopying or publication of this thesis for financial gain shall not be allowed without my writtenpermission.Department ofMining and Mineral Process EngineeringThe University of British Columbia517-6350 Stores Rd.Vancouver, BC V6T 1Z4CanadaJune 28, 1995ABSTRACTControl strategies based on purely mathematical algorithms have only limited ability to cope with thetype of operating conditions found in full-scale industrial applications. One approach to overcomethis limitation integrates elements of automatic control theory, artificial intelligence and operationsresearch into the design of a control system. This approach is employed in this research study todesign an intelligent supervisory control system (ISCS). Elements of artificial intelligence to provide“human-like” characteristics for the ISCS are central to this research.Pseudo-Qualitative Modeling as a central component of an ISCS is proposed in this research. Thisapproach provides the mechanisms required by the ISCS to handle heuristic knowledge andapproximate reasoning required in many supervisory control applications. A simulation study hasbeen performed to demonstrate the validity of this approach. Simulation results have shown that thistechnique can handle either poorly-defined heuristic models or accurate models based onmathematical concepts. In fact, pseudo-qualitative modeling provides a framework to integratequalitative and numerical models into a knowledge-based system.A prototype of an ISCS was implemented using ProcessVision, a real-time SCADA (SupervisoryControl And Data Acquisition) software package. This prototype system was applied to the C-linegrinding circuit at Highland Valley Copper (HVC) to monitor and detect tonnage restrictions thataffect circuit production. The diagnosis of tonnage restriction is currently performed manually bymetallurgists on a weekly basis. This method is a heuristic procedure based on highly subjectivejudgment. The diagnosis results provided by the ISCS prototype during the evaluation period werewell within the range of those reported by HVC metallurgists. Implementation of this ISCSprototype has demonstrated the feasibility of incorporating qualitative modeling into a commercialreal-time SCADA system widely used in industrial applications.IITABLE OF CONTENTSPageABSTRACT.iiTABLE OF CONTENTS iiiLIST OF TABLES viLIST OF FIGURES viiACKNOWLEDGMENTS ixCHAPTER 1 INTRODUCTION 11.1 Background 11.2 Organization of the Work 21.3 Research Conducted in this Work 31.3.1 Objectives and Scope 31.3.2 Significance of the Proposed Research 41.3.3 Methodology 5CHAPTER 2 ADVANCES IN SUPERVISORY CONTROL 72.1 Supervising Automatic Control: A Need 72.2 Incorporating Intelligence Into Supervision 122.3 Advances in Supervisory Control 162.3.1 Determining Setpoints — Optimizing Control9 162.3.2 Fault Diagnosis 192.3.3 Expert Control 222.3.4 Human Operators in Supervision 23CHAPTER 3 INTELLIGENT CONTROL APPROACH 263.1 Introduction to Intelligent Control 263.2 Intelligent Control Approach: Main Characteristics 273.2.1 Overall Structure 273.2.2 Representing and Reasoning Upon Symbolic Knowledge 283.2.3 Dealing with Uncertain and Incomplete Knowledge 29111Page3.2.4 The Need to Learn 303.2.5 Making Decisions on Time 313.3 Elements of Artificial Intelligence (Al) in Intelligent Control (IC) 323.3.1 Knowledge Representation (KR) 323.3.2 Handling Uncertainty and Incompleteness 373.3.3 Learning Techniques 39CHAPTER 4 DESIGN OF AN INTELLIGENT SUPERVISORY CONTROL SYSTEM (ISCS) 414.1 General Structure 414.2 General Functional Definition 434.2.1 Global Functions of the ISCS 434.2.2 Supervisory Control Tasks 444.2.3 Regulatory Control Tasks 474.3 Hardware and Software Requirements 474.3.1 General Software Specifications 474.3.2 General Hardware Specifications 484.4 Potential Al Techniques Involved in the Design of an ISCS 49CHAPTER 5 PSEUDO-QUALITATIVE MODELING APPROACH 515.1 Introduction 515.2 Alternative Techniques to Qualitative Modeling 525.3 A Pseudo-Qualitative Approach to Qualitative Modeling 545.4 Building a QM of a Head Tank 605.5 Potential and Limitations of the Approach Proposed 695.6 Incorporation of Qualitative Modeling into an ISCS 73CHAPTER 6 DESIGN AND IMPLEMENTATION OF AN ISCS PROTOTYPE 756.1 Objective and Scope 756.2 Background 766.3 General Structure 766.4 ProcessVision Software Package 776.5 Tonnage Restrictions in the C-Line Grinding Circuit at HVC 796.6 Design Aspects of the ISCS Prototype 826.7 Experimental Results 91ivPage6.8 Evaluation of Results 102CHAPTER 7 FINAL CONCLUSIONS AND RECOMMENDATIONS 1087.1 Final Conclusions 1087.2 Recommendations for Future Research 111CHAPTER 8 CLAIMS TO ORIGINAL RESEARCH 112NOMENCLATURE 113BIBLIOGRAPHY 115APPENDIX A Al ELEMENTS THAT CAN BE INCORPORATED INTO AN ISCS 125APPENDIX B PROCEDURE TO BUILDING A QM INTO THE ISCS 141APPENDIX C KNOWLEDGE BASE FOR THE HEAD TANK 143APPENDIX D KNOWLEDGE BASE FOR THE ISCS PROTOTYPE 171VLIST OF TABLESPageTable 6.1 Restrictions handled by the ISCS prototype and their possible causes 86Table 6.2 Diagnostic results provided by the ISCS. Period: March26 - 31, 1995 103viLIST OF FIGURESPageFigure 2.1 Factors affecting the application of automatic control 8Figure 2.2 Results from the application of automatic control, (adapted from Rogers, 1985) 9Figure 2.3 Effect of automatic control on the excursion of the controlled variables,(Latour 1976) 10Figure 2.4 Effect of supervisory control on automatic operation 12Figure 2.5 Block diagram of an expert control system, (Aström, 1989) 23Figure 3.1 Intelligent control: merging control theory, artificial intelligence and operationsresearch, (Saridis 1987) 26Figure 3.2 Overall structure of an intelligent control system, (Rao, 1992) 28Figure 3.3 Example of frame-based knowledge representation 33Figure 3.4 Example of semantic net representation 36Figure 3.5 Fuzzy representation of “high” for the power draw 37Figure 3.6 General structure for empirical learning techniques, (adapted from Forsyth andRada, 1986) 40Figure 4.1 Approach proposed for the JSCS 41Figure 4.2 General structure for the Intelligent Supervisory Control System (ISCS) 42Figure 5.1 General structure of a QM under the pseudo-qualitative approach proposed 54Figure 5.2 Fuzzy Sets that define qualitative information of variables 55Figure 5.3 Quadratic inputloutput behavior represented qualitatively using primitivesqm_function and qmtable(3) 58Figure 5.4 Behavior predicted by a first order dynamic model as a variable evolves from onesteady state value to another 59Figure 5.5 Head Tank analyzed in the Case Study 60Figure 5.6 QM for the level of fluid in the tank, based on a qm_table(3) primitive 62Figure 5.7 Actual and predicted level of fluid in the tank; frale_in takes the values100, 50, and 75 1pm 66Figure 5.8 Simulation results for two valve openings: v 50 % and v 100 %;frate_in takesthe values 100, 50, and 75 1pm 66Figure 5.9 Simulation results on two similar tanks but with different areas;frate_in takes thevalues 100 and 50 1pm 67viiPageFigure 5.10 Simulation results obtained from a corrected QM of the tank.frale_in takes thevalues 100, 50, and 75 1pm 68Figure 5.11 Representation of a quadratic relationship under the pseudo-qualitative approachproposed (continuous line) and under a purely qualitative one (shaded areas),using a generic definition of fuzzy concepts 71Figure 5.12 Representation of a quadratic relationship using a pure QM at different levels ofresolution and the pseudo-qualitative approach proposed 72Figure 6.1 General structure of the implementation of the ISCS prototype 77Figure 6.2 C Line Grinding Circuit at HVC 79Figure 6.3 Setting a high limit for the fresh feed setpoint 81Figure 6.4 Sequence ofmajor tasks performed by the ISCS 84Figure 6.5 Estimating tonnage losses from historic trends (schematic trends) 87Figure 6.6 Estimating tonnage lost due to a “soft ore” restriction (schematic trends) 88Figure 6.7 User Interface: Process Overview Display 90Figure 6.8 User Interface: Tonnage loss per Category 91Figure 6.9 Soft ore restriction: April 1, 1995, day shift 92Figure 6.10 Restriction RR_FEED_CUT: April 1, day shift 94Figure 6.11 Restriction P.R_FEEDER_DOWN: March 30, day shift 96Figure 6.12 Restriction RR_ORESUPPLY. March 30, night shift 97Figure 6.13 Restriction RR_SAG_STOPS: March 29, day shift 99Figure 6.14 Many restrictions due to plugged chutes. April 1, day and night shifts 100Figure A.1 Fuzzy concept “hard,” P(OH/h) 127Figure A.2 Concept “high” for the power draw 128Figure A.3 Inference network for rule R2 129Figure A.4 Combining pieces of evidence when they are not conditionally independent 132Figure A.5 Domain theory to compare values of process variables 135Figure A.6 Example of a control 1oop operating OK 136Figure A.7 Proof tree for the example of Figure A.6 137Figure A.8 Generalized explanation for the control loop case 137Figure A.9 Unrestricted generalization for the case of the control loop 138Figure A.10 Restricted generalization for the case of the control loop 139Figure A.11 User defined concept hierarchy 139viiiACKNOWLEDGMENTSThis is a very speciaL moment in my life, a moment that I share intimately with my wife and bestfriend, Monique. She patiently endured many lonely days and nights and the postponement ofimportant aspects of our family life because ... “I had to work on my thesis.” Her role in the thesiswas not passive, though. She read my thesis drafts and discussed with me about some of the issuesinvolved in the research; now she is an expert in the area. Even more important, her steadfastsupport and gentle words of love and encouragement were essential for me to overcome the stressfuland dark periods of this research project. I am forever grateful to her.My deepest gratitude is to Dr. John Meech, who supervised the latter part of this work. It has been apleasure to work with him; he always showed great enthusiasm and a positive attitude towards thisresearch. His comments and suggestions, drawn from his expertise in the area, were essential for thesuccess of this research project. I was impressed by his incredible energy and willingness to workeven overnight and during weekends to read my drafts in order to give me a timely feedback. Mygratitude also to Prof. Andy Mular for his financial support of this project. Also, thanks to RandyMorrison, Mile Boss, Andy Burkert and other friends that proof-read early thesis drafts.My gratitude to Dr. Brian Flintoff from Brenda Process Technology, for his support andencouragement during the first part of this work. Thanks are extended to Noranda and MITEC fortheir financial support. My sincere gratitude to Comdale Technologies for facilitating ProcessVision,the SCADA software used for the development of the ISCS prototype. My appreciation to HighlandValley Copper (HVC) Mine for giving me the opportunity to evaluate the ISCS prototype in one oftheir grinding circuits. Special thanks to Hans Raabe who provided the expert knowledge to buildthe prototype. Thanks also to Cohn Lindsay and Jolm Mitchell for their comments on the prototype,and to Brent Veitch for his enthusiasm and readiness to help with the interconnection between theISCS prototype and the HVC control system.Finally, in retrospect, I can only conclude that none of the above would have been possible normeaningful without the love of the eternal and only living God.ixCHAPTER 1INTRODUCTION1.1 BackgroundSubstantial progress has been made in automatic control over the past few decades. Many differentadvanced control algorithms using a variety of approaches have been proposed. However, theapplication of the new algorithms has been rather slow, so a gap between academic algorithms andpractical versions found in industrial applications has occurred. Furthermore, it is now well-recognized that automatic control theory fails to cope with many practical control problems found inan industrial environment (Tong 1977; Wittenmark and Aström 1984).Human operators have played an important role in supporting the automatic operation of a process.An operator often takes control of the process, overriding the automatic control system when it isunable to cope with some specific operating circumstances. Does the operator have a mathematicalmodel of the process, or advanced numerical control algorithms? This is doubtful. A human operatorperforms well even in the absence of precise information. He/she possesses the ability to handlepartial and incomplete information and reason at a low level of resolution. These are keycharacteristics that need to be incorporated into a control system.This research focuses on the design of a control system that supports integration of both numericaland qualitative elements. Central to this research is the development of a qualitative approach thatoffers the mechanisms required by a control system to handle the subjective judgments andapproximate reasoning found in the manual supervision ofmany industrial processes.11.2 Organization of the WorkThe second part of this chapter presents in detail the objectives of this research study as well as themethodology followed. Chapter 2 presents an introduction to supervisory control and a briefdescription of recent advances in the area. The need for incorporating human-like intelligence into asupervisory system is established in this chapter. Chapter 3 describes an approach to incorporateintelligence into a supervisory system. The chapter describes the fundamentals of this approach andthe different artificial intelligence elements involved. Chapter 4 presents the overall structureproposed for a supervisory system that integrates numerical and qualitative elements. It brieflypresents the hardware and software requirements for the implementation of such a system, as well asthe major artificial intelligence elements that may be incorporated into the system.Chapter 5 is a key section of this thesis as it describes in detail an approach to incorporate qualitativemodeling into a control system using a modified technique which is called Pseudo-QualitativeModeling. A simulation study is presented and discussed as the basis for validation of the method.Chapter 6 presents the development of a prototype system incorporating a pseudo-qualitative model.The results of the application of the prototype to a full-scale industrial grinding circuit at HighlandValley Copper Mine are presented and evaluated. Chapter 7 presents a synthesis of conclusionsabout the central aspects of this research. Finally, Chapter 8 presents a list of claims to originalresearch as the specific contribution of this study.21.3 Research Conducted in this Work1.3.1 Objectives and ScopeThe main objective of this research can be expressed as:Incorporation of a qualitative modeling facility into an Jntelligent supervisorycontrol system (ISCS) to assist in the real-time supervision of the automaticoperation of an industrial process.For ISCS we understand a supervisory control system designed under an intelligent control approach,i.e. its design integrates elements of artificial intelligence with conventional elements of automaticcontrol.Some of the specific sub-goals for this project are:i) Gain in-depth knowledge of different approaches to incorporate human-like intelligence into asupervisory control system.ii) Propose an approach to qualitative model that is suitable for operation in a real-time environmentand able to represent heuristic knowledge about the behavior of industrial unit operations.ii) Design and develop an ISCS prototype system that employs a qualitative approach to assist in thesupervision of a full-scale industrial operation.This study is intended to be a basic platform to demonstrate the feasibility of incorporatingqualitative models into the design of a supervisory control system. Qualitative models provide asupervisory system with appropriate mechanisms to handle incomplete knowledge and approximatereasoning about the behavior of a physical process.3The work focuses on the use of a pseudo-qualitative modeling approach to build adequate processrepresentation into a supervisory control system. An existing intelligent SCADA package(Supervisory Control and Data Acquisition) called ProcessVision is used as the reservoir for thequalitative models. The research will demonstrate how qualitative models can be applied within anexisting artificial intelligence (A!) tool.Other Al elements such as handling uncertainty and on-line learning will also be analyzed in brief asrequirements for future AT developments.An ISCS prototype that employs a qualitative approach to model and supervise the operation ofcomplex processes will be developed in the last stage of this research. This prototype will beimplemented using a real-time commercial system and applied to the C-line grinding circuit atHighland Valley Copper (HVC). The focus of this application will be to monitor and detect tonnagerestrictions that affect circuit production. At this stage, given the objectives of this research study,the system will not intervene directly with the process. Appropriate corrective actions will be left tothe discretion of plant operators.1.3.2 Significance of the Proposed ResearchConventional control systems based on purely numerical elements have limited ability to cope withreal world problems. One major approach taken to overcome these limitations has been theintegration of Al elements and automatic control theory. This approach marked the beginning of thefield of intelligent control.The design of an ISCS as proposed in this research is an important step towards development of anew generation of supervisory systems that integrate quantitative and qualitative elements. Therehave been other studies in this area but none of them with the scope of this research. The results of4this research will be supported by the application of an ISCS prototype to a full-scale industrialprocess.Finally, the other relevant aspect of the research is the area of application: semi-autogenous grinding.Semi-autogenous grinding is one of the most important stages within mineral processing, and offers achallenging world of opportunities for improvement to automatic control practitioners.1.3.3 MethodologyThe first step of this research is to review the aspects of supervisory control as they relate to the needfor AT methodologies. The second step includes a review of different AT techniques available forknowledge representation, reasoning and learning. The focus of this review is on qualitativemodeling and the unique requirements of real-time applications. A specific approach to qualitativemodeling, i.e. the pseudo-qualitative modeling approach, is proposed.Third, the pseudo-qualitative modeling approach is refined and validated via simulation studies. Aqualitative model (QM) of a well-understood process, a head tank, is built and simulated underdifferent conditions; the simulation results are compared to those obtained from a mathematicalmodel of the same process. This simple process was purposely chosen for this simulation study as ithelps to visualize clearly, and demonstrate, the principles of the approach proposed.Fourth, an ISCS prototype is built following the general structure proposed for the design of suchsystems. This prototype, implemented using a real-time commercial SCADA system, incorporatesthe pseudo-qualitative modeling approach proposed and demonstrates the ease of its applicationwithin available AT software.5The final step of this research involves the application of the ISCS prototype built to the C-linegrinding circuit at Highland Valley Copper (HVC). The ISCS provides on-line advice to assist in thesupervision of the automatic operation of the process. The system monitors and detects tonnagerestrictions that affect circuit production. Experimental results are employed to assess benefits andlimitations of the approach proposed.6CHAPTER 2ADVANCES IN SUPERVISORY CONTROL2.1 Supervising Automatic Control: A NeedIn the early days of the industrial era, processing plants were designed and constructed with virtuallyno instrumentation. Lack of control knowledge and technological limitations were mainlyresponsible for this. Since then, we have witnessed major technological breakthroughs which,combined with advances in knowledge, have led to automatic control as a proven technology.However, there is no guarantee that automatic control applications are always successful.It is tempting to view the solution of an automatic control application problem merely as theinstallation of a commercially available state-of-the-art piece of equipment. Although we disagreewith this practice, the reality is that many current industrial applications of automatic control (and themineral process industry is not unique in this regard), seem to follow this practice without regard tofundamental understanding of control theory. Mular (1989) states in his study of process control inmineral processing plants that: “Since 1977 older computer control systems have been or are beingreplaced by up-to-date distributed control equipment which incorporate microprocessor controllers.”However, such “up-to-date” hardware technology may not employ modern control strategies. In1989, Mular and Burkert concluded that “To date, advanced control techniques have found minimaluse in control strategies for SAG circuits.” Since that time, however, we have seen a number ofsuccessful developments in the use ofmodem techniques for grinding mill circuit control (Eggert andBenford 1994; Perry and Hall 1994; and McDermott et al. 1994).7Installing a computer-based process control system does not guarantee improved control. Variousfactors affect the application of automatic control to industrial processes, the combination of whichmay mean the difference between failure and success for a particular application. These may beclassified as inherent to the control system, to the process, to humans (personnel related to theapplication), and to the environment, as illustrated in Figure 2.1. The control problem is not only apiece of hardware together with control algorithms that manipulate process inputs to achieve desiredoutput targets. Thought must be given to other issues involved in the overall control problem.Flintoff and Mular (1992), referring to the effects of process and human factors on controlapplications, note: “If a circuit or plant is plagued by breakdowns, or is a victim of poor design orpoor operation, chances are that control will not provide the most cost effective solutions to theproblems. In the extreme, these problems can render the control system prohibitively expensiveand/or ineffective.”ENVIRONMENT HUMAN FACTORS- ntS-PFigure 2.1 Factors affecting the application of automatic control.The combined effect of different factors on a typical control application is represented in Figure 2.2(adapted from Rogers, 1985). This diagram indicates that, in general, the results of automatic controlapplication should lie somewhere between manual control and a theoretical optimum achievable.CONTROL SYSTEM- Hardware technology- Control strategy design- Control algorithms- Software packagesPROCESS- Equipment breakdown- Complex behavior- Maintenance needs- Limited capacity8Yet, in some extreme cases, automatic control may be outperformed by manual control. A moreoptimistic view of Figure 2.2 tells us that there is always room for improvement given an appropriateautomatic control strategy—the theoretical optimum is always an attractive goal to aim for. Differentcontrol algorithms and different control strategies yield different results; some will be closer to thetheoretical optimum while others will struggle to move away from the manual operation “ghost.”AUTOMATIC CONTROLManual controlTimeFigure 2.2 Results from the application of automatic control, (adapted fromRogers, 1985).Advances in control theory during the past few decades are such that the theoretical optimum may bewithin reach. With the advent of microcomputer technology, algorithms that can deal with largedelay times, time-varying parameters, multi-variable processes, noise in process variables andmeasurements, autonomous operation, and so on, have been developed (Fortescue et al. 1981;Fuentes and Cifuentes 1988; Clarke 1981; Clarke and Gawthrop 1981; Aström and Wittenmark1989; Antsaklis et al. 1989 & 1990; Tuffs and Clarke 1985). However, in spite of these advances,automatic control theory on its own still fails to cope with many practical control problems found inan industrial environment. As a result, researchers recognize the importance of appropriatesupervision of different design aspects of industrial controllers. A self-tuning algorithm, forinstance, requires supervision of its identification procedure, parameter estimation, controller designand closed loop stability (Isermann and Lachmann 1985; Wittenmark and Astrom 1984; Sanchez etTheoretical optimum9al. 1988). Such supervision is indispensable for an algorithm to succeed in the industrial world.Lack of attention to supervision has contributed to the gap between academic algorithms andpractical versions that must operate in an industrial setting. The truth is an industrial controller mustdeal not only with complex process characteristics such as nonlinearities, delays and time-varyingparameters, but also with different operating upsets such as tanks overflowing, broken belts, millsoverloading, chutes plugging and so on. To address these constraints, prior knowledge orsupervision is essential for any controller to survive. Even a simple PID (Proportional-IntegralDerivative) controller needs supervision. A PID algorithm is only the heart of an industrial PIDcontroller; sampling, filtering, conditioning, alarming and anti-wind-up mechanisms are some of thelogistic support needed by a PID controller.Well-tuned controllers, in general, reduce the variance (excursions) of controlled variables, as shownin Figure 2.3 (Latour 1976; Hales et al. 1982). However, badly-tuned controllers may cause moreproblems than benefits; they may even cause instabilities in process behavior. Unfortunately, resultssuch as that shown in Figure 2.3, for properly tuned controllers, are valid only during “normal”periods of operation.Figure 2.3 Effect of automatic control on the excursion of the controlledvariables, (Latour 1976).frequencyautomatic controlmanual controlVcontrolled variablequality specification10During normal operation, a process is not unduly disturbed, equipment operates near nominal levels(not in an overload condition or during procedures of start-up or shut-down) and process variablesare within normal ranges (no alarms are reached; they are at a safe distance from unstable or highlynonlinear zones). As soon as these normal conditions are violated, a human supervisor starts to playan important role in supporting the automatic operation and expanding its limits of operation beyondthe original boundaries given by “normal” operating conditions. It is a human operator with hisknowledge, experience, skills and intuition who takes control of the process and is able to guide itsoperation through these abnormal periods of operation.A human operator is highly resourceful but has limited capacities. His ability to supervise a processdeteriorates rapidly as the complexity of the situation increases, and excessive attention is requiredfor extensive periods of time (Drury 1976; Lees and Sayers 1976; van Deif 1985). For instance, it isdangerous for an operator to adjust controlled variables too close to limit values such as operatingconstraints, quality specifications, or boundaries of stable operating zones, and maintain thoseoperating points for a prolonged time. The position of these target landmarks vary continually withtime due to disturbances. Thus having narrowed down the excursions of controlled variables byincorporating regulatory control, we need a computer-based supervisory system to guide theoperation of such variables. This computer-based system would lead the controlled variables towardtheir optimum operating points, and would deal with constraints usually found on that path. This is atask that cannot be done only once. It must be continually repeated, as the optimum point andconstraints are essentially time-varying features of a given process (see Figure 2.4). Clearly,something to alleviate the stress on a human operator such as a supervisory control system is veryimportant. The supervisory control system has to deal not only with the complexity of processbehavior but also with operating disturbances such as break down of equipment, overload conditionsand so on.11No matter what type of individual controllers comprises the regulatory level, a proper supervision ofboth individual and collective operation of the controllers is essential to bring the operation of aprocess closer to the theoretical optimum, as shown in Figure 2.4.ObjectiveFigure 2.4 Effect of supervisory control on automatic operation.2.2 Incorporating Intelligence Into Supervision.Traditionally, supervision has been the exclusive domain of human beings. Despite advances inknowledge and technology, it still enjoys an aura of being an art that only a skillful operator canmaster. Computers, although powerful machines, are still relegated to taking more routine and well-defined tasks which require systematic execution of procedures or algorithms. Human operatorshave retained control of higher order functions such as long-term planning, overall monitoring, andconsultation when unusual situations arise.To design a supervisory system we need to examine the different functions and tasks involved, theirnature and how humans have been handling them. Sheridan (1976) classifies supervision activitiesinto four major task headers: planning, programming, monitoring and intervening. When planning, ahuman operator deals with questions and decisions concerning topics such as: the operating strategyTheoretical OptimumConstraintsTimeManual Control12to use to reach production goals; the type of actions needed given some specific process behavior; theinformation required to assess the behavior of the process; and so on. Programming involves all theactivities an operator performs when he tries to make a system operate as planned. These include:implementing a particular control strategy; setting up specific parameters for process equipment andfor control system elements; and modifying the process layout as planned. Monitoring involvesactivities such as attending to information on displays and panels, evaluating process behavior,assessing the fulfillment of planned goals, and diagnosing causes of failures or abnormal processbehavior. Intervening involves interruption by the human operator of the control loops, and sorequires direct interaction between the operator and the process.A human operator is flexible and inventive; he captures and transforms information displayed by theplant into appropriate actions according to the current goal. To perform these supervisory tasksmental representations are derived from different sources such as prior experience with plantbehavior; from knowledge of internal anatomy and functioning of the plant; or from prescribed rulesand instructions. Furthermore, different mechanisms are used to accomplish the goal; e.g.responding “automatically” to a situation, or identifying a problem or following a more formal step-by-step mental processing.Fischler and Firschein (1987) state that one of the most remarkable attributes of human intelligenceis the ability to convert a problem into a familiar representation so it can be solved with previouslyused techniques. Two people who confront the same physical reality will represent and interpret it indifferent ways, in accordance with a stored framework (model, metaphor or image), that is used bythe person to deal with the outside world. Fischler quotes North who says, “we carry around in ourhead a model of the world, of society, of the local community, of the family—even of oneself, andnone of us can deal with any of these entities, even superficially, without reference to the appropriatemental construct or model” (North 1976). It is the only way we have to relate to other people and to13our larger surroundings. We draw upon these models whenever we discuss affairs, whenever wevote, and whenever we plan for the future in any way.What sort ofmechanisms does an operator use to represent the information he handles? How does herepresent and store his experience? Are they numbers, symbols, images or abstract concepts? Whatkind of mental processing does he perform? Does he use some type of logic for reasoning, or is itpure mathematical operations? Too many questions, and not very many answers. Psychologists andcognitive scientists are still at the beginning of understanding the complexities of human behavior.Johnson-Laird (1989), notes that thinking occurs in such a dazzling variety that some cognitivescientists have despaired of understanding it. There is, at one extreme, the free flow of ideas indaydreams; which are mental processes that have no specific goal. At the other extreme, there ismental arithmetic. Here the thinking is deterministic: it has a precise goal, and it is done in avoluntary and consciously controlled way. At each point, the next step in the calculation isdetermined by its current state. Johnson-Laird suggests that perhaps most thinking lies between thesetwo extremes. It has a goal, but it is not carried out like a calculation, and people do not follow astrictly determined procedure. Different people may tackle the same problem in different ways.Even the same person, given a second chance in ignorance of his first attempt, may take a differentpath the second time around. Nothing constrains us to just a single option at each step in a thinkingprocess.An important characteristic of human reasoning when supervising a process is that observations aregenerally expressed at a higher level of abstraction related to the normal plant state, the expectedoperating point, the next task, etc. Rasmussen (1976) notes that the operator, rather than “reading”instruments, appears to ask higher level questions of the system and use individual instrumentreadings as symbols to define system states. Rasmussen presents a detailed schematic that shows a14sequence of mental activities followed by an operator between initiation of a reasoning process andexecution of an action. After detecting a specific problem, the operator arrives at different “states ofknowledge” before deciding on a specific action. These states are connected to each other viaappropriate mental processes. A skilled operator may not enter the sequence of states at the samestarting point at all times, or may change the order of the steps, or may choose a sequence with adifferent number of steps. In fact, an experienced operator only “occasionally” moves through all thesteps in a given sequence. A skilled operator is flexible and inventive, so his mental processing canlead him to “jump” from one state of knowledge to another later in the sequence. Rasmussenobserves that, when entering a study of human performance in real-life tasks one rapidly findsoneself “rushing in where angels fear to tread.”Although we are still far from fully understanding human behavior in supervision, we are certainabout one thing: the need to incorporate “human-like” characteristics into the design of a supervisorysystem. The system should be able to handle both quantitative and qualitative information; interactwith a quantitative process world and communicate with human users in both formats. It should alsobe able to handle uncertain information and incomplete and approximate knowledge, and reasonupon this type of knowledge. It should have the capacity to learn. It should also ... We couldcontinue enumerating desirable (if not essential) features for the supervisory system. If we look atthese features, they are simply a description of an operator’s abilities in relation to plant supervision.Researchers in the field of intelligent control (IC) are working toward this objective of incorporatinghuman-like features into a control system. IC researchers combine elements of artificial intelligence(Al) with traditional automatic control elements to produce new alternative solutions to the controlproblem. Several different mechanisms have been proposed that attempt to capture the richness ofhumans regarding knowledge representation and reasoning with this knowledge. Some of thesemechanisms are: semantic nets, decision trees, state transition graphs, frames, logic, mathematics and15production systems (Cifuentes and Mular 1992; Berenji 1990; Efstahiou 1990; Karetnyk et al. 1988;Leitch 1988; McGregor et a!. 1992). Researchers have also proposed different mechanisms to addlearning capacity to a computer-based system (Crosscope and Bonnell 1988; Geng and Jamshidi1988; Kokar 1988; Lee and Kim 1988; Peters et a!. 1992). Although the initial dream of a human-like computer-based system is remote and may never be reached, we believe the approach taken byIC researchers points in the right direction. As we will see in more detail in the following sections,this approach has natural advantages over a fully numerical one.2.3 Advances in Supervisory ControlThere are fewer studies conducted in supervisory control as compared to the number of publicationsconcerning regulatory control. In many cases supervisory control is considered equivalent to a classof optimizing routines that decide the values of setpoints for regulatory control; most of theapplications in the literature follow this view. Fault diagnosis has also received attention fromresearchers, although not always related to process supervision. The general impression is that muchmore work is necessary to formalize the knowledge available in this area.2.3.1 Determining Setpoints — Optimizing Control?A supervisory control system sits above the regulatory control level and determines the value ofsetpoints for the different controllers composing that level in accordance with suitable criteria (Mular1989; Flintoff and Mular 1992). Deciding setpoints for regulatory controllers is certainly importantbut supervisory control should not be limited to this task alone. It is essential to incorporatemechanisms to deal with special operating conditions such as process disturbances, abnormaloperation and special procedures; and so expand the automatic operation of the process beyond theinitial constraints of normal operation.16The algorithms to determine setpoints can vary from optimization algorithms to ad-hoc empiricalmethods that keep processes within stable or safe operating limits. An optimization algorithmcalculates setpoint values seeking to minimize (or maximize) an objective function such as anefficiency or productivity index for the process. Steady-state optimization has been more appealing,since global economic indexes are directly related to steady-state behavior of processes. Dynamicoptimization of processes, which considers time as an explicit optimization variable, has been left toresearchers in optimal control.The approaches can be classified as model-based optimization and empirical optimization. Under amodel-based approach, both process models and objective functions are described by algebraicequations and an optimization algorithm is used to search for the optimum point. Numericaltechniques such as linear programming, gradient and steepest-ascent are often used to maximize theobjective function. If models are steady state, the optimization is steady state. Empiricaloptimization is generally used when there is no appropriate model to describe the process. Thisapproach may use either an explicit or implicit objective function. In this case, processmeasurements are used to evaluate current operating points, and heuristic algorithms are employed todecide changes on setpoint values. Part of a heuristic algorithm may look like this: “If efficiencyincreased with last change, then repeat that change; if it decreased, reverse last change.” Thisempirical approach is the most common one in industrial applications not only from a lack ofappropriate models, but also because of time-varying characteristics.Mular and Burkert (1988) review control strategies for SAG circuits at a number of operations. Oneof the operations examined was the SAG mill at the Los Bronces Plant in Chile, also described byJerez et al. (1985). The control strategy at this plant aimed at: maximizing the mill throughput usingmaximum available power, while maintaining stable power draw. An empirical approach is followedwith no explicit objective function. Regulatory control is composed of two major control loops17based on variable gain PD controllers: a power loop and a bearing pressure loop. Supervisorycontrol was implemented using a procedural language (at the time of their publication), designed tocheck if the mill was in an overload condition; to bring the mill out of overload; to determine thewater/fresh-feed ratio; and to decide the feedrate setpoint according to the fresh-feed sizedistribution. If overload occurs, two alternative actions may be taken to bring the mill back to astable zone, namely, override the power loop and use the bearing pressure ioop, or decrease thepower setpoint step by step during several five minute periods. A process engineer decidesbeforehand on one of these alternative actions. Once the mill is again in a stable region, the operatorreturns mill control to the power loop, which increases the setpoint in steps until the nominal value isreached. The water/ore ratio is modified by a hill climbing routine, which increases or decreases thewater ratio according to the changes produced on the power draw by previous water changes.The approach followed by McManus et al. (1975), for the same problem of maximizing thethroughput is similar to that of Jerez et al. (1985). The specific heuristic strategy, however, isdifferent than that followed by Jerez. This difference in strategy may reflect either differences in thecircuits or differences between personnel involved in each application.Most optimization strategies designed to determine setpoint values in the mineral industry follow thegeneral empirical approach just described (Krog 1979; Ratte 1979; Bartrum et al. 1986). Theapproach followed by Hales and Herbst in which an expert system (ES) was used as part of theoptimization strategy also falls within this category. In their case, they use a Kalman filter toestimate unmeasured variables and an ES shell to implement the heuristic strategy for optimizationand safe operation of the process (Hales and Pate 1985; Hales et al. 1988; Herbst et al. 1989).Eggert and Benford (1994) and McDermott et al. (1994) also use ES technology to supervise theautomatic operation of a process. Eggert uses ES and heuristic rules drawn from experts to supervise18the automatic operation of the grinding process at Dome Mine, Ontario, Canada. McDermott’sapplication is similar to that of Eggert but for a grinding circuit at Wabush Mines, Newfoundland,Canada. The objective of increasing tonnage throughput was met in both applications.2.3.2 Fault DiagnosisThere is substantial work in the area of fault detection and diagnosis, although not all related toprocess supervision. Some of this work is oriented to digital circuits (Hamscher and Davis 1984; deKleer 1976; de Kleer and Williams 1987; Pipitone 1986), others to medicine (Shortliffe 1976;Kuipers 1989; Weiss et al. 1979), and to industrial processes (Scarl et al. 1987; Thompson andClancey 1986; Jones et a!. 1988, 1990a & 1990b; Vagenas and Grangholm 1991; Rao and Ying1990). Some of these diagnostic strategies also detect multiple faults as in the case of Arjunan(1988) and de Kleer and Williams (1987).Fault diagnosis consists of a mechanism to detect the occurrence of a fault and to find the cause forthat fault. Mechanisms vary from fully numerical to fully qualitative, and from using structuralknowledge of the elements involved to using heuristic knowledge in the form of compiled patternmatching (Milne 1987a & 1987b).Reiter (1987) presents a general theory for the fault diagnostic problem based on first principles(structural knowledge). He claims this theory can be applied to a variety of task domains such asmedicine, digital and analog circuits, and database updates. His approach starts with a description ofthe system and how its components interact. Observation of the system’s behavior is conducted. Adiagnostic problem arises when this observation conflicts with the way the system is meant tobehave. The problem is to determine those system components which, when functioning abnormally,explain the discrepancy between observed and correct system behavior. He proposes an algorithm19that determines all possible diagnoses for a given system with faults; and then uses a set of additionalmeasurements to discriminate among competing diagnoses. Other approaches based on firstprinciples include those of de Kleer (1976), de Kleer and Williams (1987), and Davis (1985). Thesemethods, however, do not incorporate expert experience in diagnostic reasoning.Another approach referred to as the “deep model” approach uses a model of the system to detectfailures. In this approach the input-output behavior of a system (or of the elements of a system) isrepresented by a model that produces expected outputs, which are compared to observed values todetermine the occurrence of a fault. Kuipers (1987) presents a model-based reasoning approach fordiagnostic purposes using qualitative models and his qualitative simulator QSIM. The goal of hiswork is to produce an explanation that accounts for the observed differences in the behavior of thesystem. An adequate explanation will cover descriptions of a correctly functioning system, adescription of any changes to that system that would account for the primary differences in themalfunctioning system, and finally, a demonstration or confirmation that the perturbed mechanismcan produce the relevant malfunctions that have been observed.Scarl et al. (1987) also present a model-based approach using knowledge of structure and function ofthe system. Their diagnostic reasoning is as follows: pick an element for the fault detected;hypothesize some faulty state for the suspect; use the model to derive expected values for thesystem’s sensors; test these values for consistency with actual sensors’ measurements; if all sensorsare consistent with their expected values then the hypothesized fault is one possible explanation forthe malfunction detected. They use knowledge of the structure and function to guide the search toeliminate possible candidates.Jones et al. (1988) compared two fault diagnosis approaches—a qualitative and a quantitative one,using a laboratory system that consists of a pump and a multiple tank assembly. The qualitative20approach referred to as “plant transgression-based diagnostics” consists of IF-THEN rules, pairing“transgressions” observed in the plant with “faults.” This is built using domain knowledge acquiredfrom an expert through first-hand experience. The second approach, referred to as “modeltransgression-based diagnostics,” uses three types of quantitative model of the plant: a model of thenormal process, a model of the observed process, and models of faulty processes. These models canbe used by either recognizing discrepancies between real and model outputs or by recognizingsimilarities between the observed model and known faulty models of the process. The strategy alsoemploys IF-THEN rules as in the case of the qualitative approach. Their results show that faults areeasier to detect with plant transgression-based diagnostics approaches than with model transgression-based approaches; although the latter may be extremely effective at detecting faults which manifestthemselves as changes in internal plant dynamics.Thompson and Clancey (1986) used Heracles, a qualitative modeling environment derived fromMycin (Shortliffe 1976) in the diagnosis of a sand casting process. Burrows et al. (1989) used the ESshell Nexpert to improve reliability of assay information in a flotation plant. Their goal is todiagnose data provided by an X-ray fluorescence analysis system, detect erroneous data points andreplace them by realistic ones. The principle used by Burrows’ work is similar to that of diagnosingthe operation of a process; in one case diagnosis is applied to data and in the others to physicalelements. Vagenas and Grangholm (1991) present a study of the potential application of expertsystems to fault diagnosis of mining equipment in Swedish mines. They consider the possibilities ofincorporating different types of knowledge into an ES including descriptive, behavioral, operational,heuristic, diagnostic and maintenance knowledge; and also two diagnostic strategies: decision tree orheuristic and model-based. One of their conclusions is that diagnosis in mining still relies mostly onempirical approaches and that much work needs to be done to formalize such experientialknowledge.212.3.3 Expert ControlThe approach followed mainly by Aström referred to as “expert control” is conceptually quite closeto a supervisoly system for control functions (Aström et al. 1986; Aström 1989, Astrom andWittenmark 1989; Verbruggen and Aström 1990). The idea of expert control is to have a collectionof algorithms of control, identification and estimation orchestrated by an ES. Instead of having onecontrol algorithm and one estimation algorithm, the system has several algorithms including those forexcitation and for diagnosis, as well as tables to store data. An ES overseeing the operation decideswhen a particular algorithm should be used or what sort of action should be taken at a given time (seeFigure 2.5).Aström recommends a bank of control algorithms and an associated database with encodedinformation for each of them in order that the ES can evaluate their behavior. A set of directsupervisory routines are designed to evaluate different aspects of the operation of the algorithms.Among these routines, we should mention an “excitation routine” to ensure proper operation of theestimator; a “jump detector” for sudden changes in parameters; a “perturbation routine” to generatean excitation signal; and a “stability supervisor” to monitor closed loop stability. The knowledgebase contains process data, results from the direct supervisory routines, operating indices, andmonitoring tables with a history of different aspects of the behavior of the system. The ES usesheuristic knowledge about particular algorithms and those conditions in which they can be used, andinformation on how to supervise the overall operation of the control system. The ES decides when touse a particular control algorithm or when there is a need for additional process excitation for betterparameter estimation.22Controlled variableFigure 2.5 Block diagram of an expert control system, (Aström, 1989).2.3.4 Human Operators in SupervisionAnother aspect that has received attention from cognitive science researchers is the role of humanoperators in supervision when interacting with an automated system. This area has been ignored byresearchers in process control, although it may have a definite impact on the effectiveness andacceptance of supervisory systems.Singleton (1976) says that whenever a computer is assisting operators to control a complex process,the computer normally performs the more routine tasks whereas human operators retain the longer-term planning function, an overall monitoring function, and a consultation function when unusualsituations arise. Rasmussen (1986) also agrees with this saying that, “automation does not removehumans from the system; it basically moves them from the immediate control of system operation tohigher-level supervisory tasks and to longer-term maintenance and planning tasks.” Thus humanoperators will continue playing a vital role in the overall effectiveness of a supervisory system. Gooddesign of the man-machine interface may still account for the difference between failure and successof a system. This design, according to Rasmussen, should be based on a generic model of the23information processes involved in the decisions to be taken by a human operator; on how heperceives and represents the world, and on how he deals with a specific situation he faces.But how does an operator perceive the physical system he is dealing with? What sort of mentalrepresentation or abstraction of that system does he have? Researchers argue that operators perceivea physical plant they are supervising as a functional abstract hierarchy. At the bottom of thishierarchy, we find physical elements with location, interconnection and form; whereas at the top, wefind the overall functional purpose of such plant (Rasmussen 1986; Pikaar 1985). This perception ofthe “world” is quite flexible; it very much depends upon the goals and intentions of the person. Indealing with a specific situation he may only have a certain part of the whole system within his spanof attention. To him, this portion is “the system” to be represented (his entire abstract hierarchy atthat time) and the rest of the system becomes part of the “environment.” As his focus of attentionchanges, in accordance with the situation, his “system “also changes eventually corresponding to theentire global system.Another interesting classification of human behavior presented by Rasmussen (1986), distinguishesskill-based, rule-based and knowledge-based behavior. Skill-based behavior represents sensorimotorperfonnance during acts or activities that, after a statement of an intention, take place withoutconscious control as smooth, automated, and highly integrated patterns of behavior. Rule-basedbehavior is goal-oriented and the particular activities chosen are structured and consciouslycontrolled by stored rules or procedures that may have been derived empirically during previousoccasions, communicated from other persons’ know-how as an instruction or cookbook recipe, or itmay be prepared on each occasion by conscious problem solving and planning. At the highest levelof knowledge-based behavior, performance is goal-controlled and knowledge-based. Here, the goalis explicitly formulated and a useful plan is developed. Different plans are considered and theireffect tested against the goal. This test is either physically by trial-and-error or, conceptually by24understanding the functional properties of the environment and predicting the effects of the planconsidered.Understanding human behavior and performance in supervision contributes to better design of man-machine systems. Sutton (1990) argues that to meet the challenges of designing man-machinesystems, it is essential to develop models of human operators and that, as in any other field, thesemodels have to be formalized and validated. He presents a detailed study on models of humanoperators closer to the lower level of behavior, referred to as “skill-based” behavior by Rasmussen.His study covers his view on man-machine interaction, proposition and simulation of different linearand non-linear models and incorporation of fuzzy set theory to man-machine interaction. Millot et al.(1985) present some approaches to man-machine cooperation in automated processes. Pikaar (1985)presents a hierarchy of activities at different levels of decision in a supervisory system that may beassigned either to the computer or to the operator depending on the level of automation. Sheridan(1976) also sees the operator of an automated system being removed from direct involvement at theloop level towards an overseeing role. He classifies supervisory functions as: planning, teaching,monitoring and intervening.Jovic and van Delf study different aspects of human performance in supervision such as short andlong-term memory, effect of motivation, data visualization, sampling rate and increasing complexityof the tasks (Jovic 1992; van Delf 1985). They describe an operators’ role and interaction with acomputerized system; the main tasks dependent on the purpose of the system and level of supervisionresponsibilities. Bösser (1985) has examined how training may affect operators’ performance. Drury(1976) goes further, examining how performance is influenced by other aspects such as availabilityand accuracy of the information, access to intermediate and historical information, processcomplexity and practice on a given task.25CHAPTER 3INTELLIGENT CONTROL APPROACH3.1 Introduction to Intelligent ControlThe term Intelligent Control (IC), traditionally attributed to Fu (1971), was more extensivelydiscussed and officially born as a research field at the First WEE Workshop on IC, New York, 1985.Saridis later defines it as control “which would replace the human mind in making decision, planningcontrol strategies, and learning new functions whenever the environment does not allow and does notjustify the presence of a human operator” (Saridis 1987). IC is still developing so new definitionsand formalizations continue to be an important discussion topic at annual IC workshops. Saridisreinforces the idea of IC as the intersection of artificial intelligence (Al), operations research (OR),and automatic control (AC), (see Figure 3.1).Figure 3.1 Intelligent control: merging control theory, artificial intelligenceand operations research, (Saridis 1987).26As argued in a panel discussion during the 1987 IEEE mt. Symposium on IC (Panel Discussion1987), IC is not Al because an IC approach uses a more rigid (more logical, more mathematical)description of the goal and sub-goals of the system; a more rigid description of the system withgradually increasing knowledge and adequacy of the models; and a more rigid method for its design.IC is not “conventional” automatic control either, since the goal of the system is describedsymbolically, the system is known imprecisely, our knowledge increases gradually during operation,and uncertainty plays an important role in the design of controllers.3.2 Intelligent Control Approach: Main Characteristics3.2.1 Overall StructureThe approach of IC follows a general principle of “decreasing precision with increasingintelligence,” which establishes a hierarchy in the distribution of intelligence within the structure ofan intelligent control system. Following this approach, Saridis proposes a hierarchical system withthree levels of intelligence: An “organizational” level that represents the master-mind of the systemwith functions dominated by Al; a “coordination” level that interfaces the high and low levels andwith functions dominated by Al and operations research; and an “execution” level with highrequirements in precision and functions dominated by systems theory (Saridis 1985).Rao emphasizes that the design of an intelligent control system should “integrate” symbolic toolswith existing technology in automatic control and not just substitute this existing technology (Rao etal. 1988; Rao 1992). Rao proposes an architecture to control and manage large-scale intelligentsystems which integrates: knowledge on different disciplinary domains; empirical expertise andanalytical knowledge; different symbolic processing and numeric computational systems; andinformation in different formats such as symbolic, numeric and graphic information. On top of these27different modules of knowledge integration he visualizes a “meta-system” which: coordinates andmanages all symbolic reasoning systems and numerical routines; distributes knowledge into separateexpert systems (ESs) and numerical routines; acquires new knowledge; finds a near optimal solutionfor the conflicting solutions and facts among the different ESs; provides the possibility of parallelprocessing; communicates with the measuring devices and the final control elements of the controlsystem; and transforms various input/output signals into the standard communication signals (seeFigure 3.2).vZNNFigure 3.2 Overall structure of an intelligent control system, (Rao, 1992).3.2.2 Representing and Reasoning Upon Symbolic KnowledgeThere are many tasks associated with the operation of a control system which are essentiallymathematical calculations for which proven mathematical techniques exist, e.g. filtering, parameterestimation, control algorithms and optimization techniques. The control problem, however, requiresmore than a collection ofmathematical algorithms. As we mentioned before, it involves a substantialamount of heuristic knowledge, especially at the supervisory level of control.An operator supervising a particular process does not check the mathematical calculations involved;rather he focuses his attention on the overall performance observed. After a change in setpoint, he28observes the evolution of the control variable, and may say: “this controller is well tuned,” or “theresponse is too slow.” Or after reading the level indication in a tank, he may say that “the level islow.” He has his own representation for the concepts he handles—”low,” “too slow,” “well tuned”and the like; and his own mental reasoning process to handle such information.An Intelligent Control system needs to have the same ability to handle abstract symbolic information.None of the existing Al technique can handle symbolic information with the richness of a humanoperator. As Rao (1992) suggests, a promising approach is integration of the different techniquesavailable.3.2.3 Dealing with Uncertain and Incomplete KnowledgeA! provides tools such as fuzzy sets, fuzzy logic, subjective probabilities and qualitative modeling todesign an intelligent system with the capacity to handle approximate knowledge. But why botherwith uncertainties and imprecise knowledge in engineering, when we all know that “engineeringprocedures require exact techniques and that there is no room for imprecision or intuition”? Anoperator would readily agree, indicating that “the reading of an instrument is a specific and precisevalue,” and “the aperture of a valve to be closed to a certain percent opening will also be a concretevalue.”It is true that physical components have “precise” status—a motor is either ON or OFF, for instance.Variables also have “concrete” values—if a power draw indicator says 3000 hp, the operator cannotsay that the power draw may also be 2800 hp. However, the above examples could be somewhatmisleading concerning the presence of uncertainty and approximation in an industrial environment.The fact is that even in the case when the operator has read the exact value of a variable such as thepower draw being 3000 hp, his mental representation of this information adds immediately an29inherent degree of vagueness and imprecision to this information. For instance, after the reading, hemay say that “the power draw is too high” and use this new representation in conjunction with hisown set of heuristic rules during his decision-making process. This reasoning strategy may lead himto the conclusion that he has to “reduce fresh feed to the mill,” which is also highly imprecise.Does an operator have a complete mathematical model of the process he is dealing with? Certainlynot. What he has is the ability to use a partial and approximate representation of the reality of hisconcern to draw conclusions. How does a grinding mill work? What are the exact phenomena takingplace in the size reduction of the ore? Not even an expert may have a complete answer to thesequestions. However, an operator may know that “if he cuts the fresh feed to a mill, the power drawwill likely decrease,” enough knowledge for him to take an appropriate action when the power drawis “too high,” for instance.3.2.4 The Need to LearnIf a computational system can handle symbolic knowledge, we immediately refer to it as an“intelligent system.” Current intelligent systems perform well as long as the problems belong to theclass for which they were designed. However, they may fail miserably for other kinds of problems orwhen they deal with a situation not foreseen in the design stage.Learning is one of the basic features that gives a system the ability to go beyond a mere execution ofwhat was programmed at the design stage. A system without this capability should be referred to asa “non-intelligent” (or perhaps, mentally deficient) system. A definition of learning favored by ATresearchers is: “Learning denotes changes in the system that are adaptive in the sense that they enablethe system to do the same task or tasks drawn from the same population more effectively the nexttime” (Partridge and Paap, 1988).30When an adaptive controller modifies its parameters to respond to changes in the process orenvironment, we may say that it has learned, in a limited sense. Within the context of intelligentcontrol, learning means creating knowledge structures, not just parameter adjustments. Learninghere is equated with building, modifying, or improving descriptions. These descriptions can be in theform of declarative statements, procedures, control algorithms, simulation models, or theories.3.2.5 Making Decisions on TimeOne important aspect to bear in mind, is that we are dealing with a time-varying process that does notwait for us to think of a better action—no action is appropriate if it is not applied “on time.” This hasled us to develop the concept of “real-time” operation for a computer system, i.e. a computer thatperforms tasks at specific time instants, or has access to (real) time values. For instance, to calculatethe rate of change of a variable the computer needs to know the exact time elapsed betweenmeasurements.A distortion of the concept of real-time has led us to think that if a system is to operate in real-time, itneeds to respond in milli-seconds——or, hopefully, instantaneously. We agree that a human operatorworks on “real-time,” but does he respond in a fraction of a second? Well, not always. Does healways need to respond in a fraction of a second? Not really. In some situations he may respondquickly whereas in others he may take longer (due to the process dynamics involved) to evaluate andto determine the need for an action. The important point is that his actions should be taken “ontime.” How long does it take, for instance, for an operator to determine if the increase of thepercentage of solids in a grinding mill is beneficial or not? Does he need to react instantly?With this in mind, a better requirement for a supervisory system is that the decision of taking anaction be made “on time.” The system needs, however, to handle the concept of time and its (real)31value in order to deal with temporal reasoning such as in the calculation of the rate of change ofvariables.3.3 Elements of Artificial Intelligence (Al) in Intelligent Control (IC)3.3.1 Knowledge Representation (KR)Besides the well known quantitative mechanisms for the representation of information, used byconventional control approaches, IC offers a rich variety of techniques taken from the field of AT torepresent symbolic knowledge about processes and operators’ heuristics. These techniques partiallyemulate human mechanisms for mental representation of knowledge.I) KR Using Rules (Production Systems)The most common knowledge representation technique employed by IC researchers is IF-THENrules. It is argued, and to some extent accepted, that the knowledge handled by humans can bestructured as a set of facts or assertions about the real world, and a set of heuristics of the form ofIF-THEN rules to reason upon that knowledge. Facts about the process or environment may berepresented symbolically by:Property (object, value)These facts could come from a translation of quantitative process measurements or could be reporteddirectly by another operator. After reading a flowmeter, the operator may interpret or represent theinformation read by saying: “the water flowrate is too low,” which can be symbolically representedby: flowrate (water, too-low). IF-THEN rules are intended to capture heuristic or experientialknowledge an operator has, and may take one of the general forms:32IF antecedents THEN consequencesIF premises THEN conclusionsIF situation THEN actionA rule related to the example of the water flowrate may be something like this: “IF the water flowrateis too low THEN we may have problems pumping the slurry.”ii) KR Using FramesA frame is a way to represent knowledge about objects and events common to a particular situation.The elements of a given situation are stored as entries in the slots of a frame. This representationgives an object-oriented approach to the knowledge represented. Thus the knowledge can be easilystructured and different techniques such as property inheritance can be used among these objects.Figure 3.3 shows an example of a frame describing a specific process pipe that transports slurry.TYPE: Slurry PipeTYPE. PumpNAME: PIPE-tONAME: PUMP.1O1DESCRIPTION: ///DESCRIPTION:FROM: PUMP-lOlTO:FLUID: Slurry_________________TYPE: Slurry FlowrateNAME:FLOWRATE:% SOLIDS:TREND:Figure 3.3 Example of frame-based knowledge representation.33It is interesting to notice that the frame for PIPE-jO, shown in Figure 3.3, can be used for any pipetransporting slurry. Another important aspect is that a slot may also be treated as an object and bedescribed by a frame, as in the case of slurry flowrate shown in Figure 3.3.In some development tools, the organization of knowledge or facts into “classes” of facts, is amodified type of a “frame.”iii) KR Using Qualitative ModelsQualitative modeling, treated extensively in chapter 5, has been used by IC researchers to deal withincomplete knowledge and with approximate and low resolution reasoning (Abdulmaj id and Wynne1991; Cifuentes and Mular 1992; Corea et al. 1992; Leitch 1988). This approach is useful insituations where one needs only a rapid and rough estimate of what behavior is possible, rather than avery precise prediction involving quantitative mathematical models.Qualitative modeling provides elements to represent continuous properties of the real world bymeans of a discrete and finite system of symbols. Only the key factors influencing the behavior ofthe reality are captured, so the models obtained have the desired high degree of abstraction. In thisformalism both variables and their relationships have to be described qualitatively.One of the formalisms to represent qualitatively a variable is sign ontology. Under this formalism avariable is represented by the sign of its amount and the sign of its derivative. Thus only threevalues are distinguished on a variable: positive, zero and negative; and we can only say that avariable is increasing, constant or decreasing. Nothing more specific can be said about it. Therelationship between variables is expressed by “qualitative relationships.”34As an example, let us consider a qualitative model (QM) for the relationship between the power drawand the fresh feedrate of solids to the mill. This relationship could be represented by the qualitativeproportionality:P draw a FF_ solidsread as: “the power draw on the mill is qualitatively proportional to the fresh feedrate of solids to themill.” In algebraic notation this would be written as P draw = f (. . . , FF_solids, . .), withf anunspecified monotonic function.If we are told that the fresh feedrate of solids, FF_solids, is increasing, we could immediately deducethat the power draw, P_draw, will also increase, provided we have not exceeded the maximum in thepower versus feedrate curve. There is no numerical value involved, and there is no need for morespecific information to determine the type of change that the power draw will have. This is one ofthe important features of qualitative models.iv) KR Using Semantic NetsA tree or graphic structure is typically used to describe relationships between objects, often for thegeneral purpose of questioning and answering. A partial description of a grinding mill may berepresented as shown in Figure 3.4. From this representation, we could derive for instance that: “thepower drawn by the mill is pd-value, and that this power draw is proportional to the fresh feedrate ofsolids to the mill.”35v) KR Using Fuzzy SetsFuzzy set theory gives us the elements to deal with vagueness and uncertainty in knowledge. Humanoperators’ language is full of fuzzy concepts such as “high,” “very-low,” “hard,” “coarse” and so on.For instance, after reading the value of the power draw of a mill, the operator may say that, “thepower draw is high.” He may have a range of values for which he says that the power draw is“high,” with some degree of certainty. As the power draw increases his certainty in using thisconcept also increases to a point at which he may say that “the power draw is definitely high.” Torepresent the vagueness of the concept “high,” within the context of the example, a possibilitydistribution of the formPoss{ high j} = 6 J, the set of power draw values within “high”associated with the value of the power draw, j, being “high” is chosen. This possibility distributionis considered to be numerically equal to a membership function ..Lhjgh(j)’ with J being the domain ofthe values of “high” (see Figure 3.5). For values greater than J1, the power draw is considered to behas-amt : has amounthas-dyn : has dynamicsFigure 3.4 Example of semantic net representation.36“definitely high,” whereas for values less than J0, it is said to be “definitely not-high.” In otherwords, a degree of truth (belief) between 0 (completely false) and 1 (definitely true) has beenassigned to the proposition “the power draw is high.”I.’ (I)drawFigure 3.5 Fuzzy representation of “high” for the power draw.3.3.2 Handling Uncertainty and IncompletenessProblem solving and decision making by people are often done in environments where theinformation concerning the problem is partial and approximate. These deficiencies in knowledgemay be due to factors such as: partial or unreliable information, inherently imprecise representationlanguage and conflicting information from multiple sources.Al researchers have proposed several approaches to represent and deal with uncertainty. However,the only one that seems to have reached the IC world is fuzzy logic with its possibility theory (Harrisand Meech 1987; Karr 1991; Sugeno 1985; Peters et al. 1992; Berenji 1990; Dubois and Prade 1988).Qualitative modeling is another important Al technique considered to handle approximate knowledge(Forbus 1984 & 1986a; DAmbrosio 1989a & 1989b).Fuzzy logic, as proposed by Zadeh (1988), provides the means for dealing with imprecise predicatessuch as “high,” “low,” “hard,” etc. A heuristic rule involving, for instance, the proposition “thepower draw is high” from the previous example shown in Figure 3.5 may be given by:‘high”0JI37IF power draw is high ThEN the ore is hard (3.1)Given this IF-THEN rule, we obtain a conditional possibility distribution for the hardness of the oregiven the evidence that “the power draw is high,” written as p. and given by (see Tong 1977;Andersen and Nielsen 1985):hX(J,h)=min[l1J(J)A!1h(h)] j EJ&h EH (3.2)where (j) and Ih(h) are the membership functions for “power draw high” and “the ore is hard”respectively; and J and H are the sets of possible values for the power draw and ore hardness.The output of rule (3.1), i.e. the conclusion “the ore is hard,” will also be a possibility distributionsimilar to that of Figure 3.5 for the power draw, given by:= max { mm [‘ (j) A th .j (J, h) I } (3.3)JEJDifferent authors use different approaches to deal with fuzzy sets and fuzzy logic; they use different“fuzzy” operations to obtain the results from a rule (Zadeh 1988; Dubois and Prade 1988; Tong1977; Harris and Meech 1987; Andersen and Nielsen 1985; Isaka 1990; Karr 1991).Another interpretation of the certainty factors (degrees of belief) associated with propositions andrules is that they account for incompleteness in our knowledge. If we assign a degree of belief 0.7 tothe rule given in (3.1), for instance, we may interpret it by saying that we are not absolutely sure thatthe only reason for the high value of power draw is due to a hard ore. Or, from another perspective,we may say that this rule is the simplest way to estimate the hardness of the ore—and it is only arough approximation.38In general, a heuristic rule is a partial representation of a situation. We may know that there are otherfactors contributing to that piece of knowledge, but due to unknown effects of those factors, orbecause we know that their contribution is not significant and we want to work with simple rules, orbecause their effect has been implicitly considered, we choose to assign a degree of belief to the rulerepresenting the incompleteness of that piece of knowledge.3.3.3 Learning TechniquesMost of the learning techniques used in IC fall within the category of “empirical learning.” Withinthis category we can distinguish symbolic learning, evolutionary (genetic) learning, and connectionistlearning. The main characteristic of these techniques is that they are based on knowledge-poorinductive inference. “Analytical learning” techniques are still within the AT domain. Thesetechniques are knowledge-intensive and require background knowledge; the basic inference type theyuse is deduction. The knowledge learned is basically a new representation for the input information;and not necessarily new knowledge.Empirical learning can be described as a framework where the real and ideal behaviors of the systemare compared and the system is then modified according to the difference between these behaviors(see Figure 3.6). Some of these techniques can be considered search or optimization techniquesusing specific algorithms such as evolution theory, genetics or neuronal operation (connectionist).There is a goal or ideal behavior and the system is continually modified to reach the goal (Forsythand Rada 1986). Karr (1991) uses a genetic algorithm to modify definitions of fuzzy sets and thusmodify the performance of a fuzzy controller. Connectionist approaches are used for learning controlapplications to robot operation (Miller and Hewes 1988; Isik and Ciliz 1988). An ad-hoc searchtechnique is used by Crosscope and Bonnell (1988) to modify a “learning network” which can beused to model a plant for control purposes.39system inputFigure 3.6 General structure for empirical learning techniques, (adaptedfrom Forsyth and Rada, 1986).IC researchers are cautious about using learning techniques that go beyond parameter learning. Themain reason is that learning techniques are still in their infancy. Hence, it is risky at this stage todevelop an application in which the system autonomously learn new rules on how to control a plant.It is much safer when the user defines the structure of the knowledge and the learning techniquedetermines parameters only—which is fairly close to adaptive control.40CHAPTER 4DESIGN OF AN INTELLIGENT SUPERVISORYCONTROL SYSTEM (ISCS)4.1 General StructureThe approach proposed for the design of the intelligent supervisory control system (ISCS), is that ofa supervisory system sitting on top of a regulatory control system (RCS) as shown in Figure 4.1. TheISCS deals with functions such as: monitoring the operation of the RCS; deciding setpoints; choosingoperating modes for controllers; analyzing the operation of main components of the circuit as well asglobal operation; and supporting special tasks such as start-up and shut-down.Figure 4.1 Approach proposed for the ISCS.The design of the ISCS provides the flexibility to deal with different types of RCS. The ISCSprovides the tools and mechanisms to implement the supervisory functions as required by a specificRCS. In general, the ISCS has access to the database of the RCS to read the information needed andto implement actions resulting from its decision-making process. These actions may be new valuesof setpoints for controllers, or direct command to equipment or final control elements.41——_META-LEVEL ——I INGiRepresentationNINJANTITATIVEMODULE1I_________________I Mathematical iiI [ntroIlers J models jjjProc. Analysis/database/& optimizationI SRLI II Supervisory- RegulatoryLevel InterfaceThe internal structure of the ISCS is conceived as composed of two distinctive levels of operation: ahigher meta-level in a coordinating role and a lower level with two modules, one to handle symbolicknowledge about the process being supervised and the other to handle quantitative processing such asnumerical algorithms and mathematical calculations (see Figure 4.2).I ISYMBOLIC MODULEKR & Reasoning REASONING1r QM__ _I Uncertainty I K B Qualitative-II & I I QuantitativeI Probability I I - Q. Models I I Interface— Heuristics_____ __ __ _ __ _I - frames - Facts______ _ ___—rules III_ _Figure 4.2 General structure for the Intelligent Supervisory Control System (ISCS).1The meta-level, rich in symbolic knowledge and abstract concept representation, coordinates theoperation of the modules at the lower level. It has knowledge regarding overall strategies tosupervise a process and meet goals; knowledge of conditions under which a particular controlalgorithm can operate; and knowledge regarding the integration of qualitative and quantitativemechanisms. It also provides the mechanisms to interact with the user. The symbolic module at thelower level deals with specific supervisory tasks such as monitoring of control loops, fault diagnosis,42special operating procedures, and translation of information between qualitative and quantitativeformats. The quantitative module is responsible for any mathematical operation required by theISCS. it may have, for instance, mathematical models, optimization routines, statistical packages andvarious algorithms of control. The proper integration of these two symbolic and quantitativemodules is an important challenge for the design of the system and a subject for further research.4.2 General Functional Definition4.2.1 Global Functions of the ISCSThe main supervisory functions considered in the design of an ISCS are:I) Monitoring the overall operation of the regulatory control system (RCS). The main purpose ofthis function is to lead the global operation of the process towards specific technical-economicaloperating goals such as quality specifications, maximum capacity, and maximum efficiency. Theactions derived from this function are the determination of setpoint values for the differentcontrollers of the RCS.ii) Monitoring each individual controller of the RCS. The ISCS assesses the overall operation ofeach controller and decide if there is a need for parameter adjustment. The ISCS possessesspecific knowledge to tune individual controllers. The ISCS decides on what type of controllerto use according to the prevailing operating conditions. It could also decide to overrideautomatic operation and operate in manual mode.iii) Assisting the operation during special procedures such as start-up and shut-down. The ISCSpossesses the knowledge to deal with these special operations, including emergency situationsdue to disturbances or equipment failure. During these special periods of operation the ISCS43may decide to operate with particular controllers, or use different sets of parameters for thecontrollers, or even override the RCS.iv) Fault detection and diagnosis of the operation of the RCS. The ISCS has mechanisms to detectfailure of process equipment and elements of the RCS. Depending on the results of thediagnostic process, the ISCS may take different actions by itself or advise the operator forspecific actions.v) Interacting with the operator. The ISCS has the elements to interact with the operator in ahuman-like fashion. It has the ability to explain some of its conclusions or actions to the user, forinstance. The ISCS also provides the mechanisms for the user to modify knowledge andprocedures currently Intervening. The ISCS has the mechanisms to modify parameters, relevant points in thedatabase, and configuration of elements in the RCS.Communication with the RCS is obtained through direct access to the database of the RCS. Thedatabase includes working data used by the RCS such as analog and digital input/output, as well asparameters for controllers or other algorithms. Calculated variables such as trends, needed by theISCS, may also be directly read from the database. However, more specialized processing such asmaterial balances, may need more interaction with the ISCS so they may be processed at the lowerquantitative level within the ISCS.4.2.2 Supervisory Control TasksThe major supervisory control tasks associated with the operation of the ISCS are as follows (refer toFigure 4.2):441) Meta-Level• Coordination. Coordinate the operation of the symbolic and quantitative modules at the lowerlevel. Decide on an appropriate strategy to solve a problem. Assign tasks to the differentmodules involved in the solution of a problem.• Quantitative-Qualitative Integration. Provide smooth integration of the two modules withmechanisms for transferring and translation of information.• User interface. Interact with the user in a human-like manner providing access to specificinformation, explanations for actions taken, and mechanisms to access and modify theknowledge base as needed.• Concept learning. Handle abstract concepts and build a hierarchy of more complex conceptsas the system interacts with the user.ii) Symbolic Module• Overall RCS supervision. Monitor and guide the operation of the RCS as a whole to satisfyglobal operating tasks such as quality specifications, maximize production, or minimizediscarded material.• Individual controller supervision. Monitor the behavior of each controller providing themechanisms for assessing their behavior, modifying parameters, changing operating modes andoverriding automatic operation.• Process analysis. Evaluate the operation of units, circuits and the overall plant, as part of anISCS supervision task, or under direct request by the user.45• Equipment operation. Assess the operation of each piece of equipment as needed by othersupervisory tasks, (determine if a tank is overflowing, or a valve is plugged, for instance).• Fault diagnosis. Detect abnormal operation and diagnose possible causes such as defectiveequipment responsible for the anomaly observed.• Special operations. Guide the operation of the process during special operating periods suchas during start-up or shut-down, or when process layout is being modified.• Quantitative Interface. Translate quantitative information to the appropriate qualitativerepresentation, and vice versa, as required by the symbolic module, the meta-level or the user.iii) Quantitative Module• Controller operation. Provide a bank with different algorithms of control, their associatedidentification and parameter estimation mechanisms, and basic indices to assess theiroperation.• RCS interface. Handle the transference of information between the ISCS and the RCS and theupdating of the database on the ISCS.• Mathematical models. Provide mathematical models of different process units and theenvironment. Simulate these models and make the results available as required during theoperation of the ISCS or directly by the user.• Optimization routines. Provide numerical optimization algorithms in support of the overallprocess optimization functions of the ISCS, or as required by the user.• Process analysis. Analyze the operation of the process through balances or statistical analysesas required during the operation of the ISCS or directly by the user.464.2.3 Regulatory Control TasksAlthough not part of the design of the ISCS, a brief description of the tasks associated with the RCSare mentioned here. The main tasks the RCS is responsible for are:• Continuous Process Control. Keep control variables operating on setpoints or targets despitedisturbances affecting the operation of the process.• Batch or Sequential Control. Follow operating procedures and steps according to a specifiedsequence or operating program.• Interlocking. Provide the mechanisms of interlocking between different equipment involved,facilitating operations such as start-up, shut-down, or emergency procedures.• Alarming. Provide the basic mechanisms for detection of abnormal situations such asvariables out of range, and mechanisms to communicate this to the plant operator and to theIScS.• Manual Operation. Provide the mechanisms for a direct manipulation of equipment and finalcontrol elements by the operator.4.3 Hardware and Software Requirements4.3.1 General Software SpecificationsThere are two basic options regarding the software available to build an ISCS. These are:i) Use an expert system (ES) development software package, which has most of the capabilitiesrequired for building an ISCS, and which provides a high level programming interface for thedevelopment of the remaining facilities or characteristics required.47ii) Use an artificial intelligence (Al) programming language such as LISP or PROLOG -includingC++; or use a specialized software package available in the market such as Knowledge Kraft orEnvisage. The latter alternative provides different facilities especially useful at the developmentstage (e.g. a versatile user interface, debugging capabilities, etc.).The major requirement for a software package, essential to supervisory control applications, is theneed to handle the concept of time: the software package should handle temporal reasoning and havethe ability to perform tasks in real-time fashion, e.g. sampling process variables at specific timeintervals. Another requirements is the need for an open architecture in order to allow custom-modification if needed, e.g. integration of user-developed modules with those already available in thesoftware package. A final requirement is the need for interconnection with the RCS level, whichusually is running on a different machine.4.3.2 General Hardware SpecificationsSpecial computers have been designed for use in Al supporting languages such as LISP. LISPmachines include the Symbolics 3600 series machines (Symbolics, Inc.), the Lambda series machines(LISP Machines, Inc.), the Xerox 1100 series (Xerox Corporation), and the Explorer (TexasInstruments Inc.). These manufacturers have their own versions of LISP, which are native to theirmachines.The processing power of these specialized LISP machines has made them the ideal choice for largescale, LISP-based projects. Many of the medium and large ES shells were originally developed torun on these type of machines. However, the recent trend is to modify those original products oroffer new ones running on conventional machines. Economical reasons as well as the desire to reachother potential users and applications have been the causes for such a trend. Thus, nowadays, there48are many ES shells and development environments running on conventional mini andmicrocomputers.The specific type of computer will depend on the software package selected for the development ofthe system as well as on the requirements of the specific application.4.4 Potential Al Techniques Involved in the Design of an ISCSThere are numerous techniques available that deal with different aspects of artificial intelligence, andresearchers continue proposing new ones. Only a few of these techniques are being used byresearchers in intelligent control (IC); the majority still remain within the academic boundaries of theAl world.The focus of this research project is qualitative modeling and its potential integration into the designof a real-time ISCS. Qualitative models provide an ISCS with the mechanisms to handle and reasonupon heuristic knowledge about behavior of physical elements. The next chapters describe in detail apseudo-qualitative modeling approach, its incorporation into an ISCS prototype, and the applicationof this prototype to a full scale industrial plant for validation of the approach proposed.In addition to qualitative modeling, two other Al aspects, namely uncertainty handling andlearning—also potential candidates for incorporation into the design of an ISCS—were brieflystudied in the course of this research (see sections 3.3.2 and 3.3.3). Appendix A presents some of themajor aspects that resulted from these additional studies. Time constraints have contributed to thenon-implementation of these components at this stage; they are left for future research projects.A simplified framework to handle uncertainty based on a subjective interpretation of probability isproposed and described in Appendix A.1. Under this interpretation, probability is viewed as theactual degree of belief in a given proposition held by some real individual at some specific time49(Kyburg and Smokier 1964; Weatherford 1982). This approach overcomes major limitations foundin the application of a more traditional interpretation, which views probability as a relative frequencyof a number of repetitive events.Learning theory and available learning techniques are too immature to work with critical paths ofknowledge within an ISCS. Thus, an alternative approach proposed in this study is the incorporationof learning to enhance the user interface (see Appendix A.2 for details). Under this approach, thesystem does not intervene directly with the process; instead, it learns how to handle conceptsinvolved in the interaction with operators. A user interface rich in high-level concepts gives anopportunity to establish a more “intelligent” communication with the system.50CHAPTER 5PSEUDO-QUALITATIVE MODELING APPROACH5.1 IntroductionA central aspect of human reasoning is the representation of knowledge and the representation of thephysical world we need to deal with. People, it has been said, walk around with a mentalrepresentation of the external world in their heads. This mental model allows them to try out variousalternatives in a given situation before taking a final decision, to react to future situations before theyarise, to utilize the knowledge of past events in dealing with the present and the future, and to learnfrom their experience so they can deal in a better way next time they face a similar situation.Scientists have been puzzled by human reasoning for ages, trying to find out what sort ofrepresentation and reasoning mechanisms people employ.Mathematics is one of the modeling techniques most commonly used in formal scientific studies,especially in engineering fields. A literature review will show that there is not a single area ofknowledge without mathematical models, representing at least the most important and fundamentalaspect of the field. Researchers agree, however, that these are not the kinds of model people use intheir everyday life. People seem to reason fluently about many phenomena without any informationon the mathematical relationship that may describe these phenomena.An example of the above situation can be found in the operation of an industrial plant. It is notuncommon to find that an operator has overridden an automatic control system which was unable tocope with particular operating circumstances. Does the operator have a mathematical representation51of the behavior of the process?—very unlikely. For example, an operator only needs to recognize thepossibility of overflow in a tank to quickly decide on an appropriate corrective action. He does notneed to spend time using a full mathematical model to predict when an overflow will occur or howmuch liquid will spill or how big the resulting puddle might be. This ability to handle partial,incomplete information and to reason at a low level of resolution, is one of the key characteristicsthat we need to incorporate into an intelligent computer-based system.5.2 Alternative Techniques to Qualitative ModelingFormalisms, such as rules, frames, and semantic networks used in today’s expert systems areimportant alternatives to handle knowledge in the way mentioned above (Fischler and Firschein1987; Bowerman and Glover 1988, Luger and Stubblefield 1989). However, due to the explicitcharacteristics of these formalisms, i.e., every possible behavior that may occur must be deduced andexplicitly represented, the models obtained are referred to as “shallow models.” For example, a rule-based model to represent the input/output behavior of a process may consist of a set of rules of theform:{ IF input condition THEN output behavior }This set of rules needs to consider every possible condition for input such as high, low, increasing,or decreasing. For each of these conditions we need first to determine the resulting behavior of theoutput, and then write down the corresponding rule. Thus, the model obtained is an explicit list ofcondition-behavior pairs associated with the operation of the process. In general, a different set ofrules has to be obtained for each particular process being modeled.Researchers in Qualitative Physics have proposed various formalisms that exhibit suitablecharacteristics to handle incomplete information (Forbus 1985, 1986a & 1988; de Kleer and Brown521985; Kuipers 1986; Leitch 1990). A qualitative model (QM) built using these formalisms may beviewed as a “deep model,” i.e., although the relationship between variables is explicit, the behaviorof the output is unknown until a simulation of the model is performed. Under one of theseformalisms, the input/output behavior of a process could be expressed as:input a outputread as “the output is qualitatively proportional to the input.” This qualitative proportionality a,is a representation of the phenomena that define the relationship between these two variables. Aqualitative simulation will then solve this model and predict the behavior of the output according tothe values the input may take.Several approaches have been proposed within qualitative physics to obtain a general framework torepresent a physical reality in a qualitative fashion. De Kleer and Brown (1985 & 1986), andWilliams (1984) describe their qualitative models in terms of “components” and “connections.”Kuipers builds qualitative models starting from mathematical descriptions, and then he uses his ownsimulation algorithms to obtain predicted behavior (Kuipers 1984, 1985 & 1986). Bhaskar andNigam (1990) use dimensional analysis as a method for qualitative reasoning; they do not require anexplicit knowledge of the physical laws, but only knowledge of the dimensional representation of therelevant variables. Other researchers propose a semi-quantitative representation combiningqualitative and quantitative reasoning as an alternative to pure qualitative reasoning approaches(Widman 1989; Simmons 1986). Finally, Forbus proposes a “qualitative process” ontology to dealwith qualitative reasoning. In this ontology any physical reality is seen, in general, as a “process”with inputs and outputs through which it interacts with other processes and with the environment(Forbus 1984 & 1986b).535.3 A Pseudo-Qualitative Approach to Qualitative ModelingA pseudo-qualitative approach to qualitative modeling is proposed in this research. Under thisapproach, a QM is defined as a mathematical model with a hybrid structure capable of handling bothnumerical and qualitative information (see Figure 5.1).qualitative input I I qualitative outputDE-FUZZIFICATION_I__________________FUZZIFICATIONMATHEMATICALRELATIONSHIPquantitative input quantitative outputQUALITATIVE MODELFigure 5.1 General structure of a QM under the pseudo-qualitative approach proposed.A de-fuzzification algorithm is used when the information received by the model is purelyqualitative; no pre-processing is required when the information received is quantitative. Theinformation is mathematically processed to obtain the output of the model, which is presented in bothqualitative and quantitative formats.The accuracy of the QM is determined by the requirements of the specific application and by theinformation available to build the model. An application may only require representation of simpleheuristic knowledge such as: “the output of the process is proportional to its input.” In another case,we may need to represent a more accurate input/output behavior given by a specific mathematicalexpression.As shown later on in this section, a QM under this pseudo-qualitative approach offers the same levelof flexibility as a QM using a pure qualitative approach. The use of mathematical relationships as54the core of a QM does not impose any additional constraint. In fact, this pseudo-qualitative approachoffers considerable advantages over its purely qualitative counterparts as discussed in section 5.5.The major elements of this QM approach, described below, are: variable representation, fuzzificationand de-fuzzification, steady state QM primitives, and dynamic QM primitives.1) Variable RepresentationA process variable is represented in both quantitative and qualitative formats. The qualitative valueis represented by a set of qualitative terms that describe both the sign and dynamic trend of thevariable. Figure 5.2 shows the set of qualitative terms proposed and their definition.DoB AMT - amount DoB DYN - dynamics100 10090 9080 8070 7060 6050 50-100 -75 -50 -25 0 25 50 75 100 -100 -75 -50 -25 0 25 50 75 100process variable (%) rate of change of process variable (%)Figure 5.2 Fuzzy Sets that define qualitative information of variables.Each of the qualitative terms shown in Figure 5.2 corresponds to a fuzzy set that associates thenumerical value of the variable with a degree of belief (DoB). The DoB, in the context of pseudo-qualitative modeling, is a numerical value between 50 and 100. The set of qualitative terms shown inFigure 5.2, together with DoB values, suffice to uniquely specifS’ the numerical value of a variable.The numerical value of variables is expressed as a percentage of the range of values that a variablemay take.N /negative positive55Using this formalism, for example, a variable V that is at steady state and whose value is 50% can bequalitatively expressed asAMT( V positive DoB: 74.4) DYN( V constant DoB: 100)is interpreted as a person’s certainty about the appropriateness of using a particular qualitative termto express the value of a variable. For example, if we indicate that the value of a variable is “high”and we are absolutely certain about that, we would assign a DoB equal to 100 to that assertion. ADoB equal to zero would have indicated our complete certainty that the variable is “not high.”The internal 3-term representation of a variable shown in Figure 5.2 can be directly translated intoany user-defined set of qualitative terms such as “positive low,” “positive medium” and “positivehigh.” A user-defined representation may also involve a different interpretation of a DoB, such asthat where a DoB is interpreted as a person’s certainty about the appropriateness of using a particularqualitative term to express the value of a variable.ii) FuzzificationLDe-Fuzzification ProcedureIn the context of a supervisory system, most of the information required by a QM is read directlyfrom the process database; hence, it is already available in a numerical format. If the information isreceived in a qualitative format, it would need to be de-fuzzified before being used by the QM. Thefirst step of this procedure consists of mapping the information available onto the set of qualitativeterms shown in Figure 5.2. The second step consists of direct translation of these terms intonumerical values using the same qualitative definitions shown in Figure 5.2.The fuzzification procedure, i.e., to convert a numerical value into qualitative terms, is similar to thede-fuzzification procedure indicated above but in the reverse order.56iii) Steady State PrimitivesThe two primitives proposed to build steady state QMs that describe the input/output behavior of aprocess are:output = qm_function (input) ; qm_function is a user-defined mathematical relationshipbetween the input and the output of the process.qm_table (inputk, outputk) ; qm_table is a look-up table that associates input/outputpairs of the form (inputk, outputk).Let us assume that we want to build a single-input, single-output steady state QM of a process. If theonly information available indicates that the output is “proportional” to the input, we could write aQM based on the qm_function primitive asQM1: output = K• input (%) ;K= 1 (default value)K can be tuned, if needed, when new information about its value is available.If the input/output relationship is known to be a quadratic one, the QM would be written as (seeFigure 5.3).QM2: output = K• (input)2 (%) ; K = 1/100 (default value)K can be adjusted to fit any specific input/output quadratic behavior.In general, the user can define qm_function as the most appropriate mathematical expression thatrepresents the known input/output behavior of the process. In that case, the QM would take the formQM3: output = qm_function (input) (%) ; with qm_function a mathematical expression.57The second primitive, qm_table, allows the user to define the steady state behavior of a process as aset of input/output pairs, without specifying a mathematical relationship. A quadratic input/outputbehavior, as represented by a qm_table with three input/output pairs, qm_table(3), could give theresults shown in Figure 5.3. As a comparison, Figure 5.3 also shows the results of modeling thesame behavior with a quadratic qm_function.output (%)100input (%)Figure 5.3 Quadratic input/output behavior represented qualitatively usingprimitives qm_function and qm_table(3).In the case of an application that does not require a high degree of accuracy, the results obtainedfrom the two QMs shown in Figure 5.3 could be considered to be essentially the same.iv) Dynamic QM PrimitivesA dynamic QM provides time-dependent information about the behavior of a process. A dynamicQM would indicate if a variable is “constant,” “increasing,” or “decreasing,” as well as the value ofthe output variable at any given time.A dynamic mathematical model is at the center of a dynamic QM. This mathematical model predictsthe evolution of a variable as it reaches a steady state value that has been previously obtained by asteady state QM of the same process. The dynamic QM primitive developed is based on a first order58dynamic model; primitives based on higher order dynamic models could be developed in a similarmanner.The response to a step input of a first order dynamic system with delay takes the form shown inFigure 5.4. This response can be mathematically written asoutput(t)=out(l_e(ttdT) ;ttd (5.1)where td : delay timeT : time constant, time required for the output to reach 63.2% of the final steady statevalueOut : final steady state value that the output reachesoutput(’t,)0.632:::td r+ td t (time)Figure 5.4 Behavior predicted by a first order dynamic model as a variableevolves from one steady state value to another.The recursive form of equation (5.1) that gives the value of output(t) at each sampling time is(Franklin G.F. and Powell J.D. 1980, chapter 3).OUtPUtk = OUtPUtkl eo/ + (1- e_To/v ) OUtss(k..-d1) (5.2)59where Outputk = predicted output value at the current sampling instantOutputk.i = predicted output value at the previous sampling instantOUtss(kd4) = steady state value that the output will reach, as predicted (d+ 1) samplinginstants prior to the current timed = delay time, expressed as number of sampling instantssampling time (same units as r)Equation (5.2) is the final expression of the dynamic QM primitive. The user has to provide onlytwo parameters at the time of building a QM for a specific process: r, the time constant of theprocess, and d, the delay time expressed as number of sampling instants. Out is provided by asteady state QM of the process.5.4 Building a QM of a Head TankThis section presents a case study, based on simulation results, to determine the validity of theproposed QM approach. A head tank with the configuration shown in Figure 5.5 is the processselected for this study. This simple and well-understood process was purposely chosen for this studyas it helps to visualize clearly and demonstrate the principles of the approach proposed.frate_inI V openingILJIIItI frate outFigure 5.5 Head Tank analyzed in the Case Study.60The variables of interest are level, level of the fluid in the tank; frate_in, flowrate of fluid enteringthe tank; frate_out, flowrate of fluid leaving the tank; and v_opening, the opening of the valve.frate_in is considered as the manipulated variable, and v_opening as a parameter that disturbs thebehavior of the tank. This study assumes that measurements of all the variables around the tank areavailable, including the opening of the valve.A QM that describes the behavior of level is proposed and simulated using ProcessVision, a real-timeSCADA software package. The source code of the knowledge base associated with this simulationstudy, as implemented in ProcessVision, is presented in Appendix C. The simulation results from theQM are analyzed against those obtained from a mathematical model of the head tank—the latterassumed to represent the real behavior of the level of fluid in the tank.i) Steady State Qualitative ModelLet us assume that the only information we have about the steady state relationship between level andfrale_in comes from heuristic knowledge. If this heuristic knowledge indicates that the level of fluidin the tank is directly proportional to the flowrate entering the tank, and inversely proportional to theopening of the valve, we could write the following modellevel = Kfrate_ in(53)v_openingwhere K is a parameter that needs to be estimated. An estimate of K could be obtained from plantdata or from additional heuristic knowledge about the behavior of the tank.Now, if experimental data are available, we may be able to use a qm_table primitive, described in theprevious section, to represent the behavior of the level of fluid in the tank. Let us assume that wehave information regarding three steady state points for “low”, “medium” and “high” values of the61variables. With this information we may represent the behavior of level by a qm_table(3) as shownin Figure 5.6, valid for a specific valve opening. Additional QMs for different valve openings couldalso be constructed and implemented, if required.leveiblevelmlevel1level (m)frafe_in,h highm :mediumI :10wFigure 5.6 QM for the level of fluid in the tank, based on a qm_table(3) primitive.As more knowledge about the operation of the tank and about the specific relationships that holdamong the variables is gathered, we could update the initial model with more “accurate” ones. Forexample, if a mathematical model of the tank is available, we may replace equation (5.3) with acuadratic steady state model of the form:level = I frate_2‘KR .v_opening,)(5.4)Equation (5.4) was implemented in ProcessVision using the QM primitive qmJunction described inthe previous section.frate_inm frafe_in hfrate_in (1pm)62ii) Dynamic Qualitative ModelUsing a dynamic QM primitive of the form presented in equation (5.2), the evolution of the level offluid in the tank is given bylevelk = levelkl e_To/T + (1- e_To/T ) levelSS(kI) (5.5)where levelk and levelk.1 are the level values at the current and previous sampling instantsrespectively; levelSS(I4) is the steady state level value predicted by the steady state QM ofequation (5.4) at the previous sampling instant; V is the time constant of the tank; and T0 is thesampling time.iii) Mathematical ModelA mathematical model that is generally accepted to represent the behavior of the level of fluid in thehead tank of Figure 5.5 isK.AJ.+R(V)JIJ=F, [1pm] (5.6)where L level of fluid in the tank, [m]F, = flowrate of fluid entering the tank, [1pm]A = cross sectional area of the tank, [m2]R(v) = resistance to flowrate of fluid leaving the tank, [1pm iJj. This resistance dependsalso on factors such as valve type, valve size, pipe size, and downstream pressure.V valve opening, [%]K= 1000, a constant to adjust the dimensions of equation (5.6), [1/rn3]63R(v) is assumed proportional to the opening of the valve, although other correlation may be used ifrequired (e.g., if the valve is non linear). R(v) is given byR(V,)=KR ‘v (5.7)where KR is a parameter that comprises all other factors that determine the resistance to the flowrateof fluid leaving the tank. Replacing R(v) in equation (5.6), and incorporating C K A, the capacityof the tank, we obtain that the model of the tank of Figure 5.5 is given by+ KR V JiJ = F,,, [1pm] (5.8)The modified Euler’s method for numerical integration (Stark 1970), is used to implement andsimulate equation (5.8). Applying the modified Euler’s method to equation (5.8) we obtain thefollowing recursive expression:= Lk_l + --[f(Lk_l, n(k—1)’ tkl) + f(L, n(k)’ tk)] T, (5.9)where k, k-i = indices of current and previous sampling instants= integration step= a preliminary estimate ofLk given byL = + f(Lk_l, (k—1)’ tk_1) Tandf is a re-written version of equation (5.8) given byf(L, F,,,, t) = = v + F,,,64Equation (5.9) was implemented in ProcessVision; its simulation results are assumed to represent thetrue behavior of the level of the fluid in the tank.iv) Simulation ResultsThe following values for the parameter of the tank (chosen arbitrarily) were used during thissimulation study:A = 1.0 m2 KR = 0.943 (1pm /-sJ/%) v = 75 % (nominal valve opening)Tuning of the steady state and dynamic QMs (equations (5.4) and (5.5)), requires the value of twoparameters: KR and v. Assuming that we do not know the numerical value of the parameters of thetank, we would need to simulate equation (5.9) to obtain KR and r (in a real-world case, we wouldneed to perfonn some experimental tests around the tank). From the simulation results using theabove parameters, we obtain that KR = 0.943 (1pm /-J/%) and i 32 mm.Different simulation tests were performed to compare the results provided by the QMs proposed tothose obtained from the mathematical model of the tank. Although this comparison involved onlynumerical values, the results predicted by QMs were also available in qualitative terms at any giventime during the simulation.Figure 5.7 shows the simulation results for a valve opening of v = 75 %. During this test frate_intakes the values 100 1pm, 50 1pm, and 75 1pm.65mathematical modelqualitative model900Figure 5.7 Actual and predicted level of fluid in the tank;frate_in takes the values 100, 50, and 75 1pm.In order to study the effect of different valve openings on the ability of the QMs to predict thebehavior of the tank level, tests were performed for valve openings of v = 50 % and v = 100 %. Therest of the parameters of the tank for this test are the same as those used in the previous test. Theresults are shown in Figure 5.8.mathematical modelqualitative model900Figure 5.8 Simulation results for two valve openings: v = 50 % and v = 100 %;frate_in takes the values 100, 50, and 75 1pm.A simulation test to study the ability of QMs to predict the behavior of similar processes withoutre-tuning parameters was also performed. This test simulated the case where a QM was applied tolevel (m)2.50 300 600time (mm)level (m)0 300 600time (mm)66tanks with different cross sectional area. Figure 5.9 shows the results obtained for areas of 0.5 m2and 2.0 m2 and a valve opening of 75 %; the results for the original tank with an area of 1.0 m2 areshown in Figure 5.7.level (m)mathematical modelqualitative model900Figure 5.9 Simulation results on two similar tanks but with different areas;frate_in takes the values 100 and 50 1pm.v) Analysis of Simulation ResultsFrom the simulation results presented above, we can observe that:• A well-tuned QM can accurately predict the behavior of a process (see Figure 5.7). Thisaccuracy depends also on other factors such as the quality of the knowledge represented bythe QM. We cannot expect to have the same results with a QM built from simple heuristicknowledge than with one derived from a mathematical model of the process.• The performance of a QM deteriorates when process parameters change (see Figure 5.8).This deterioration could be corrected by tuning the QM as parameters change (as the valveopening changes, in this case), or by establishing a correlation between these parameters andthe variables in the model. There is no general solution to this problem; each case must betreated separately.0 300 600time (mm)67The prediction errors shown in Figure 5.8 can be corrected however, by incorporating thevalve opening into the original QM of the tank. Only the dynamic QM (equation (5.5)) needsto be modified; the steady state QM (equation (5.4)), already considers the valve opening.From equation (5.8) (assuming that we know the mathematical model of the tank), we obtainthat the corrected time constant of the tank, as a function of the valve opening, is given by thefollowing QMr a (5.10)where t0 = 32 mm. and v0 = 75 %, are the original values for the time constant and theopening of the valve, respectively. Equation (5.10) is incorporated into equation (5.5) toobtain a corrected QM of the tank shown in Figure 5.5.The simulation test of Figure 5.8 was repeated using the corrected QM, providing the resultsshown in Figure 5.10.level (m)5.04.0 I mathematical modelLzz--- corrected QM3. 5.10 Simulation results obtained from a corrected QM of the tank.frate_in takes the values 100, 50, and 75 1pm.0 300 600time (mm)68From the results shown in Figure 5.10, we can see that the prediction errors have beeneliminated. These results demonstrate that the complexity of a QM can be adjusted in orderto expand the range of validity of the model, i.e. the set of operating condition in which themodel accurately predict the behavior of a process.• The simple first order dynamic QM primitive proposed can accurately predict the dynamicbehavior of a process (see Figure 5.7). The accuracy, however, is sensitive to the tuning ofthe QM (see Figure 5.8), and it may also be affected by the actual order of the dynamicbehavior of the process being modeled.• A QM that has been accurately tuned for one specific process may behave poorly if applied toanother process (compare the results of Figure 5.7, for a tank with a cross sectional area of1.0 m2, to those shown in Figure 5.9 for tanks with different areas). QMs should beappropriately tuned for each application to achieve good results.Following a similar procedure to that described above for the case of the valve opening, theoriginal QM could be corrected to take the area of the tank into consideration. The correctedQM eliminates the prediction errors shown in Figure Potential and Limitations of the Approach Proposedi) Handling Heuristic KnowledgeOne of the most important features of qualitative modeling is that a QM can be built with a minimumof information. We do not need to know in detail the kind of phenomena that defines the behavior ofa process to start building a QM, nor do we require a previous mathematical model of the process —heuristic knowledge may suffice. The accuracy of the prediction, however, will reflect the accuracyof the information employed to build the model.69The pseudo-qualitative approach proposed offers similar flexibility to that of the pure qualitativeapproach as proposed by Forbus (Forbus, 1984 & 1985). Both approaches can handle QMs based onheuristic knowledge such as qualitative relationships of the form “the output is proportional to theinput of the process”. However, the pseudo-qualitative approach proposed can also handle QMsbased on very accurate information. Under this approach, for example, a QM could be built as adirect representation of a mathematical model, as in the case of the open tank described in theprevious section.ii) Resolution and AmbiguitiesAn important feature of QMs is their ability to handle information at a low level of resolution. AQM can handle variables whose values are expressed in qualitative terms such as “small,” “medium,”and “large.” Both inputs and outputs of a QM would be expressed in similar terms. If the aboveresolution satisfies the requirements of an application, any additional information about the values ofthe variables involved would be irrelevant for that application.Working at a low level of resolution, however, limits the capacity of QMs based on purely qualitativeapproaches to represent a more complex behavior such as one described by a non-linear relationship.A three-level resolution QM cannot represent properly a quadratic relationship between twovariables, V1 and V2, as shown by the shaded areas in Figure 5.11. In this case, a generalizeddefinition of fuzzy concepts was used, i.e. the definition of fuzzy concepts is based on percentagevalues and is the same for each variable. This three-level resolution QM cannot reliably differentiatebetween a linear and a non-linear relationship.703-level resolution,pure qualitative60approachmedium : pseudo-qualitative40 approachsmallT’’V1(%)0 20 40 60 80 100small medium largeFigure 5.11 Representation of a quadratic relationship under the pseudo-qualitativeapproach proposed (continuous line) and under a purely qualitative one(shaded areas), using a generic definition of fuzzy concepts.The pseudo-qualitative approach proposed does not exhibit the representational problems found inpurely qualitative approaches. It offers a high resolution for the internal representation of knowledgeand, at the same time, an external level of resolution that responds to the specific requirements of anapplication. A quadratic behavior between two variables, for example, would be internallyrepresented by a mathematical relationship as shown by the continuous line in Figure 5.11. Theinput/output information, however, could still be expressed in terms of the low resolution values:“small,” “medium,” and “large.”The ability of a pure QM to represent nonlinear behavior can be improved by redefining the fuzzyconcepts to fit the nonlinearity. As shown in Figure 5.12(a), the improvement obtained is notsubstantial. Increasing the resolution is another alternative to improve the representational ability ofa pure QM. A five-level resolution gives the results shown in Figure 5.12(b). From these results wecan see that some improvement is obtained by increasing the resolution. However, changing theresolution implies changing the fuzzy concept definition as well as the heuristic rules associated withthe variables involved in the model. Also, as the resolution increases so does the complexity of themechanisms that handle this information. As shown in Figure 5.12, the results from the improvedv2 (%) quadratic relationship100large8071versions of a pure QM are inferior to those from a pseudo-qualitative approach. The lattercorrespond exactly to the mathematical representation of a quadratic relationship.Figure 5.12 Representation of a quadratic relationship using a pure QM at differentlevels of resolution and the pseudo-qualitative approach proposed.Low level resolution representation also brings ambiguity problems to purely qualitative formalisms.A QM based on these formalisms, for example, cannot differentiate between two “positive medium”variables. The pseudo-qualitative approach proposed is not affected by these ambiguity problems; aQM under this approach uses a degree of belief associated with the qualitative description of avariable to uniquely identify the value of each variable.iii) Qualitative Models and IF-THEN RulesQualitative modeling is a powerful mechanism to represent knowledge about process behavior at lowlevels of resolution. It should not, however, be considered as a direct rival to any other techniquethat may be employed in a given application. Each technique has its own strengths, weaknesses, andspecific areas of application in which they are more suitable than other available techniques.v2 (%) quadratic relationship100large8060medium4020small “Iv (%) quadratic relationship100rVi (%)0 20 40:smallv-large80large 6040medium20- Sm___________V1 (%v-small U —0 20 40 60: 80: 100v-small small medium large v-large60 80 100medium largepurely qualitative approachpseudo-qualitative approach(a) 3-level resolution QM (b) 5-level resolution QM72Qualitative models may not be the recommended alternative in an application that only requires therepresentation of one simple linear steady state proportional relationship; IF-THEN rules maysuffice. However, if the application involves the representation of a more complex behavior such asthe dynamic behavior of the tank shown in Figure 5.5, qualitative models would certainly be anappropriate option.iv) Uncertainty in Qualitative ModelingPurely qualitative formalisms do not handle uncertain information in the characterization ofvariables: variables have “crisp” values, e.g. a variable is either definitely “small” or definitely“medium”. This becomes a drawback in an application in which qualitative modeling is combinedwith other representation techniques that work with uncertain information.The pseudo-qualitative approach proposed in this research, unlike purely qualitative approaches,handles uncertainty. Uncertainty, under this pseudo-qualitative approach, is represented by a degreeof belief associated with each piece of knowledge handled by the QM. This is another importantfeature of the approach proposed.5.6 Incorporation of Qualitative Modeling into an ISCSThe validity of the pseudo-qualitative modeling approach proposed has been demonstrated. Theflexible structure of a QM allows the representation of behavior derived from simple heuristicknowledge, as well as a more accurate behavior obtained from existing mathematical model.Simulation results showed that a QM, built using the pseudo-qualitative modeling approach, canaccurately predict the behavior of a physical process. The structure of a QM and the mechanisms for73information representation allow on-line simulation and handling of uncertain information; these aretwo important features that allow the incorporation of QMs into an ISCS.The next step in this research is the incorporation of qualitative modeling into a real-time ISCS. Thisinvolves the development of an ISCS prototype and its application to a real-world situation. Thisnext stage will further establish the validity of the approach proposed and the feasibility of itsapplication to an industrial plant.74CHAPTER 6DESIGN AND IMPLEMENTATION OF AN ISCS PROTOTYPE6.1 Objective and ScopeThe main objective for developing this intelligent supervisory control system (ISCS) prototype is todemonstrate the feasibility of applying a qualitative modeling approach within a system designed fora full-scale industrial operation.This prototype was applied to the C Line grinding circuit at Highland Valley Copper (HVC) inLogan Lake, B.C., Canada, to assist in process supervision. The initial focus has been to monitor anddetect tonnage restrictions that affect circuit production.The system is designed to provide on-line advice via an intelligent SCADA interface to the shiftsupervisors in the control room regarding the occurrence of circuit restrictions. At this stage thesystem does not intervene directly with the operation of the process. Appropriate actions are left tothe discretion of plant operators.Periodic reports summarize diagnostic results; these are used to assess the extent and frequency ofproduction-limiting bottlenecks. Changes in operating philosophy are expected to derive from thisanalysis. On-line information, together with reports summaries, can reduce the decision-makingtime. This can lead to removal of a restriction fast enough to reduce tonnage losses. Average lossesdue to grinding circuit restrictions range up to 5000 tons per week for the C-line circuit.756.2 BackgroundOnce per week, an experienced metallurgist analyses the weekly output of trend graphs together withshift log reports to establish the extent, frequency and occurrence of production losses due to circuitrestrictions. The approach used is highly heuristic, perhaps even subjective, leading to inconsistentanalyses and reliance on a single individual to perform the work.It was considered that development of an on-line system capable of providing minute-to-minuteanalysis using the knowledge of the expert could result in several gains:• more consistent and reliable analysis.• faster turnaround of data.• reduction in the extent and frequency of certain delays.• potential improvement in the automatic tonnage control system.Accordingly, this system had been developed based on the expert knowledge of Hans Raabe, who atthe time of initiation of the project, February 1995, was the plant metallurgist at HVC.6.3 General StructureThe ISCS runs on a PC (UBC-PC) and is interfaced to the HVC-PC computer that runs the BaileyDCS (Distributed Control System) currently in operation at HVC (see Figure 6.1). The ISCSaccesses the Bailey database to obtain on-line information about the operation of C-line. The dataare used by the ISCS reasoning system to detect and monitor restrictions that affect the operation ofthe process.76ISS PROTOTYPERS 232BaileyProcessVision - Software PackageSoftware Package LinkU BC-PCHVC-PCLAN-90GRINDING PLANTDATABASEFigure 6.1 General structure of the implementation of the ISCS prototype.The ISCS has been implemented using the software package ProcessVision from ComdaleTechnologies, Toronto, Canada.A file with required process data is created on the HVC-PC and transferred from this computer to theUBC-PC via an RS-232 serial link. Current data updates take place on about a 60 second timeinterval. A communication routine on the UBC-PC updates the ProcessVision database with theinformation received. Direct access to the Bailey network will eventually be setup once the HVC-PChas upgraded its operating system.6.4 ProcessVision Software PackageProcessVision is a modular software package for development of knowledge-based real-timeapplications. ProcessVision runs on a standard PC under the QNX 4.2 operating system fromQuantum Software of Kanata, Ontario. Version 5.3, used in this application, is a multi-taskingdevelopment toolkit in which all sub-tasks are assigned to separate modules; data transfer, messagetransfer, alarming, scheduling events, trend analysis, and knowledge processing. The softwareprovides facilities to interface with existing control systems, field 110 and PLCs.77Information in ProcessVision is represented by keyword triplets of the form:object.attribute.value :DoBor {class} .attribute.value :DoBwhere DoB is the degree of belief (assigned by the user or estimated by the system) in the knowledgerepresented by the keyword triplet.In this format, a developer can conceptualize knowledge in an object-oriented manner. Thisapproach provides a structured manipulation and organization of objects by type or “classes” ofobjects. A piece of equipment or a process variable can be considered as an object represented bythe object token of a keyword triplet. Specific characteristics of an object, such as the area or heightof a tank, are represented by the attribute token; quantification of these attributes is executed by thevalue token of the keyword triplet. An example of a keyword triplet is:tank.area.small DoB: 85This triplet indicates that “the area of the tank is small”, and that the degree of belief associated withthis piece of information is 85%.Comdale/C, a real-time expert system, is the module that enables ProcessVision to handle symbolicinformation. This module deals with heuristics about the behavior of a process as well asinformation captured from the expertise of human operators. Comdale/C can reason with thisknowledge to make decisions on the best actions to be taken or to advise the operator on thequalitative state of the process. Other modules that comprise ProcessVision include a historicaldatabase, a network administrator, an alarm administrator, an explanation facility, and a graphicaluser interface. The modularity of an application together with the features of each individual module78allow a system to be designed to mimic the heterogeneous functions used by a human to reason abouta complex process.6.5 Tonnage Restrictions in the C-Line Grinding Circuit at HVCi) Process DescriptionFeed for C-line is reclaimed from a stockpile by five variable-speed feeders (see Figure 6.2).Primary grinding is achieved by a Semi-Autogenous Grinding (SAG) mill (43’xl 6’) equipped withgrate discharge. The mill feeds two grizzlies where the undersize is split out. Oversize returns to theSAG mill, while the undersize is sent to two ball mill discharge pumps. Mill power derives from twovariable-speed 4700 KW motors. Feed tonnage ranges from 1200 to 2000 tph.Secondary grinding occurs in two 16.5’x27’ ball mills operated in closed circuit with a cluster often760 mm cyclones. Cyclone overflow discharges by gravity to the flotation plant where copperminerals are extracted.00waterFigure 6.2 C Line Grinding Circuit at HVC.79A Bailey Distributed Control System interfaces with the grinding plant. The global objective of thecontrol strategy is to maximize tonnage at maximum power draw. Fresh feed is adjusted by one ofthe two main control loops: SAG mill power draw or SAG bearing pressure. A switching logicprogram determines which ioop manipulate the fresh feed at any given time. There is also a secondalgorithm to adjust the speed of the SAG mill in order to maintain a constant mill inventory of ore.All other major process variables (water addition, cyclone conditions, etc.) are also monitored andadjusted by the control system.ii) Tonnage RestrictionsA tonnage restriction exists when the tonnage fed to the mill cannot be maintained (it must bedecreased) or cannot be increased beyond a specific value due to the presence of certain operatingconditions. Tonnage restrictions prevent the control system from achieving its goal of maximumtonnage; thus, a tonnage loss is attributed to their occurrence.The most frequent type of restriction occurs when the tonnage cannot be maintained at a specificvalue. Two cases can be distinguished:• The operator imposes a upper limit on the fresh feed setpoint. Although the SAG mill couldprocess higher tonnage, the operator restricts its value due to specific operating conditions,e.g. when one ball mill is down for maintenance or when the plant tailings discharge box levelis high.• The fresh feed controller cannot achieve the required setpoint value. In this case, the freshfeed flowrate drops below the setpoint value due to operating problems in the feeding system,e.g. some feeders are down or some chutes are plugged.80The operator imposes a high limit on the fresh feed setpoint by reducing the maximum tonnage valuein the hi-limit block (see Figure 6.3). Thus, although the main controller (power or bearing pressure)requires a higher fresh feed flowrate, the setpoint to the fresh feed controller is limited to the highlimit value imposed by the operator. The SAG mill speed is also modified when the tonnage is beinglimited.maximumtonnagePowerController Setpoint toFresh Feed ControllerBearing PressureControllerModify Setpoint toMill Speed ControllerFigure 6.3 Setting a high limit for the fresh feed setpoint.The second type of restriction occurs when the tonnage has reached the absolute maximum that canbe delivered to C-line. Tonnage is limited at this level even though the SAG mill could still handlemore ore. This is generally known as a “soft ore” restriction. Raabe (1994) indicates that losses dueto this restriction are the most difficult ones to estimate.A different tonnage restriction, much more difficult to detect, may occur when a feeder with fine oregoes down but the rest of the feeders can continue supplying the required tonnage (Raabe 1994).Feeders draw from different points in the stockpile into which ore is discharged from the primarycrusher. Particle segregation takes place naturally in this stockpile meaning that certain feeders tendto deliver coarser ore than others (in the case of C-line, feeders #1 and 5 supply coarser ore thanfeeders # 2, 3 and 4). Raabe argues that the mill throughput may be greatly affected if the proportionof coarse ore in the feed increases when a feeder goes down. This restriction may eventuallydisappear as the stock pile material naturally readjusts to a new equilibrium.81H. Raabe (1994) developed a heuristic procedure to evaluate the occurrence of restrictions, todetermine possible causes, and to estimate the tonnage lost in each case. The procedure is performedmanually on a weekly basis requiring intensive examination of trend graphs as well as informationfrom the control room.Much of the procedure is based on subjective judgment; hence, different people will obtain differentresults. As well, the knowledge is only available well after the restrictions have occurred. It wasconsidered that an on-line system to perform this analysis automatically could help to standardize theprocedure and decrease the frequency and duration of such restrictions. The application thus,attempts to mimic how experienced plant metallurgists think about and interpret circuit upsets ratherthan modeling data extracted from the plant directly.6.6 Design Aspects of the ISCS PrototypeThe following is a brief description of major aspects of the design of the ISCS prototype. The mainaspects of the knowledge base used in the system can be viewed in Appendix B.i) Knowledge RepresentationThe ISCS uses keyword triplets as the basic element for knowledge representation. Information suchas status of equipment, which requires a True/False value, is represented by logical keyword triplets.Other information such as values of process variables are represented by both numerical andqualitative keyword triplets (see chapter 5 for more details). The following are some examples of theknowledge represented by keyword triplets on this application.82mill-power.real-value.f ; numerical value ofmeasured variablessag-milLstatus.running (True/False) ; equipment statusmill-power.real-value.high (DoB) ; qualitative value of variablesii) Diagnosing Tonnage RestrictionsA complete classification of all the major tonnage restrictions that affect the operation of the C-linegrinding circuit, and possible causes of these restrictions were obtained during discussions with HVCpersonnel. This information along with the heuristic procedures involved in diagnosing tonnagerestrictions were incorporated into the ISCS. This heuristic knowledge was implemented usingIF-THEN rules and “procedures” (a structured knowledge representation element offered byProcessVision).The ISCS updates its knowledge base with information read from the process database at regulartime intervals. The reasoning system uses this information together with the heuristic rules to detectthe occurrence of tonnage restrictions, determine potential causes and estimate tonnage losses.Figure 6.4 shows a diagram with the sequence of major tasks performed by the ISCS at eachsampling time.83The following is a list of the restrictions that the ISCS prototype can detect. A brief description ofthe heuristics associated with the diagnosis of each tonnage restrictions is also given.RR_FEED_LIMIT: The operator imposes a high limit to the fresh feed flowrate to the C-linegrinding circuit.Detection: The system will indicate that this restriction occurs when the followingconditions are met: the input to the high limit block that limits the tonnage ishigher than its output value, and this output value is lower than the maximumtonnage (target value) specified for the C-line grinding circuit, (seeFigure 6.3).Figure 6.4 Sequence of major tasks performed by the ISCS.84RR_FEED_CUT: Fresh feed is cut completely, but the SAG mill continues running.Detection: The system will indicate that this restriction occurs when all feeders stop,while the SAG mill continues running.RR_SOFT_ORE: Tonnage increases until it reaches the maximum value (target value) specifiedfor the C grinding line.Detection: The system will indicate that this restriction occurs when the followingconditions are met: the tonnage reaches the high limit (the absolute maximumvalue that can be delivered to C-line), the bearing pressure remains relativelystable, and the power draw drops below the setpoint value.RR_FEEDER_DOWN: One or more feeders with fine ore are down (feeders #2, 3 or 4), but the rest ofthe feeders can supply the required tonnage.Detection: The system will indicate that this restriction occurs when the followingconditions are met: a feeder with fine ore is down, the mill power draw is at itssetpoint value, but the tonnage drops from the average value it had before theoccurrence of the restriction. (The mill throughput decreases due to a coarserfresh feed).RR_ORE_SUPPLY: The fresh feed flowrate cannot reach its setpoint value.Detection: The system will indicate that this restriction occurs when the fresh feedflowrate drops below its setpoint value and does not appear to return to it.RR_SAG_STOPS: SAG mill stops. (Mill stops are not considered as restrictions; they will bedetected and recorded but no tonnage lost will be estimated)85Detection: The system will indicate that this restriction occurs when the SAG mill speedis zero or the SAG mill motor control signal is OFF.After detecting a restriction, the ISCS prototype uses its heuristic knowledge to determine the causeof the restriction detected. Table 6.1 shows some of the possible causes for each of the restrictionsthe prototype handles. The ISCS provides the mechanisms which allow the user to confirm/correcton-line some of the findings and results reported by the system.Table 6.1 Restrictions handled by the ISCS prototype and their possible causes.CAUSESOFT ORE PLUGGED SAG BALL MILLS BM PUMPS FLOTATION TAILINGS OTHERRESTRICTIONCHUTES CONTROLSRR_SOFT_ORE YES1RR_FEED_CUT YES YES YES YES(2)RR_FEED_LIMIT YES YES YES YES YES YES(2)RR_FEEDER_DOWN YES(3)RR_ORE_SUPPLY YES YES(4)RR_SAG_STOPS YES (5) YES(1) YES, in each case, means that the corresponding cause could be responsible for the restriction detected.(2) The restriction could be due to other problems such as BM cyclones.(3) One or more feeders with fine ore are down (feeders #2, 3 or 4). Undetermined feeder problems.(4) Low ore supply or feeder problems could be the cause of this restriction.(5) Both ball mills are down.(6) Problems with the SAG pump or other unclassified problems may have caused this restriction.iii) Estimating Tonnage LostThe regulatory control system automatically compensates for losses resulting from brief restrictions:an initial drop in tonnage is compensated by a sharp increase in tonnage when the restriction is86removed. Hence, a tonnage loss is only recorded when the restriction affects operation for a periodof time longer than 10 mm.Estimation of tonnage loss is based on the difference between a predicted and a measured value ofthe fresh feed to the SAG mill. The predicted value is the tonnage rate assumed to be processed bythe mill if the restriction had not occurred. For some restrictions, the predicted value is obtainedfrom an analysis of tonnage trends before the occurrence of the restriction. For other restrictions, thepredicted value derives from appropriate qualitative models of the process.Every restriction, except for the “soft ore” one, is characterized by a tonnage reduction, i.e. thetonnage during the restriction is lower than the average value before the occurrence of the restriction.In this case, the predicted tonnage value during a restriction corresponds to the average tonnage valuebefore the occurrence of the restriction (for a period without restrictions). Thus, the tonnage lost isestimated as the accumulated difference (area) between the predicted value and the actual tonnagemeasured during the restriction (see restriction 1 in Figure 6.5).Fresh feedrestriction IFigure 6.5 Estimating tonnage losses from historic trends (schematic trends).When the restriction is over, the tonnage may stabilize at a value different than the average valuebefore the occurrence of the restriction. If this occurs, the ISCS assumes that the predicted tonnagerestriction 2 time87value is an inclined line connecting average tonnage values before and after the restriction (seerestriction 2 in Figure 6.5).Tonnage losses due to a “soft ore” restriction are much more difficult to estimate. There is no simpleanswer as to what tonnage value might be possible if a high limit restriction did not exist (seeFigure 6.6).Mill Powerpredicted by a;sse!atFresh feed:4— restriction —+:timeFigure 6.6 Estimating tonnage lost due to a “soft ore” restriction (schematic trends).As shown in Figure 6.6, during a “soft ore” restriction the power draw drops as the fresh feed reachesthe absolute maximum value that can be delivered to C-line. Thus, tonnage losses are estimated asthe additional tonnage required to maintain the power draw at its setpoint value (shaded area inFigure 6.6). Metallurgists use historic trends to detennine the drop in the power draw and theduration of the restriction. From this information, they would estimate the approximate tonnagelosses associated with the restriction. Raabe (1994) notes, however, that these heuristics proceduresto estimate losses are based on pure “guesstimating” techniques; hence, different people obtaindifferent results.Conventional rule-based systems lack appropriate tools to implement heuristic procedures such asone to estimate losses during a “soft ore” restriction. A promising alternative to overcome this lackof representation capabilities is offered by the qualitative modeling approach proposed in this88research. Under this approach, a QM that represents the relationship between the power draw andthe fresh feed can be implemented. The QM can be built directly from the heuristic procedurecurrently employed at HVC or from information provided by a mathematical model of the process.This QM estimates a tonnage value that accounts for the difference between the actual mill powerdraw and its setpoint value. Thus, the difference between the tonnage predicted by the QM and theactual tonnage measured will correspond to the tonnage lost due to the “soft ore” restriction.A QM that mimics the heuristic procedure employed by metallurgists at HVC to estimate tonnagelosses has been incorporated into the ISCS. This QM can be expressed asTonnage_loss a (Power_draw_setpoint - Power_draw)The proportionality constant used by the ISCS for this model corresponds to the ratio between themaximum tonnage rate that can be delivered to C-line and the power draw setpoint.The ISCS accumulates the estimated losses over the period the restriction affects the operation. TheISCS displays these losses in real-time as it accumulates them while the restriction is present; it alsoreports and records the final estimate when the restriction is over. Appendix B presents the overallsteps required to incorporate additional QMs into the ISCS should they be required in the future.Appendix D the source code of the QM to estimate tonnage losses as incorporated into the ISCS.iv) User InterfaceThe ISCS provides on-line information associated with the supervision of the process and findingsfrom its restriction diagnosis. This output includes type of restriction detected, classification ofrestriction cause, estimate of tonnage lost, and accumulated losses per shift. The ISCS also providesmechanisms to allow the user to confirm or correct on-line some of the findings and results reported89by the ISCS. Should the system begin to diagnose a fault that has not really occurred, the user canoverride the system and prevent an erroneous prediction.Figure 6.7 and Figure 6.8 show two of the displays the ISCS offers to interact with the user.Figure 6.7 is a display with an overall view of the process. This display shows the value of relevantvariables and the status of the equipment involved; this displays also has a message window toinform about the occurrence of restrictions. This displays provides the mechanism for the user tooverride ISCS findings. Figure 6.8 shows a displays where the ISCS reports tonnage loss percategory. Losses are reported for current shift, previous shift and accumulated-to-date. When arestriction occurs, the ISCS highlights the corresponding row, and reports the duration and estimatedlosses in real-time as the restriction progresses. The accumulated-to-date information is alsopresented as percentage of the total losses in the circuit.oueruieucancel) HelpJTONNAGE RESTRICTION: RB—SOFT—ORE ConfirmPossible Cause of Restriction: Soft OreI1I2I34I5IFeed Rate2UU .I1TPHPower :62 .BMWSpeed?.Hydrostat85@ PSIG_________G0 TO)FlotationTailin9sboxFigure 6.7 User Interface: Process Overview Display.90categoryFigure 6.8 User Interface: Tonnage loss per Category.The ISCS generates reports at the end of each shift with a summary of supervision results. A filewith a record of all relevant events is also generated by the ISCS. This file can be accessed by theplant metallurgist to assist in daily or weekly analysis.6.7 Experimental ResultsThe ISCS ran at HVC for an evaluation period of six weeks. The diagnostic results obtained fromthe ISCS were stored on files to be analyzed at the end of the evaluation period. Operators did nothave access to the system nor to the results during this period.Trends of relevant process variables were obtained to analyze the capabilities of the ISCS system todiagnose tonnage restrictions. The following are some of the results provided by the ISCS, togetherwith trends of process variables and a list ofmajor events for the periods of interest.CançjJ HeIp..SAG SHUT—DOUNSHIFT ACCUMULATEDSOFT OREPLUGGED CHUTESSAG HILL CONTROLBALL MILLSUM PUMPSFLOTATIONTAILINGSFEEDERSOTHERTO TAL 1313 ieaR1LIWiL!JiRESTRICTIONSBAR GRAPH91i) Soft ore restriction (RR_SOFT_ORE)-ezJ—04 C FEED RATE8- —.--- — 1680.9 MTPH. 1990 865 C MOTOR AMPS6308.6 AMPS 70006298 006 C HYDROSTAT PR— 789.98 PSIG 1000809 700— —- 6—‘—. i6......— -_ — 8? C MILL LJATER— i0?8.1MTPH 1500111? 008C MILL SPEED— 78.92’.CS 80— 79 5001 01:00 81 02;20 01 03:40 81 Ø5:ØØ 31—Mar—1995 22:28:0004 C FEED RATE1652.8 MTPH 30002016 005 C MOTOR AMPSZDD.e 6309.6 AMPS 7000—5932 0289.25 PSIG 1000C06 C HYDROSTAT PRIl 788 700‘—0E-..-_ —. - 07C MILL IAIATER1068.5 MTPH 1560—1116 0‘ 08C MILL SPEED79.10 .CS 887? 5001 06:08 01 07:20 01 08:48 j 10:09 01—Apr—1995 12:00:068:22 Feeder #5 stops9:07 All feeders stop (the power draw reaches its high-high limit)9:25 Feeder #5 startsFigure 6.9 Soft ore restriction: April 1, 1995, day shift.92The ISCS reported the following restrictions during this period of time.TIME RESTRICTION DURATION TONNAGE LOST02:06 — 09:07 hrs. RR_SOFT_ORE 7 hrs. 1 mm. 103 tons09:07 — 09:15 hrs. RR_ORE_SUPPLY 8 mm. 128 tons (too short)09:15 — 10:19 hrs. RR_SOFT_ORE many very short restrictionsThe soft ore restriction that started at 02:06 hrs. was adequately diagnosed by the ISCS. From ananalysis of the historic trends, a metallurgist would have estimated 80 tons lost for this restriction,slightly lower than that estimated by the ISCS.At 9:07 hrs., the power draw reached the absolute maximum limit, at which point all the feeders wereautomatically turned off by the interlocking system. The ISCS correctly detected and reported thisrestriction as an RR_ORE_SUPPLY. The ISCS estimated a loss of 128 tons; however, since therestriction duration was shorter than 10 mm., these losses were discarded. A metallurgist might havealso discarded the losses caused by this short restriction.From a close analysis of the operating conditions around this short restriction, we conclude that thisrestriction and the associated 128 tons lost could have been prevented. Given the appropriateheuristic knowledge, the ISCS could analyze the evolution of process variables to determine whenthis type of restriction is likely to happen. At that time, the ISCS could either warn the operators orintervene directly with the operation of the process. This would give the ISCS the ability to not onlyestimate losses caused by restrictions but also prevent their occurrence.Between 9:15 and 10:19 hrs., the ISCS detected a series of very short soft ore restrictions. None ofthese restrictions was longer than the minimum time pre-specified (10 mm.); thus, the ISCS did notaccumulate the corresponding tonnage losses. A metallurgist, however, would likely have reported93the occurrence of a single soft ore restriction during this period, with losses of approximately100 tons.ii) Fresh feed to the mill is cut (RR_FEED_CUT)13:12 hrs.13:28 hrs.13:50 hrs.14:05 hrs.14:22 - 14:48 hrs.Feeder #2, 3, 4 and 5 stopFeeder #2, 3, 4 and 5 startFeeder #5 stopsFeeder #4 stopsAll feeders start and stop several times.Figure 6.10 Restriction RR_FEED_CUT: April 1, day shift.The ISCS reported the following restrictions during this period of time.TIME13:13 - 13:15 hrs.RESTRICTIONRR_ORE_SUPPLYDURATION2 mm.TONNAGE LOST39 tons (too short)13:27 - 13:29 hrs.14:06 - 14:22 hrs.RR_ORE_SUPPLYRR_ORE_SUPPLY2 mm.16 mm.34 tons (too short)42 tons01 13:00 01 13:40 01 14:20 01 15:00 01—Apr—199513:15 - 13:27 hrs. RR_FEED_CUT 12 mm. 351 tons94Metallurgists considered the restriction that occurred at 13:13 hrs. as a single restriction that lasteduntil 13:29 hrs. The ISCS, however, reported the occurrence of three restrictions. Before and afterthe main restriction RR_FEED_CUT, the ISCS indicated the occurrence of RR_ORE_SUPPLYrestrictions.The total losses estimated by the ISCS for the restrictions detected between 13:13 and 13:29 hrs. are424 tons, which is very close to the value of 450 tons estimated by an expert from the trendsmeasurements.Metallurgists differ about whether the entire period between 13:29 and 14:22 hrs. should beconsidered as a restriction, or just the period between 14:02 and 14:22 hrs. This would obviouslylead to different estimate of tonnage losses. Losses for the entire period are estimated to beapproximately 170 tons; for the shorter period the estimate is 40 tons.The ISCS reported the occurrence of a restriction for the period between 14:06 and 14:22 hrs.; itreported losses of 42 tons—very close to a metallurgist’s estimate. The ISCS heuristics can be tunedto follow either view as supported by the metallurgists.iii) Fresh Feedrate High Limit (RR_FEED_LIMIT)This restriction did not occurred during the period of evaluation of the ISCS.iv) Feeders are down (RR_FEEDER_DOWN)Some feeders tend to take coarser ore than others due to natural particle segregation in the stockpile.This causes a change in the size composition of the fresh feed changes when a feeder goes down.Variations in size composition may produce either a decrement or an increment in the tonnage that95can be processed by the mill, as the ore becomes coarser or finer respectively. In the case shownhere, the tonnage increases after a feeder goes down.—— —.8-’———--‘ 04 C FEED RATE-OS—c 1683.4 MTPH 3Ø“‘ ‘t 1997 005 C MOTOR AMPS07_.0?6295.5 AMPS 70006128 04.4‘‘ ‘06 C HYDROSTAT PR791.67PSIG 1000816 700— 07C MILL WATER—06- —i.. ,......—— 1095.2 MTPH 15001204 008C MILL SPEED— 79.14’.CS 8079 5030 j7:4Ø 30 18:20 30 19:00 30—Mar—199517:59 hrs. Feeder #4 stops18:32 hrs. Feeder #4 startsFigure 6.11 Restriction RR_FEEDER_DOWN: March 30, day shift.The ISCS reported the following restrictions during this period of time.TIME RESTRICTION DURATION TONNAGE LOST17:59 - 18:03 hrs. RRORE SUPPLY & few short restrictionsRR_FEEDER_DOWN18:03 - 18:32 hrs. RR FEEDER DOWN 28 mm. 0 tonsFigure 6.11 shows the case of feeder #4 going down. This feeder normally delivers finer ore, so weexpected a decrease in the tonnage processed by the mill after this feeder went down. However, thetonnage increased on this particular occasion.The ISCS appropriately detected this potential restriction when feeder #4 went down. When therestriction was lifted at 18:32 hrs., the ISCS reported zero losses.96A non-experienced metallurgists may overlook the irregularities shown in the historic trends for thisperiod, indicating that there is no restriction. An experienced metallurgist, however, would be ableto detect the occurrence of this restriction. After a careful analysis of this period of time, he wouldnote that there are no tonnage losses associated with the restriction. Thus, agreeing with the resultsreported by the ISCS.During the initial 4 mm. of this restriction, between 17:59 and 18:03 hrs., the ISCS indicated thatshort RR_ORE_SUPPLY & RR_FEEDER_DOWN restrictions occurred a couple of times.v) Problems with ore supply (RR_ORE_SUPPLY)Figure 6.1230 00:20 30 01:00 38 Øj:4Ø 30 02:28 30—Mar—199500:16 hrs. Feeder #4 stops00:40 hrs. Feeder #2 stops00:48 hrs. Feeder #4 starts00:50 hrs. Feeder #2 startsRestriction RR_ORE_SUPPLY. March 30, night shift.97The ISCS reported the following restrictions for this period of time.TIME RESTRICTION DURATION TONNAGE LOST00:17 - 00:21 hrs. RRJEEDER_DOVN several alternating& RR_ORE_SUPPLY short restrictions00:2 1 - 00:4 1 hrs. RR_FEEDER_DOWN 20 mm. 2 tons00:4 1 - 00:5 1 hrs. RR_ORE_SUPPLY 10 mm. 97 tons00:5 1 - 01:00 hrs. RR SOFT ORE 9 mm. 9 tons (too short)When feeder #4 went down at 00:16 hrs., the size composition of the feed to the mill changed. As aresult of this, the tonnage processed by the mill increased (similar to the restriction shown inFigure 6.11, discussed earlier). The ISCS detected this restriction and reported a loss of 2 tons.These losses occurred right after the feeder went down, before the control system could compensatefor the sudden drop in fresh feedrate.When feeder #2 went down at 00:40 hrs., the remaining feeders could no longer continue supplyingthe tonnage rate requested. As a result, the fresh feedrate to the mill dropped, and so did the powerdraw as shown in Figure 6.12.The ISCS correctly detected this restriction, reporting a tonnage loss of 97 tons. A metallurgist, onthe other hand, would roughly estimate a loss of 110 tons, slightly higher than that reported by theISCS. The difference in the estimated losses is caused by the highly subjective aspect of thisproblem, i.e. the estimation of the fresh feed rate that could have been processed by the mill iffeeder #2 had not stopped. The metallurgist estimated a loss of 110 tons by assuming that the millwould continue to process the same tonnage average that existed just prior to the time feeder #2 wentdown. The ISCS, on the other hand, obtained its estimate by assuming that the mill would processthe same tonnage rate that it was processing before feeder #4 went down. The ISCS uses a period of98operation with no restriction, such as the one before the restriction caused by feeder #4, to estimatethe tonnage that the mill may continue Mill is shut down (RR_SAG_STOPS)38-.—.. 04 C FEED RATE-95_.r 1713.3 MTPK 38001873 0— — 6302.2 AMPS 700085 C MOTOR AMPS6278 0...86 C HYDROSTAT PR789.83PSIG 1000821 700—..06 — —07 C MILL WATER— 949.95 NTPH 15001117 0—08 C MILL SPEED?9.00/.CS 8079 5029 06:40 29 08:00 29 89:20 29 10:40 29 12:00 29—Mar—199508:01 hrs. Feeder #2, 3, 4 and 5 stop (feeder #1 had already stopped)08:04 hrs. SAG mill stops08:40 hrs. Both ball mills stop09:13 hrs. SAG mill and ball mills start09:15 hrs. Feeder #2, 3,4 and 5 startFigure 6.13 Restriction RR_SAG_STOPS: March 29, day shift.The ISCS reported the following diagnostic resultsThe shut down of the mill involves stopping all feeders. As shown in Figure 6.13, the feeders werestopped just prior to the shut down of the mill. The start-up of the mill is a reverse procedure: themill is re-started first with no feed, and then the feeders are re-started.TIME RESTRICTION DURATION TONNAGE LOST08:02 - 08:03 hrs. RR_ORE_SUPPLY 1 mm. 25 tons (too short)08:03 - 08:03 hrs. RR_FEED_CUT 0 mm.08:03 - 09:13 hrs. RRSAG STOPS 1 hr. 10 mm. 2112 tons09:13 - 09:15 hrs. RR_FEED_CUT 2 mm. 45 tons (too short)09:15 - 09:19 hrs. RR_ORE_SUPPLY 4 mm. 31 tons (too short)99This shut down procedure caused some difficulties for the ISCS. The ISCS, instead of reporting onlyone restriction, reported five restrictions: the main RRSAG_STOPS restriction, plus two shortrestrictions just before and two just after the main restriction. The ISCS reported a loss of 2112 tonsassociated with the main restriction; it discarded the losses caused by the short restriction, whichamount to 101 tons.A metallurgist would have considered the whole period from 08:02 hrs. until 09:19 hrs. as a singlerestriction. Tonnage losses estimated from the historic trends for this period amount to 2250 tons.This estimate is very close to the total losses of 2213 tons that the ISCS would have reported if allfive restrictions had been considered as one single restriction.vii) Operating period with several disturbances—— —08--.-—.- — = = 04 C FEED RATE95— — -05—I p’— 1642.9 MTPH 30001591 085 C MOTOR AMPS0? 6255.7 AMPS 7000—6274 006 C HYOROSTAT PR‘— 288.3? PSIG i000ll 289 2000?C MILtIIATER6J— r— 1090.5 MTPH 150087? 0— 08C MILL SPEED—-——————— 79.12>’.CS 8079 5001 17:20 01 18:40 01 20:00 01 21:20 01 22:40 01—Apr—199518:00 - 21:49 hrs. All feeders start and stop many timesFigure 6.14 Many restrictions due to plugged chutes. April 1, day and night shifts.100The ISCS reported the following major restrictions during this period of time.TIME RESTRICTION DURATION TONNAGE LOST18:0 1 - 18:22 hrs. RR_FEEDER_DOWN 21 mm. 7 tons20:02 - 20:16 hrs. RRORE SUPPLY 14 mm. 125 tons20:16 - 20:35 hrs. RRFEEDER_DOWN 19 mm. 61 tons20:38 - 21:06 hrs. RRFEEDER_DOWN 28 mm. 15 tons21:06-21:29 hrs. RR ORE SUPPLY 23 mm. 177 tonsTotal loss: 385 tonsIt is not an easy task to detect restrictions and estimate tonnage losses for operating periods such asthat shown in Figure 6.14. A metallurgist would have identified two major restrictions: one at20:01 his. and another at 21:06 hrs. Tonnage losses associated with these two restrictions areestimated to be 100 tons and 150 tons, respectively. Some metallurgists may also report a roughestimate of overall losses due to the other short restrictions present during this period. They wouldnot, however, estimate this on a detailed restriction-by-restriction basis.The ISCS reported five major restrictions during the period shown in Figure 6.14; it also discardedseveral short restrictions detected during this period. The total losses reported by the ISCS were385 tons, higher than those reported by a metallurgist. The major reason for this difference is thatthe ISCS does a much more detailed diagnosis of the operation of the circuit; a metallurgist is likelyto consider major restrictions only.1016.8 Evaluation of ResultsThe following is a summary of the findings obtained from an analysis of the results presented in theprevious section.i) Overall ISCS PerformanceThe overall performance of the ISCS is very encouraging. The system could appropriately detect anddiagnose every restriction that affected the operation of C-line during the evaluation period.Tonnage losses estimated by the ISCS are very close to those obtained from historic trends, reportedby HVC personnel.The current set of heuristics incorporated into the ISCS covers every restriction of interest to HVCpersonnel. It does not consider, however, all possible circumstances in which a restriction mayoccur. The ISCS, for example, detects a high tonnage limit (RR_FEED_LIMIT) when the operator usesthe high-limit block to constrain production (see Figure 6.3); the ISCS cannot detect this restrictionproperly if the operator imposes this high limit by other means, e.g. by turning the power loop tomanual operation and manipulating directly the output of the fresh feed controller.The performance of the ISCS was analyzed on a restriction-by-restriction basis. It was difficult to dothis for a long operating period due to problems with the HVC-PC, the computer that provides theISCS with access to the Bailey database. The HVC-PC crashed randomly every few days throughoutthe evaluation period. Because of these crashes, the ISCS sometimes missed restrictions thatproduced significant production losses. These hardware problems have since been eliminated and thesystem has operated essentially free of hardware and software errors from April 1 to May 1, 1995.The period from March 26 to March 31, 1995, was chosen for evaluation of system output as itrepresented a period of time for which reliable data were available. The trend charts of this period102were analyzed manually using the heuristic approach of Hans Raabe. This comparison appears inTable 6.2.Table 6.2 Diagnostic results provided by the ISCS. Period: March26 -31, 1995NUMBER OF DURATION TONNAGE LOSTRESTRICTION CAUSE RESTRICTIONS hh:mm tonsISCS METALLURGIST ISCS METALLURGIST ISCS METALLURGIST=SAG STO 5 54649 5694.::4 -..,FEEDERPROBLEMS 9 2 03:50 01:05 1019 1050CHUTES 13 4 02:44 00:57 423 485SOFT ORE 7 0 02:07 00:00 55 0OTHER 3 1 00:57 00:35 8 450NOT DETECTED(2) 2 00:45 —- 550TOTAL 34 7 09:38 2:37 2055 1985(1) This is detected by the ISCS but not integrated with the other causes of restriction. HVC keeps aseparate record of it.(2) The ISCS missd two restrictions as explained in the text.The total tonnage losses reported by HVC for this period was 2100 tons, which compared with themanual total in Table 6.2, demonstrates the variability of different metallurgists conducting thisanalysis. The important point, however, is that the ISCS estimate is clearly within the range of thesetwo manually derived predictions.The difference between the results provided by the ISCS, those reported by HVC, and those obtainedusing Raabe’s heuristics (see Table 6.2), is due to three factors. First, The ISCS performs a muchmore meticulous diagnosis; it does not only report restrictions responsible for significant losses butalso those that only cause minor losses. Metallurgists, however, tend to consider losses caused bymajor restrictions only. This accounts for the big difference in both number and duration ofrestrictions shown in Table 6.2. During this period of evaluation, for example, the ISCS detected a103number of small soft ore restrictions, which produced estimated total losses of 55 tons. HVCpersonnel, however, overlooked these small restrictions and their corresponding losses. Second, theset of heuristics in the ISCS is incomplete: it does not cover all the possible circumstances in which arestriction may occur. During the evaluation period, HVC operators imposed a high limit to thesetpoint of fresh feed by a mechanism not covered by the heuristics available in the ISCS (theyturned the power draw loop to manual mode and manipulated the setpoint of the fresh feedcontroller). Hence, the ISCS could not appropriately detect this problem. This restriction wasresponsible for a loss of 450 tons, as estimated from historic trends.Finally, there were some problems with the HVC-PC, the computer that interfaces with the Baileydatabase. The HVC-PC was down when a restriction occurred preventing the ISCS from detecting it.Losses due to this restriction were estimated at 100 tons.ii) Using QM to estimate tonnage lossesThis application has provided a good opportunity to demonstrate the capabilities of qualitativemodeling.Every aspect of the diagnostic problem involves qualitative information and subjective analysis—achallenge to any knowledge-based system. The most difficult and subjective aspect of thisapplication is the estimation of tonnage losses due to soft ore restrictions. How much tonnage canthe mill process, after the fresh feed has reached the high limit target specified for C-line, in order tokeep the power draw at its setpoint value? (see Figure 6.9). Different people have different answersto this problem. This is an aspect that causes serious difficulties to conventional knowledge-basedsystems; they do not provide an appropriate tool to handle this kind of problem. The results of theapplication of the ISCS demonstrate that QMs, under the pseudo-qualitative modeling approachproposed in this research, can appropriately handle such problems.104A steady state QM implemented into the ISCS proved to be an essential tool to estimate lossescaused by soft ore restrictions. This QM represents the mental model of a metallurgist regarding therelationship between the fresh feed to the mill and the power draw. The mental model can beexpressed as follows: the additional tonnage required to bring the power back to its setpoint value isproportional to the difference between the actual power draw and its setpoint value. The ISCS usesthis QM to predict a fresh feed value that could have been processed by the mill during theoccurrence of the soft ore restriction. Finally the ISCS estimates the losses based on the differencebetween the predicted fresh feedrate value and the high limit imposed on the fresh feed setpoint.iii) Revision of the Current Set of HeuristicsThe ISCS detected every restriction that affected the operation of C-line (provided that they werecovered by its current set of heuristics). Most of these restrictions were appropriately detected, afew, however, caused some difficulties for the ISCS. As discussed below, the deficiencies found inthe ISCS heuristics can be solved by modifying/expanding the current set of heuristics.The ISCS split some soft ore restrictions into several shorter ones as in the case shown in Figure 6.9.According to the ISCS report, the restriction in Figure 6.9 occurred intermittently during this period,which in strict terms, is correct. The setpoint for the fresh feed oscillated continuously around thetarget tonnage rate for C-line during this period. Current heuristics associated with soft orerestrictions are sensitive to this oscillation; thus the ISCS switched the restriction condition on andoff. A metallurgist, however, would conclude that it is more appropriate to consider that only onerestriction occurred during this period. This problem can be eliminated by modifying current ISCSheuristics in order to reduce their sensitivity to the oscillations described earlier.105In some cases, the ISCS reported the occurrence of several shorter restrictions when only a singlerestriction occurred. When the fresh feed was cut (see Figure 6.10), for example, the ISCS firstindicated a restriction due to feeders (feeders stopped), then a restriction due to ore supply (the freshfeed dropped below its setpoint), and finally, the restriction due to a fresh feed cut. Similar splittingoccurred when the restriction was lifted and the fresh feed restored. The ISCS requires additionalheuristics that instruct the system that shorter restriction may be detected before and after theoccurrence of a main one, but all such irregularities correspond to the same restriction. These newheuristics could be arranged as supervisory heuristics dedicated to the detection of specificrestrictions.The ISCS also misdiagnosed some restrictions. This normally occurred following the removal of amajor restriction. When the mill restarts after a shut down, for example, the control system wouldrequest a high value of fresh feed to bring the power draw back to its setpoint value. In some cases,due to requests by the control system, the fresh feed may reach the maximum tonnage valueallowable for C-line. When this happened, the ISCS reported the occurrence of a soft ore restriction.If we analyze only the value of relevant variables during that time, ignoring that the mill has just restarted, we would also conclude that a soft ore restriction is affecting the operation. However,considering the above in the right context, we would conclude that what has occurred is the naturalresponse of the control system and not that of a soft ore restriction. This could be solved by fine-tuning the existing heuristics and adding others designed to supervise and monitor partial diagnosticresults.The 10 minute-criteria incorporated into the ISCS to decide whether or not a restriction is too short tobe considered needs to be revised. Depending on specific cases, a metallurgist may include arestriction shorter than 10 mm. and discard others longer than 10 mm. The ISCS should exhibit asimilar degree of flexibility.106iv) Future expansion of the Heuristic KnowledgeAt this stage the ISCS operates as an real-time advisory system; it does not intervene directly withthe process. The ISCS provides on-line reports about restrictions affecting circuit operation;appropriate actions are left to the discretion of plant operators. A future expansion of the ISCS is togive the system the ability to intervene with the operation in order to prevent the occurrence of sometonnage restrictions.For example, the ISCS could override the control system to prevent the cut in tonnage shown inFigure 6.9. This upset occurs because the conventional control system cannot distinguish between ahigh limit imposed on the tonnage by operators and one due to a soft ore restriction. In both cases,the control system reduces mill speed in order to maintain a constant mill inventory of ore. In thecase of a soft ore restriction, this action eventually produces a rapid increase in power draw as themill loses its grinding capacity (see Figure 6.9). When the mill power draw reaches the absolutemaximum allowed, the interlocking system stops the feeders causing the upset to circuit operation.The ISCS, however, is able to distinguish between these two situations. Appropriate heuristics couldbe incorporated into the ISCS to override the existing control system before this upset occurs. Thiswould result in reduction of tonnage losses due to restrictions and in stable feed tonnage.107CHAPTER 7FINAL CONCLUSIONS AND RECOMMENDATIONS7.1 Final Conclusionsi) Pseudo-Qualitative ModelingWhile other researchers have proposed incorporation of heuristics with mathematical models forsupervisory or adaptive control, this work demonstrates that such components can, in fact, beintegrated into a singular overall modeling approach, called Pseudo-Qualitative Modeling. Thismethodology will allow system developers to attack the problem of real-time supervision even whenthey do not have a mathematical model or understanding of a complex process. Alternatively, shouldsuch models exist, it is easy to incorporate these within the arena of Pseudo-Qualitative Modeling.• Pseudo-Qualitative Modeling is proposed as a suitable method to build supervisory controlsystems that requires heuristic knowledge and/or input and/or mathematical models.ii) Components of Pseudo-Qualitative ModelingPseudo-Qualitative Modeling offers the same versatility as purely qualitative approaches to handlemodels based on heuristic knowledge. In addition, the approach proposed can handle well definedand accurate models including mathematical models. In fact, the approach provides a framework tointegrate qualitative and numerical models into a knowledge-based system.108A pseudo-QM is conceived as a model with a hybrid structure capable of handling both numericaland qualitative information. Qualitative information is represented by a set of fuzzy concepts thatcan be directly translated into any other user-defined set, which facilitates the integration of QMswith other elements of an ISCS. Pseudo-QMs offer qualitative primitives that allow therepresentation of both steady state and dynamic behavior.• A pseudo-QM can appropriately represent the behavior of complex processes. Its parameterscan be tuned as more knowledge becomes available or by mechanisms that adjust itsparameters in relation with process variables.• A pseudo-QM can be fully integrated with other elements of knowledge representation andreasoning within the environment of an ISCS.iii) Application of Pseudo-Qualitative Modeling to a real world processQualitative models, under the approach proposed, proved to be a valuable tool to represent andhandle heuristic models. A QM incorporated into the ISCS mimics the heuristic knowledge thatmetallurgists possess about the relationship between power draw and fresh feed into the mill. Theuse of this QM was essential in estimating tonnage losses caused by operating restrictions thataffected the operation of the process.The ISCS provides periodic reports that can be used to assess the extent and frequency of productionlimiting bottlenecks. On-line information together with report summaries, can reduce the decisionmaking time. This can ultimately lead to a reduction of tonnage losses, which range up to 5000 tonsper week in C-line. In addition, the ISCS provides consistent criteria to deal with this diagnosticproblem and can save about 5 hours per week of a metallurgist’s time.109• The application of the ISCS to the diagnosis of tonnage restrictions in a grinding line at HVChas demonstrated the validity of the proposed pseudo-qualitative modeling approach. Thefeasibility of incorporating this technique into a commercial real-time SCADA systemwidely used in industrial applications has been proven.• An ISCS, with the structure and elements proposed in this research, can effectively beapplied to a real-time full-scale industrial operation. In the HVC application, the ISCS dealtwith aspects that are difficult to tackle with tools provided by current knowledge-basedsystems. The ISCS could mimic human expertise and heuristic knowledge to handle all thesubjective aspects involved in this application.• ProcessVision was found to be a powerful tool for the development and implementation ofthe ISCS. Its versatility played an important role in reducing the development time of thissystem. The modularity of ProcessVision together with features of each individual module,were essential factors for the system to be designed to mimic the heterogeneous functionsused by a human to reason about complex processes.iv) Handling UncertaintyProbability has not been widely accepted by researchers in intelligent control mainly due to a lack ofan appropriate approach to handle heuristic knowledge and fuzzy concepts. A simplified frameworkto handling uncertainty based on subjective probability is proposed along the lines described inAppendix A. 1. This approach is suitable to represent and handle concepts such as those required forISCS process supervision applications.This approach has various similarities to existing numerical approaches to certainty; its majordifference is that it employs the widely respected probability calculus to handle uncertainty. In110summary, this is a contribution of another item to the arsenal from which we can select the mostappropriate tool for a given application.7.2 Recommendations for Future ResearchResearch should continue along the following lines:• Expand the ability of current pseudo-qualitative modeling approach to include subjectiveprobability analysis described in Appendix A. 1.• Develop a philosophy on intelligent learning along the lines outlined in Appendix A.2.Initially the focus should be on explanation and justification, moving on to adaptation oflinguistic definitions in response to heuristics, then eventually leading to development ofpseudo-QMs that can add new knowledge elements.• Extension of the ISCS developed for HVC to supervisory control to intervene with theoperation of the control system to eliminate abnormal operations such as tripout of feeders.• Addition to the HVC ISCS system of new heuristics to identif,’ the onset of certainrestrictions and to combine several short intermittent restrictions into a single major.• Examination of other AT methodologies that might interact effectively with pseudo-QMwithin the environment of an ISCS; methodologies such as artificial neural networks, geneticalgorithms and cluster analysis for such problems as pattern recognition, optimization andclassification.111CHAPTER 8CLAIMS TO ORIGINAL RESEARCHI claim the following items as original research deriving from this work:• The proposition that heuristic knowledge together with numerical models can be integratedinto an approach for real-time supervision of direct control of a complex process. Such atechnique is referred to as Pseudo-Qualitative Modeling.• The definition of the components and structure of a Pseudo-Qualitative Model, andverification of this approach to model a simple well-understood process (head tank).• The incorporation of a pseudo-qualitative modeling facility into a commercial SCADAsoftware package to create an ISCS system to monitor in real-time a full-scale industrialprocess.• The proposition of an uncertainty handling technique, based on subjective interpretation ofprobability that can be used in an ISCS system employing pseudo-qualitative modeling.112NOMENCLATUREi) List of Symbols °AMT AmountCNT : ConstantDEC : DecreasingDYN DynamicsNC : IncreasingNEG : NegativeP05 : Positivemm : minimummax : maximum—‘ : NOT (negation)A : (logical) ANDQualitative proportionalityBelongs toMembership function for fuzzy sets‘C : Time constantii) AcronymsAl : Artificial IntelligenceDCS : Distributed Control SystemDoB : Degree of BeliefEBL : Explanation-Based LearningES : Expert SystemHVC Highland Valley CopperIC : Intelligent Control(1) Other symbols and acronyms used in the text are described whenever they are used.113ISCS : Intelligent Supervisory Control SystemKB : Knowledge BaseKR : Knowledge RepresentationOR : Operations ResearchPC : Personal ComputerPD Proportional-Integral-DerivativeQM : Qualitative ModelRCS Regulatory Control SystemSAG : Semi-autogenous grindingSCADA : Supervisory Control And Data AcquisitionU_I : User Interfaceiii) Unitscm : Centimetershp : Horse powerhrs. : HoursKB : Kilo BytesKW : Kilo Watts1pm : Liters per minutem : Metermi : MinuteMB : Mega Bytes% crit : Percent of critical speed114BIBLIOGRAPHYAbdulmajid B.A. and Wynne R.J., (1991). “An Extended Qualitative Controller”, lEE mt.Conference on Control’91, Edinburgh, UK, March, pp 606-611.Andersen T.R. and Nielsen S.B., (1985). “An Efficient Single Output Fuzzy Control Algorithm forAdaptive Applications”, Automatica, Vol 21, No 5, pp 539-545.Anderson J.A. and G.E. Hinton, (1981). “Models of Information in the Brain”. In Hinton G.E. &Anderson J.A., (Eds.)., Parallel Models ofAssociative Memory. Lawrence Erlbaum Associate,Publ., NJ, USA.Antsaklis P.J., Passino K.M. and Wang S.J., (1989). “Towards Intelligent Autonomous ControlSystems: Architecture and Fundamental Issues”, Journal of Intelligent and Robotic Systems,Vol. “pp315-42Antsaklis P.J., Passino K.M. & Wang S.J., (1990). “An Introduction to Autonomous ControlSystems”, IEEE mt. Symposium on Intelligent Control, Philadelphia, PA, USA, September,pp 21-26.Arjunan W. M., (1988). “Diagnosing Multiple Faults in Intelligent Controls and AutomatedSystems”, Third IEEE mt. Symposium on Intelligent Control, Arlington, VA, USA, August,pp 93-97.Aström K.J., Anton J. and Arzén K., (1986). “Expert Control”, Automatica, Vol 22, N° 3,pp 277-286.Aström K.J., (1989). “Toward Intelligent Control”, IEEE Control Systems Magazine, April,pp 60-64.Astrom K.J. and Wittenmark B., (1989). Adaptive Control, Addison-Wesley Publishing Co.Bartrum J., Bowler A. and Butcher G., (1986). “SAG Mill Operations at Kidston Gold Mines”,Minerals andMetallurgical. Processing, May, pp 96-103.Berenj i H., (1990). “Neural Networks and Fuzzy Logic in Intelligent Control”, IEEE mt. Symposiumon Intelligent Control, Philadelphia, PA, USA, September, pp 916-920.Bhaskar R. and Nigam A., (1990), “Qualitative Physics Using Dimensional Analysis”, ArtUlcialIntelligence, Vol 45, No 1-2, September, pp 73-111.Bösser T.E., (1985). “Learning to control Complex Technical Systems”, in Willumeit H.P., (Ed.),Human Decision Making andManual Control, Elsevier Science Publ., pp 3 19-328.Bowerman R. and Glover D.E., (1988). Putting Expert Systems into Practice. Van NostrandReinhold Co.115Burrows M.J. Carriere J.D., Leung J. and Laguitton D., (1989). “An Expert System Designed toImprove Reliability of Assay Information in a Flotation Plant”, 21st CM]’ Conference, Ottawa,ON, Canada, January.Cheeseman P., (1985). “In Defense of Probability”, Proc. of the Ninth JJCAI, Los Angeles, CA,USA, August, pp 1002-1009.Cheeseman P., (1986). “Probabilistic Versus Fuzzy Reasoning”, in Kanal L.N. and Lemmer J.F.(Eds.), Uncertainty in Arilficial Intelligence, Elsevier Science Pubi. B.V., North Holland,pp 85-102.Cifuentes E.I. and Mular A.L., (1992). “An Introduction to Qualitative Modeling and its Potential inthe Development of Intelligent Control Systems”, Conference and Exhibition on IndustrialAutomation, Montreal, PQ, Canada, June, pp 1.5-1.8.Clarke D.W., (1981). “Implementation of Adaptive Controllers”, In Harris C.J. and Billings S.A.,(Eds.), Self-tuning andAdaptive Control, Peter Peregrinus, UK.Clarke D.W. and Gawthrop P.J., (1981). “Implementation and Application of Microprocessor-BasedSelf-Tuners”, Automatica, Vol 17, No 1, pp 233-244.Cohen P.R., (1985). Heuristic Reasoning about Uncertainty: An ArtfIcial Intelligence Approach,Pitman Publ. Inc.Corea R., Tham M.T. and Morris A.J., (1992). “Qualitative Modeling - An Application toSupervisory Control of a Distillation Column”, IEEE mt. Symposium on Intelligent Control,Glasgow, Scotland, UK, August, pp 586-591.Crosseope J.R. and Bonnell R.D., (1988). “A Dynamically Evolving Learning Network for IntelligentControl”, IEEE mt. Symposium on Intelligent Control, Arlington, VA, USA, August, pp 529-533.D’Ambrosio B., (1 989a). “Extending the Mathematics in Qualitative Process Theory”, mt. Journal ofIntelligent Systems, Vol 4, pp 55-80.D’Ambrosio B., (1 989b). Qualitative Process Theory Using Linguistic Variables, Springer-Verlag.Davis R., (1985). “Diagnostic Reasoning Based on Structure and Behavior”, Art/Icial Intelligence,Vol 24, pp 347-4 10.DeJong G., (1988). “An introduction to Explanation-based Learning”, in Shrobe H.E., (Ed.),Exploring Artt/Icial Intelligence, Morgan Kaufmann Publishers, Inc., Ch. Kleer J, (1976). Local Methods for Localizing Faults in Electronic Circuits, MIT, Cambridge,MA, Kleer J. and Brown J.S., (1985). “Qualitative Physics Based on Confluences”, in Hobbs J.R. &Moore R.C., (Eds.), Formal Theories of the Commonsense World, Ablex Publ. Corp., Norwood,NJ, USA, pp Kleer J. and Brown J.S., (1986). “Theories of Causal Ordering”, Artflcial Intelligence, Vol 29,No 1, pp 33-61.116de Kleer J. and Williams B.C., (1987). “Diagnosing Multiple Faults”, Artflcial Intelligence, Vol 32,pp 97-130.Drury C. G., (1976). “Human Performance in Manual Process Control”, in Sheridan T.B. andJohannsen G. (Eds.), Monitoring Behavior and Supervisory Control, Plenum Press, New York,pp 359-369.Dubois D. and Prade H., (1988). “The Treatment of Uncertainty in Knowledge-Based Systems UsingFuzzy Sets and Possibility Theory”, mt. Journal ofIntelligent Systems, Vol 3, pp 141-165.Efstahiou H.J., (1990). “Introduction to Knowledge-Based Systems for Process Control”, Ch. 2 inMcGhee J., Grimble M.J. & Mowforth P., (Eds.), Knowledge-Based Systems for IndustrialControl, Peter Peregrinus Ltd., London, UK.Eggert J. and Benford P., (1994). “Development and implementation of an expert system for grindingcontrol at The Dome Mine,” 26th Meeting ofthe Canadian Mineral Processors, Ottawa, Ontario,Canada, January.Fischler M. and Firschein 0., (1987). Intelligence. The Eye, the Brain and the Computer, Addison-Wesley Pubi. Co.Flintoff B.C., and Mular A.L. (Eds.), (1992). A Practical Guide to Process Controls in the MineralsIndustry, University of British Columbia, Brenda Mines Ltd. and MINTEC, Ch 2.Forbus K.D., (1984). “Qualitative Process Theory”, Artificial Intelligence, Vol 24, No 1-3,December, pp 85-168.Forbus K.D., (1985), “The role of Qualitative Dynamics in Naive Physics”, in Hobbs J.R. & MooreR.C., (Eds.), Formal Theories of the Commonsense World, Ablex Pubi. Corp., Norwood, N.J.,USA, pp 185-226Forbus K.D., (1 986a). “Qualitative Physics: Past, Present, and Future”, in Shrobe H.E. & AmericanAssociation for AT, (Eds.), Exploring ArtUlcial Intelligence: Survey Talks from the NationalConferences on Al, Morgan Kaufmann PubI., Inc., California, USA, pp 23 9-296.Forbus K.D., (1986b). “Interpreting Measurements of Physical Systems”, AAAI-86, Philadelphia, PA,USA, August, pp 113-117.Forbus K.D., (1988). “Commonsense Physics: A Review”, Annual Review of Computer Science,pp 197-232.Forsyth R and Rada R., (1986). Machine Learning: Applications in Experts Systems and InformationRetrieval, Ellis Horwood Ltd.Forsyth R.(Ed.), (1989). Machine Learning. Principles and Techniques, Chapman and Hall.Fortescue T.R., Kershenbaum L.S. and Ydstie B.E., (1981). “Implementation of Self-TuningRegulators with Variable Forgetting Factors”, Automatica, Vol 17, No 6, pp 831-835.117Fox J., (1986). “Three Arguments for Extending the Framework of Probability”, in Kanal L.N. &Lemmer J.F., (Eds.), Uncertainty in Art(ficial Intelligence, Elsevier Science Pubi. B.V., NorthHolland, pp 447-458.Franklin G.F. and Powell J.D, (1980). Digital Control of Dynamic Systems. Addison-WesleyPublishing Co.,Fu K.S., (1971). “Learning Control Systems and Intelligent Control Systems: An Intersection ofArtificial Intelligence and Automatic Control”, IEEE Trans. on Automatic Control, Vol AC- 16,No 1, pp 70-72.Fuentes A., Cifuentes E.L, (1988). “Design of a Selftuning Regulator with Feed Forward Signals”.VII Brazilian Conference on Automation, Aeronautic Technical Institute, Sao Paulo, Brazil,August.Geng Z. and Jamshidi M., (1988). “Design of Self-Learning Controllers Using Expert SystemTechniques”, IEEE mt. Symposium on Intelligent Control, Arlington, VA, USA, August,pp 551-558.Hales L.B., Burdett B.W. and Gilbert S.R., (1982). “The History and Development of GrindingControl”, in Mular A.L. and Jergensen (Eds.), Design and Installation ofComminution Circuits,Ch 44, SME-AIME, Littleton, CO, USA.Hales L.B. and Pate W.T., (1985). “Supervisory and Optimal Control Strategies for MineralProcessing Plants”, Conference ofMetallurgists, Vancouver, BC, Canada. August.Hales L.B., Vanderbeek J.L. and Herbst J.A., (1988). “Supervisory Control of a Semi-AutogenousGrinding Circuit”, mt. Journal ofMineral Processing, Vol 22, pp 297-312.Hamscher W. and Davis R., (1984). “Diagnosing Circuits with State: An Inherently UnderConstrained Problem”, AAAI-84, Austin, TX, USA, pp 142-147.Harris C.A. and Meech J.A., (1987). “Fuzzy Logic : a Potential Control Technique for MineralProcessing”, CiMBulletin, September, pp 51-59.Herbst J.A., Pate W.T. and Oblad A.E., (1989). “Experiences in the use of Model Expert ControlSystems in Autogenous and Semi Autogenous Grinding Circuits”, in Mular A.L. and Agar G.E.(Eds.), Advances in Autogenous and Semiautogenous Grinding Technology, University of BritishColumbia, Vancouver, BC, Canada, September, pp 669-686.Horwitz E. and Heckerman D., (1986). “The Inconsistent use of Certainty in Artificial IntelligentResearch”, in Kanal L.N. and Lemmer J.F., (Eds.), Uncertainty in Artificial Intelligence, ElsevierScience PubI. B.V., North Holland, pp 137-15 1.Hunter D., (1986). “Uncertain Reasoning using Maximum Entropy Inference”, in Kanal L.N. andLemmer J.F., (Eds.), Uncertainty in ArtUlcial Intelligence, Elsevier Science Pubi. B.V., NorthHolland, pp 203-209.Isaka S., (1990). “An Optimization Approach for Fuzzy Controller Design”, 1990 American ControlConference, San Diego, CA, USA, May, pp 1485-1492.118Isermann R. and Lachmann K.H., (1985). “Parameter-adaptive Control with Configuration Aids andSupervision Functions”, Automatica, Vol 21, pp 625-638.Isik C and Ciliz K, (1988). “A Two-level Neural Network System for Learning Control of RobotMotion”, IEEE mt. Symposium on Intelligent Control, Arlington, VA, USA, August, pp 519-522.Jerez J., Toro H. and Von Borries G., (1985). “Automatic Control of Semi-Autogenous Grinding atLos Bronces”, IFAC Symposium Automation for Mineral Resource Development, Qeensland,Australia, pp 275-282.Johnson-Laird P., (1989). “Mental Models”, in Posner M.I. (Ed.), Foundations ofCognitive Science,MIT, Ch. 12, pp 469-499.Jones A.H. , Porter B. and Fripp R.N., (1988). “Qualitative and Quantitative Approaches to theDiagnosis of Plant Faults”, IEEE mt. Symposium on Intelligent Control, Arlington, VA, USA,August, pp 87-92.Jones A.H., Fripp R.N. and Porter B., (1990a). “Intelligent Knowledge-Based Control ofMultivariable Plants”, IEEE mt. Symposium on Intelligent Control, Philadelphia, PA, USA,September, pp 786-793.Jones A.H., Porter B., Fripp R.N. and Pallet S., (1990b). “Real-time Expert Systems for Diagnosisand Closed-Loop Control”, IEEE mt. Symposium on Intelligent Control, Philadelphia, PA, USA,September, pp 1088-1094.Jovic F., (1992). Process Control Systems: Principles of Design, Operation and Interfacing,Chapman & Hall, 2nd edition.Karetnyk D.G., Grant E. and McGregor D.R., (1988). “A Review of Artificial Intelligence inFeedback Control”, IEEE mt. Symposium on Intelligent Control, Arlington, VA, USA, August,pp 40-45.Karr Ch., (1991). “Applying Genetics to Fuzzy Logic”, AlExpert, March, pp 38-43.Kokar M.M., (1988). “Machine Learning in a Dynamic World”, (Ed. Panel discussion), IEEE mt.Symposium on Intelligent Control, Arlington, VA, USA, August, pp 500-507.Krog S.R., (1979). “Automatic Control of Autogenous and Semiautogenous Mills”, in Digre M.(Ed.), Proc. of Autogenous Grinding Seminar, University of Trondheim, Norway, May,pp ELI-EL2O.Kuipers B., (1984). “Commonsense Reasoning about Causality: Deriving Behavior form Structure”,Artflcial Intelligence, Vol 24, No 1-3, December, pp 169-203.Kuipers B., (1985). “The Limits of Qualitative Simulation”, IJCAI-85, Los Angeles, CA, USA,August, pp 128-136.Kuipers B., (1986). “Qualitative Simulation”, Artificial Intelligence, Vol 29, No 3, September,pp 289-338.119Kuipers B., (1987). “Qualitative Simulation as Causal Explanation”, IEEE Trans. on Systems, Man,and Cybernetics, Vol SMC-1 7, No 3, May/June, pp 432-444Kuipers B., (1989). “Qualitative Reasoning with Causal Models in Diagnosis of Complex Systems”,in Lawrence W., Loparo A.K. and Nielsen N.R., (Eds.), Artflcial Intelligence, Simulation andModeling, John Wiley & Sons, Inc.Kyburg H.E. and Smokier H.E., (1964). Studies in subjective Probability, John Wiley & Sons, Inc.Latour P.R., (1976). “The Hidden Benefits from Better Process Control”, Advances inInstrumentation, Vol 31, Part 1, ISA-76 Annual Conference, pp 528;1-11.Lea Sombé, (1990). “Reasoning Under Incomplete Information in Artificial Intelligence”, mt.Journal ofIntelligent Systems, Vol 5, No 4, September, Special Issue, pp 3 24-470.Lee S. and Kim M.H., (1988). “Learning Expert Systems For Robot Fine Motion Control”, IEEE mt.Symposium on Intelligent Control, Arlington, VA, USA, August, pp 534-544.Lees F.P. and Sayers B., (1976). “The Behavior of Process Operators under Emergency Conditions”,in Sheridan T.B. and Johannsen G., (Eds.), Monitoring Behavior and Supervisory Control,Plenum Press, NY, USA, pp 33 1-341.Leitch R., (1988). “Qualitative Modeling of Physical Systems for Knowledge Based Control”, inDenham M.J. and Laub A.J., (Eds.), Advanced Computing Concepts and Techniques in ControlEngineering, NATO ASI Series, Springer-Verlag, pp 31-51.Leitch R., (1990). “A Review of the approaches to the Qualitative Modeling of Complex Systems”,in McGee J., Grimble M.J. and Mowforth P., (Eds.), Knowledge-Based Systems for IndustrialControl, Peter Peregrinus Ltd., London, UK.Luger G.F. and Stubblefield W.A., (1989). Artificial Intelligence and the Design ofExpert Systems,The Benjamin/Cummings Pub!. Co., Inc.McDermott K., Cleyle P., Hall M. and Harris C.A., (1994). “Expert System for Control of No 4Autogenous Mill Circuit at Wabush Mines,” 26th Meeting of the Canadian Mineral Processors,Ottawa, Ontario, Canada, January.McDermott D. and Doyle J., (1980). “Nonmonotonic Logic I”, Artificial Intelligence, Vol 3,pp 41-72.McGregor D.R., Odetayo M.O. and Dasgupta D., (1992). “Adaptive Control of a Dynamic Systemusing Genetic-based Methods”, IEEE mt. Symposium on Intelligent Control, Glasgow, Scotland,UK, August, pp 52 1-525.McManus J., Paul A.R. and Yu F., (1975). “Process Control in the Lomex Grinding Circuit”, CIMBulletin, May, pp 146-151.Miller T.T. and Hewes R.P., (1q88). “Real Time Experiments in Neural Network Based LearningControl During High Speed Nonrepetitive Robotic Operations”, IEEE mt. Symposium onIntelligent Control, Arlington, VA, USA, August, pp 513-518120Mime R., (1987a). “Artificial Intelligence for On-Line Diagnosis”, fEE Proceedings, Vol 134, Pt D,No 4, July, pp 23 8-244.Mime R., (1 987b). “Strategies for Diagnosis”, IEEE Trans. on Systems, Man, and Cybernetics,Vol SMC-17, No 3, May/June, pp 333-339.Minton S., (1988). Learning Search Control Knowledge. An Explanation-Based Approach, KluwerAcademic Publishers, Boston, USA.Minton S., Garbonell J.G., Knoblock C.A., Kuokka D.R., Etzioni 0. and Gil Y., (1989).“Explanation-Based Learning: A Problem Solving Perspective”, Art/Icial Intelligence, Vol 40,pp 63-118.Mooney R.J. and Benett S.W., (1986). “A domain Independent Explanation-Based Generalizer”,AAAI-86, Philadelphia, PA, USA, August, pp 551-555.Mooney R.J., (1990). A General Explanation-Based Learning Mechanism and its Application toNarrative Understanding, Morgan Kaufmann Publishers, Inc., California, USA.Mular A.L., (1989). “Process Control and Instrumentation in Mineral Processing Plants”, in CIM,Operation andMaintenance in Mineral Processing Plants, Montreal, Ch 10.Mular A.L. and Burkert A., (1988). “Automatic Control of Semiautogenous Grinding Circuits”,Report submitted to Brenda Business Development Corp., Brenda Mines Ltd., Kelowna, BC,Canada.Neapolitan R.E., (1990). Probabilistic Reasoning in Expert Systems: Theory and Algorithms, JohnWiley & Sons, Inc.Negoita C.V., (1985). Expert Systems and Fuzzy Systems. Menlo Park, CA., BenjaminlCummingsPubl. Co.Negoita C.V., (1987). Simulation, Knowledge-Based Computing, and Fuzzy Statistics, Van NostrandReinhold.North R.C., (1976). The World that Could Be, The Portable Stanford, Stanford Alumni Association,Stanford, CA., USA.(Panel Discussion), (1987). “Intelligent Control: How it is Understood by Al and Systems Scientists,and How to Teach it to the Graduate Students”, IEEE In!. Symposium on Intelligent Control,Philadelphia, PA, USA, pp 508-529Pang D., Bigham J. and Mandani E.H., (1987). “Reasoning with Uncertain Information”, lEEProceedings, Vol 134, Part D, No 4, July, pp 23 1-237.Partridge D. and Paap K.R., (1988). “Learning”, Ch 7 in McTear M.F. (Ed.), UnderstandingCognitive Science, Ellis Horwood Ltd., Chichester, England.Pearl J., (1988). “Evidential Reasoning Under Uncertainty”, in Shrobe H.E., (Ed.), Exploring Al:Survey talks from the National Conferences on Al, Morgan Kaufmann Publishers, Inc.,CA, USA.121Perry R. and Hall M., (1994). “Selbaie Mines Expert System,” 26th Meeting of the CanadianMineral Processors, Ottawa, Ontario, Canada, January.Peters L., Beck K. and Camposano R., (1992). “Fuzzy Logic Controller with Dynamic Rule Set”,IEEE mt. Symposium on Intelligent Control, Glasgow, Scotland, UK, August, pp 216-219.Pikaar R.N., (1985). “Man-Machine-Interaction in Process Control”, in Willumeit H.P., (Ed.),Human Decision Making andManual Control, Elsevier Science Publ., pp 157-172.Pipitone F., (1986). “The FIS Electronic Troubleshooting System”, IEEE Computer, pp 68-75.Raabe H., (1994). “Mill Tonnage Restrictions”, Internal communication, Highland Valley CopperMine, Logan Lake, B.C., Canada.Rao M., Jiang T.S. and Tsai J.J.P., (1988). “Integrated Architecture for Intelligent Control”, IEEEmt. Symposium on Intelligent Control, Arlington, VA, USA, August, pp 81-86..Rao M. and Ying Y., (1990). “Intelligent Control: A New Decade for Pulp and Paper Processes”,IEEE mt. Symposium on Intelligent Control, Philadelphia, PA, USA, September, pp 1095-1099Rao M., (1992). “Integrated System for Intelligent Control”, Lecture Notes in Control andInformation Sciences, Springer-Verlag.Rasmussen J., (1976). “Outlines of a Hybrid Model of the Process Plant Operator”, in Sheridan T.B.and Johannsen G. (Eds.), Monitoring Behavior and Supervisory Control, Plenum Press, NewYork, pp 371-383.Rasmussen J, (1986). Information Processing and Human-Machine Interaction. An Approach toCognitive Engineering, Elsevier Science Pubi. Co.Ratte A.K., (1979). “Computer Control of No 2 Mill at Island Copper Mine”, CMP RegionalMeeting, Vancouver, BC, November.Reiter R., (1987). “A Theory of Diagnosis from First Principles”, Artificial Intelligence, Vol 32,pp 57-95.Rogers J.A., (1985). “Optimizing Process and Economic Aims”, Chemical Engineering, December,pp 95-99.Sanchez I., Ciftientes E.I. and Sbarbaro D., (1988). “Selftuning controller operating under realconditions”, III Latin-American Congress on Automation, VIII Chilean Automatic ControlConference, Viña del Mar, Chile, October.Saridis G.N., (1977). Self-Organizing Control ofStochastic Systems, Marcel Dekker, NY.Saridis G.N., (1985). “Foundations of the theory of Intelligent Controls”, IEEE Int. Symposium onIntelligent Control, Troy, New York, USA, August, pp 23-28.Saridis G.N., (1987). “Knowledge Implementation: Structures of Intelligent Control Systems”, IEEEInt. Symposium on Intelligent Control, Philadelphia, PA, USA, pp 9-17.122Scan E.A., Jamieson J.R. and Delaune C.I., (1987). “Diagnosis and Sensor Validation throughKnowledge of Structure and Function”, IEEE Trans. on Systems, Man, and Cybernetics,Vol SMC-17, No 3, May/June, pp 360-3 68.Shafer G., (1976). A Mathematical Theory ofEvidence, Princeton, University Press.Sharkey N.E., (1988). “Neural Network Learning Techniques”, Ch 8 in McTear M.F. (Ed.),Understanding Cognitive Science, Ellis Horwood Ltd., Chichester, England.Shavlik J.W., (1990). Extending Explanation-Based Learning by Generalizing the Structure ofExplanations, Morgan Kaufmann Publishers, Inc., California, USA.Sheridan T.B, (1976). “Toward a General Model of Supervisory Control”, in Sheridan T.B. andJohannsen G., (Eds.), Monitoring Behavior and Supervisory Control, Plenum Press, New York,USA, pp 271-281.Shortliffe H.E., (1976). Computer-basedmedical consultations: Mycin, American Elsevier, NY.Simmons R., (1986). “Commonsense Arithmetic Reasoning”, AAAI-86, Philadelphia, PA, USA,August, pp 118-124.Singleton W.T., (1976). “The Model Supervisor Dilemma”, in Sheridan T.B. and Johannsen G.,(Eds.), Monitoring Behavior and Supervisory Control, Plenum Press, NY, pp 261-270.Stallings, W., (1977). “Fuzzy Set Theory versus Bayesian Statistics”, IEEE Trans. On Systems, Man,and Cybernetics, March, pp 216-219.Stark P.A., (1970). llntroduction to Numerical Methods. MacMillan Publishing Co., NYSugeno M., (1985). Industrial Applications ofFuzzy Control, (Ed.), Elsevier Science Publishers.Sutton R., (1990). Modeling Human Operators in Control System Design, Research Studies PressLtd.Thompson T.F. and Clancey W.J., (1986). “A Qualitative Modeling Shell for Process Diagnosis”,IEEE Software, March, pp 6-15.Tong R.M., (1977). “A Control Engineering Review of Fuzzy Systems”, Automatica, Vol 13,pp 5 59-569.Tuffs P.S. and Clarke D.W., (1985). “Self-Tuning Control of offset: A Unified Approach”, lEEProceedings, Vol 32, Pt D, No 3, May, pp 100-110.Vagenas N. and Grangholm S., (1991). “Developing and applying expert systems for fault diagnosisof mining equipment in Swedish mines”, In Poulin R. et al. (Eds.), Proc. of the 2nd CanadianConference on Computer Applications in the Mineral Industry, Vancouver, BC, Canada,September, pp 191-201.van DelfJ.H., (1985). “Cognitive Aspects of Human Monitoring Behavior”, in Willumeit H.P., (Ed.),Human Decision Making andManual Control, Elsevier Science Publ., pp 3 19-328.123Verbruggen H.B. and Aström K.J., (1990). “Artificial Intelligence and Feedback Control”, in RoddM.G., Li H. and Su S., (Eds.), Artificial Intelligence in Real-Time Control 1989, Proceedings ofthe IFAC Workshop, Shenyang, China, September, Pergamon Press, pp 1-11.Weatherford R., (1982). Philosophical Foundations ofProbability Theory, Routledge & Kegan Paul.Weiss S.M., Kulikowski C.A., Amarel S. and Safir A., (1979). “A Model-Based Method forComputer-Aided Medical Decision-Making”, Artificial Intelligence, Vol 11, pp 145-172.Widman L., (1989). “Semi-Quantitative Close-Enough Systems Dynamics Models: An Alternative toQualitative Simulation”, in Lawrence W., Loparo A.K. and Nielsen N.R., (Eds.), ArtificialIntelligence, Simulation andModeling, John Wiley & Sons, Inc.Williams B, (1984) “Qualitative Analysis of MOS Circuits”, Artflcial Intelligence, Vol 24, No 1-3,December, pp 28 1-346.Wittenmark B. and Astrom K.J., (1984). “Practical Issues on the Implementation of Self-tuningControl”, Automatica, Vol 20, pp 595-605.Zadeh L.A., (1973). “Outline of a New Approach to the Analysis of Complex Systems and DecisionProcesses”, IEEE Trans. Systems, Man and Cybernetics, Vol SMC-3, pp 28-44.Zadeh L.A., (1986). “Is Probability Theory Sufficient for Dealing with Uncertainty in Al: A NegativeView”, in Kanal L.N. and Lemmer J.F. (Eds.), Uncertainty in Artificial Intelligence, ElsevierScience Publ. B.V., North Holland, pp 103-116.Zadeh L.A., (1988). “Fuzzy Logic”, IEEE Computer, April, pp 83-93.124APPENDIX A Al ELEMENTS THAT CAN BE INCORPORATEDINTO AN ISCSA.1 A Subjective Probability Approach to Handle UncertaintyA.1.1 Alternatives to Reasoning Under UncertaintyThe approaches followed by artificial intelligence (AT) researchers to tackle this problem can beclassified into three groups: logicist, neo-calculist, and neo-probabilist (Pearl 1988). The logicistapproach attempts to deal with uncertainty using non-numerical techniques such as non-monotoniclogic (McDermott and Doyle 1980), and the theory of endorsements (Cohen 1985). The neo-calculistapproach uses numerical representations of uncertainty and believing somewhat that probabilitycalculus is inadequate for the task, invents an entirely new calculus such as evidence theory (Shafer1976), fuzzy logic (Zadeh 1973 & 1988; Negoita 1985 & 1987; Tong 1977), and certainty factors(Shortliffe 1976). The neo-probabilist approach remains within the framework of probability theory,while attempting to strengthen its interpretation to deal with AT tasks (Cheeseman 1986; Weatherford1982; Hunter 1986).There has been much controversy regarding which one of these approaches is most adequate or mostappropriate to deal with reasoning under uncertainty. This discussion has been especially hotbetween fuzzy logic and probabilistic approach supporters (Cheeseman 1985 & 1986; Zadeh 1986;Stallings 1977; Hunter 1986). Cheeseman (1985) concludes his ‘defense of probability’, for instance,by saying that, “an AT system for reasoning under uncertainty should be possible based only on thebasic laws of probability ... No other representation or calculus is necessary for reasoning underuncertainty.” Zadeh (1986) argues that, “viewed as a language, classical probability theory isinsufficiently expressive to cope with the multiplicity of kinds of uncertainty which one encountersin Al and, more particularly, in expert systems.”Other researchers, however, such as Lea Sombé group (1990), Pang et al. (1987) and Fox (1986),conclude that it seems pointless to think that a single formalism would be capable of representinguncertainty in commonsense reasoning. Fox, in particular, recommends that we should understandthe different alternative approaches and represent their assumptions, advantages and weaknesses125explicitly, so that we can look at them not as rivals but as real alternatives to be used ascircumstances demand.In line with Fox’s conclusions, this study focuses on the development of a “subjective” probabilityapproach that seems suitable to handle uncertainty in intelligent control (IC) problems. The questionof which method—probability or other—is the “best” or the “right” method to deal with uncertaintyis not considered as an issue.A.1.2 A Subjectivistic View of ProbabilityThe subjectivistic view of probability considers probability as “the actual degree of belief in a givenproposition held by a person at some specific time on the basis of given evidence”(Weatherford 1982; Kyburg and Smokler 1964, Chap. 1).According to this view, probability represents a relation between a statement and a body of evidence.The numerical value attached to it represents nothing more than a “degree of belief.” This value isnot uniquely determined; a given statement may have any probability between 0 and 1, on a givenevidence, according to the inclination of the person whose degree of belief that probabilityrepresents.Subjective probability allows us to talk about probabilities of single events. If we need to know, forinstance, the probability of “overloading the SAG mill during the next shift,” we just ask the millforeman; and his degree of belief is the probability value for this proposition. Possibly, his answerwill be different from that of the mill operator. Subjectivists recognize that a person’s opinion is thefinal authority, even though there can be as many probabilities as there are opinions. Classicalprobability theory, on the other hand, would lead us to the embarrassing conclusion that there is noprobability for this proposition of overloading the mill.A. 1.3 Fuzzy Concepts RepresentationIn this section we will see how to represent and interpret fuzzy concepts such as “high,” “low,”“hard” or “coarse,” under a subjective probability approach. Thus, suppose we consider a grindingcircuit where the topic of interest is the hardness of the ore being treated. Asked for a description ofthe hardness of the ore, an operator may respond that “the ore is HARD.” What does he really meanby “hard”? We have to recognize the inherent vagueness of concepts such as “hard,” and the need to126specify the context in which they are being used. The result would be completely different if insteadof ore we were talking about boiled eggs. After questioning the operator for more detail, we may beable to understand and represent his concept of “hard” when referring to the ore. In general, therepresentation of “hard” may take any form as long as it represents the coherent degree of belief ofsomeone in the same situation analyzed. A possible representation of this concept is shown inFigure A.1Figure A. I Fuzzy concept “hard,” P(OHJh).Under probability formalisms, the proposition SI: “the ore is HARD,” given by an operator, can berepresented as:Si: P(OHIh) = db(h) (A.1)where: h is the specific value of the ore hardness; OH, “the ore can be referred to as HARD;” anddb(h), a degree of belief (D0B) that may take any value between 0 and 1. A DoB equal to 1 wouldindicate that the ore is “definitely hard”, while a DoB equal to 0 would indicate that the ore is“definitely not high.”A.1.4 Reasoning Under UncertaintyWe will see now how to incorporate fuzzy concepts, when represented and interpreted as indicatedabove, into a rule-based reasoning process. Let us consider the same scenario as in the previoussection, where an operator is supervising the operation of a grinding mill. Let us assume that a pieceof his heuristic knowledge can be represented by the rule:Ri: IFTHENpower_drawthe oreis “high”is “hard”“hard”1.00P(OH/h)Ore hardnessh0definitelynot hard127where both the concept “high” for power draw and the concept “hard” for the ore hardness are fuzzyconcepts. Let us assume that the operator’s concept “high” for the power draw, P(JI-JJj), is as shownin Figure A.2; and that the concept “hard” for the ore hardness, P(OHIh), is the same as shown inFigure A.1.j)“high” P(JH/j)Power drawJo JxJiFigure A.2 Concept “high” for the power draw.An approach to incorporate probability in a reasoning process, based on a method known as “causalbelief networks” by Neapolitan (1990), is proposed. Under this approach, rule Ri can be written as:P(OHIKJ) = P(OHJJH) P*(JHIKJ) + P(OH) [1 - P*(JHJKJ) j ;P(JHIKJ) 0.5 (A.2)where p*(JI{/KJ) = 2 [P(JHIKJ) - 0.5]OH: proposition “the ore is hard”KJ: information on the power draw - evidence to decide if the power draw is high or notJH: proposition “the power draw is high”P(OH): unbiased degree of belief in OH before knowing KJ.Equation (A.2)gives the updated degree of belief in the conclusion of rule Ri when this rule is fired.To solve equation (A.2) we need to have an expert’s opinion about P(OHJJH) in the knowledge base,and a value for P(JHJKJ) provided by the operator when rule Ri is instantiated.A.1.5 Combining EvidenceWhen a rule has two or more antecedents we need a mechanism to combine these antecedents todetermine the resulting degree of belief in the conclusion. To see how this can be done let usconsider a rule with two antecedents of the form:128R2: IF A1 AND A2THEN CLet us assume that the antecedents A1 and A2 are known with some uncertainty, i.e. the informationis actually given for P(A1/e)and P(A2/e),where e1 and e2 are the evidence used to infer A1 and A2respectively; and that C is independent of the evidence c, given that A. or —1A is known withcertainty. Then R2 can be represented by the inference network shown in Figure A.3.R2: IF A1 AND A2THEN Cwith: e1 , evidence for A1 , ande2, evidence for A2Figure A.3 Inference network for rule R2.The degree of belief in the conclusion given the evidence e1 and e2, P(C/e1Ae),can be obtained withBayes’ theorem as:P(C/e1Ae2)P(e1Ae2/C)P(C) (A.3)P(e1 Ae2)In this situation with more than one antecedent to draw a conclusion we would like to be able toobtain independently P(C/e1)and P(C/e2), and then through a mathematical operation combine themto obtain the desired value of P(C / e1 Ae2). However, as shown by Neapolitan (1990, Chap. 4), thisis impossible without proper probabilistic assumptions.Case A. Conditional Independence of the EvidenceP(C / e1 Ae2)can be obtained in terms of P(C1e1) and P(C/e2) if we assume that e1 and e2 areconditionally independent, i.e. if e1 and e2 are independent when C occurs and when C does notoccur. P(C I e1 Ae2)can be obtained as follows:i) Obtain P(C/e1)and P(C/e2)from129P(C/e) = P(C/A1)P*(A1/e)+ P(C) [1- P*(A/e)] ;P(A1/e) 0.5 (A.4)where P*(A1/e)= 2 [P(A1/e)- 0.5]P(C/A1)and P(C/—1A)are given by an expert, and P(A1/e) are the values supplied at the time ofinstantiating the associated rule.ii) Calculate the odds 0(C/e1Ae2) from0(C/e1Ae2) ei 0(C) (A.5)where e=0(C/e)/’0(C), O(C1e1)=P(C/e1)and 0(C)P(C)1 1-P(C/e) 1-P(C)iii) Calculate the degree of belief in the conclusion of rule R2 given the evidence e1 and e2,P(C/e1Ac2), fromP(C/e1Ae2)O(C/e1Ae2)(A.6)1+ 0(C / e1 Ae2)From equation (A.5) we can see how to project this updating scheme for any number of pieces ofevidence, provided the conditional independence assumption applies. Equation (A.5) is modular, soall we need is P(C), the initial degree of belief in the conclusion to determine 0(C); then evaluateeach P(C/e) and 0(C/e1)as evidence arrives; then use equation (A.5) to determine 0(C / e1 ... A e.);and finally use equation (A.6) to update the degree of belief in the conclusion, P(C / e1 ... A e1).Case B. Evidence is not conditionally independentIf we cannot assume that the pieces of evidence are conditionally independent, the updated degree ofbelief in the conclusion of rule R2 can be obtained from:P(C/e1Ae2) P(C/A1AA2)P(A1/el) P(A2/e2) +P(C/Al A —A2) P(A1/el) [1 - P(A2/e2)] +P(C/—A1 A A2) [1 - P(A1/e)]P(A2/e)+P(C/—A1A--2)[1 -P(A1/e)j [1 - P(A2/e)] (A.7)130An expert needs to provide the values for P(C / A1 AA2), P(C / A1 A -,A2), P(C /—1A AA2) andP(C /—1A A—12), which may not always be easy to estimate. This becomes a real problem as thenumber of pieces of evidence involved increases - the number of terms the expert would need toprovide also grows exponentially. As in Case A, P(A1/e)and P(A2/e)are the only values that needto be provided when R2 is instantiated.Another problem with equation (A.7) is that when there is no information about A1 and A2, i.e.P(A1/e)=P(A2/e)= 0.5, P(C/e1Ae2)takes the valueP(C/e) = [P(C/A1AA2+ P(C/A1A—iA2)+P(C/-A1AA2)+P(C/—1A--2)] /4 (A.8)which may not necessarily correspond to P(C), the previous degree of belief in the conclusion C. Inthe same way, we may expect that when P(A1/e)is provided but not P(A2/e); i.e. P(A2/e)= 0.5,P(C / e1 Ae2) would correspond to P(C/e1), the degree of belief in the conclusion given the evidencee1 alone. However, from equation (A.7) we obtainP(C/elAe) = ‘/2 [P(C/A1AA)+P(CIA1A—iA2)]P(A1e)+1/2 [P(C/—AAA+P(C/-,AA--,)j[1 - P(A1e)] (A.9)which may not always correspond to P(C/e1). The same situation happens when P(A2/e)is knownand P(A1/e)is 0.5.This can be solved by splitting equation (A.7) into four equations one for each region shown inFigure A.4. In this case we have more independence on the values assigned to previous beliefs andupdated ones. However, this increase of freedom has the disadvantage that the number of values theexpert has to assign increases even more — so, perhaps it is not worth trying it. This problem is evenmore obvious when the number of antecedents is larger than two.131P(A21e2)P(C/-’A1A2) P(C/A1A2)1.0 rP(C /ei) P(C /e2)0.5P(C/—’Ai--’A2) : P(C/A1-’A2)0 ,P(A1e)Figure A.4 Combining pieces of evidence when they are not conditionallyindependent.A.1.6 Potential and Limitations of the Approach ProposedIn general, we can say that the subjective probability approach proposed in this research is suitable torepresent and handle fuzzy concepts such as those found in human reasoning, when dealing with thesupervision of a process. However, as for any other single method to deal with uncertainties inreasoning, it is not a panacea but an approach with its own inherent limitations.The most interesting and obvious feature of this approach is that it uses probability calculus to handleconcepts. According to a study by Horwitz and Heckerman (1986), probability gives a properdistinction between absolute belief and belief updates, when combining evidence to update a degreeof belief in a conclusion. Another interesting aspect of the subjective approach proposed is theseparation between the degree of belief in a proposition and in its negation.One basic conclusion valid for each of the techniques proposed to deal with uncertainty is that noneof them can equal the richness and flexibility of human reasoning in dealing with these kinds ofproblems. Probability, for example, is a widely respected tool for dealing with uncertainty. Weshowed in this research how a subjective probability approach can be used to incorporate uncertaintyhandling in the context of an ISCS. However, we cannot expect to represent under this singleformalism every type of uncertainty problems that an ISCS has to deal with.132An approach supported by researchers is to integrate different techniques under the coordination of a“meta level” of knowledge about uncertainty. This meta level would decide which technique orgroup of techniques are more appropriate to deal with a particular problem.A.2 Learning CapacityLearning is still in an early stage of development, far too immature to let one of these techniques takefull control of an ISCS and intervene with the operation of a process. A much more reasonablealternative is proposed in this study: the incorporation of learning into an ISCS to enhance the userinterface. The system could start operating with a user interface that handles a basic set of linguisticconcepts. As a result of a learning process, the system would slowly acquire new conceptsorganizing them into a hierarchical structure to represent more complex concepts. Ultimately, a userinterface rich in high-level concepts gives the user the opportunity to establish a more “intelligent”communication with the system.A.2.1 Alternative Techniques to LearningThere are several learning techniques proposed by Al researchers. Among them we can distinguishempirical and analytical learning techniques. Within empirical learning techniques we can mentionsymbolic induction learning, evolutionary (genetic) learning, and connectionist learning.. Analyticallearning techniques are knowledge-intensive and require background knowledge; the basic inferencetype they use is deduction. The knowledge learned is basically a new representation for the inputinformation; and not necessarily new knowledge (Forsyth 1989; Anderson and Hinton 1981;Partridge and Paap 1988; Sharkey 1988).A characteristic of most learning techniques is that they follow a process of gradual learning. Theydo not take sufficient advantage of domain knowledge; they learn by abstracting common propertiesfrom a large number of positive and possibly negative instances of some concept (Forsyth and Rada1986, Forsyth 1989). Some of these techniques, such as evolutionary learning and connectionistlearning require hundreds of learning cycles before something useful is learned. However, whendealing with learning in the context of a real-time ISCS, there is not enough time available or enoughcases of some sort to apply one of these techniques that require a large number of instances to learn aconcept.133A.2.2 Explanation-Based Learning (EBL) TechniquesSeveral researchers have been working on learning techniques referred to as Explanation-BasedLearning (EBL) techniques (DeJong 1988; Minton 1988; Minton et al. 1989; Mooney 1990; Mooneyand Benett 1986; Shavlik 1990). These learning techniques overcome the barrier of requiring a largenumber of instances to learn a concept; researchers claim that learning can be achieved with evenonly one example. These features make EBL techniques the recommended choice for theincorporation of learning into the design of an ISCS.In a standard EBL technique, the system starts with a “target” concept definition, knowledge aboutthe domain of the concept to be learned and with a general criterion on how the knowledge should berepresented. Then the system receives a “training” example from which it has to derive a moreappropriate representation (explanation) of such concept. EBL techniques use the explanation of avery few examples (usually just one) to define the boundaries of a concept. The concept’s definitionis determined by a guided inspection using domain-knowledge on why an example worked, and notby similarities and differences between positive and negative examples, as in the case of inductiontechniques. The explanation identifies the relevant features of the example, which constitutesufficient conditions for describing the concept. The task of the system is to generalize suchexplanations so they are applicable to a range of similar situations. This allows explanations to bereused, hence improving the performance of the system.A.2.3 An EBL Approach to Learn ConceptsLet us consider an example to describe in more detail EBL techniques. Let us consider that we aresupervising the operation of a control loop, and that we want to teach the system how to recognizewhen “the control loop is operating OK.” To make things easy, let us assume that the only aspect ofthe operation of the loop we are interested in, is the evolution of the controlled variable. If thecontrolled variable follows its setpoint, we would say that “the control loop is operating OK.” Weare not interested in a proper tuning of the controller or in any other aspect of the operation of theloop.We said that EBL techniques use domain-knowledge to learn a concept. Thus the first thing we needis a domain theory concerning the aspects of the operation of the loop we are interested in. Usingrule-based representation, we may write the domain theory for this example as shown in Figure A.5.134The limited theory shown in Figure A.5 defines the concepts agrees-with, is-close-to andis-approaching-to, when dealing with the behavior of two variables. For example, a variable var1is-close-to a variable var2 (see rule R3 in Figure A.5), if the difference in their amounts is less than apre-specified value. Nothing is said about the dynamics of these variables.Ri: IF ?var1 agrees-with ?var2OR ?var1 is-close-to ?var2OR ?var1 is-approaching-to ?var2THEN ?var1 follows ?var2R2: iF amount(?var1) is-equal-to amount(?var2)AND dynamics(?varj) is-equal-to dynamics(?varTHEN ?var1 agrees-with ?var2R3: IF difference(?varj, ?var2) is-less-than duff-limitwrr difference(?var1,?var2)=amount(?var1)- amount(?var2)THEN ?var1 is-close-to ?var2R4: IF amount(?varj) is-less-than aniount(?var2)AND dynamics(?var2) is CNTAND dynamics(?var1 is INCTHEN ?var1 is-approaching-to ?var2R5: IF amount(?varj) is-greater-than amount(?var2)AND dynamics(?var2) is cNrAI’41) dynamics(?var1 is DECTHEN ?var1 is-approaching-to ?var2where: ?var1: an instance of a process variable.duff-limit: pre-specified valueINC/CNT/DEC: increasing/constant/decreasingFigure A.5 Domain theory to compare values of process variables.We also require a functional specification of the desired concept to be learned. In this case, this willbe given by Qi as follows:Qi: IF ?loop is-a control-loopAND controlled-variable(?loop) follows setpoint(?loop)THEN ?loop is-operating OKThis functional representation of the concept can be interpreted as the “depth” at which the userwants to interact with the system. In other words, when the user interacts with the system and asksfor an explanation why the system responds that a loop “is operating OK,” the system should give an135explanation in terms of the corresponding controlled variable and setpoint of the loop, and use theconcept follows, as in rule Qi.Now we have to give the system an example of a case where a ioop is operating properly (OK). Thisexample is given in Figure A.6.LIC-lO is-a CONTROL-LOOPLIC-lo is-controlling level-of-fluid in TANK-blevel-JO is-controlled-variable-of LIC-lOsp-1O is-setpoint-of LIC-lOaniount(sp-IO) has-value POS-MEDIUMdynamics(sp-IO) has-value CNTamount(level-1O) has-value POS-SMALLdynarnics(level-1O) has-value INCwhere: os: positiveINC/CNT: increasing/constantFigure A.6 Example of a control loop operating OK.The system then builds a proof-tree using the domain knowledge available. This proof tree is shownin Figure A.7.From this proof tree the system obtains a generalized explanation for the example that can be usedlater in a similar situation. This generalization includes the elimination of irrelevant features such asthe fact that LIC-lO is controlling the level of fluid in tank TANK-b, for instance. It also includesidentity elimination, i.e. it removes unnecessary dependence on particular objects. The fact thatlevel-JO is the controlled variable of the loop is not important; what it is important is that this pieceof knowledge is applicable to a controlled variable of a control loop. In the same way, there isnothing specific for the loop LIC-1 0; this example would work as well for any other loop -controlling level or any other variable. The generalized explanation for this example is shown inFigure A.8.136is-operating OKLIC-lO is-a CONTROL- LOOPFigure A.7 Proof tree for the example of Figure A.6.Ioop is-operating OK?loop is-a CONTROL- LOOPcontrolled-var(?loop) is-approaching-to setpoint(?Ioop)DYN(setpoint(?toop)) is CNT DYN(conlrolled-var(?toop)) is INCDYN(controlled-var(?loop)) is INCFigure A.8 Generalized explanation for the control ioop case.DYN(controlled-var(LIC-1O)) is INCAMT(controlled-var(LIC-1O)) is (POS small) AMT(setpoint(LIC-1O)) is (POS medium)AMT:DYN:CNT:NC:POS:amountdynamicsconstantincreasingpositiveDYN(setpoint(?toop)) is CNTAMT: amountDYN: dynamicsCNT: constantINC: increasingPOS: positive137This generalized explanation is then used to obtain macro-rules which are more efficientrepresentations of the concept or sub-concepts being taught to the system. A non-restricted macro-rule for this example is given schematically in Figure A.9 . The system will use this macro-rulewhen asked to assess the operation of a loop. And when asked for an explanation of why a specificloop is operating OK, the explanation will be in terms of the antecedents of this macro-rule - theother sub-goals have been eliminated.AMT(controlled-var(?Ioop)) < AMT(setpoint(?Ioop))Figure A.9 Unrestricted generalization for the case of the control loop.If we now consider the restrictions imposed by the functional representation given by rule Qi, wecannot eliminate the sub-concept follows. The system has to use the concept follows when providingan explanation about the behavior of the loop. Thus follows can be represented via a macro-rulederived from the generalized explanation of Figure A.8 and added to the unrestricted macro-rule ofFigure A.9. Thus the new direct components of the concept the “loop is operating OK” is shown inFigure A.10.From Figure A.9 and Figure A. 10 we can see how it is possible for the user to control the “depth” atwhich we want to interact with the system. If the user chooses to interact with the system in theterms given by rule Qi, for instance, he cannot work with the unrestricted macro-rule shown inFigure A.9 because it does not have the sub-concept follows. If the user does not need the branchesunder this sub-concept, he can replace the sub-concept follows by an operational macro-rule with theresults shown in Figure A. 10. If the main concept is going to be part of a larger concept hierarchy,and none of the sub-concepts involved are required, the unrestricted operational representation ofFigure A.9 will suffice.DYN(setpoint(?loop)) is CNT DYN(controlled-var(?Ioop)) is INC138?loop ispeting OK?loop is-a CONTROL- LOOP111 :::;::;;:;;;::::::::::::::s::::::;::[J:j::::::::;:::;:::::::::::::?Ioop is-a CONTROL- LOOP_roIl-va?lop)6c tpoint(?k,op))1sCNTTt.i ill’AMT(controlled-var(?loop)) < AMT(setpoint(?Ioop)) DYN(setpoint(?Ioop)) is CNT DYN(controlled-var(?Ioop)) is INCFigure A. 10 Restricted generalization for the case of the control ioopThe general idea of partial operational representation is schematically shown in Figure A. 11.Depending on the level of abstraction specified by the user, some of the sub-concepts within thehierarchy are represented by operational macro-rifles while other remain with a full representation.All the sub-concepts beneath the main concept are lost but with respect to this main concepthierarchy only; they remain in the knowledge base and can be incorporated back at any time.where: : rule for concept definitionterminal node - no further concept definitionFigure A. 11 User defined concept hierarchy139A.2.4 Potential and Limitations of the Approach ProposedTwo major features make this proposed learning approach a feasible and an attractive learningalternative in the design of an ISCS. The first feature is that this learning approach involves only theinteraction with the user so the chances of spurious learning harming the process being supervisedare minimized. The second feature is that the learning process does not require a high volume ofdata; in many cases learning can be obtained with only one instance of the learning goal.An ISCS could start with a default set of concepts for the user interface. Then its learning capacitywould allow it to learn new concepts and thus accommodate the user interface to suit therequirements of each individual user.Another important feature of the learning approach is that it provides a flexible hierarchical structurefor the concepts the system handles. Thus the user can decide the level of abstraction at which hewants to interact with the system.Does the system learn concepts? Does the system “understand” a new concept and the instance whenthis concept can be used? Some researchers may respond that the system does “learns” concepts;however, others argue that what we call learning is no more than a different manipulation ofsymbolic information by the system. Despite limitation of current techniques, we should continueresearching towards the goal of real “artificial learning.”140APPENDIX B PROCEDURE TO BUILDING A QM INTO THE ISCSi) Building a Steady State QMThe following steps are required for a developer to build a steady state qualitative model inProcessVision.Step 1: Edit class qmjunction. Add an object mss_name, where name is the name of the QM to becreated.Step 2: Create a procedure with the name chosen in Step 1, mss_name. This procedure defines theQM in terms of inputJoutput variables of the form: variable.input.@floatvariable. output. Jloat.Step 3: If mss_name is a new model created in Step 2, and it needs to run every sampling instant,add the following line to the procedure run_model_ss.RUN PROCEDURE (“mss name”)The relative position of this line within the procedure is important: this line should be afterthe lines invoking models that provide information required by mss_name.If the QM to be created uses the qmss_table(3) primitive, follow the steps indicated below.Step a.1: Same as Step I described above.Step a.2: Create a procedure mss_name_definition with the following contents:mss_name.input_l.@float = mimss_name.outputl.@float = out1mss_name.inputm.@float =mss_name.outputm.@float = OUtmmss_name.input_h.@float — znmss_name.outputh.@float = OUthwhere (in1, out1) are the values that form the low (I), medium (m), and high (h) pairs thatdefine the steady state QM. name is the name given to the model being built.Step a.3: Create a procedure mss_name to assign values to the inputs and to read the output of theQM qm_iable(3). This procedure is as follows:qm_table3 .input_l.@float = mss_name.input_l.@floatqm_table3 .input_m.@float = mss_name.input_m.@floatqm_table3 .input_h.@float mss_name.input_h.@floatqm_table3 .output_l.@float mss_name.output_l.@floatqm_table3 .output_m.@float = mss_name.output_m.@floatqm_table3 .output_h.@float = mss_name.output_h.@floatqm_table3 .input.@double = mss_name.inputl .@doubleMACRO ( “qmss_table3”)mss_name.output.@double qmss_table3 .output.doubleStep a.4: Same as Step 3 described above.141ii) Building a Dynamic QMThe steps required to build the first order dynamic model that predicts the dynamic behavior of aprocess are:Step 1: Edit the class model dyn. Add the object mdyn_name, where name is the name of the QMto be created.Step 2: Create a procedure mdyn_name, with name chosen in Step 1. This procedure contains thefollowing information:qm_dyn_first.output_ss.@double = variable.pred_amt_ss.@floatqm_dyn_first.output_old.double = variable.pred_amt_old.@floatqm_dyn_first.time_s_state.@float = variable.time_constant.@floatRUN_PROCEDURE ( “qm_dyn_first”)variable.pred_amt.@float = qm_dyn_first.output.doublewherevariable = name of the output variable of the model.variable.pred_amt.@float = predicted output value at the current sampling instant.variable.pred_amt_old. Jloat predicted output at the previous sampling instant.variable.pred_amt_ss. @float = steady state output value predicted by a steady state QM.variable, timeconstant.@float = time constant of the process.qm_dynjirst = procedure that solves the dynamic QM primitive.Step 3: Add the following line to the procedure run_model_dynRUN_PROCEDURE(”mdyn_name”)The relative position of this line in the procedure is important. This model may requireinformation provided by another dynamic model, and at the same time it may provideinformation to other models.142APPENDIX C KNOWLEDGE BASE FOR THE HEAD TANKThe following is the source code of the knowledge base associated with the simulation of the headtank (see section 5.4), as implemented in ProcessVision. The same structure of the differentcomponents provided by ProcessVision is maintained.Class@name = model_dyn@object = mdyn_frate_out, mdyn_level 1endClassClass@name = model_ss@object = mss_frate_out, mss_levelI, mss_level2, mss_level3@public = inputi .@double, input2.@double, output.@doubleendClassClass@name = p_var@object = frate_in, frate_out, level@public = diff_amt_pred.large, diff_amt_pred.medium, diff_amt_pred.small,diffamt_pred.@float, p_amt.high, p_amt.low,p_amt.medium, p_amt.neg, p_amt.pos,p_amt.@float, p_amt_old.@float, p_amt_ss.@float,p_amt_status.string, p_dyn.cnt, p_dyn.dec,, p_dyn.@float, p_dyn_status.@string,qmodeI_ss.string, rate_of_change.float, real amt.high,real_amt.low, real_amt.medium, real_arrit.pos,real_amt.@float, real_amt_max.@float, real_amt_min.@float,real_amt_old.@float, real_amt_status.string, real_dyn.cnt,real_dyn.dec,, real_dyn.@float,real_dyn_status.@string, std_amt.@float, time_s_state.@floatendClassClass@name = qm_table3object = mss_level2@public inputl.@double, input_h.@float, input_l.@float,input_m.@float, output.@double, output_h.@float,output_l.@float, output_m.@floatendClassObject@name = a@attribute = b.string, b.@float, c.stringendObjectObject@name = analyze@attribute = simulation.resultsendObjectObject@name = convert@attribute = var.string, varaibIe.string, variabIe.stringendObject143Object@name = dummy@attribute = convert.@string, eval_pred.double, expo.@double,kl.@double, k2.@double, k3.@double,k4.@double, model.@string, pred_level.@double,procedure.@string, reasoning.string, rotate.string,std_amt.@float, var.@stringendObjectObject@name = fratein@class p_var@attribute = diff_amt_pred.large, diff_amt_pred.medium, diffamt_pred.small,diff_amt_pred.@float, p_amt.high, p_amt.Iow,p_amt.medium, p_amt.neg, p_amt.pos,p_amt.@float, p_amt_old.@float, p_amt_ss.@float,p_amt_status.string, p_dyn.cnt, p_dyn.dec,, p_dyn.@float, p_dyn_status.string,qmodel_ss.@string, rate_of_change.float, real_amt.high,real_amt.Iow, real_amt.medium, real_amt.pos,real_amt.@float, real_amt_max.@float, real_amt_min.@float,real_amt_old.@float, real_amt_status.string, real_dyn.cnt,real_dyn.dec,, real_dyn.@float,rea1_dyn_status.string, std_amt.@float, time_s_state.@floatendObjectObject@name = frate_out@class = p_var@attribute = diff_amt_pred.large, diff_amt_pred.medium, diff_amt_pred.small,diff_amt_pred.@float, p_amt.high, p_amt.Iow,p_amt.medium, p_amt.neg, p_amt.pos,p_amt.@float, p_amt_old.@float, pamt_ss.@float,p_amt_status.@string, p_dyn.cnt, p_dyn.dec,, p_dyn.©float, p_dyn_status.@string,qmode1_ss.string, rate_of_change.float, real_amt.high,real_amt. low, real_amt.medium, real_amt.pos,real_amt.@float, real_amt_max.@float, real_anlt_min.@float,real amt old.@float, real_anit_ss.@float, real_amt_status.@string,real_dyn.cnt, real_dyn.dec,,real_dyn.@float, real_dyn_status.string, std_amt.@float,time_s_state.@floatendObjectObject@name = level@class = p_var@attribute = diff_amt_pred.large, diff_amt_pred.medium, diff_amt_pred.small,diff_amt_pred.@float, p_amt.high, p_amt.low,p_amt.medium, p_amt.neg, p_anit.pos,p_amt.@float, p_amt old.@float, p_amt_ss.@float,p_amt_status.string, p_dyn.cnt, pdyn.dec,, p_dyn.float, p_dyn_status.@string,qmodel_ss.string, rate_of_change.float, real_amt.high,real_amt.low, real_ajnt.medium, real_amt.pos,real_amt.@float, real_amt_max.@float, real_amt_min.@float,real_amt_old.@float, real_amt_status.@string, real dyn.cnt,real_dyn.dec,, real_dyn.float,real_dyn_status.string, std_amt.@float, time_s_state.@floatendObject144Object@name = mdyn_frate_out@class = model_dynendObjectObject@name = mdyn_Ievel I@class = model_dynendObjectObject@name = mss_frate_out@class = model_ss@attribute = inputl.@double, input2.@double, output.@double,parameter.@floatendObjectObject@name = mss_Ievel I@class = modelss@attribute = dummyl .@double, dummy2.@double, inputl .@double,input2.@double, output.@double, parameter.@floatendObjectObject@name = mss_leveI2@class = qm_table3, model_ss@attribute = inputi .@double, input2.@double, input_h.@float,input_I.@float, input_m.@float, output.@double,output_h.@float, output I.@float, output_m.@float,parameter.@floatendObjectObject@name = mss_leveI3@class = model_ss@attribute = input I .@double, input2.@double, output.@double,parameter.@floatendObjectObject@name = mss_tank_outlet@attribute = inputl.@double, input2.@double, output.@doubleendObjectObject@name = qm_addition@attribute = input 1 .@double, input2.@double, output.@doubleendObjectObject@name = qm_difference@attribute inputl.@double, input2.@double, output.@doubleendObjectObject@name = qm_division@attribute = inputl.@double, input2.@double, output.@doubleendObjectObject145@name qm_dyn_first@attribute = dummy.@double, output.@double, output_old.@double,output_ss.@double, times_state.@floatendObjectObject@name = qm_multiplication@attribute = inputi .@double, input2.@double, output.@doubleendObjectObject@name = qmjrop_square@attribute = input.@double, output.@doubleendObjectObject@name = qmjroportional@attribute = constant.@float, input.@double, output.@double,parameter.@floatendObjectObject@name = qm_table3@attribute = input.@double, input_h.@float, input_L@float,input_m.@float, output.@double, output_h.@float,output_I.@float, output_m.@float, slope.@doubleendObjectObject@name = runx@attribute simulation.againendObjectObject@name = start@attribute = simulation.yesendObjectObject@name stop@attribute = simulation.yesendObjectObject@name = system@attribute = already.configuredendObjectObject@name = tank@attribute = area.@float, capacity.@float, height.float,outletj,arameter.@float, outlet_restriction.@float, simulaiton.initialized,simulation.initializedendObjectObject@name = timex@attribute current.integer, elapsed.@float, elapsed_old.@float,samp1ing.float, sleep.@floatendObject146Object@name = valve@attribute = opening.@floatendObjectProcedure@name = QMsimulator_coordinator@doRUN_PROCEDURE ( “convert_all_measurements”)RUN PROCEDURE ( “run_model_ss”)RUN_PROCEDURE ( “run_model_dyn’)RUN_PROCEDURE ( “obtain_predicted_dynamics”)RUN_PROCEDURE ( ‘rotate_all_predictions’)MACRO ( “qual_status*”)endProcedureProcedure@name = basic_data_processing@doTEXT (“basic proc”)RUN_PROCEDURE ( “mss_tank_outlet_run”)endProcedureProcedure@name = convert_all_measurements@doSTRCOPY ( dummy.convert.string, “level’)RUN_PROCEDURE (“convert_real_var’)STRCOPY ( dummy.convert.@string, “frate_in”)RUN_PROCEDURE (“convert_real_var’)dummy.convert.string is “frate_out’RUN_PROCEDURE (“convert_real_var’)endProcedureProcedure@name = convert_real_var@do=<dummy.convert.string>.std_amt.float = ( <durnmy.convert.string>.real_amt.float -<dummy.convert.string>.real_amt_min.float ) I ( <dummy.convert.string>.real_amt_max.float -<dummy.convert.@string>.real_amt_min.@float ) * 100endProcedureProcedure@name = dynamics_predicted@do<dummy.var.@string>.p_dyn.@float = RELATIVECHANGE ( <dunimy.var.@string>.p_amt.@float ,0,<dumniy.var.@string>.rate_of_change.@float )endProcedureProcedure@name dynamics_real@do =<dummy.var.@string>.reaidyn.@float = RELATIVECRANGE ( <dummy.var.cstring>.reai amt.@float , 0,<dummy.var.string>.rate_of_change.float )endProcedureProcedure@name = generate_files@doEXPORT ( “..Itmpls_time.rep+”, “timex.elapsed.@float”, 0, 100)EXPORT ( “../tmpll_pred.rep+”, “level.p_amt.@float”, 0, 100)147EXPORT ( “../tmpfl_real.rep+’, “level.real_amt.@float”, 0, 100)EXPORT ( “../tmp/f real.rep+”, “frate_out.real_amt.@float”, 0, 100)EXPORT ( “../tmp/f_pred.rep+”, “frate_out.p_amt.@float”, 0, 100)endProcedureProcedure@name = global_manager@do =DISABLEBACKWARDCHAIN (TRUE)DISABLEFORWARDCHAIN (TRUE)TEXT (“0’)MACRO ( “continue*”)TEXT (“1”)MACRO ( “initialization*”)TEXT (“2”)RUN_PROCEDURE (“read_data_coordinator”)TEXT (“3”)RUN_PROCEDURE ( “QM_simulator_coordinator”)TEXT (“4”)DISABLEBACKWARDCHMN (FALSE)DISABLEFORWARDCHA1N (FALSE)RUN_PROCEDURE (“reasoning_coordinator”)TEXT (“5”)RUN_PROCEDURE (“update_database”)RUN_PROCEDURE (“update_simulation_time”)endProcedureProcedure@name = initial_tank_simulation_values@doTEXT (“initial tank sim values”)frate_in.real_amt.@float = 100.000000frate_in.real_amt_old.@float = 0.000000level.real_amt_old.@float = 0.000000frate_out.real_amt_old.@float 0.000000va1ve.opening.float = 75.000000endProcedureProcedure@name initial_values@do =level.p_amt_old.@float = 0.000000timex.elapsed_old.@float = 0.000000level.qmodel_ss.string is “mss_level 1”endProcedureProcedure@name = initialize_files@do =EXPORT ( “..Itmp/f_real.rep”, “frate_out.real_amt.@float”, 0, 100)EXPORT ( “../tmp/f_pred.rep”, “frate_out.p_amt.@float”, 0, 100)EXPORT ( “../tmp/l_real.rep”, “level.real_amt.@float”, 0, 100)EXPORT ( “../tmp/l_pred.rep”, “level.p_amt.@float”, 0, 100)EXPORT ( “../tmp/s_time.rep”, “timex.elapsed.@float”, 0, 100)endProcedureProcedure@name = mathematical_simulation_coordinator@do=TEXT (“mathematical sim coordinator”)MACRO ( “tank_simulation_mit”)148RUN_PROCEDURE ( “mss_tank_outlet_run’)MACRO ( “simulate_tank”)endProcedureProcedure@name = mdyn_frate_out@doRUN_PROCEDURE ( “mss_tank_outlet_run”)frate_out.p_amt.float tank.outlet_restriction.@float * SQRT ( level.real_amt.@float )endProcedureProcedure@name mdyn_level 1@do =qm_dyn_first.output_ss.double = level.p_amt_ss.@floatqm_dyn_first.output_old.double = level.p_amt_old.@floatqm_dyn_first.time_s_state.float Ievel.time_s_state.@floatRUN_PROCEDURE ( “qm_dyn_first”)leveLp_anlt.@float = qm_dyn_first.output.@doubleendProcedureProcedure@name = mss_frate_out@do =qm_proportiona1.input.double = mss_frate_out.inputl .@doubleqm_proportional.constant.@float = 1RUN_PROCEDURE ( “qm_proportional”)mss_frate_out.output.@double = qm_proportiona1.output.doub1eendProcedureProcedure@name = mss_frate_out_run@do =mss_frate_out.inputl .@double = frate_in.real_amt.@floatRUN_PROCEDURE ( “mss_frate_out”)frate_out.p_amt_ss.float = mss_frate_out.output.@doubleendProcedureProcedure@name mssevel 1@do =qm_prop_square.input.@double = mss_level 1 .inputl .@doubleRUN_PROCEDURE ( “qm_prop_square”)mss_level 1 .dummyl .@double = qm_prop_square.output.doub1eqm_prop_square.input.double = tank.outlet_restriction.@floatRUN_PROCEDURE ( “qm_prop_square”)mss_level I .dummy2.@double = qm_prop_square.output.doub1eqm_division.inputl .@double = mss_level 1 .dummyl .@doubleqm_division.input2.doub1e = mss_Ievel I .dummy2.@doubleRUN_PROCEDURE ( “qm_division’)mss_level 1 .output.@double = qm_division.output.doubleendProcedureProcedure@name = mss_level2@do =qm_tab1e3.input_1.float = mss_level2.input_1.@floatqm_tab1e3.input_m.float = mss_leveI2.input_m.@floatqm_tab1e3.input_h.float = mss_level2.input_h.@floatqm_tab1e3.output_1.float = mssjevel2.output_1.@floatqm_tab1e3.output_m.float = mss_Ievel2.output_m.@float149qm_table3.output_h.float = mssjevel2.output_h.@floatqm_table3.input.doubIe = mss_level2.inputl .@doubleMACRO ( “qm_table3”)mss_level2.output.@double = qm_table3.output.doubleendProcedureProcedure@name = mss_level2_definition@do =mss_level2.input_l.@float =0mss_level2.output_l.@float =0mss_level2.input_m.@float =50mss_level2.output_m.@float = 0.500000mss_level2.input_h.@float = 100mss_level2.output_h.@float =2endProcedureProcedure@name = msslevel3@domss_level3.output.@double = ( mss_level3.inputl.@double I tank.outlet_restriction.@float ) A 2endProcedureProcedure@name = mss level_run@do<level.qmodel_ss.string>.inputl .@double = frate_in.real_amt.@float<level.qmodel_ss.@string>.input2.@double = valve.opening.float<level.qmodel_ss.string>.parameter.float = 1RUN_PROCEDURE ( level.qmodeiss.string)level.p_amt_ss.@float = <level.qmodel_ss.@string>.output.@doubleendProcedureProcedure@nalne = mss_tank_outlet@do =mss_tank_outlet.output.@double = mss_tank_outlet.inputl .@double * mss_tank_outlet.input2.@doubleendProcedureProcedure@name = mss tank outlet run@doTEXT ( “mss tank outlet run’)mss_tank_outlet.inputl .@double = tank.outlet_parameter.@floatmss_tank_outlet.input2.@double = valve.opening.floatRUN_PROCEDURE ( “mss_tank_outlet”)tank.outlet_restriction.@float = mss_tank_outlet.output.@doubleendProcedureProcedure@name = obtain_predicted_dynamics@do =STRCOPY ( dummy.var.string, “level”)RUN_PROCEDURE (“dynamics_predicted”)dummy.var.string is “frate_out”RUN_PROCEDURE (“dynamics_predicted”)endProcedureProcedure@name = obtain_real_dynamics150STRCOPY (dummy.var.@string, “level’)RUN_PROCEDURE ( “dynamics_real”)STRCOPY ( dummy.var.string, “fratein”)RUN_PROCEDURE ( “dynamics_real”)dummy.var.string is “frate_out”RUN_PROCEDURE ( “dynamics_real”)endProcedureProcedure@name qm_addition@do =qm_addition.output.@double = qm_addition.inputl .@double + qm_additioninput2.doub1eendProcedureProcedure@name = qm_difference@do =qm_difference.output.double = qm_difl’erence.inputl .@double - qm_difference.input2.@doubleendProcedureProcedure@name = qm_division@doqm_division.output.doub1e = qm_division.input1.doub1e / qm_division.input2.@doubleendProcedureProcedure@name = qm_dyn_first@do=qm_dyn_first.dummy.double = EXP ( - 3 / qm_dyn_first.time_s_state.float * timex.sampling.float )qm_dyn_first.output.double = qm_dyn_first.output_old.double * qm_dyn_first.dummy.double + (1 -qm_dyn_first.dummy.@double ) * qm_dyn_first.output_ss.doubleendProcedureProcedure@name = qm_multiplication@do =qm_multiplication.output.double = qm_multiplication.inputl .@double * qm_mu1tiplication.input2.doub1eendProcedureProcedure@name = qm_prop_square@do =qm_prop_square.output.doub1e = qm_prop_square.input.double “2endProcedureProcedure@name = qmj,roportional@doqm_proportiona1.output.doubIe = qm_proportional.input.doub1e * qm_proportionaI.constant.floatendProcedureProcedure@name qm_table3_high@do =qm_table3.slope.double = ( qm_tab1e3.output_h.float - qm_table3.output_m.float ) / ( qm_table3.input_h.float- qm_table3.input_m.float )qm_table3.output.@double = ( qm_table3.input.@double - qm_table3.input_m.@float ) * qm_tab1e3.s1ope.doub1e +qm_table3.output_m.@floatendProcedure151Procedure@name = qm_table3_low@do =qm_table3.slope.doub1e = ( qm_tab1e3.output_m.float - qm_table3.output_1.float ) I ( qm_tab1e3.input_m.float- qm_table3.input_l.@float )qm_table3.output.double = ( qm_table3.input.doub1e - qm_table3.input_l.float ) * qm_table3.s1ope.doubIe +qm_tab1e3.output_l.floatendProcedureProcedure@name = re_configuration@do =runx.simulation.again is FALSEtimex.elapsed.@float =0endProcedureProcedure@name = read_data@do =TEXT ( “read data”)GETPO1NTDATA ( frate_in.real_amt.@float )GETPOJNTDATA ( frate_in.real_amt_old.@float )GETPOINTDATA ( level.reaLamt.@float )GETPOINTDATA ( level.real_amt_old.@float )GETPOINTDATA ( frate_out.real_amt.@float )GETPOINTDATA ( frate_out.real_amt_old.@float )GETPOINTDATA ( valve.opening.@float )endProcedureProcedure@name = read_data_coordinator@do =TEXT ( “read data coordinator”)RUN_PROCEDURE ( “read_data”)RUN_PROCEDURE (“basic_data_processing”)RUN_PROCEDURE (“mathematical_simulation_coordinator”)RUN_PROCEDURE (“obtain_real_dynamics”)endProcedureProcedure@name = reasoning_coordinator@do =analyze.simulation.results is TRUEdummy.reasoning.string is “level”MACRO ( “reas*”)FREERULE ( $RuIe, “reas*”)dummy.reasoning.@string is “frate_out”MACRO ( “reas”)analyze.simulation.results is FALSEendProcedureProcedure@name = rotate_all_predictions@do =STRCOPY ( dummy.rotate.string, “level”)RUN_PROCEDURE (“rotate_predicted_var”)STRCOPY ( dummy.rotate.string, ‘frate_out”)RUN_PROCEDURE (“rotate_predicted_var”)endProcedureProcedure152@name = rotate_predicted_var@do =<dummy.rotate.string>.p_amt_old.float = <dummy.rotate.@string>.p_amt.floatendProcedureProcedure@name = run_model_dyn@doRUN_PROCEDURE ( “mdyn_level 1”)RUN_PROCEDURE ( “mdyn_frate_out”)endProcedureProcedure@name = run_model_ss@do =RUN_PROCEDURE ( “mss_tank_outlet_run”)RUN_PROCEDURE ( “mssleveLrun”)RUN_PROCEDURE ( “mss_frate_out_run”)endProcedureProcedure@name = simulation_parameters@do =timex.sampling.@float =5timex.sleep.@float = 0.000000endProcedureProcedure@name = start_simulation@dorunx.simulation.again is TRUEPUTPOINTDATA ( “runx.simulation.again”, 100)endProcedureProcedure@name = stop_simulation@do=runx.simulation.again is FALSEPUTPOINTDATA ( “runx.simulation.again”, 0)endProcedureProcedure@name = system_initialization@do =RUN_PROCEDURE ( “ simulation_parameters”)RUN_PROCEDURE (“tank_definition’)RUN_PROCEDURE (“initial_values”)RUN_PROCEDURE ( “mss_level2_definition”)RUN_PROCEDURE (“initialize_files”)endProcedureProcedure@name tank_definition@do=tank.area.@float = 2.000000tank.capacity.@float = tank.area.@float * 1000tank.height.@float =2tank.outlet_parameter.@float = 0.942809level.realamtmax.@float =2level.real_amtmin.@float =0fratein.realamtmax.@float = 100153frate_in.real_amt_min.@float =0frate_out.real_amt_max.@float = 100frate_out.real_amt_min.@float =0Ievel.time_s_state.@float = 110frate_out.time_s_state.@float = 110Ievel.rate_of_change.@float = 5frate_in.rate_of_change.float = 5frate_out.rate_of_change.@float = 5endProcedureProcedure@name = tank_simulation@do =dummy.expo.@double = - tank.outlet_restriction.@float * SQRT ( level.real_amt_old.@float ) / tank.capacity.@float ÷frate_in.real_amt_old.@float / tank.capacity.floatdummy.pred_level.@double = level.real_amt_old.@float ÷ dummy.expo.doub1e * timex.samp1ing.floatdummy.eval_pred.@double = - tank.outlet_restriction.@float * SQRT ( dummy.pred_level.@double ) /tank.capacity.float + frate_in.real_amt_old.@float I tank.capacity.@floatlevel.realamt.@float level.realamt_old.@float + ( dummy.expo.@double + dummy.eval_pred.@double ) *timex.sampling.float /2frate_out.real_amt.@float = tank.outlet_restriction.@float * SQRT ( level.real_amt.@float )endProcedureProcedure@name = tank_simulation_RKutta@do =dummy.kI .@double = ( - tank.outlet_restriction.@float * SQRT ( level.real_amt_old.@float ) / tank.capacity.float +frate_in.real_amt_old.@float / tank.capacity.float ) * timex.sampling.@floatdummy.k2.@double = ( - tank.outlet_restriction.@float * SQRT ( level.real_amt_old.@float + dummy.kl .@double /2)/ tank.capacity.float + frate_in.real_amt_old.@float I tank.capacity.@float ) * timex.sampling.@floatdummy.k3.@double = ( - tank.outletrestriction.@float * SQRT ( level.real_amt_old.@float + dummy.k2.@double /2)/ tank.capacity.@float + frate_in.real_amt_old.@float / tank.capacity.@float ) * timex.sampling.@floatdummy.k4.@double (- tank.outlet_restriction.@float * SQRT ( level.real_amt_old.@float + dummy.k3.@double ) /tank.capacity.float ÷ frate_in.real_amt_old.@float / tank.capacity.float ) * timex.sampling.floatlevel.real_amt.@float = level.real_amt_old.@float + ( dummy.kl .@double + 2 * dummy.k2.@double + 2 *dummy.k3.@double + dummy.k4.@double ) /6frate_out.real_amt.@float = tank.outlet_restriction.@float * SQRT ( level.real_amt.@float )endProcedureProcedure@name = tank_simulation_euler@dodummy.expo.@double = - tank.outlet_restriction.@float * SQRT ( level.real_amt_old.@float ) / tank.capacity.@float ÷frate_in.real_amt_old.@float / tank.capacity.@floatlevel.real_amt.@float = level.real_amt_old.@float + dummy.expo.@double * timex.sampling.@floatfrate_out.real_amt.@float = tank.outlet_restriction.@float * SQRT ( level.real_amt.@float )endProcedureProcedure@name = tank_simulation_euler_mod@do =dummy.expo.@double = - tank.outlet_restriction.@float * SQRT ( level.real_amt_old.@float ) I tank.capacity.float +frate_in.real_amt_old.@float I tank.capacity.floatdummy.pred_1evel.double = level.real_amt_old.@float ÷ dummy.expo.@double * timex.sampling.floatdummy.eval_pred.@double = - tank.outlet_restriction.@float * SQRT ( dummy.pred_level.@double ) Itank.capacity.float + frate_in.real_amt_old.@float I tank.capacity.floatlevel.real_amt.@float = level.real_axnt_old.@float + ( dummy.expo.@double + dummy.eval_pred.@double ) *timex.sampling.float 12frate_out.real_amt.@float = tank.outlet_restriction.@float * SQRT ( level.realamt.@float )endProcedure154Procedure@name = tank_simulation_orig@do =dummy.expo.@double = EXP ( - tank.outlet_restriction.@float /2 / tank.capacity.float / SQRT (level.real_amt_old.@float ) * timex.samp1ing.float )level.real_amt.@float = level.realamtold.@float * dummy.expo.@double + SQRT ( level.real_amt_old.@float ) /tank.outlet_restriction.@float * (1 - dummy.expo.@double ) * frate_in.real_amt_old.@floatfrate_out.real_amt.@float = tank.outletrestriction.@float * SQRT ( level.real_amt.@float )endProcedureProcedure@name = update_database@do =PUTPOINTDATA ( “frate_in.real_amt_old.@f’, frate_in.real_amt.@float , 100)PUTPOINTDATA ( “level.real_amt_old.@f’, level.real_amt.@float , 100)PUTPOINTDATA ( “frate_out.real_amt_old.@f’, frate_out.real_amt.@float , 100)endProcedureProcedure@name = update_simulation_time@dotimex.current.integer SECOND ( $Current_time)SLEEP (timex.sleep.@float )timex.elapsed.@float timex.elapsed_old.@float + timex.sampling.@floattimex.elapsed_old.@float = timex.elapsed.@floatendProcedureRestriction@name = zero@constraint = $OAV > 0.000 100endRestrictionIfchange@name = max_certainty@objectinherit = ASNCERTAINTY ( $OAV, 100)endlfchangeFuzzy@name = frate_in_p_amt_high@source = frate_in.p_amt.@floatgrange 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 0.000000, 50.000000, 100.000000, 100.000000endFuzzyFuzzy@name = frate_in_p_amt_Iow@source = frate_in.p_amt.@float@range 3@value = 0.000000, 50.000000, 100.000000@rank = 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_in_p_amt_medium@source = frate_in.p_amt.@floatrange = 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 100.000000, 50.000000, 0.000000, 0.000000endFuzzy155Fuzzy@name frate_inj_amtjos@source = frate_in.p_amt.@float@range 2@value .100.000000, 100.000000@rank 0.000000, 100.000000endFuzzyFuzzy@name frate_inj_dyn_cnt@source = frate_in.p_dyn.@float@range =5@value -100.000000, -10.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name frate_inj_dyn_dec@source = frate_in.p_dyn.@floatrange 4@value = -100.000000, -10.000000, 0.000000, 100.000000@rank = 100.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_inj,_dyn_inc@source = frate_in.p_dyn.@floatrange = 4@value = -100.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 100.000000endFuzzyFuzzy@name = frate_in_real_amt_high@source = frate_in.std_amt.@floatrange 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 0.000000, 50.000000, 100.000000, 100.000000endFuzzyFuzzy@name = frate_in_real_amt_Iow@source = frate_in.std_amt.@float@range 3@value = 0.000000, 50.000000, 100.000000@rank = 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = fratejn_real_amt_medium@source frate_in.std_amt.@floatrange 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 100.000000, 50.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_in_real_dyn_cnt@source = frate_in.real_dyn.@float@range 5@value = -100.000000, -10.000000, 0.000000, 10.000000, 100.000000156@rank = 0.000000, 0.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_in_real_dyn_dec@source = frate_in.real_dyn.@float@range 4@value = -100.000000, -10.000000, 0.000000, 100.000000@rank 100.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = fratejn_real_dyn_inc@source frate_in.rea1_dyn.floatgrange 4@value = -100.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 100.000000endFuzzyFuzzy@name = frate_out_diff_amt_pred_Iarge@source = frateout.diffamtj,red.@float@range = 4@value = 0.000000, 5.000000, 15.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 100.000000endFuzzyFuzzy@name = frate_out_diff_amt_pred_medium@source = frateout.diffamt_pred.floatgrange 4@value = 0.000000, 5.000000, 15.000000, 100.000000@rank = 0.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_out_diff_amtpred_small@source = frate_out.diff_amt_pred.floatgrange 3@value = 0.000000, 5.000000, 100.000000@rank = 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_out_p_amt_high@source = frate_out.p_amt.@float@range = 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 0.000000, 50.000000, 100.000000, 100.000000endFuzzyFuzzy@name = frate_outj_amt_Iow@source = frate_out.p_amt.@floatrange 3@value = 0.000000, 50.000000, 100.000000@rank = 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name frate_outj_amt_medium157@source = frate_out.p_amt.@floatgrange 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 100.000000, 50.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_outj_amtjos@source = frate_out.p_amt.@floatorange = 2@value -100.000000, 100.000000@rank = 0.000000, 100.000000endFuzzyFuzzy@name = frate_outj,_dyn_cnt@source = frate_out.p_dyn.@floatgrange 5@value = -100.000000, -10.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_outj,_dyn_dec@source = frate_out.p_dyn.floatrange = 4@value = -100.000000, -10.000000, 0.000000, 100.000000@rank = 100.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_outj,dyn_inc@source frate_out.p_dyn.floatgrange 4@value = -100.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 100.000000endFuzzyFuzzy@name = frate_outjeal_amt_high@source = frate_out.std_amt.@float@range = 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 0.000000, 50.000000, 100.000000, 100.000000endFuzzyFuzzy@name = frate_outjeal_amt_low@source = frate_out.std_amt.@floatrange 3@value = 0.000000, 50.000000, 100.000000@rank = 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate out real amt medium@source = frate_out.std_amt.@float@range 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 100.000000, 50.000000, 0.000000, 0.000000endFuzzy158Fuzzy@name = frate_out_real_dyn_cnt@source = frate_out.real_dyn.@floatrange = 5@value = -100.000000, -10.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_out_real_dyn_dec@source = frate_out.reaI_dyn.floatgrange 4@value = -100.000000, -10.000000, 0.000000, 100.000000@rank = 100.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = frate_out_real_dyn_inc@source = frate_out.reaI_dyn.float@range 4@value = -100.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 100.000000endFuzzyFuzzy@name Ievel_diff_amt_pred_large@source level.diffamt_pred.@floatgrange 4@value = 0.000000, 5.000000, 15.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 100.000000endFuzzyFuzzy@name = level_diff_amt_pred_medium@source = Ievel.diffamt_pred.@floatgrange 4@value = 0.000000, 5.000000, 15.000000, 100.000000@rank = 0.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = level_diff_amt_pred_small@source = level.diffamt_pred.@floatrange 3@value = 0.000000, 5.000000, 100.000000@rank = 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = level_p_amt_high@source = level.p_amt.@floatrange 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 0.000000, 50.000000, 100.000000, 100.000000endFuzzyFuzzy@name = Ievel_p_amt_low@source = Ievel.p_amt.@float@range 3159@value 0.000000, 50.000000, 100.000000@rank = 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = 1eve1j_amt_medium@source = level.p_amt.@float@range 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 100.000000, 50.000000, 0.000000, 0.000000endFuzzyFuzzy@name = levelj_amtjos@source = level.pamt.@floatrange =2@value = -100.000000, 100.000000@rank = 0.000000, 100.000000endFuzzyFuzzy@name = 1eve1j_dyn_cnt@source = Ievel.p_dyn.@float@range 5@value = -100.000000, -10.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = levelJ_dyn_dec@source = Ieve1.p_dyn.float@range 4@value = -100.000000, -10.000000, 0.000000, 100.000000@rank 100.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = Ievelp_dyn_inc@source = level.p_dyn.@floatgrange 4@value -100.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 100.000000endFuzzyFuzzy@name = level_real_amthigh@source = level.std_amt.@floatorange 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 0.000000, 50.000000, 100.000000, 100.000000endFuzzyFuzzy@name = level_real_amt_low@source = Ievel.std_amt.@floatgrange =3@value = 0.000000, 50.000000, 100.000000@rank = 100.000000, 0.000000, 0.000000endFuzzyFuzzy160@name = level_real_amt_medium@source = level.std_amt.@float@range 5@value = 0.000000, 50.000000, 75.000000, 90.000000, 100.000000@rank = 0.000000, 100.000000, 50.000000, 0.000000, 0.000000endFuzzyFuzzy@name = level_real_amt_pos@source = level.std_amt.@floatrange =2@value = -100.000000, 100.000000@rank = 0.000000, 100.000000endFuzzyFuzzy@name = level_real_dyn_cnt@source = level.real_dyn.floatgrange = 5@value = -100.000000, -10.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = level_real_dyn_dec@source = level.real_dyn.@float@range 4@value = -100.000000, -10.000000, 0.000000, 100.000000@rank = 100.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = level_real_dyn_inc@source = level.real_dyn.@float@range 4@value = -100.000000, 0.000000, 10.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 100.000000endFuzzyRule@name = change van@prioril’ =0IF timex.elapsed.@float = 500THEN frate_in.real_amt.@float = 50THEN PUTPOINTDATA ( “frate_in.real_amt.@f’, frate_in.real_amt.@float , 100)endRuleRule@name = change_var2@priority =0IF timex.elapsed.@float = 1100THEN frate_in.real_amt.@float 75THEN PUTPOINTDATA ( “frate_in.real_amt.@f’, frate_in.real_amt.@float , 100)endRuleRule@name = continue_i@pniorit3’ = 10IF TRUETHEN GETPOINTDATA ( ‘runx.simulation.again”)THEN FREERULE ( $Rule, “continue_2’)161THEN GOTO ( “continue_2”)endRuleRule@name = continue_2@priority 10IF runx.simulation.againTHEN DONOTHING ()ELSE FREERULE ( $RuIe, ‘continue_i”)ELSE timex.elapsed.@float = 0ELSE GOTO ( “continue_i”)endRuleRule@name = global_manager@priority 10IF TRUETHEN DISABLEBACKWARDCHAIN (TRUE)THEN DISABLEFORWARDCHAIN ( TRUE)THEN MACRO ( “continue*”)THEN DISPLAY (“here”, “message-i”)THEN MACRO ( “initialization*”)THEN RUN_PROCEDURE (“read_data_coordinator”)THEN RUN_PROCEDURE ( “QM_simulator_coordinator”)THEN DISABLEBACKWARDCHAIN (FALSE)THEN DISABLEFORWARDCHAIN ( FALSE)THEN RUN_PROCEDURE (“reasoning_coordinator”)THEN RUN_PROCEDURE (“update_database”)THEN RUN_PROCEDURE (“update_simulation_time”)THEN RUN_PROCEDURE (“generate_files”)THEN MACRO ( “change_var*’)endRuleRule@name = initialization_iIF system.alreadyconfiguredTHEN DONOTHINO ()ELSE RUN_PROCEDURE (“system_initialization”)ELSE system.already.configured is TRUEendRuleRule@name qm_table3IF qm_tabIe3.input.double <= qm_table3.input_m.floatTHEN RUN_PROCEDURE ( “qmtable3 low”)ELSE RUN_PROCEDURE ( “qm_table3_high’)endRuleRule@name = qual_status_p_cnt@priority’ = 0IF ?variable = ANY ((p_var) .p_dyn.cnt is TRUE)THEN ALL ( ?variable.p_dyn_status.@string is “constant”)endRuleRule@name = qual_status_p_dec@prio1t’ =0IF ?variable = ANY ( {p_var).p_dyn.dec is TRUE)THEN ALL ( ?variable.p_dyn_status.@string is “decreasing”)endRule162Rule@name = qual_statusj_high@priorit’ =0IF ?variable = ANY ( {p_var}.p_amt.high is TRUE)THEN ALL ( ?variab1e.p_amt_status.string is “high”)endRuleRule@name = qual_statusj_inc@priority’ 0IF ?variable ANY ( {p_var) is TRUE)THEN ALL ( ?variable.p_dyn_status.string is “increasing”)endRuleRule@name = qual_statusj_low@priority =0IF ?variable = ANY ( {p_var}.p_amt.low is TRUE)THEN ALL ( ?variable.p_amt_status.string is “low”)endRuleRule@name = qual_statusj_medium@priorit’ =0IF ?variable ANY ( {pyar}.p_amt.medium is TRUE)THEN ALL ( ?variable.p_amt_status.string is “medium”)endRuleRule@name = qual_status_real_cnt@priorit3’ = 0IF ?variable = ANY ( {p_var}.real_dyn.cnt is TRUE)THEN ALL ( ?variable.real_dyn_status.@string is “constant”)endRuleRule@name = qual_status_real_dec@priorit’ = 0IF ?variable = ANY ( {p_var}.real_dyn.dec is TRUE)THEN ALL ( ?variable.real_dyn_status.string is “decreasing”)endRuleRule@name = qual_status_real_high@priority’ =0IF ?variable = ANY ( {p_var}.real_amt.high is TRUE)THEN ALL ( ?variable.real_amt_status.string is “high”)endRuleRule@name = qual_status_real_inc@priorit’ =0IF ?variable = ANY ( {p_var} is TRUE)THEN ALL ( ?variable.real_dyn_status.@string is “increasing”)endRuleRule@name = qual_status_real_low@priorit3’ =0IF ?variable = ANY ( {p_var}.real_amt.low is TRUE)163THEN ALL ( ?variable.real_amt_status.string is ‘low’)endRuleRule@name = qual_status_real_medium@prioritY = 0IF ?variable = ANY ( {p_var}.real_amt.medium is TRUE)THEN ALL (?variable.real_amt_status.@string is “medium”)endRuleRule@name = reasoning_0@priority =0IF analyze.simulation.resultsTHEN dummy.std_amt.@float = ( <dummy.reasoning.@string>.p_amt.@float -<dummy.reasoning.string>.real_amt_min.float ) I ( <dummy.reasoning.string>.real_amt_max.float -<dummy.reasoning.@string>.real_amt_min.@float ) * 100THEN <dummy.reasoning.@string>.diff_amt_pred.@float = ABS (<dummy.reasoning.@string>.std_amt.@float -dummy. std amt.@float )THEN FORGET ( “<model.dout.@s>.diff_amt_mp.medium”)THEN FORGET ( “<model.d_out.@s>.diff_amt_mp.large”)THEN FORGET ( “”)endRuleRule@name = reasoning_i@priorit’ =0IF analyze.simulation.resultsAND <dummy.reasoning.@string>.diffamt_pred.smallTHEN TEXT (“.. Measured and predicted !$dummy.reasoning.@s$! agree!...!$<dummy.reasoning.@s>.diff_amt_pred.@f $!“)endRuleRule@name = reasoning_2@priority0IF analyze.simulation.resultsAND <dummy.reasoning.string>.diff_amt_pred.mediumTHEN TEXT ( “.. they are close!... !$ <dummy.reasoning.s>.diff_amtj,red.f$!”)endRuleRule@name = reasoning_3@priority 0IF analyze.simulation.resultsAND <dummy.reasoning.@string>.diff_amt_pred.largeTHEN TEXT (“.. there are some PROBLEMS!!! !... !$ <dummy.reasoning.s>.diff_amt_pred.@f $!‘)endRuleRule@name = simulate_tank@priority =0IF level.real_amt_old.@float <=0THEN level.realamtold.@float = 0.001000THEN RUN_PROCEDURE ( “tank_simulation”)ELSE RUN_PROCEDURE (‘tank_simulation”)endRuleRulename = tank_simulation_mitIF tank.simulation.initialized164THEN DONOTHING ()ELSE RUN_PROCEDURE ( “initiaI_tank_simu1ation_va1ues)ELSE tank.simulation.initialized is TRUEendRuleFacets@triplet = {model_ss}.output.@double@ifchange = max_certaintyendFacetsFacets@triplet = fratejn.p_amt.high@fuzzy = frate_in_p_amt_highendFacetsFacets@triplet = frate_in.p_amt.Iow@fuzzy = frate_in_p_amt_IowendFacetsFacets@triplet = frate_in.p_amt.medium@fuzzy = frate_in_p_amt_mediumendFacetsFacets@triplet = frate_in.p_amt.pos@fuzzy = fratejnp_aint_posendFacetsFacets@triplet = frate_in.p_dyn.cnt@fuzzy = frate_in_p_dyn_cntendFacetsFacets@triplet frate_in.p_dyn.dec@fuzzy frate_in_p_dyn_decendFacetsFacets@triplet = frate_in_p_dyn_incendFacetsFacets@triplet = frate_in.real_amt.high@fuzz’ frate_in_real_amt_highendFacetsFacets@triplet = frate_in.real_amt.low@fuzz’ = frate_in_real_amt_lowendFacetsFacets@triplet = frate_in.real_amt.medium@fuzz’ = frate_in_real_amt_mediumendFacetsFacets165@triplet = frate_in.real_dyn.cnt@fuzzy = frate_in_real_dyn_cntendFacetsFacets@triplet = frate_in.real_dyn.decfuzzy = frate_in_real_dyn_decendFacetsFacets@triplet = frate_in_real_dyn_incendFacetsFacets@triplet = frate_out.diff_amt_pred.large@fuzzy = frate_out_diff_amt_pred_largeendFacetsFacets@triplet frate_out.diff_amt_pred.medium@fuzzy’ = frate_out_diff_amt_pred_mediumendFacetsFacets@triplet = frate_out.diff_amt_pred.small@fuzz’ = frate_out_diff_amt_pred_smallendFacetsFacets@triplet = frateout.diffamt_pred.@float@ifchange = max certaintyendFacetsFacets@triplet = frate_out.p_amt.high@fuzz’ = frate_out_p_amt_highendFacetsFacets@triplet = frate_out.p_amtiow@fuzzy’ = frate_out_p_amt_IowendFacetsFacets@triplet = frate_out.p_amt.medium@fuzz’ = frate_out_p_amt_mediumendFacetsFacets@triplet frate_out.p_amt.pos@fuzz’ = frate_out_p_amt_posendFacetsFacets@triplet frate_out.p_dyn.cnt@fuzz’ = frate_out_p_dyn_cntendFacetsFacets@triplet = frate_out.p_dyn.dec166@fuzzy = frate_outj_dyn_decendFacetsFacets@triplet = = frate_outj,_dyn_incendFacetsFacets@triplet = frate_out.real_amt.high@fuzzy = frate_out_real_amt_highendFacetsFacets@triplet = frate_out.real_amt. low@fiizzy = frate_out_realamt_lowendFacetsFacets@triplet frate_out.real_amt.medium@fuzz3’ = frate_out_real_amt_mediumendFacetsFacets@triplet = frate_out.real_dyn.cnt@fuzzy = frate_out_real_dyn_cntendFacetsFacets@triplet = frate_out.real_dyn.dec@fuzzy = frate_out_real_dyn_decendFacetsFacets@triplet = = frate_out_real_dyn_incendFacetsFacets@triplet = level.diff_amtjred.large@fuzz’ = level_diff_amt_pred_largeendFacetsFacets@triplet = leveLdiff_amt_pred.medium@fuzzy = level_diff_amt_pred_mediumendFacetsFacets@triplet = level.diff_amt_pred.small@fuzzy = level_diff_amt_pred_smallendFacetsFacets@triplet = level.diff_amt_pred.@floatifchange max_certaintyendFacetsFacets@triplet = level.pamt.high@fuzzy = level_p_amt_high167endFacetsFacets@triplet = level.p_amt.low@fuzz3’= level_p_amt_lowendFacetsFacets@triplet = level.p_amt.medium@fuzz’ = Ievel_p_amt_mediumendFacetsFacets@triplet = Ievel.p_amt.pos@fuzzy = Ievelj,_amt_posendFacetsFacets@triplet = level.p_amt.@float@ifchange = max_certaintyendFacetsFacets@triplet = level.p_amt_old.@floatifchange = max_certaintyendFacetsFacets@triplet = Ievel.p_amt_ss.@float@ifchange = max_certaintyendFacetsFacets@triplet = level.p_dyn.cnt@fuzz’ = level_p_dyn_cntendFacetsFacets@triplet = Ievel.p_dyn.dec@fuzzy = Ievel_p_dyn_decendFacetsFacets@triplet level_p_dyn_incendFacetsFacets@triplet = leveLp_dyn.@float@ifchange = max_certaintyendFacetsFacets@triplet = level.real_amt.high@fuzzy = level_real_amt_highendFacetsFacets@triplet = level.real_amt. low@fuzzy = Ievel_real_amt_lowendFacets168Facets@triplet = level.real_amt.medium@ftizzy = level_real_amt_mediumendFacetsFacets@triplet = level.realamt.pos@fuzzy = Ievel_real_amt_posendFacetsFacets@triplet = level.real_dyn.cnt@fuzzy = level_real_dyn_cntendFacetsFacets@triplet = level.real_dyn.dec@fuzzy level_real_dyn_decendFacetsFacets@triplet = = level_real_dyn_incendFacetsFacets@triplet = level.real_dyn.@float@ifchange = max_certaintyendFacetsFacets@triplet = Ievel.std_amt.@floatifchange = max_certaintyendFacetsFacets@triplet = mss_levell .parameter.@float@default = 1.000000, 100.000000endFacetsFacets@triplet = qm_division.output.@doubleifchange = max_certaintyendFacetsFacets@triplet = qm_dyn_first.output.doub1eifchange = max_certaintyendFacetsFacets@triplet = qm_prop_square.output.doub1eifchange = max_certaintyendFacetsFacets@triplet = qm_proportional.output.@double@ifchange = max_certaintyendFacets169Facets@triplet tank.capacity.floatifchange = max_certaintyendFacetsFacets@triplet = tank.outlet_restriction.@float@restriction = zeroendFacets!*** LoadStrategy must go at the end of the Knowledge Base ***!LoadStrategy@name = ‘tnkl_qnx.stg”EndLoadStrategy170APPENDIX D KNOWLEDGE BASE FOR THE ISCS PROTOTYPEThis appendix presents the source code of the knowledge base of the ISCS, as implemented inProcessVision. The knowledge incorporated into ISCS, as in the case of every knowledge-basedsystem implementation, is structured by the system at the time the reasoning process takes placeduring the actual application of the system. Thus, this knowledge is presented using the same formatin which ProcessVision stores it.Class@name = mill@object sag_millpublic = status.running, status.was_running, status.@floatendClassClass@name = ball_mill@object = ball_mill_i, ball_mill_2@superClass = mill@public = status.running, status.was_running, status.@floatenilClassClass@name = feeder@object = feederl, feeder2, feeder3, feeder4, feeder5@public = contribution.integer, real_speed.@float, speed_ratio_real.@float,status.mnning, status.was_running, status.@float,status_cliute.pluggedendClassClassname = model_dynendClassClass@name = process_var@object = fresh_feed, hi_tons_in, hi_tons_out, sag_amps, sag_hydro, sag_speed@public = agrees_with.setpoint, controller_name.string, deviation.@float,diff_amt_pred.large, diff_amt_pred.medium, diff_amt_pred.small,diff_amt_pred.float, is_approaching_to.setpoint, is_close_to.setpoint,pred_amt.high, pred_amt.low, pred_amt.medium,pred_amt.setpoint, pred_amt.@float, pred_amt_old.@float,pred_amt_ss.@float, pred_amt_status.string, pred_dyn.constant,pred_dyn.decreasing, pred_dyn.increasing, pred_dyn.@float,pred_dyn_status.@string, qmodel_ss.string, rate_of_change.float,real_amt.high, real_amt. low, real_amt.medium,real_amt.positive,, real_amt.@float,real_amt_max.@float, real_amt_min.@float, real_amt_old.@float,real amt status.string, real_average.float, real_dyn.constant,real_dyn.decreasing, real_dyn.increasing, real_dyn.@float,real_dyn_status.string, real setpoint.@float, std_amt.@float,std_setpoint.@float, time_constant.@float, time_s_state.@uloatendClassClass@name = qmss_functionobject = mss_sag_speed171@public inputl.@double, input2.@double, input3.@double,input4.double, output.@doubleendClassClass@name = qmss_table3@public = inputi.@double, input_h.@float, input_l.@float,input m.@float, output.@double, output_h.@float,output_l.@float, output_m.@floatendClassClass@name = restriction_categoiyobject = ball_mills, bm_pumps, feeders, flotation, other, plugged_chutes, sag_control, sag_shut_down, soft_ore, tailings@private = restriction.exists@public = current_restriction.exists, lost_current_shift.@double, lost_last_shifi.@double,percent_accumulated_losses.@float, real_accumulated_losses.@doubleendClassClass@name = restriction_id@object = rr_feeder_down, rr_ffeed_cut, rr_ffeed_limit, rr_ore_supply, if_sag_stops, if_soft_ore, rr_speed, rr_water_ratio@public = cause.ball_mills, cause.bm_pumps, cause.flotation,cause.other, cause.plugged_chutes, cause.sag_control,cause.sag_shut_down, cause.soft_ore, cause.tailings,hour_elapsed.integer, lost_current_rr.@double, lost_current_shift.@doubie,lost_last_shift.@double, minute_elapsed.integer, possible_cause.determined,real_accumulated_losses.@double, restriction.detected, restriction.detected_past_sampling,restriction.existed, restriction.exists, restriction.has_been_identified,restriction.ignore, restriction, initialized, restriction.integer,second_elapsed.integer, time_delta_elapsed.@float, time_elapsed.@float,time_final.@time, time_initial.@time, time_total.@floatendClassObject@name = a@attribute = a.@float, al .@string, aa.@float,b.@float, b_i .@float, c.@float,ci .integer, d.@float, param.initialized,rr.initialized, time_elapsed.@float, time_init.@time,time_now.@timeendObjectObject@name = analyze@attribute = simulation.resultsendObjectObject@name = ball_mill_I@class = ball_mill@attribute = status.running, status.was running, status.@floatendObjectObject@name = ball_mill_2@class = ball_mill@attribute status.running, status.was_running, status.@floatendObjectObject172@name = ball_mills@class = restriction_category@attribute = current_restriction.exists, lost_current_shifi.@double, Iost_last_shift.@double,percent_accumulated_losses.@float, real_accumulated_losses.@double, restriction.existsendObjectObject@name = bm_pumps@class = restriction category@attribute = current_restriction.exists, lost_current_shift.@double, lost_last_shift.@double,percent_accumulated_losses.@float, real_accumulated_losses.@double, restriction.existsendObjectObject@name = category_all@attribute = current_restriction.string, percent_accumulated_losses.@float, real_accumulated_losses.@double,total_lost_current_shift.@double, total_lost_last_shifi@double, user_chose.new_causeendObjectObject@name = category_any@attribute = current_category.stringendObjectObject@name = chute_conveyor@attribute = status_chute.pluggedendObjectObject@name = chute_feed@attribute = status_chute.pluggedendObjectObject@name = chutes@attribute = status.pluggedendObjectObject@name = coarse_ratio@attribute = pred_amt.@float, real_setpoint.@floatendObjectObject@name = convert@attribute = variable.stringendObjectObject@name = conveyor_3c@attribute status.runningendObjectObject@name = conveyor_4c@attribute = status.runningendObjectObject@name = dummy173@attribute = a.string, a.@float, adjustment.@float,ball mi11.string, begin_average.float, categorystring,convert.string, current_Ioss.@double, difference.@float,double.@double, end_average.float, equipment.string,evalpred.doubIe, expo.@double, feeder.string,finaI_average.float, floating.float, init_average.float,integer.@integer, ki .@double, k2.@double,k3.@double, k4.@double, losses.@double,macro.string, model.@string, modeI_name.string,model_slope.@double, name.string, new_cause.@string,number_ofjr.integer, pred_level.@double, procedurestring,process_var.string, reasoning.string, rectang1e.doubIe,remainder.@float, restriction.exists, restriction.string,rotate.string, rr_anaIyzed.integer, rr_being_adjusted.float,rr_time_acc.integer, std_amt.@float, string.string,time I .@time, time2.@float, time_accumulated.@float,time_initial.@time, timej,revious.@float, timex.@time,triang1e.doubIe, var.stringendObjectObject@name = end@attribute of.shiftendObjectObject@name feederl@class = feeder@attribute = chute.plugged, contribution.integer, real_speed.@float,speed_ratio_real.@float, status.running, status.was_running,status.@float, status_chute.pluggedendObjectObject@name = feeder2@class = feeder@attribute = chute.p)ugged, contribution.integer, rea_speed.@float,speed_ratio_real.@float, status.running, status.was_running,status.@float, status_chute.pluggedendObjectObject@name = feeder3@class = feeder@attribute = chute.plugged, contribution.integer, real_speed.@float,speed_ratio_real.@float, status.running, status.was_running,status.@float, stattischute.pluggedendObjectObject@name = feeder4@class = feeder@attribute = chutep1ugged, contribution.@integer, real_speed.@float,speed_ratio_real.@float, status.running, status.was_running,status.@float, status_chute.pluggedendObjectObject@name = feederS@class feeder@attribute = chute.pugged, contribution.@integer, real_speed.@float,174speed_ratio_real.@float, status.running, status.was_running,status.@float, status_chute.pluggedendObjectObject@name = feeder_set@attribute = coarse_contribution.integer, current_restriction.exists, fine_contribution.integer,status_all.running, totaI_contribution.integerendObjectObject@name = feeders@class = restriction_category@attribute = current_restriction.exists, Iost_current_shilt@double, lost_Iast_shift.@double,percent_accumulated_losses.@float, real_accumulated_losses.@double, restriction.exists,total_lost_current_shift.@doubleendObjectObject@name = flotation@class = restriction_category@attribute = current_restriction.exists, lost_current_shift.@double, lost_last_shifi@double,percent_accumulated_losses.@float, real_accumulated_Iosses.@double, restriction.exists,total_lost_current_shift.@doubleendObjectObject@name = fresh_feed@class = process_var@attribute = agrees_with.setpoint, controller.meets_demand, controller_mode.cascade,controller_name.string, cut_time.initialized, cut_time_elapsed.@float,cut_time_fmal.@time, cut_time_init.@time, cut_time_total.@double,deviation.@float, diff_amt_pred.large, diff_amt_pred.medium,diff_amt_pred.small, diff_amt_pred.@float, follows.setpoint,has_been.cut, has_been.recovered_from_cut, hi_Iimit_real.@float,hi_limit_target.float, is_approaching_to.setpoint, is_close_to.setpoint,pred_amt.high, pred_amt.low, pred_amt.medium,pred_amt.setpoint, pred_amt.@float, pred_amt_old.@float,pred_amt_ss.@float, pred_amt_status.@string, pred_dyn.constant,pred_dyn.decreasing, pred_dyn.increasing, pred_dyn.@float,pred_dyn_status.string, qmodel_ss.string, rate_of_change.@float,real_amt.high, real_amt.low, real_amt.medium,real_amt.positive,, real_amt.@float,real_amt_max.@float, real_amt_min.@float, real_amt_old.@float,real_amt_status.@string, real_average.@float, real_dyn.constant,real_dyn.decreasing, real_dyn. increasing, real_dyn.float,real_dyn_status.string, real_setpoint.@float, std_amt.@float,std_dyn.float, std_setpoint.@float, time_constant.@float,time_s_state.@float, tonnage_difference.@float, was.cutendObjectObject@name = fresh_feed_controller@attribute = operation.follows_setpointendObjectObject@name = hi_tons@attribute = target_hi_I imit.@floatendObject175Object@nanle = hi_tonsjn@class = process_var@attribute = agrees_with.setpoint, close_to.setpoint, controller name.string,deviation.float, diff_amt_pred.large, diffarnt_pred.medium,diff_amt_pred.small, duff amt_pred.@float, is_approaching_to.setpoint,is_close_to.setpoint, pred_amt.high, pred_amt.low,pred_amt.medium, pred_amt.setpoint, pred_amt.@float,pred_arnt_old.@float, pred_amt_ss.@float, pred_amt_status.string,pred_dyn.constant, pred_dyn.decreasing, pred_dyn.increasing,pred_dyn.@float, pred_dyn_status.@string, qmode1_ss.string,rate_of_change.float, real_amt.high, real_amt.Iow,real_amt.medium, real_arnt.positive,,real_amt.@float, real_amt_max.@float, real_amt_min.@float,real_amt_old.@float, real_amt_status.string, real_average.float,real_dyn.constant, real_dyn.decreasing, real_dyn.increasing,real_dyn.@float, real_dyn_status.string, real_setpoint.@float,setpoint.@float, std_amt.@float, std_setpoint.@float,time_constant.@float, time_s_state.@floatendObjectObject@name = hi_tons_out@class = process_var@attribute = agrees_with.setpoint, close_to.setpoint, controller_name.string,deviation.@float, diff_amt_pred.large, diff_amt_pred.medium,diffamt_pred.small, diff_amt_pred.float, is_approaching_to.setpoint,is_close_to.setpoint, pred_amt.high, pred_amt.low,pred_amt.medium, pred_amt.setpoint, pred_amt.@float,pred_amt_old.@float, pred_amt_ss.@float, pred_amt_status.string,pred_dyn.constant, pred_dyn.decreasing, pred_dyn.increasing,pred_dyn.@float, pred_dyn_status.string, qmodel_ss.@string,rate_of_change.@float, real_amt.high, real_amt. low,real_amt.medium, real_amt.positive,,real_amt.@float, real_amt_max.@float, real_amt_min.@float,real_amt_old.@float, real_amt_status.string, reaI_average.float,real_dyn.constant, real_dyn.decreasing, real_dyn.increasing,real_dyn.@float, real_dyn_status.string, real_setpoint.@float,setpoint.@float, std_amt.@float, std_setpoint.@float,time_constant.@float, time_s_state.@floatendObjectObject@nanle = iss_user@attribute = accumulate current rr.give warning, accumulate_tonnage_lost.give_warning, do_not_correct.give_warning,do_not_correct.waming_givenendObjectObject@name = level_tailing_box@attribute = real_arnt.high, real_amt.@floatendObjectObject@name = mss_sag_speed@class = qmss_function@attribute = input.@double, input 1 .@double, input2.@double,input3.@double, input4.@double, input_h.@float,input_l.@float, input_m.@float, output.@double,output_h.@float, output_l.@float, output_m.@floatendObject176Object@name other@class restriction_category@attribute = current_restriction.exists, lost_current_shift.@double, lost_last_shifi.@double,percent_accumulated_losses.@float, real_accumulated_losses.@double, restriction.exists,total lost current_shifi@doubleendObjectObject@name = plugged chutes@class = restriction_category@attribute = current_restriction.exists, lost_current_shift.@double, lost_last_shift.@double,percent_accumulated_losses.@float, real_accumulated_losses.@double, restriction.exists,total_lost_current_shifl@doubleendObjectObject@name power_to_hydro@attribute = selector.powerendObjectObject@name qm_dyn_first@attribute = dummy.@double, output.@double, output_old.@double,output_ss.@double, time_constant.@float, time_s_state.@floatendObjectObject@name qmss_table3@attribute = input.@double, input I .@double, input_h.@float,input_l.@float, input_m.@float, output.@double,output_h.@float, output l.@float, output_m.@float,slope.@doubleendObjectObject@name rr_adjustment@attribute = accumulated_tonnage.@double, accumulated_tonnage_i .@double, accumulated_tonnage_2.@double,accumulated_tonnage_3 .@double, accumulated_tonnage_4.@double, accumulated_tonnage_5.doubie,accumulated_tonnage_6.double, accumulated_tonnage_7.double, accumulated_tonnage_8.double,accumulated_tonnage_9.double, accumulated_tonnage_previous.double, cause_i .string,cause_2.@string, cause_3 .@string, cause_4.string,cause_5.string, cause_6.string, cause_7.string,cause_8.@string, cause_9.@string, change_in_final_tonnage.float,change_in_initial_tonnage.@float, change_in_tonnage.float, change_in_tonnage_previous.float,correction_tons_accumulated.@double, did_not_correcttonnage_lost, do_not_correct.tonnage_lost,do_not_correct.waming_given, do_not_correct.warning_sent, final_tonnage.in_progress,final_tonnage.was_in_progress, final_tonnage.@float, ignore_tonnage.correction,initial_tonnage.@float, maximum_time.@float, mechanism.initialized,new_initial_tonnage.float, number_of_rr.integer, pred_tonnage_during_rr.float,process.initialized, restriction_i .@string, restriction_2.string,restriction_3.@string, restriction_4.string, restriction_5.string,restriction_6.@string, restriction_7.string, restriction_8.@string,restriction_9.@string, rr_being_adjusted.integer, time_elapsed_i .@float,time_elapsed_2.@float, time_elapsed_3.@float, time_elapsed_4.@float,time_elapsed_5.@float, time_elapsed_6.float, time_elapsed_7.@float,time elapsed 8.@float, time_elapsed_9.@float, time_elapsed_total.@floatendObjectObject177@name = if_all@attribute = real_accumulated_losses.@double, time_detected.integer, time_rr_estimate.@float,time_rr_exists.@float, time_tons_average.float, tons_average.float,total_lost_current_shift.@double, total_lost_last_shift.@doubleendObjectObject@name = rr_any@attribute = accumulate_losses.rr_sag_stops, begin_average.@float, current_restriction.@string,do_not_accumulate.tonnage_current_rr, do_not_accumulate.tonnage_lost, end_average.float,first_restriction.appeared, follow.up, last_restriction.disappeared,minimum_time_to_estimate.@float, pred_tonnage_during_rr.float, restriction.existed,restriction.exists, stop_accumulating.tonnage_lost, stops_accumulating.tonnage_lost,time_first_rr_appeared.@float, time_last_rr_disappeared.@float, time_no_exists_restriction.@float,time_no_exists_restrictions.@floatendObjectObject@name = if_dummy@attribute = rectangle.doubIeendObjectObject@name rr_feeder_down@class = restriction_id@attribute = cause.ball_mills, cause.bm_pumps, cause.flotation,cause.other, cause.plugged_chutes, cause.sag_control,cause.sag_shut_down, cause.soft ore, cause.tailings,hour_elapsed.@integer, lost current rr.@double, lost_current_shifi.@double,lost_last_shift.@double, minute_e1apsed.integer, possible_cause.determined,possible_cause.feeders, possible_cause.plugged_chutes, real_accumulated_losses.@double,restriction.detected, restriction.detected_past_sampling, restriction.existed,restriction.exists, restriction.has_been_identified, restriction.has_been_initialized,restriction. identi1v, restriction. identii,’_cause, restriction, ignore,restriction.initialized, restriction.pIease_identif,’, restriction.integer,second_elapsed.integer, time_delta_elapsed.@float, time_elapsed.@float,time_elapsedx.integer, time_final.@time, time_initial.@time,time_total.@floatendObjectObject@name = rrffeed_cut@class = restriction_id@attribute = cause.ball mills, cause.bm_pumps, cause.flotation,cause.other, cause.plugged_chutes, cause.sag_control,cause.sag_shut_down, cause.sofi_ore, cause.tailings,hour_elapsed.integer, lost current_rr.@double, lost_current_shift.@double,lost_last_shift.@double, minute_e1apsed.integer, possible_cause.ball_mills,possible_cause.bm_pumps, possible_cause.determined, possible_cause.flotation_operation,possible_cause.other, possible_cause.sag_control, real_accumulated_losses.@double,restriction.detected, restriction.detected_past_sampling, restriction.existed,restriction.exists, restriction,has_been_identified, restriction.has_been_initialized,restriction.identi1, restriction.identiI’_cause, restriction.ignore,restriction.initialized, restriction.please_identi1’, restriction.integer,second_elapsed.@integer, time_delta_elapsed.@float, time_elapsed.@float,time_elapsedx.@integer, time_final.@time, time_initial.@time,time_total.@floatendObjectObject@name = rrffeed limit178@class = restriction_id@attribute = cause.ball_mills, cause.bm_pumps, cause.flotation,cause.other, cause.plugged chutes, cause.sag_control,cause.sag_shut_down, cause.soft_ore, cause.tailings,hour_e1apsed.integer, lost_current_rr.@double, lost_current_shift.@double,lost last_shift.@double, minute_e1apsed.integer, possible_cause.ball_mills,possible_cause.bm_pumps, possible_cause.determined, possible_cause.flotation_operation,possible_cause.other, possible_cause.others, possible_cause.tailings,real_accumulated_losses.@double, restriction.detected, restriction.detected_past_sampling,restriction.existed, restriction.exists, restriction.has_been_identified,restriction.has_been_initialized, restriction.identi1’, restriction.identi&_cause,restriction.ignore, restriction.initialized, restriction.please_identify,restriction.@integer, second_elapsed.@integer, time delta elapsed.@float,time_elapsed.@float, time_elapsedx.@integer, time_final.@time,time_initial.@time, time_total.@floatendObjectObject@name if_ore_supply@class = restriction_id@attribute = cause.ball_mills, cause.bm_pumps, cause.flotation,cause.other, cause.plugged_chutes, cause.sag_control,cause.sag_shut_down, cause.soft_ore, cause.tail ings,hour_elapsed.integer, lost_current_rr.@double, lost_current_shift.@double,lost_last_shift.@double, minute_elapsed.@integer, possible_cause.determined,possible_cause.feeders, possible_cause.other, possible_cause.others,possible_cause.plugged_chutes, real_accumulated_losses.@double, restriction.detected,restriction.detected_past sampling, restriction.existed, restriction.exists,restriction.has_been_identified, restriction.has_been_initialized, restriction.identi1’,restriction.identi1,i cause, restriction.ignore, restriction.initialized,restriction.please_identiij, restriction.@integer, second_elapsed.integer,time_delta_elapsed.@float, time_elapsed.@float, time_elapsedx.integer,time_final.@time, time_initial.@time, time total.@floatendObjectObject@name = rr_sag_stopsclass restrictionid@attribute = cause.ball_mills, cause.bm_pumps, cause.flotation,cause.other, cause.plugged_chutes, cause.sag_control,cause.sag_shut_down, cause.soft_ore, cause.tailings,hour_eIapsed.integer, lost_current_rr.@double, lost_current_shift.@double,lost_last_shift.@double, minute elapsed.integer, possible_cause.ball_mills,possible_cause.bm_pumps, possible_cause.determined, possible_cause.sag_control,possible_cause.sag_liners, possible_cause.sag_mill, possible_cause.sag_pump,possible_cause.sag_shut_down, real_accumulated_losses.@double, restriction.detect,restriction.detected, restriction.detected_past_sampling, restriction.existed,restriction.exists, restriction.has_been_identified, restriction.has_been_initialized,restriction.identif’, restriction. identily_cause, restriction.ignore,restriction.initialized, restriction.please_identif’, restriction.@integer,restrjctiooncause.determjned, second_elapsed.integer, time_delta_elapsed.@float,time_elapsed.@float, time_elapsedx.@integer, time_final.@time,time_initial.@time, time_total.@floatendObjectObject@Ilame = if_soft_ore@class restriction_id@attribute = cause.ball_mills, cause.bmjumps, cause.flotation,cause.other, cause.plugged_chutes, cause.sag_control,cause.sag_shut_down, cause.soft ore, cause.tailings,hour_elapsed.integer, lost current rr.@double, lost_current_shift.@double,179lost_Iast_shift.@double, minute_eIapsed.integer, possible_cause.determined,possible_cause.soft_ore, possible_cause.tailings, reaI_accumu1ated_1osses@doub1e,restriction.detected, restriction.detected_past_sampling, restriction.existed,restriction.exists, restriction.has_been_identified, restriction.has_been_initialized,restriction.identii,’, restriction.identii’_cause, restriction.ignore,restriction.initialized, restriction.p1ease_identi1’, restriction.integer,second_elapsed.integer, time_delta_elapsed.@float, time_elapsed.@float,time_e1apsedx.integer, time_final.@time, time_initial.@time,time_total.@floatendObjectObject(name = n_speed@class = restriction_id@attribute = cause.balI_mills, cause.bm_pumps, cause.flotation,cause.other, cause.plugged_chutes, cause.sag_control,cause.sag_Iiners, cause.sag_shut_down, cause.soft_ore,cause.tailings, hour_e1apsed.integer, lost_current_rr.@double,lost_current_shift.@double, lost_Iast_shift.@double, minute_elapsed.@integer,possible_cause.determined, real_accumulated_losses.@double, restriction.detected,restriction.detected_past_sampling, restriction.existed, restriction.exists,restriction.has_been_identified, restriction.has_been_initialized, restriction.identi1’,restriction.identiij_cause, restriction.ignore, restriction.initialized,restriction.@integer, second_elapsed.@integer, time_delta_elapsed.@float,time_elapsed.@float, time_elapsedx.@integer, time_final.@time,time_initial.@time, time_total.@floatendObjectObject@name = if_water_ratio@class = restriction_id@attribute = cause.ball_mills, cause.bm_pumps, cause.flotation,cause.other, cause.plugged_chutes, cause.sag_control,cause.sag_Iiners, eause.sag_shut_down, cause.sofi_ore,cause.tailings, hour_elapsed.@integer, Iost_current_rr.@double,Iost_current_shifL@double, lost_last_shift.@double, minute_elapsed.@integer,possible_cause.determined, possible_cause.sag_control, real_accumulated_Iosses.@double,restriction.detected, restriction.detected_past_sampling, restriction.existed,restriction.exists, restriction.has_been_identified, restriction.has_been_initialized,restriction.identif’, restriction.identii’_cause, restriction.ignore,restriction.initialized, restriction.p1ease_identiij, restriction.integer,second_e1apsed.integer, time_delta_elapsed.@float, time_elapsed.@float,time_eIapsedx.integer, time_finaL@time, time_initial.@time,time_total.@floatendObjectObject@name = runx@attribute = simulation.againendObjectObject@name = sag_amps@class = process_var@attribute = agrees_with.setpoint, contro11er_name.string, deviation.@float,difl’_amt_pred.large, diff_amt_pred.medium, diff_amt_pred.small,diff_amt_pred.@float, is_approaching_to.setpoint, is_close_to.setpoint,pred_amt.high, pred_amt.low, pred_amt.medium,pred_amt.setpoint, pred_amt.@float, pred_amt_o1d@float,pred_amt_ss.@float, pred_amt_status.@string, pred_dyn.constant,pred_dyn.decreasing, pred_dyn.increasing, pred_dyn.@float,180pred_dyn_status.string, qm_paraml .@float, qm_param_original.float,qmodel_ss.string, rate_of_change.float, real_amt.high,real_amt.low, real_amt.medium, real_amt.positive,, real_amt.@float, real_amt_max.@float,real_amt_min.@float, real_amt_old.@float, real_amt_statiis.string,real_average.float, real_dyn.constant, real_dyn.decreasing,real dyn.increasing, real dyn.@float, real_dyn_status.string,real setpoint.@float, std_amt.@float, std_setpoint.@float,time_constant.@float, time_s_state.@floatendObjectObject@name = sag_ball_load@attribute = real_amt.@floatendObjectObject@name = sag_control@class = restriction_category@attribute = current_restriction.exists, lost_current_shift.@double, lost_last_shift.@double,percent_accumulated_losses.@float, real_accumulated_losses.@double, restriction.exists,total_lost_current_shift.@doubleendObjectObject@name = sag_hydro@class = process_var@attribute = agrees_with.setpoint, controller_name.string, deviation.@float,diff_amt_pred.large, diff_amt_pred.medium, diff_amt_pred.small,diff_amt_pred.@float, hi_limit_real.@float, hi_limit_target.float,is_approaching_tosetpoint, is_close_to.setpoint, pred_amt.high,pred_amt.low, pred_amt.medium, pred_amt.setpoint,pred_amt.@float, pred_amt_old.@float, pred_amt_ss@float,pred_amt_status.string, pred_dyn.constant, pred_dyn.decreasing,pred_dyn.increasing, pred_dyn.float, pred_dyn_status.string,qmodel_ss.string, rate_of_change.float, real_amthigh,real amt.low, real_amt.medium, real_amt.positive,, real_amt.@float, real_aint_max.@float,real amt min.@float, real_amt_old.@float, real_amt_status string,real_average.@float, real_dyn.constant, real_dyn.decreasing,real_dyn.increasing, real_dyn.@float, real_dyn_status.string,real_setpoint.@float, std_amt.@float, std_setpoint.@float,time_constant.@fioat, time_s_state.@floatendObjectObject@name = sag_mill@class = mill@attribute = model_name.string, status.running, status.was_nlnning,status.@floatendObjectObject@name = sag_power@attribute = amps_amt.@float, model_parameter.@float, real_amt.@float,real setpoint.@floatendObjectObject@name = sag_shut_down@class = restriction_category181@attribute = current_restriction.exists, lost_current_shift.@double, lost_last_shift.@double,percent_accumulatedjosses.@float, real_accumulated_losses.@double, restriction.existsendObjectObject@name = sag_speed@class = process_var@attribute = agrees_with.setpoint, controller_name.@string, deviation.@float,diff_amt_pred.large, diff_amt_pred.medium, diff_amt_pred.small,diff_amt_pred.@float, is_approaching_to.setpoint, is_close_to.setpoint,pred_amt.high, pred_amt. low, pred_amt.medium,pred_amt.setpoint, pred_amt.@float, pred_amt_old.@float,pred_amt_ss.@float, pred_amt_status.@string, pred_dyn.constant,pred_dyn.decreasing, pred_dyn.increasing, pred_dyn.@float,pred_dyn_status.string, qmodel_ss.string, rate_of_change.float,real_amt.high, real_amt.Iow, real_amt.medium,real_amt.positive,, real_amt.@float,real_amt_max.@float, real_amt_min.@float, real_amt_old.@float,real_amt_status.@string, real_average.float, real_dyn.constant,real_dyn.decreasing, real_dyn. increasing, real_dyn.@float,rea1_dyn_status.string, real_setpoint.@float, std_amt.@float,std_setpoint.@float, time_constant.@float, time_s_state.@floatendObjectObject@name = sag_water@attribute = real_amt.@floatendObjectObject@name = sag_water_ratio@attribute = real_amt.@floatendObjectObject@name = soft_ore@class = restriction_category@attribute = current_restriction.exists, lost_current_shift.@double, lost_Iast_shift.@double,percent_accumulated_losses.@float, real_accumulated_losses.@double, restriction.exists,total_lost_current_shift.@doubleendObjectObject@name = start@attribute = simulation.yesendObjectObject@name = stop@attribute simulation.yesendObjectObject@name system@attribute = already.configuredendObjectObject@name = SystemClock@attribute = sty1e_5.stringendObject182Object@name = tail_boxi@attribute = level.high, real_amt.@floatendObjectObject@name = tail_box2@attribute level.high, real_amt.@floatendObjectObject@name = tailings@class = restriction_category@attribute = current_restriction.exists, lost_current_shift.@double, lost_last_shift.@double,percent_accumulated_losses.@float, real_accumulatedjosses.@double, restriction.exists,total lost_current_shift@doubleendObjectObject@name = timex@attribute = current_timex.@time, elapsed.@float, elapsed_old.@float,elapsed_time.@float, last_sampling.instant, sampling.©float,sampling_time.float, since_last_sampling.integer, sleep.@float,timex.@stringendObjectObject@name = water_ratio@attribute = pred_amt@float, real_amt.@floatendObjectProcedure@name QM_simulator_coordinator@do=RUN_PROCEDURE ( “convert all measurements”)RUN_PROCEDURE ( “run_model_ss”)RUN_PROCEDURE (“run_model_dyn”)RUN_PROCEDURE ( “obtain_predicted_dynamics’)RUN_PROCEDURE (“rotate_all_predictions”)MACRO ( “qual_status*”)endProcedureProcedure@name = amps_deviation@do =sag_amps.deviation.float = sag_amps.real_setpoint.float - sag_amps.real_amt.floatendProcedureProcedure@name = is “ball_mill_I”FREERULE ( $Rule, “check_equip_status*”)MACRO ( “check_equip_status*”) is “ball_mill_2”FR.EERULE ( $Rule, “check_equip_status*”)MACRO (“check_equip_status*”)dunimy.equipmentstring is ‘feederl”FREERULE ( $Rule, “check_equip_status*’)MACRO (‘check_equip_status*”) is “feeder5”FREERULE ( $Rule, “check_equip_status*”)MACRO ( “check_equip_status*”)endProcedureProcedure@name = check ifeed_controller@do =STRCOPY ( dummy.process_var.string, “fresh_feed”)FREERULE ( $Rule, “check controllers*”)MACRO ( “check_controllers_*”)MACRO (“check_controller_ifeed”)endProcedureProcedure@name = choose_ball_mills@do=dummy.new_cause.@string is “ball_mills”FREERULE ( $Rule, “choose_one_cause”)MACRO (“choose_one_cause”)endProcedureProcedure@name choose_bm_pumps@do =dummy.new_cause.@string is “bm_pumps”FREERULE ( $Rule, “choose_one_cause”)MACRO (“choose_one_cause”)endProcedureProcedure@name choose_feeders@dodummy.new_cause.@string is “feeders”FREERULE ( $Rule, “choose_one_cause”)MACRO (“choose_one_cause”)endProcedureProcedure@name choose_flotation@do =dummy.new_cause.string is “flotation”FREERULE ( $Rule, “choose_one_cause”)MACRO (“choose_one_cause”)endProcedureProcedure@name choose_other@dodummy.new_cause.string is “other”FREERULE ( $Rule, “choose_one_cause”)MACRO ( “choose_one_cause”)endProcedureProcedure@name = choose_plugged_chutes@dodummy.new_cause.string is “plugged_chutes”FREERULE ( $Rule, “choose_one_cause”)MACRO (“choose_one_cause”)endProcedure184Procedure@name = choose_sag_control@do =dummy.new_cause.@string is “sag_control’FREERULE ( $Rule, “choose_one_cause”)MACRO ( “choose_one_cause”)endProcedureProcedure@name = choose_sagJiners@do=dummy.new_cause.@string is “sag_liners”FREERULE ( $Rule, “choose_one_cause”)MACRO ( “choose_one_cause”)endProcedureProcedure@name = choose_soft_ore@dodummy.new_cause.string is “soft_ore”FREERULE ( $Rule, “choose_one_cause”)MACRO (“choose_one_cause”)endProcedureProcedure@name = choose tailings@do =dummy.new_cause.string is “tailings”FREERULE ( $Rule, “choose_one_cause”)MACRO ( “choose_one_cause”)endProcedureProcedure@name = coarse_ratio_prediction@dofeeder_set.coarse_contribution.integer = feederl .contribution.integer + feeder5.contribution.integerfeeder_set.fine_contribution.integer = feeder2.contribution.@integer + feeder3 .contribution.integer +feeder4.contribution.integercoarse_ratio.pred_amt.@float = 100.000000 * feeder_set.coarse_contribution.integer I (feeder_set.coarse_contribution.integer + feeder_set.fine_contribution.@integer)endProcedureProcedure@name = controller_name@do =?all_vars = CLASSTOLIST (“process_var”)ALL ( ?all_vars.controller_name.string is”)fresh_feed.controller_name.@string is “ifeed_controller”endProcedureProcedure@naine = convert_all_measurements@do =STRCOPY ( dummy.convert.@string, “fresh_feed”)RUN_PROCEDURE (“convert_real_var”)STRCOPY ( dummy.convert.string, “sag_amps’)RUN_PROCEDURE (“convert_real_var”)endProcedureProcedure185@name = convert_all_setpoints@do =STRCOPY (dummy.convert.@string, “fresh_feed”)RUN_PROCEDURE ( “convert_setpoints”)endProcedureProcedure@name = convert_real_var@do=<dummy.convert.string>.std_amt.float = ( <dummy.convert.string>.rea1_amt.float -<dummy.convert.string>.rea1_amt_min.float ) / ( <dummy.convert.string>.rea1_amt_max.float -<dummy.convert.string>.rea1_amt_min.float ) * 100endProcedureProcedure@name = convert_setpoints@do =<dummy.convert.string>.std_setpoint.float = ( <dummy.convert.string>.rea1_setpoint.float -<dummy.convert.string>.real_amt_min.float ) / ( <dummy.convert.string>.rea1_amt_max.float -<dummy.convert.string>.rea1_amt_min.float ) * 100endProcedureProcedure@name = determine rr causes@do?current_rr = ANY ( {restriction id}.restriction.exists is TRUE)ALL ( MACRO ( ?current_rr.restriction_name.string))endProcedureProcedure@name = disable accumulate_current_rr@dorr_any.do_not_accumulate.tonnage_current_rr is TRUErr_adjustment. ignore_tonnage.correction is TRUEiss_user.accumulate_current_rr.give_warning is TRUETEXT ( “USER: DISABLE tonnage accumulation for current restriction.”, “if-user”)TEXT ( “USER: DISABLE tonnage accumulation for current restriction.”, “restrictions”)endProcedureProcedure@name = disable accumulation tons lost@dorr_any.stop_accumulating.tonnage_Iost is TRUEiss_user.accumulate_tonnage_lost.give_warning is TRUETEXT ( “USER: DISABLE mechanism for accumulation of tonnage lost”, “rr-user”)TEXT (“USER: DISABLE mechanism for accumulation of tonnage lost”, “restrictions”)endProcedureProcedure@name = disable_correct_tonnage_lost@do =rr_adjustment.do_not_correct.tonnage_lost is TRUEiss_user.do_not_correct.give_warning is TRUETEXT (“USER: DISABLE correction of tonnage lost estimated.”, “rr-user”)TEXT (“USER: DISABLE correction of tonnage lost estimated.”, “restrictions”)endProcedureProcedure@name = disable_current_rr@dorr_any.do_not_accumulate.tonnage_current_rr is TRUE186iss_user.accumulate_current_rr.give_warning is TRUEendProcedureProcedure@name = dynamics_predicted@do =<dummy.var.@string>.pred_dyn.@float = RATEOFCHANGE (<dummy.var.@string>.pred_amt.@float , 0,<dummy.var.@string>.rate_of_change.@float ) * 60endProcedureProcedure@name = dynamics_real@do<dummy.var.@string>.real_dyn.@float = RATEOFCHANGE ( <dummy.var.string>.real_amt.@float , 0,<dummy.var.string>.rate_of_change.float ) * 60endProcedureProcedure@name = enable_accumulate_current_if@do =rr_any.do_not_accumulate.tonnage_current_rr is FALSErr_adjustment.ignore_tonnage.correction is FALSEiss_user.accumulate_current_rr.give_waming is TRUETEXT (“USER: ENABLE tonnage accumulation for current restriction. “, “rr-user”)TEXT ( “USER: ENABLE tonnage accumulation for current restriction.”, “restrictions”)endProcedureProcedure@name = enable_accumulation_tons_lost@do =rr_any.stop_accumulating.tonnage_lost is FALSEiss_user.accumulate_tonnage_lost.give_warning is TRUETEXT (“USER: ENABLE mechanisms for accumulation of tonnage lost.”, “rr-user”)TEXT (“USER: ENABLE mechanisms for accumulation of tonnage lost.”, “restricitons”)endProcedureProcedure@name = enable_correct_tonnage_lost@dorr_adjustment.do_not_correct.tonnage_lost is FALSEiss_user.do_not_correct.give_warning is TRUETEXT (“USER: ENABLE correction of tonnage lost estimated.”, “rr-user”)TEXT (“USER: ENABLE correction of tonnage lost estimated.”, “restrictions”)endProcedureProcedure@name = end_of_shift@doend.of. shift is TRUEendProcedureProcedure@name = initial_equipment_status@doball_mill_i .status.@float =ball_mill_2.status.@float = Isag_mill.status.float = 1chutes.status.plugged is FALSEPUTPOINTDATA (“ball_mill_i .status.@float”, ball_mill_l .status.@float , 100)PUTPOINTDATA ( “ball_mill_2.status.@float”, ball_mill_2.status.@float , 100)PUTPOINTDATA ( “sag_mill.status.float”, sag_mill.status.float , 100)187TEXT (“initializing equipment again .... “, “developer”)endProcedureProcedure@name = initial_feeder_status@do =feederl.status.@float = 1feeder2.status.@float = 1feeder3.status.@float = 1feeder4.status.@float = 1feeder5.status.@float = 1coarse_ratio.real_setpoint.@float = 2.000000 I 5.000000 * 100PUTPOINTDATA ( “feederl .status.@float”, feederl .status.@float , 100)PUTPOINTDATA ( “feeder2.status.@float”, feeder2.status.@float , 100)PUTPOINTDATA ( “feeder3.status.@float”, feeder3.status.@float , 100)PUTPOINTDATA ( “feeder4.status.@float”, feeder4.status.@float , 100)PUTPOINTDATA ( “feeder5.status.@float”, feeder5.status.@float , 100)endProcedureProcedure@name = initial_values@do =end.of. shift is FALSEtimex.sampling_time.float =30timex.last_sampling.instant is TRUERUN_PROCEDURE (“initialize_variables”)RUN_PROCEDURE (“initialize_models”)RUN_PROCEDURE ( “initialize_rr_categories”)RUN_PROCEDURE (“initialize_restrictions”)RUN_PROCEDURE (“initialize_tonnage_adjustment”)RUN_PROCEDURE ( “initialize_user_settings”)RUN_PROCEDURE ( “x_initial_equipment_status”)RUN_PROCEDURE ( “x_initial_feeder_status”)RUN_PROCEDURE ( “mss_sag_speed_definition”)endProcedureProcedure@name = initialize_models@dosag_power.model_pararneter.@float = 1750.000000 I 6300.000000sag_mill.model_name.string is “mss_sag_power”sag_amps.qm_param_original.float = 6300.000000 / 1750.000000sag_amps.time_constant.float = 30.000000endProcedureProcedure@name initialize_restrictions@do =?restriction = CLASSTOLIST (“restriction_id”)ALL ( ?restriction.restriction.initialized is FALSE)ALL ( ?restriction.restriction.existed is FALSE)ALL ( ?restriction.possible_cause.determined is FALSE)ALL ( ?restriction.restriction.detected is FALSE)ALL ( ?restriction.restriction.exists is FALSE)ALL ( ?restriction.time_elapsed.@float = 0.000000)ALL ( ?restriction.lost_current_rr.@double = 0.000000)ALL ( ?restriction.lost_current_shift.@double = 0.000000)ALL ( ?restriction.lost_last_shift.@double = 0.000000)ALL ( ?restriction.real_accumulated_losses.@double = 0.000000)rr_adjustment.maximum_time.float = 2400.000000rr_adjustment.final_tonnage. in_progress is FALSE188rr_adjustment.final_tonnage.was_in_progress is FALSErr_all.time_tons_average.float = 2400.000000rr_all.time_rr_exists.@float = 600.000000rr_all.real_accumulated_losses.@double = 0.000000rrall.totallost_last_shift.@double = 0.000000rr_any.restriction.existed is FALSErr_any.restriction.exists is FALSErr_any.first_restriction.appeared is FALSErr_any.last_restriction.disappeared is TRUErr_any.do_not_accumulate.tonnage_current_rr is FALSErr_any.stop_accumulating.tonnage_lost is FALSErr_any.minimum_time_to_estimate.@float = 600.000000rr_any.time_no_exists_restriction.@float = 600.000000rr_any.accumulate_losses.rr_sag_stops is FALSErr_speed.restriction.ignore is FALSErr_speed.restriction.detected_past_sampling is FALSErr_speed.restriction.has_been_identified is FALSErr_speed.time_elapsed.@float = 0.000000endProcedureProcedure@name = initialize_if_categories@do=?category = CLASSTOLIST ( ‘restriction_categoiy”)ALL ( ?category.current_restriction.exists is FALSE)ALL ( ?category.lost_current_shift.@double = 0.000000)ALL ( ?category.lost_last_shift.@double = 0.000000)ALL ( ?category.rea1_accumulated_1osses.doub1e = 0.000000)categoiy_all.user_chose.new_cause is FALSEendProcedureProcedure@name = initialize_tonnage_adjustment@do =rr_adjustment.restriction_1 .string isrr_adjustment.cause_1 .@string isrr_adjustment.time_elapsed_l .@float = 0.000000rr_adjustment.do_not_correct.tonnage_lost is FALSErr_adjustment.did_not_correct.tonnagejost is FALSErr_adjustment.ignore_tonnage.correction is FALSEendProcedureProcedure@name = initialize_user_settings@do =iss_user.do_not_correct.give_warning is FALSEiss_user.accumulate_current_rr.give_warning is FALSEiss_user.accumulate_tonnagejost.give_warning is FALSEendProcedureProcedure@name initialize_variables@do =RUN_PROCEDURE ( “max_mm_values’)sag_speed.real_amt.float = 75fresh_feed.real_amt.@float = 1500fresh feed.real_setpoint.@float = 1500fresh_feed.rate_of_change.@float = 3600fresh_feed.hi_Iimit_target.(float = 2000fresh_feed.hi_limit_real.@float = 2000fresh_feed.controller_mode.cascade is TRUE189sag_power.rea1amt.float = 6300sag_power.real_setpoint.float = 6600water_ratio.real_amt.@float = 0.650000hi_tons.target_hi_limit.@float = 2000hi_tons_in.realamt.@float = 1500hi_tons_out.realamt.@float = 1500level_tai1ing_box.real_amt.float = 2endProcedureProcedure@name = max_mm_values@do =fresh_feed.realamt_min.@float =0fresh_feed.real_amt_max.@float = 2000sag_amps.real_amt_min.@float =0sag_amps.reaI_amt_max.float = 7000endProcedureProcedure@name = mss_sag_power@do =fresh_feed.pred_amt.@float = fresh_feed.real_amt.@float + (sag_amps.reaI_setpoint.float -sag_amps.rea1_amt.float ) * sag_power.model_parameter.floatendProcedureProcedure@name mss_sag_speed_definition@do =mss_sag_speed.input_l.float = 65.000000mss_sag_speed.outputj.@float = 900.000000mss_sag_speed.input_m.@float = 77.000000mss_sag_speed.output_m.float = 100.000000mss_sag_speed.input_h.float = 79.000000mss_sag_speed.output_h.float = 0.000000endProcedureProcedure@name = mss_sag_speed_run@do =dummy.model_name.@string is “mss_sag_speed”mss_sag_speed.input.@double = sag_speed.rea_amt.floatMACRO ( “qmss_table3”)fresh_feed.predamt.@float fresh_feed.real_amt.@float + mss_sag_speed.output.doubleTEXT ( “I’m here in MSS_SAG_SPEED_RUN “, “developer”)endProcedureProcedure@name = obtain_predicted_dynamics@doSTRCOPY ( dummy.var.string,”)RUN_PROCEDURE ( “dynamics_predicted’)endProcedureProcedure@name = obtain_real_dynamics@do=STRCOPY ( dummy.var.string, “fresh_feed”)RUN_PROCEDURE ( “dynamics_real”)endProcedureProcedure190@name = qm_amps@dodummy.expo.@double = EXP ( - timex.sampIing.float I sag_amps.time_constant.@float )sag_amps.pred_amt_ss.@float = sag_amps.qm_paraml .@float * fresh_feed.real_amt.@floatsag_amps.pred_amt.float = sag_amps.pred_amt_o1d.float * dummy.expo.@double + (1 - dummy.expo.@double )* sag_amps.pred_amt_ss.floatsag_amps.pred_amt_o1d.float = sag_amps.pred_amt.floatendProcedureProcedure@name = qm_dyn_first@do =qm_dyn_first.dummy.doubIe EXP ( - timex.samp1ing.float / qm_dyn_first.time_constant.float )qm_dyn_first.output.@double = qm_dyn_first.output_oId.doub1e * qm_dyn_first.dummy.doub1e + (1 -qm_dyn_first.dummy.doub1e ) * qm_dyn_first.output_ss.doub1eendProcedureProcedure@name = qmss_table3_high@dodummy.model_slope.@double (<dummy.model_name.@string>.output_h.@float -<dummy.mode1_name.@string>.output_m.float ) / ( <dummy.model_name.@string>.input_h.@float -<dummy.mode1_naine.string>.input_m.float )<dummy.modeI_name.string>.output.doub1e = ( <dummy.modeI_name.string>.inputdoub1e -<dummy.mode1_name@string>.input_m.@float ) * dummy.model_slope.@double +<dummy.mode1_name.string>.output_m.floatendProcedureProcedure@name = qmss_table3_low@dodummy.model_slope.@double = ( <dummy.model_name.@string>.output_m.@float -<dummy.mode1_name.string>.output_1.float ) / ( <dummy.model_name.@string>.input_m.@float -<dummy.mode1_name.string>.input_1.float )<dummy.modeI_name.string>.output.doub1e = ( <dummy.model name.string>.input.doub1e -<dummy.mode1_name.@string>.input_1.float ) * dummy.model slope.@double +<dummy.modeI_name.string>.output_1.floatendProcedureProcedure@name = reconfiguration@do =runx.simulation.again is FALSEtimex.elapsed.@float = 0endProcedureProcedure@name = read_data@do =RUN_PROCEDURE ( “x_read_variables’)RUN_PROCEDURE ( “x_read_feeder_status”)RUN_PROCEDURE ( “x_read_equipment_status”)RUN PROCEDURE ( “amps_deviation”)sag_amps.rea1_average.float = TIMEAVERAGE ( sag_amps.rea1_anit.float , 0, 3600)fresh_feed.reaI_average.float = TIMEAVERAGE (fresh_feed.real_amt.@float , 0, 3600)MACRO ( “feeders_all_running*”)MACRO ( “check_chutes*”)MACRO ( ‘check_equip_status*”)endProcedureProcedure191@name = read_data_coordinator@do =timex.current_timex.(time is $Current_timeRUN_PROCEDURE ( “read_data’)RUN_PROCEDURE ( “convert_all_measurements’)RUN_PROCEDURE ( “convert_all_setpoints”)RUN_PROCEDURE ( “obtain_real_dynamics”)MACRO ( “controller_deviation”)MACRO ( “variables_high*”)endProcedureProcedure@name = read_feeder_status@do =GETPOINTDATA ( “feeder I .status.running”)GETPOINTDATA ( “feeder2.status.running”)GETPOINTDATA ( “feeder3.status.running”)GETPOINTDATA ( “feeder4.status.running”)GETPOINTDATA ( “feeder5.status.running”)endProcedureProcedure@name = read_variables@do =GETPOINTDATA ( “fresh_feed.real_amt.@f’)GETPOINTDATA ( “fresh_feed.real_setpoint.@f”)GETPOINTDATA ( “water_ratio.real_amt.@float”)endProcedureProcedure@name = reasoning_coordinator@do =analyze.simulation.results is TRUEanalyze.simulation.results is FALSEendProcedureProcedure@name = rotate_all_predictions@do =STRCOPY ( dummy.rotate.string, “)RUN_PROCEDURE (“rotate_predicted_var”)endProcedureProcedure@name = rotate_predicted_var@do =<dummy.rotate.string>.pred_amt_old.float = <dummy.rotate.@string>.pred_amt.@floatendProcedureProcedure@name = run_model_dyn@do=RUN_PROCEDURE (“)endProcedureProcedure@name = run_model_ss@do =RUN_PROCEDURE (“)endProcedure192Procedure@name = simulation_parameters@dotimex.sampling.@float = 5timex.sleep.@float = 1.000000endProcedureProcedure@name start_simulation@do =runx.simulation.again is TRUEPUTPOINTDATA ( “runx.simulation.again”, 100)endProcedureProcedure@name = stop_simulation@dorunx.simulation.again is FALSEPUTPOINTDATA ( “runx.simulation.again”, 0)endProcedureProcedure@name = system_initialization@do =timex.sampling.@float 60RUN_PROCEDURE (“controller name”RUN_PROCEDURE ( “max_mm_values”)RUN_PROCEDURE (“initial_values”)endProcedureProcedure@name = update_database@doDONOTHENG ()endProcedureProcedure@name = update_timetimex.currenttimex.@time is $Current_timeendProcedureProcedure@name = write db coordinator@do =RUN_PROCEDURE (“write_variables”)RUN_PROCEDURE (“write_feeder_status”)RUN_PROCEDURE (“write_mill_status”)endProcedureProcedure@name = write feeder status@doPUTPOINTDATA ( “feederl .status.@float”, feederl .status.@float , 100)PUTPOINTDATA ( “feeder2.status.@float”, feeder2.status.@float , 100)PUTPOINTDATA ( “feeder3.status.@float”, feeder3.status.@float ,100)PUTPOINTDATA ( “feeder4.status.@float’, feeder4.status@float , 100)PUTPOINTDATA ( “feeder5.status.@float’, feeder5.status.@float , 100)endProcedureProcedure193@name = write_mill_status@do =PUTPOINTDATA (“ball_mill_I .status.@float”, ball_mill_i .status.@float , 100)PUTPOINTDATA ( “ball_mill_2.status.@float”, baIl_mill_2.status.@float , 100)PUTPOINTDATA ( “sag milLstatus.@float”, sag_milI.status.@float , 100)endProcedureProcedure@name = write_variables@doPUTPOINTDATA ( “fresh_feed.real_amt.@float”, fresh_feed.real_amt.@float , 100)PUTPOINTDATA ( “fresh_feed.real_setpoint.@float”, fresh_feed.real_setpoint.@float , 100)PUTPOINTDATA ( “water_ratio.real_amt.@float”, water_ratio.real_amt.@float , 100)endProcedureRestriction@name = zero@constraint = $OAV > 0.000100endRestrictionIfchange@name = equipment_status@objectinherit = is OBJ ( $OAV)FREERULE ( $Rule, “equipment_running_l”)MACRO (“equipment_running_I”)endlfchangeIfchange@nanIe = max_certainty@objectinherit = ASNCERTAINTY ( SOAV, 100)endIfchangeIfchange@name = rr_dep_timing@obJectinherit = STRCOPY (rr_any.current_restriction.@string, OBJ ( $OAV))FREERULE ( $Rule, “timing_rr_*”)MACRO ( “timing_rr_dep”)MACRO ( “timing_rr_dep_elapsed”)MACRO ( “timing_rr_final”)endlfchangeIfchange@name = if_feeder_down_existsobjectinherit = STRCOPY ( rr_any.current_restriction.string, “rr_feeder_down”)MACRO ( “timing_rr_indep”)MACRO ( “timing_if_elapsed”)MACRO ( “timing_rr_final”)endlfchangeIfchange@name = rrffeed_cut_exists@objectinherit = STRCOPY ( rr_any.current_restriction.string, “rr_ffeed_cut”)MACRO ( “timing_rr_indep”)MACRO (“timing_if_elapsed”)MACRO (“timing_if_final”)endifchangeIfchange@name = rrffeed limit_exists@objectinherit = STRCOPY ( rr_any.current_restriction.@string, “rr_fl’eed_limit”)FREERULE ( $Rule, “timing_rr_*”)194MACRO ( “timing_rr_dep”)MACRO ( “timing_rr_elapsed”)MACRO ( “timing_rr_final”)endlfchangeIfchange@name rr_indep_timing@objectinherit STRCOPY ( rr_any.current_restriction.string, OBJ ( $OAV))FREERULE ( $Rule, “timing_rr_*”)MACRO ( “timing_rr_indep”)MACRO ( “timing_rr_indep_elapsed”)MACRO ( “timing_rr_final”)endlfehangeIfchange@name = rr_ore_supply_exists@objectinherit = STRCOPY ( rr_any.current_restriction.string, “rr_ore_supply”)MACRO ( “timing_rr_indep”)MACRO (“timing_rr_elapsed”)MACRO (“timing_n_final”)endlfchangeIfchange@name = rr_sag_stops_existsobjectinherit = STRCOPY ( rr_any.current_restriction.@string, “rr_sag_stops”)MACRO ( “timing_rr_indep”)MACRO ( “timing_rr_elapsed”)MACRO ( “timing_n_final”)endlfchangeJfchange@name = rr_soft_ore_exists@objectinherit = STRCOPY ( rr_any.current_restriction.string, “rr_soft_ore”)MACRO ( “timing_rr_dep”)MACRO ( “timing_rr_elapsed”)MACRO ( “timing_rr_final”)endlfchangeIfchange@name = n_speed_detectedobjectinherit = STRCOPY ( rr_any.current_restriction.@string, OBJ ( $OAV))MACRO ( “timing_rr_speed”)MACRO (‘timing_n_elapsed”)MACRO ( “timing_rr_speed_final”)endlfchangeIfchange@name n_speed_timing@objectinherit = n_any.current_restriction.string is OBJ ( $OAV)FREERULE ( $Rule, “timing_rr_speed_*”)MACRO (“timing_n_speed”)MACRO (“timing_n_speed_elapsed”)MACRO ( “timing_n_speed_final”)endlfchangeIfchange@nanle = IT_water_ratio_exists@objectinherit = STRCOPY ( rr_any.current_restriction.string, “n_water_ratio”)MACRO ( “timing_n_indep”)MACRO (“timing_n_elapsed”)MACRO ( “timing_n_final”)195endlfchangeIfchange@name = set time_constantobjectinherit = OBJ ( $0AV)<>.timeconstant.float = $OAV / 4endlfchangeIfchange@name = set_time_s_state@objectinherit = = OBJ ( $OAV)<>.time_s_state.float = $OAV * 4endlfchangeFuzzy@name = agrees_with_ifeed@source = fresh_feed.deviation.@floatgrange 3@value = 0.000000, 4.000000, 100.000000@rank = 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = close_to_ifeed@source = fresh_feed.deviation.@floatgrange = 5@value = 0.000000, 2.000000, 5.000000, 11.000000, 100.000000@rank 0.000000, 50.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = constant ifeed@source = fresh_feed.real_dyn.@floatgrange 5@value = -100.000000, -5.000000, 0.000000, 5.000000, 100.000000@rank = 0.000000, 0.000000, 100.000000, 0.000000, 0.000000endFuzzyFuzzy@name = decreasing_ifeed@source = fresh_feed.real_dyn.@floatgrange = 4@value = -100.000000, -5.000000, 5.000000, 100.000000@rank = 100.000000, 50.000000, 0.000000, 0.000000endFuzzyFuzzy@name = increasing_ifeedsource = fresh_feed.real_dyn.@floatrange 4@value = -100.000000, -5.000000, 5.000000, 100.000000@rank = 0.000000, 0.000000, 50.000000, 100.000000endFuzzyFuzzy@name = level_tailings_high@source = leveI_tailing_box.real_amt.floatrange 3@value = 0.000000, 1.500000, 2.000000@rank = 0.000000, 100.000000, 100.000000endFuzzy196Fuzzy@name = positive_fresh_feed@source = fresh_feed.std_amt.@floatrange =3@value = 0.000000, 2.500000, 100.000000@rank = 0.000000, 50.000000, 100.000000endFuzzyFuzzy@name = positive_sag_speed@source = sag_speed.rea1_amt.float@range 3@vaiue = 0.000000, 2.500000, 100.000000@rank = 0.000000, 50.000000, 100.000000endFuzzyFuzzy@name = tail_box 1_high@source = tail_box 1 .real_amt.@floatrange = 3@value = 0.000000, 14.000000, 15.000000@rank = 0.000000, 50.000000, 100.000000endFuzzyFuzzy@name = tail_box2_high@source = tail_box2.real_amt.@floatgrange = 3@value = 0.000000, 14.000000, 15.000000@rank = 0.000000, 50.000000, 100.000000endFuzzyFuzzy@nalne = zero_fresh_feed@source = fresh feed.std amt.@float@range 4@vaiue = 0.000000, 2.500000, 5.000000, 100.000000@rank = 100.000000, 50.000000, 0.000000, 0.000000endFuzzyFuzzy@name = zero_sag_speed@source = sag_speed.real_amt.floatgrange = 4@value 0.000000, 2.500000, 5.000000, 100.000000@rank = 100.000000, 50.000000, 0.000000, 0.000000endFuzzyRule@name = accumulate_adjusted_IIF rr_any.stop_accumulating.tonnagejost is FALSETHEN dummy.losses.@double = <rr_any.current_restriction.string>.1ost_current_shift.doub1eTHEN <rr_any.current_restriction.string>.lost_current_shift.double = dumiuy.losses.@double +rradjustment.correctiontonsaccumulated.@doubleTHEN dummy. losses.@double = <rr_any.current_restriction.string>.rea1_accumu1ated_1osses.doubleTHEN <rr_any.current_restriction.string>.real_accumulated_losses.@doub1e = dummy.losses.@double +rr_adjustment.correction_tons_accumulated.@doubleTHEN MACRO (“accumulate_losses_il”)THEN TEXT (“here in accum adjusted I”, “developer”)THEN TEXT ( “ current rr: !S rr_any.current_restriction.@s $!‘, “developer”)197THEN TEXT ( “ lost_curr_shift: !$ <rr_any.current_restriction.@s>.lost_current_shift.@db $!“, “developer”)THEN TEXT ( “real_accum_losses: !$ <rr_any.current_restriction.@s>.real_accumulated_losses.@db $! “,“developer”)THEN TEXT ( “adjustment: !$ rr_adjustment.correction_tons_accumulated.@db $! “,“developer”)ELSE IGNORE ( $Rule, “accumulate adjusted*”)endRuleRule@name = accumulate_adjusted 2IF TRUETHEN dummy.losses.@double = <category_any.current_category.@string>.lost_current_shift.doubleTHEN <category_any.current_category.string>.Iost_current_shift.double = dummy.losses.@double +rr_adjustment.correction_tons_accumulated.@doubleTHEN dunlmy.losses.@double = <category_any.current_category.string>.rea1accumulated_losses.doubleTHEN <category_any.current_category.string>.real_accumulated_Iosses.double = dummy.losses.@double +rradjustment.correctiontonsaccumulated.@doubleTHEN FREERULE ( $Rule, “accumulate_losses*”)THEN MACRO (“accumulate losses 21”)THEN MACRO ( “accumulate_losses_3*”)THEN TEXT ( “accum adjusted 2...”, “developer’)endRuleRule@name = accumulate_losses_0@comment = “called from RR TIMING FINAL”IF rr_any.stop_accumulating.tonnage_lostOR rr_any.do_not_accumulate.tonnage_current_rrTHEN <rr_any.current_restriction.@string>.lost_current_rr.@double = 0.000000THEN MACRO (“accumulate losses 4” )THEN IGNORE ( $Rule, “accumulate_losses*”)endRuleRule@name = accumulate_losses_I@comment = “called from RR TIMING FiNAL’IF <rr_any.current_restriction.string>.time_elapsed.float >= rr_any.minimum_tiine_to_estimate.floatTHEN dummy.losses.@double = <rr_any.current_restriction.string>.lost_current_shift.doubleTHEN <rr_any.current_restriction.string>. lost_current_shift.@double = dummy.losses.@double +<rr_any.current_restriction.string>.lost_current_rr.doubleTHEN dummy. losses.@double = <rr_any.current_restriction.string>.real_accumulated_losses.doubleTHEN <rr_any.current_restriction.string>.real_accumulated_losses.double = dummy.losses.@double +<rr_any.current_restriction.string>. lost_current_rr.@doubleELSE <rr_any.current_restriction.@string>.lost_current_rr.@double = 0.000000ELSE TEXT ( “the restriction ‘!$ rr_any.current_restriction.s$!’ has been ignored: Not long enough! “,‘restrictions”)ELSE rr_adjustment.ignore_tonnage.correction is TRUEELSE IGNORE ( $Rule, “accumulate_Iosses*”)endRuleRule@name accumulate_losses_li@comment = “called from RR TIMING FINAL”IF rr_any.accumulate_losses.rr_sag_stopsTHEN lost current shift.@double = CLASSTOTAL ( {restriction_id}.lost current shilt@double )THEN rrall.real accumulated losses.@double = CLASSTOTAL ( {restriction Id) real accumulated losses.@double )ELSE lost current_shift.@double = CLASSTOTAL ( {restriction_id} .lost_current_shifi.@double ) -rr_sag_stops.lost_current_shifLdoubleELSE rrall.real accumulated losses.@double = CLASSTOTAL ( {restriction_id}.real accumulated losses.@double ) -rr_sag_stops.real_accumulated_losses.@doubleendRuleRule@name = accumulatejosses_2198IF ?causex = ANY ( {restriction_category).current_restriction.exists is TRUE)THEN category_any.current_category.string is LISTFIRSTOBJECT ( ?causex)THEN dummy.string.string is LISTALLOBJECT ( ?causex,”,”)THEN TEXT (“End of restriction !$ rr_any.current_restriction.@s $! -- causes.. !$ dummy.string.s $! ...“, “developer”)THEN dummy.Iosses.@double = <category_any.current_category.string>.lost_current_shiftdoubleTHEN <category_any.current_category.string>.Iost_current_shift.double = dummy.losses.@double +<rr_any.current_restriction.string>.lost_current_rr.doubleTHEN dummy.losses.@double = <categoiy_any.current_categoiy.string>.real_accumulated_losses.doub1eTHEN <category_any.current_category.string>.real_accumulated_losses.double = duminy.losses.@double +<rr_any.current_restriction.string>.lost_current_rr.doubleTHEN <rr_any.current_restriction.string>.lost_current_rr.double = 0.000000endRuleRule@name = accumulate_losses_21IF rr_any.accumulate_losses.rr_sag_stopsTHEN category_all.total_Iost_current_shift.@double = CLASSTOTAL ({restriction_category).lost_current_shift.double )THEN category_all.real_accumulated_losses.double = CLASSTOTAL ({restriction_categoiy) .real_accumulated_losses.@double )ELSE category_all.total_lost_current_shift.@double = CLASSTOTAL ( {restriction_category}.lost_current_shift.double) - sag_shut_down.lost_current_shifLdoubIeELSE category_all.real_accumulated_losses.double = CLASSTOTAL(restriction category) .real_accumulated_losses.@double ) - sag_shut_down.rea1_accumulated_losses.doubleendRuleRule@name = accumulate_losses_3IF ?category_x = CLASSTOLIST (“restriction_category”)THEN ALL ( ?category_x.percent_accumulated_losses.float = ?category_x.real_accumulated_losses.double Icategory_alLreal_accumulated_losses.@double * 100.000000)endRuleRule@name = accumulate_losses_3 1IF rr_any.accumulate_losses.rr_sag_stopsTHEN category_aIl.percent_accumulated_losses.float = CLASSTOTAL ((restriction_category) .percent_accumulated_losses.@float )ELSE category_all.percent_accumuIated_losses.float = CLASSTOTAL ({restriction_category) .percent_accumulated_losses.@float ) - sag_shut_down.percent_accumulated_losses.floatendRuleRule@name = accumulate_losses_4@comment = “needed when no restriction exists (the cuases has not been set to false)”IF ?restrictionx = ANY ( {restriction_id).restriction.exists is TRUE)THEN DONOTHING ()ELSE <category_any.current_category.string>.current_restriction.exists is FALSEendRuleRule@name = amps_model_0IF fresh_feed.real_average.@float > 1200THEN sag_amps.qm_paraml .@float = sag_amps.real_average.@float I fresh_feed.real_average.floatELSE sag_amps.qm_paraml .@float = sag_amps.qm_param_original.floatendRuleRule@name = amps_model_IIF TRUETHEN RUN_PROCEDURE ( “qmamps”)199endRuleRule@name = cause_rr_feeder_down_OIF rr_feeder_down.possible_cause.determined is FALSEI’HEN MACRO ( “initialize_causes*”)THEN rr_feeder_down.possible_cause.feeders is FALSETHEN rr_feeder_down.possible_cause.plugged_chutes is FALSEELSE IGNORE ( $Rule, “cause_rr_feeder_down*”)endRuleRule@name = cause_rr_feeder_down_lIF chutesstatus.pluggedTHEN rr_feeder_down.possible_cause.plugged_chutes is TRUETHEN plugged_chutes.current_restriction.exists is TRUETHEN rr_feeder_down.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘if_feeder_down’ is: Plugged chutes”, “if-cause”)THEN TEXT (“Possible cause of restriction ‘if_feeder_down’ is: Plugged chutes”, “restrictions”)THEN IGNORE ( $Rule, “cause_rr_feeder_down*”)endRuleRule@name = causerrfeederdown2IF TRUETHEN rr_feeder_down.possible_cause.feeders is TRUETHEN feeders.current_restriction.exists is TRUETHEN rr_feeder_down.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘rr_feeder_down’ is: Feeder problems”, “if-cause”)THEN TEXT (“Possible cause of restriction ‘rr_feeder_down’ is: Feeder problems”, “restrictions”)endRuleRule@name cause rrffeedcutOIF rr_ffeed_cut.possible_cause.determined is FALSETHEN MACRO ( “initialize_causes*”)THEN rr_ffeed_cut.possible_cause.ball_mills is FALSETHEN rr_ffeed_cut.possible_cause.bm_pumps is FALSETHEN rr_ffeed_cut.possible_cause.sag_control is FALSETHEN rr_ffeed_cut.possible_cause.other is FALSEELSE IGNORE ( $Rule, “cause_rr_ffeed_cut*”)endRuleRule@name = cause_rr_ffeed_cut_lIF ball_mill_I .status.running is FALSEOR ball_mill_2.status.nmning is FALSETHEN rr_ffeed_cut.possible_cause.ball_mills is TRUETHEN rr_ffeed_cut.possible_cause.bm_pumps is TRUETHEN ball_mills.current restriction.exists is TRUETHEN rr_ffeed_cut.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘rr_ffeed_cut’ is: Ball Mills or BM pumps”, “if-cause”THEN TEXT ( “Possible cause of restriction ‘rr_ffeed_cut’ is: Ball Mills or BM pumps”, “restrictions”)THEN IGNORE ($Rule, “cause_rr_ffeed_cut*”)endRuleRule@name cause_rr_ffeed_cut_2IF ball_mill_I.status.running is TRUEAND ball_mill_2.status.running is TRUETHEN rr_ffeed_cut.possible_cause.sag_control is TRUE200THEN sag_control.current_restriction.exists is TRUETHEN rr_ffeed_cut.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘rr_ffeed_cut’ is: SAG Mill controls”, “if-cause”)THEN TEXT (“Possible cause of restriction ‘rr_ffeed_cut’ is: SAG Mill controls”, “restrictions”)THEN IGNORE ( $Rule, “cause_rr_ffeed_cut*”)endRuleRule@name = cause_rr_ffeed_cut_3IF rr_ffeed_cut.possible_cause.determinecl is FALSETHEN rr_ffeed_cut.possible_cause.other is TRUETHEN other.current restriction.exists is TRUETHEN rr_ffeed_cut.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘rr_ffeed_cut’ is: Another problem”, “if-cause”)THEN TEXT (“Possible cause of restriction ‘rr_ffeed_cut’ is: Another problem”, “restrictions”endRuleRule@name = cause_rr_fl’eed_limit_OIF rr_ffeedjimit.possible_cause.determined is FALSETHEN MACRO ( “initialize_causes*”)THEN rr_ffeed_limit.possible_cause.ball_mills is FALSETHEN rr_ffeed_limit.possible_cause.bm_pumps is FALSETHEN rr_ffeed_limit.possible_cause.tailings is FALSETHEN rr_ffeed_Iimit.possible_cause.other is FALSEELSE IGNORE ( $Rule, “cause_rr_ffeed_limit*”)endRuleRule@name = cause_rr_fi’eed_limit_IIF ball_mill_I .status.running is FALSEOR ball_mill_2.status.running is FALSETHEN rr_ffeed_limit.possible_cause.ball_mills is TRUETHEN rr_ffeed_limit.possible_cause.bm_pumps is TRUETHEN ball mills.current restriction.exists is TRUETHEN rr_ffeed_limit.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘rr_ffeed_limit’ is: Ball Mills or BM pumps”, “if-cause”)THEN TEXT (“Possible cause of restriction ‘rr_ffeed_limit’ is: Ball Mills or BM pumps”, “restrictions”)THEN IGNORE ( $Rule, “cause_rr_ffeed_limit*”)endRuleRule@name = cause_if_ffeed_limit_2IF ball_mill_i .status.runningAND ball_mill_2.status.runningAND (tail_boxi.level.high I tail_box2.level.high)THEN rrffeed_limit.possible_cause.tailings is TRUETHEN tailings.current_restriction.exists is TRUETHEN rr_ffeed_limit.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘rr_ffeed_limit’ is: Level of tailings box”, “n—cause”)THEN TEXT (“Possible cause of restriction ‘rr_ffeed_limit’ is: Level of tailings box”, “restrictions”)THEN IGNORE ( $Rule, “cause_rr_ffeed_limit*”)endRuleRule@name = cause_rr_fl’eed_limit_3IF TRUETHEN rr_fl’eed_limit.possible_cause.other is TRUETHEN other.current_restriction.exists is TRUETHEN rr_ffeed_limit.possible_cause.determined is TRUETHEN TEXT ( “Possible cause of restriction ‘rr_ffeed_limit’ is: Another problem”, “if-cause”)201THEN TEXT ( “Possible cause of restriction ‘rr_ffeed_limit’ is: Another problem”, “restrictions”)endRuleRule@name = cause_rr_ore_supply_OIF rr_ore_supply.possible_cause.determined is FALSETHEN MACRO ( “initialize_causes*”)THEN rr_ore_supply.possible_cause.plugged_chutes is FALSETHEN rr_ore_supply.possible_cause.feeders is FALSETHEN rr_ore_supply.possible_cause.other is FALSEELSE IGNORE ( $Rule, “cause_rr_ore_supply*”)endRuleRule@name = cause_rr_ore_supply_lIF chutes.status.pluggedTHEN rr_ore_supply.possible_cause.plugged_chutes is TRUETHEN plugged_chutes.current_restriction.exists is TRUETHEN rr_ore_supply.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘rr_ore_supply’ is: Chutes are plugged”, “rr-cause”)THEN TEXT (“Possible cause of restriction ‘rr_ore_supply’ is: Chutes are plugged”, “restrictions”)THEN IGNORE ( $Rule, “cause_rr_ore_supply*”)endRuleRule@name = cause_rr_ore_supply_2IF feeder_set.status_all.running is FALSEAND chutes.status.plugged is FALSETHEN rr_ore_supply.possible_cause.feeders is TRUETHEN feeders.current_restriction.exists is TRUETHEN rr_ore_supply.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘if_ore_supply’ is: Feeder problems”, “rr-cause”)THEN TEXT (“Possible cause of restriction ‘rr_ore_supply’ is: Feeder problems”, “restrictions”)THEN IGNORE ( $Rule, “cause_rr_ore_supply*”)endRuleRule@name = cause_rr_ore_supply_3IF TRUETHEN rr_ore_supply.possible_cause.other is TRUETHEN other.current_restriction.exists is TRUETHEN rr_ore_supply.possible_cause.determined is TRUETHEN TEXT (“Possible cause of restriction ‘if_ore_supply is: Another problem”, “if-cause”)THEN TEXT (“Possible cause of restriction ‘if_ore_supply’ is: Another problem”, “restrictions”)endRuleRule@name cause_IT_sag_stops_IIF rr_sag_stops.possible_cause.determined is FALSETHEN MACRO (‘hinitialize_causes*”)THEN rr_sag_stops.possible_cause.sag_shut_down is TRUETHEN sag_shut_down.current_restriction.exists is TRUETHEN rr_sag_stops.possible_cause.determined is TRUETHEN TEXT (“ SAG Mill SHUT DOWN”, “restrictions”)endRuleRule@name cause_if_soft_ore_IIF rr_soft_ore.possible_cause.detenmned is FALSETHEN MACRO ( “initialize_causes*”)THEN rr_soft_ore.possible_cause.soft_ore is TRUE202THEN soft ore.current_restriction.exists is TRUETHEN rr_soft_ore.possible_cause.determined is TRUETHEN TEXT ( “Possible cause of restriction ‘rr_soft_ore is: Soft Ore”, “rr-cäuse” )THEN TEXT ( “Possible cause of restriction ‘rr_soft_ore’ is: Soft Ore”, “restrictions”)endRuleRule@name = cause_rr_water_ratio_IIF rr_water_ratio.possible_cause.determined is FALSETHEN rr_water_ratio.possible_cause.sag_control is TRUETHEN rr_water_ratio.possible_cause.determined is TRUETFIEN TEXT (“Possible cause of restriction ‘rr_water_ratio’ is: SAG Mill controls”, “rr-cause”)THEN TEXT (“Possible cause of restriction ‘rr_water_ratio’ is: SAG Mill controls”, “restrictions”)endRuleRule@name = check_chutesIF ?chutex = ANY ( {feeder}.status_chute.plugged)OR chute_feed.status_chute.pluggedOR chute_conveyor. status_chute.pluggedTHEN chutes.status.plugged is TRUEELSE chutes.status.plugged is FALSEendRuleRule@name = check_control ler_ifeedIF fresh_feed.real_amt.@float <fresh_feed.real_setpoint.@floatAND fresh_feed.follows.setpoint is FALSETHEN fresh_feed.controller.meets_demand is FALSEELSE fresh feecl.controller.meets_demand is TRUEendRuleRule@name check_controllers_IIF <dummy.process_var.string>.real_setpoint.float > <dummy.process_var.string>.real_amt.floatAND <dummy.process_var.string>.real_dyn.increasingTHEN <dummy.process_var.@string>.is_approaching_to.setpoint is TRUEELSE <dummy.process_var.@string>.is_approaching_to.setpoint is FALSEendRuleRule@name = check_controllers_2IF <dummy.process_var.string>.real_setpoint.float <<dummy.process_var.string>.real_amt.floatAND <dummy.process_var.string>.real_dyn.decreasingTHEN <dummy.process_var.@string>.is_approaching_to.setpoint is TRUEELSE <dummy.process_var.@string>.is_approaching_to.setpoint is FALSEendRuleRule@name = check_controllers_3IF <dummy.process_var.string>.agrees_with.setpointOR <dummy.process_var.string>. is_close_to.setpointOR <dummy.process_var.string>. is_approaching_to.setpointTHEN <dummy.process_var.string>.follows.setpoint is TRUEELSE <dummy.process_var.string>.follows.setpoint is FALSEendRuleRule@name = check_equip_status_IIF feederl.status.rtinning is FALSEAND feederl .status.was_running203THEN TEXT (“ Feeder-I stopped ...“, “warning”)THEN TEXT (“ Feeder-I STOPPED ...“, “restrictions”)endRuleRule@name = check_equip_status_ 10IF feeder5.status.runningAND feeder5.status.was running is FALSETHEN TEXT (“ Feeder-5 STARTED again ...“, “warning”)THEN TEXT (“ Feeder-5 STARTED again ...“, “restrictions”)endRuleRule@name = check_equip_status_I 1IF sag_miIl.status.running is FALSEAND sag_mill.status.was_runningTHEN TEXT (“ SAG MILL SHUT-DOWN ...“, “warning”)THEN TEXT (“ SAG MILL SHUT-DOWN ...“, “restrictions”)endRuleRule@name = check_equip_status_l2IF sag_mill.status.runningAND sag_mill.status.was_running is FALSETHEN TEXT (“ SAG MILL STARTED AGAIN ...“, “warning”)THEN TEXT (“ SAG MILL STARTED AGAIN ...“, “restrictions”)endRuleRule@name = check_equip_status_I 3IF ball_mill_I.status.running is FALSEAND ball_mill_l .status.was_runningTHEN TEXT (“ BALL MILL I SHUT-DOWN ...“, ‘warning”)THEN TEXT ( “ BALL MiLL I SHUT-DOWN ...“, “restrictions”)endRuleRule@name = check_equip_status_14IF baIl_mill_2.status.running is FALSEAND baIl_mill_2.status.was_runningTHEN TEXT (“ BALL MILL 2 SHUT-DOWN ...“, “warning”)THEN TEXT (“ BALL MILL 2 SHUT-DOWN ...“, “restrictions”)endRuleRule@name = check_equip_status_15IF ball_mill_l.status.runningAND ball_mill_I .status.was_running is FALSETHEN TEXT (“ BALL MILL 1 STARTED AGAIN ...“, “warning”)THEN TEXT (“ BALL MILL I STARTED AGAIN ...“, “restrictions”)endRuleRule@name = check_equip_status_16IF ball_mill_2.status.runningAND ball_mill_2.status.was_running is FALSETHEN TEXT (“ BALL MILL 2 STARTED AGAIN ...“, “warning”)THEN TEXT (“ BALL MILL 2 STARTED AGAIN ...“, “restrictions”)endRuleRule204@name = check_equip_status_2IF feeder2.status.running is FALSEAND feeder2.status.was runningTHEN TEXT (“ ... Feeder-2 stopped ...“, “warning”)THEN TEXT (“ ... Feeder-2 STOPPED ...“, “restrictions”)endRuleRule@name = check_equip_status_3IF feeder3.status.running is FALSEAND feeder3.status.was_runningTHEN TEXT (“ ... Feeder-3 stopped ...“, “warning”)THEN TEXT ( “ ... Feeder-3 STOPPED ...“, “restrictions”)endRuleRule@name = check_equip_status_4IF feeder4.status.running is FALSEAND feeder4.status.was_runningTHEN TEXT (“ ... Feeder-4 stopped ...“, “warning”)THEN TEXT (“ ... Feeder-4 STOPPED ...“, “restrictions”)endRuleRule@name = check_equip_status_5IF feeder5.status.running is FALSEAND feeder5.status.was_runningTHEN TEXT (“ ... Feeder-5 stopped ...“, “warning”)THEN TEXT (“ ... Feeder-5 STOPPED ...“, “restrictions”)endRuleRule@name = check_equip_status_6IF feeder 1 .status.runningAND feeder 1 .status.was_running is FALSETHEN TEXT (“ ... Feeder-i STARTED again ...“, “warning”)THEN TEXT (“ ... Feeder- 1 STARTED again ...“, “restrictions”)endRuleRule@name = check_equip_status_7IF feeder2.status.runningAND feeder2.status.was_running is FALSETHEN TEXT (“ ... Feeder-2 STARTED again , “warning”)THEN TEXT (“ ... Feeder-2 STARTED again ...“, “restrictions”)endRuleRule@name = check_equip_status_8IF feeder3.status.runningAND feeder3.status.was_running is FALSETHEN TEXT (“ ... Feeder-3 STARTED again ...“, “warning”)THEN TEXT (“ ... Feeder-3 STARTED again ...“, “restrictions”)endRuleRule@name = check_equip_status_9IF feeder4.status.runningAND feeder4.status.was_running is FALSETHEN TEXT (“ ... Feeder-4 STARTED again ...“, “warning”)THEN TEXT (“ ... Feeder-4 STARTED again ...“, “restrictions”)205endRuleRule@name choose_one_causeIF rr_any.restriction.existsAND rr_any.do_not_accumulate.tonnage_current_rr is FALSEAND rr_any.stop_accumulating.tonnage_Iost is FALSETHEN ?causex = CLASSTOLIST ( “restriction_category’)THEN ALL ( ?causex.current_restriction.exists is FALSE)THEN <dummy.new_cause.string>.current_restriction.exists is TRUETHEN TEXT ( “USER: New cause for current restriction - !$ dummy.new_cause.@s $!“, “rr-user”)THEN TEXT ( “USER: New cause for current restriction - !$ dummy.new_cause.@s $!“, “restrictions”)THEN category_all.user_chose.new_cause is TRUEendRuleRule@name = choose_one_cause_2@comment = “I’m not sure about the usefulness of this ruleIF categoty_all.user_chose.new_causeTHEN ?causex = CLASSTOLIST ( “restriction_category”)THEN dummy.new_cause.string is LISTALLOBJECT ( ?causex,””,””)THEN TEXT ( “Possible cause of restriction ‘rr_water_ratio’ is: SAG Mill controls’, ‘rr-cause”)THEN TEXT (“Possible cause of restriction ‘rr_water_ratio’ is: SAG Mill controls”, “restrictions”)THEN TEXT (“User has chosen a new cause for the current restriction - NEW CAUSE: !$ dummy.new_cause.@s S!’. “rrcause”)THEN TEXT ( “User has chosen a new cause for the current restriction - NEW CAUSE: !$ dummy.new_cause.@s 5!”,“restrictions” )THEN category_all.user_chose.new_cause is FALSEendRuleRule@name = controller_deviationIF ?p_var = ANY ( STRLEN ( {process_var}.controller_name.@string)> 0)THEN ALL ((process var}.deviation.@float = ABS ( {process_var).std_setpoint.@float -{process_var}.stdamt.@float ))endRuleRule@name = detectrrfeeder_down_lIF feeder2.status.running is FALSEOR feeder3.status.running is FALSEOR feeder4.status.running is FALSETHEN rr_feeder_down.restriction.detected is TRUEELSE rr_feeder down.restriction.detected is FALSEendRuleRule@name = detect rr_ffeed_cut_lIF fresh_feed.has_been.cutTHEN rr_ffeed cut.restriction.detected is TRUEELSE rr_ffeed cut.restriction.detected is FALSEendRuleRule@name = detect_rr_ffeed_limit_OIF fresh_feed.controller_mode.cascade is FALSETHEN rr_ffeed_limit.restriction.detected is TRUEELSE rr_ffeed Iimit.restriction.detected is FALSEendRuleRule206@name = detect_rr_ffeed_limit_1IF TRUETHEN dummy.difference.@float = fresh_feed.hi_limit_real.@float - fresh_feed.real_setpoint.@floatendRuleRule@name = detect_rr_ffeed_limit_2IF dummy.difference.@float <= 1.000000AND fresh feed.hi_limit_real.@float <fresh_feed.hi_1imit_target.floatTHEN rr_ffeed limit.restriction.detected is TRUEELSE rr ifeed limit.restriction.detected is FALSEendRuleRule@name = detect_rr_ore_supply_1IF fresh_feed.controller.meets_demand is FALSEAND sag_miIl.status.runningTHEN rr_ore_supply.restriction.detected is TRUEELSE rr_ore_supply.restriction.detected is FALSEendRuleRule@name = detect_rr_sag_stops_iIF sag_mill.status.running is FALSETHEN rr_sag_stops.restriction.detected is TRUEELSE rr_sag_stops.restriction.detected is FALSEendRuleRule@name = detect rr soft oreIF fresh_feed.realsetpoint.@float > fresh feed.hi_limit_real.@floatAND fresh feed.hi_limit_real.@float > fresh_feed.hi_limit_target.floatTHEN rr_soft_ore.restriction.detected is TRUEELSE rr_soft_ore.restriction.detected is FALSEendRuleRule@name = detect_rr_speed_lIF hi_tons in.real_amt.@float > hi tons out.real_arnt.@floatTHEN rr_speed.restriction.detected is TRUEELSE rr speed.restriction.detected is FALSEendRuleRule@name = detect_if_water_ratio_IIF water_ratio.realamt.@float <water_ratio.pred_amt.@floatTHEN rr_water ratio.restriction.detected is TRUEELSE rr_water_ratio.restriction.detected is FALSEendRuleRule@name = determine_if_causes_iIF ?currentrr = ANY ( {restriction_id}.restriction.exists is TRUE)THEN ALL ( MACRO ( STRCONCAT ( “cause_”, STRCONCAT ( OBJ ( ?current_rr.restriction.exists), _*))))endRuleRule@name determinerrcauses2IF ?categoryx = ANY ( (restriction_category}.current_restriction.exists is TRUE)THEN category_all.current_restriction.@string is LISTFIRSTOBJECT ( ?categoryx)ELSE category_all.current_restriction.string is ‘none”207endRuleRule@name = determine_rr_exists_lIF TRUETHEN MACRO ( “exists_rr_sag_stops*”)THEN MACRO ( “exists_rr_ffeed_cut*”)THEN MACRO ( “exists_rr_ore_supply*”)THEN MACRO ( “exists_rr_ffeedlimit*”)THEN MACRO ( “exists_rr_soft_ore*”)THEN MACRO ( “exists_rr_feeder_down*”)THEN MACRO ( “exists_any_restriction”)THEN MACRO ( “exists_rr_any_2*”)THEN MACRO ( “exists_rr_timing*”)THEN MACRO ( “follow_up_begin_rr*”)THEN MACRO ( “exists_rr_any_3*”)endRuleRule@name = determine_tonnage_differenceIF fresh_feed.pred_amt.@float > fresh feed.real_amt.@floatTHEN fresh_feed.tonnage_difference.float = fresh_feed.pred_amt.@float - fresh_feed. real_amt.@floatELSE fresh_feed.tonnage_difference.@float = 0endRuleRule@name = donot_accumulate_current_rrIF rr_any.do_not_accumulate.tonnage_current_rrAND iss_user.accumulate_current_rr.give_warningTHEN TEXT (“USER: Do not accumulate tonnage lost in current restriction”, “if-user’)THEN TEXT (“USER: Do not accumulate tonnage lost in current restriction”, “restrictions”)THEN iss_user.accumulate_current_rr.give_warning is FALSEendRuleRule@name do_not_accumulate_tons_lost_IIF rr_any.stop_accumulating.tonnage_lostAND iss_user.accumulate_tonnage_lost.give_wamingTHEN TEXT (“USER: Do not accumulate tonnage lost.”, “rr-user”)THEN TEXT (“USER: Do not accumulate tonnage lost.”, “restrictions”)THEN iss_user.accumulate_tonnage_lost.give_warning is FALSEendRuleRule@name = do not accumulate_tons lost 2IF rr_any.stop_accumulating.tonnage_lost is FALSEAND iss_user.accumulate_tonnage_lost.give_warningTHEN TEXT (“USER: Continue accumulating tonnage lost.”, “rr-user”)THEN TEXT (“USER: Continue accumulating tonnage lost.”, “restrictions”)THEN iss_user.accumulate_tonnage_lost.give_warning is FALSEendRuleRule@name = do_not_correct_tons_lIF rr_adjustment.do_not_correct.tonnage_lostAND iss_user.do_not_correct.give_warningTHEN TEXT ( “USER: DISABLE algorithm to adjust tonnage estimated in each restriction.”, ‘rr-user”)THEN TEXT (“USER: DISABLE algorithm to adjust tonnage estimated in each restriction.”, “restrictions”)THEN iss_user.do_not_correct.give_warning is FALSEendRule208Rule@name = do_not_correct_tons_2IF rr_adjustment.do_not_correct.tonnage_lost is FALSEAND iss_user.do_not_correct.give_warningTHEN TEXT ( “USER: ENABLE algorithm to adjust tonnage estimated in each restriction.”, “rr-user’)TFIEN TEXT ( “USER: ENABLE algorithm to adjust tonnage estimated in each restriction.”, “restrictions”)THEN iss_user.do_not_correct.give_waming is FALSEendRuleRule@name end_of_shift_OIF end.of.shift is FALSETHEN IGNORE ( $Rule, “end_of_shift*”)ELSE end.of.shift is FALSEendRuleRule@name = end_of_shift_iIF ?restrictionx = ANY ( (restriction id}.restriction.exists is TRUE)THEN rr_any.current_restriction.@string is LISTFIRSTOBJECT ( ?restrictionx)THEN dummy.string.string is LISTALLOBJECT ( ?restrictionx, “‘, ““)THEN FREERULE ( $Rule, “accumulate_losses*”)THEN MACRO ( “accumulate_losses*’)THEN <rr_any.current_restriction.@string>.lost_last_shift.double =<rr_any.current_restriction.string>.Iost_current_shift.@doubleTHEN rr_all.total_lost_Iast_shift.@double rr_alI.total_lost_current_shift.@doubleendRuleRule@name end_of_shifi_2IF ?restrictionx = CLASSTOLIST ( “restriction_id”)THEN ALL ( ?restrictionx.lost last shift.@double = ?restrictionx.lost current shift@double )THEN rr_all.total_lost_last shift.@double = lost current shift.@doubieTHEN ALL ( ?restrictionx.lost_current shift.@double = 0)THEN rr_alI.total_lost_current_shifi@double = 0endRuleRule@name = end of shift 3IF ?categoryx = CLASSTOLIST (‘restriction_category”)THEN ALL ( ?categoryx.lost_last_shift.@double = ?categoryx.lost_current_shift.@double )THEN category_all.total_lost_last_shilt@double = category_al1.totaI_lost_current_shift.doubleTHEN ALL ( ?categoiyx.lost_current_shift.@double =0)THEN category_all.total_lost_current_shift.@double =0endRuleRule@name = end_of_shift_4IF TRUETHEN TEXT ( “ “, “restrictions” )THEN TEXT ( EN D 0 F S H I F T “restrictions” )THEN TEXT ( “i’ “, “restrictions”THEN TEXT ( “ TOTAL TONNAGE LOST ACCUMULATED TO-DATE: !$ rr_all.real_accumulatedlosses.@db $!Tons. “, “restrictions” )TFIEN TEXT ( “ “, “restrictions” )THEN TEXT ( “* TOTAL TONNAGE LOST LAST DURING PAST SHIFT: !$ rr_all.total_lost_last_shift.@db $! Tons.“,“restrictions” )THEN TEXT ( “ “, “restrictions” )THEN TEXT ( “* RE S T RI CT! ON “, “restrictions”THEN TEXT ( “* SAG not running: !$ rr_sag_stops.lost_Iast_shift.db $! Tons. “, “restrictions”)THEN TEXT ( “* Feed was cut: !$ rr ifeed cut.lost last shift.@db $! Tons. “, “restrictions”)209THEN TEXT ( “ Feeder down: !$ rr feeder down.lost last shift.@db $! Tons. “, “restrictions”)THEN TEXT ( “p Ore Supply: !$ rr_ore_supply.lost_last_shift.db $! Tons. “, ‘restrictions”)THEN TEXT ( “ Restricted feed: !$ rr_ffeed_limit.lost_last_shift.@db $! Tons. “, “restrictions”)1’HEN TEXT ( “i’ Soft Ore: !$ rr soft ore.lost_Iast_shift.@db $! Tons. “, “restrictions”)TI-lEN TEXT ( “ “, “restrictions”THEN TEXT ( “* CA T E GO R Y “, “restrictions”)THEN TEXT ( “* Soft Ore: !$ soft ore.lost_last_shift.@db $! Tons. “, “restrictions”)THEN TEXT ( “* Plugged chutes: !$ plugged_chutes.1ost_last_shift.db S Tons. ‘, “restrictions”)THEN TEXT ( “* SAG mill control : !$ sag_control.lost_last_shift.db $! Tons. “, “restrictions”)THEN TEXT ( “ Ball mills : !$ ball_mills.lost_last_shift.@db $! Tons. “, “restrictions”THEN TEXT ( “ BM pumps: !$ bm_pumps.lost_last_shift.db $! Tons. “, “restrictions’)THEN TEXT ( “* Flotation : !$ flotation.lost last shift.@db $! Tons. “, “restrictions”THEN TEXT ( “* Tailings : !$ tailings.lost_last_shift.db $! Tons. “, “restrictions”)THEN TEXT ( “ Feeders: !$ feeders.lost_last_shift.@db $! Tons. ‘, ‘restrictions”)THEN TEXT ( “ Other: !$ other.lost_last_shift.@db $! Tons. ‘, ‘restrictions”THEN TEXT ( “p “, “restrictions” )THEN TEXT ( “***************** EN D OF S H I FT **********“, “restrictions” )THEN TEXT ( “ “, “restrictions” )endRuleRule@name = estimate_init_tonnage_OIF rr_any.restriction.existedTHEN IGNORE ($Rule, “estimate_init_tonnage*”)endRuleRule@name = estimate_mit_tonnage_IIF rr_any.current_restriction.string is_not “soft_ore”THEN rrany.timelastrrdisappeared.@float = AGE ( rr_any.last_restriction.disappeared)THEN rr_any.time_first_rr_appeared.@float = AGE ( rr_any.first_restriction.appeared)THEN rr_any.begin_average.float = rr_all.time_tons_average.floatTHEN rr_any.end_average.®float = timex.sampling_time.floatELSE GOTO ( “estimate_init_tonnage_4”)endRuleRule@name = estimate_init_tonnage_2IF rr_any.time last rr_disappeared.@float <rr_any.begin_average.floatTI-lEN rr_any.begin_average.float = rr_any.time_last_rr_disappeared.@floatendRuleRule@name = estimate_init_tonnage_3IF rr_any.begin_average.@float > rr_any.end_average.floatTHEN fresh_feed.pred_amt.@float = TIMEAVERAGE ( fresh_feed.real_amt.@float ,rr_any.end_average.floatrr_any.begin_average.@float )endRuleRule@name = estimate_init_tonnage_4IF TRUETHEN rr_adjustment.initial_tonnage.float = fresh_feed.pred_amt.@floatTHEN rr_adjustment.pred_tonnage_during_rr.float = fresh_feed.pred_amt.@floatendRuleRule@name = exists_any_restrictionIF ?any_rr = ANY ( {restriction_id).restriction.exists is TRUE)THEN rr_any.restriction.exists is TRUEELSE rr_any.restriction.exists is FALSE210ELSE fresh_feed.pred_amt.@float = fresh_feed.real_amt.@floatendRuleRule@name = exists_rr_any_2IF rr_any.restriction.existed is FALSEAND rr_any.restriction.existsAND rr_any.first_restriction.appeared is FALSETHEN rr_any.firstjestriction.appeared is TRUETHEN IGNORE ( $Rule, “exists_rr_any_21”)endRuleRule@name = exists_rr_any_2 1IF rr_any.restriction.existed is FALSEAND rr_any.restriction.existsAND rr_any.first_restrietion.appeared is TRUETHEN rr_any.first_restriction.appeared is FALSEendRuleRule@name = exists_rrany3IF rr_any.restriction.existedAND rr_any.restriction.exists is FALSEAND rr_any.Iast_restriction.disappeared is FALSETHEN rr_any.last_restriction.disappeared is TRUETHEN IGNORE ( $Rule, “exists_rr_any_3 1”)endRuleRule@name = existsjr_any_3 1IF rr_any.restriction.existedAND rr_any.restriction.exists is FALSEAND rr_any.Iast_restriction.disappearedTHEN rr_any.last_restriction.disappeared is FALSEendRuleRule@name = exists_rr_feeder_downj@priorit’ = 7IF rrfeeder_down.restriction.detectedAND rr_sag_stops.restriction.detected is FALSEAND rr_ffeed_eut.restriction.detected is FALSEAND rr_ore_supply.restriction.detected is FALSEAND rr_soft_ore.restriction.detected is FALSEAND rrffeed_limit.restrietion.detected is FALSETHEN rr_feeder_down.restriction.exists is TRUEELSE rr_feeder_down.restriction.exists is FALSEendRuleRule@name = exists_rr_feeder_down_2@priorit3’ 7IF rr_feeder_down.restriction.exists is FALSEAND rr_feeder_down.restriction.existedTHEN rr_any.current_restriction.@string is “rr_feeder_down”THEN FREERULE ( $RuIe, ‘timing_rr_finaP’)THEN MACRO ( “timing_rr_finaP)endRuleRule211@name = exists_rr_ffeed_cut_ I@priority = 8IF rr_ffeed_cut.restriction.cletectedAND rr_sag_stops.restriction.detected is FALSETHEN rr_ffeed_cut.restriction.exists is TRUEELSE rr_ffeed_cut.restriction.exists is FALSEendRuleRule@name = exists_rr_ffeed_cut_2@priority = 8IF rr_ffeed_cut.restriction.exists is FALSEAND rr_ffeed_cut.restriction.existedTHEN rr_any.current_restriction.string is “rr_ffeed_cut”THEN FREERULE ( $Rule, “timing_rr_final”)THEN MACRO ( “timing rr final”)endRuleRule@name = exists_rr_ffeed_limit_lIF rr_ffeedjimit.restriction.detectedAND rr_sag_stops.restriction.exists is FALSEAND rr_ffeed_cut.restriction.exists is FALSEAND rr_ore_suppiy.restriction.exists is FALSETHEN rr_ffeed_iimit.restriction.exists is TRUEELSE rr ffeed_iimit.restriction.exists is FALSEendRuleRule@name = exists_rr_ffeed_limit_3IF rr_ffeed_limit.restriction.exists is FALSEAND rr_ffeed_limit.restriction.existedTHEN rr_any.current_restriction.string is “rr_ffeed_limit”THEN FREERULE ( $Rule, “timing_if_final”)THEN MACRO ( “timing_rr_final”)endRuleRule@name = exists_rr_ore_supply_l@priorit’ =6IF rr_ore_supply.restrietion.deteetedAND rr_sag_stops.restriction.detected is FALSEAND rr_ffeed_cut.restriction.exists is FALSETHEN rr_ore_supply.restriction.exists is TRUEELSE rr_ore_supply.restriction.exists is FALSEendRuleRule@name = exists_rr_ore_supply_2@priorit’ = 6IF rr_ore_suppiy.restriction.exists is FALSEAND rr_ore_supply.restriction.existedTHEN rr_any.current_restriction.@string is “if_ore_supply”THEN FREERULE ( $Rule, “timing_rr_final”)THEN MACRO ( “timing_rr_final”)endRuleRule@name = exists_if_sag_stops_i@priority 9IF rr_sag_stops.restriction.detected212THEN rr_sag_stops.restriction.exists is TRUEELSE rr_sag_stops.restriction.exists is FALSEendRuleRule@name = exists_rr_sag_stops_2@priority 9IF rr_sag_stops.restriction.detected is FALSEAND rr_sag_stops.restriction.existedTHEN rr_any.current_restriction.string is “rr_sag_stops”THEN FREERULE ( $Rule, “timing_rr_final’)THEN MACRO ( “timing_rr_final”)endRuleRule@name = exists_rr_soft_ore_IIF rrsoftore.restriction.detectedAND rr_sag_stops.restriction.detected is FALSEAND rr_ffeed cut.restriction.exists is FALSEAND rr_ore_supply.restriction.exists is FALSEAND sag_amps.deviation.float > 30.000000THEN rr_soft_ore.restriction.exists is TRUEELSE rr_soft_ore.restriction.exists is FALSEendRuleRule@name exists_rr_soft_ore_3IF rr_soft_ore.restriction.exists is FALSEAND rr_soft_ore.restriction.existedTHEN rr_any.current_restriction.@string is “if_soft_ore’THEN FREERULE ( $Rule, “timing_rr_finaP’)THEN MACRO ( “timing_if_final”)endRuleRule@name = exists_if_timing_I@comment = ‘called from determine_exists_if”IF ?restrictionx = ANY ( {restriction_id}.restriction.exists is TRUE)THEN MACRO ( “tonnage_final_aborted*’)THEN rr_any.current_restriction.string is LISTFIRSTOBJECT ( ?restrictionx)ELSE IGNORE ( $Rule, “exists_rr_timing*’)endRuleRule@nare = exists_rr_timing_2IF rr_any.current_restriction.string is “rr_soft_ore”THEN FREERULE ( $Rule, “timing_rr_*”)THEN MACRO ( “timing_rr_indep”)THEN RUN_PROCEDURE ( sag_miH.model_name.string)THEN MACRO ( “timing_rr_indep_elapsed”)ELSE FREERULE ( $Rule, ‘timing_rr_*”)ELSE MACRO ( ‘timing_rr_indep*”)endRuleRule@nIe exists rr water ratio@priorit’ 10IF rr_waterratio.restriction.detectedTHEN rr_water_ratio.restriction.exists is TRUETHEN rr_any.current_restriction.@string is “if_water_ratio”THEN FREERULE ( $Rule, “timing_rr_*”)213THEN MACRO ( “timing_rr_indep*”)ELSE rr water_ratio.restriction.exists is FALSEendRuleRule@name = exists_rr_water_ratio_2@priority = 10IF rr_water_ratio.restriction.detected is FALSEAND rr_water_ratio.restriction.existed‘fl-lEN rr_any.current_restriction.string is “rr_water_ratio”THEN FREERULE ( $Rule, “timing_rr_final”)THEN MACRO ( “timing rrfinal”)endRuleRule@name = feeders_all_runningIF ?feeder = ANY ( {feeder}.status.running is FALSE)THEN feeder_set.status_all.running is FALSEELSE feeder_set.status_all.running is TRUEendRuleRule@name = follow_up_begin_rr_0IF rr_any.restriction.existsAND rr_any.restriction.existed is FALSETHEN DONOTHING ()ELSE IGNORE ( $Rule, ‘follow_up_begin_rr*”)endRuleRule@name = follow_up_begin_if_i@comment = “Instantiated in rule DETERMINE EXISTS RR”IF TRUETHEN rr_adjustment.final_tonnage.in_progress is FALSETHEN rr_adjustment.number_of_rr.integer = 0THEN rr_adjustment. initial_tonnage.@float = fresh_feed.pred_amt.@floatTHEN rr_adjustment.pred_tonnage_during_rr.float = fresh_feed.pred_amt.@floatTHEN rr_adjustment.final_tonnage.float = fresh_feed.pred_amt.@floatTHEN rr_adjustment.time_elapsed_total.@float = 0.000000THEN rr_adjustment.final_tonnage. in_progress is FALSETHEN rr_adjustment.ignore_tonnage.correction is FALSETHEN rr_any.do_not_accumulate.tonnage_current_rr is FALSETHEN TEXT ( “ follow up begin ....“, “developer”)endRuleRule@name = follow_up_begin_rr_2@comment “Instantiated in rule DETERMINE EXISTS RR”IF rr_any.time_last_rr_disappeared.@float <rr_any.time_no_exists_restriction.@floatTHEN rr_adjustment.ignore_tonnage.correction is TRUETHEN TEXT (“ADJUSTMENT current restriction IGNORED....”, “developer”)THEN TEXT (“ADJUSTMENT current restriction IGNORED....”, “restrictions”)endRuleRule@name = follow_up_end_if_i@comment = “Instantiated from TIME_FINAL”IF rr_any.current_restriction.string is “if_soft_ore”OR rr_any.current_restriction.@string is “rr_sag_stops”THEN rr_adjustment.ignore_tonnage.correction is TRUETHEN IGNORE ( SRule, “follow_up_end_rr*”)214endRuleRule@name = follow_up_end_rr_2@comnent = “Instantiated from TIME_FINAL”IF rr_adjustment. ignore_tonnage, correction is FALSETHEN rr_acIjustment.number_of_rr.integer= rr_adjustment.number_of_rr.integer + 1THEN rr adjustment.\restriction \<rr adjustment.number_of_rr.integer>.string is rr_any.current_restriction.@stringTHEN rr_adjustment.\cause_\<rr_adjustment.number_of_rr.integer>.string is category_any.current_category.@stringTHEN rr_adjustment.\time_elapsed_\<rr_adjustment.number_of_rr.@integer>.@float =<rr_any.current_restriction.string>.time_total.floatTHEN rradjustment.timeelapsedtotal.@float = rr_adjustment.time_elapsed_total.@float +<rr_any.current_restriction.string>.time_tota1.floatTHEN TEXT (“ here in follow up end 2 .... #: !$ rr_adjustment.number_of_rr.@i $! restr: !$ rr_any.current_restriction.@s$! cause: !$ category_any.current_category.s $!“, “developer”)THEN TEXT ( “ rr: rr adjustment.restriction l.@s $! cause: !$ rr_adjustment.cause 1 .s $! time: !$rr_adjustment.time_elapsed_1.@ $!“, “developer”)ELSE IGNORE ( $Rule, “follow_up_end_rr*”)endRuleRule@name = follow_up_end_rr_3@comment = “Instantiated as soon as a restriction is found”IF rr_adjustment.number_of_rr.integer> 10THEN TEXT ( “ The mechanism to adjust tonnage estimation detected more than 10 restriction ...“, “restrictions”)endRuleRule@name = fresh_feed_cut_IIF sag_mill.status.runningAND fresh feed.real amt,zeroTHEN fresh feed.has_been.cut is TRUEELSE fresh_feed.has_been.cut is FALSEendRuleRule@name = fresh_feed_cut_2IF fresh_feed.has_been.cutAND fresh_feed.cut_time.initialized is FALSETHEN fresh feed.cut_time_init.@time = timex.currenttimex.@timeTHEN fresh feed.cuttime.initialized is TRUEendRuleRule@name = fresh feed cut 3IF fresh_feed.has_been.cutAND fresh_feed.cuttime.initializedTHEN fresh_feed.cut_time_elapsed.@float = ELAPSEDTIME ( timex.current_timex.@time,fresh_feed.cuttimeinit.@time)endRuleRule@name = fresh_feed_recovered_IIF fresh_feed.was.cutAND fresh_feed.real_amt.positiveTHEN fresh_feed.has_been.recovered from cut is TRUETHEN fresh_feed.cut time final.@time is timex.current_timex.@timeTHEN fresh feed.cut time total.@double = ELAPSEDTIME ( fresh_feed.cut_time_final.@time,fresh_feed.cuttimeinit.@time)THEN FORGET ( “fresh_feed.cut_time_init.@t”)THEN FORGET ( “fresh feed.cut time.initialized”)215endRuleRule@name = global_manager_I@priority 50IF TRUETHEN MACRO ( “run_simulation_again*”)THEN MACRO ( “initialization_l”)THEN MACRO (“sampling_time*”)THEN RUN_PROCEDURE ( “update time” )THEN DISABLEBACKWARDCHAIN ( F)THEN RUN_PROCEDURE ( “read_data_coordinator”)THEN RUN_PROCEDURE ( “check_ifeed_controller”)THEN MACRO ( “amps_model*”)THEN MACRO (“detect_rr*”)THEN DISABLEBACKWARDCHAIN ( T)THEN MACRO ( “determine_rr_exists*”)THEN MACRO (“determine_tonnage_difference”)THEN MACRO ( “determine_rr_causes*”)THEN MACRO ( “tonnage_final_average*”)THEN MACRO ( “end_of_shift*”)THEN MACRO ( “update_db*”)THEN RUN_PROCEDURE ( “write_db_coordinator_xxxxx”)THEN IGNORE ( $RuIe, “a*”)THEN IGNORE ( $Rule, “c*”)THEN IGNORE ( $Rule, “d*”)THEN IGNORE ( $Rule, “e*”)THEN IGNORE ( $Rule,THEN IGNORE ( $Rule, “i*)THEN IGNORE ( $Rule, “1*”)THEN IGNORE ( $Rule, q*)THEN IGNORE ( $RuIe, “r*”)THEN IGNORE ( $Rule, “t*”)THEN IGNORE ($Rule, “u*”)endRuleRule@name = initialization_IIF system.already.configuredTHEN DONOTHING ()ELSE RUN_PROCEDURE ( “system_initialization”)ELSE system.already.configured is TRUEendRuleRule@name = initialize_causesIF ?causex = CLASSTOLIST (“restriction_category”)THEN ALL ( ?causex.current_restriction.exists is FALSE)endRuleRule@name = qmss_table3IF <dummy.model_name.string>.input.@double <= <dummy.model_name.string>.input_m.@floatTHEN RUN_PROCEDURE ( “qmsstable3 low”)ELSE RUN_PROCEDURE ( “qmss_table3_high”)endRuleRule@name = qual_status_p_cnt@priority 0IF ?variable = ANY ( {process_var} .pred_dyn.constant is TRUE)216THEN ALL ( ?variable.p_dyn_status.string is “constant”)endRuleRule@name = qual_statusj,dec@priorit’ =0IF ?variable = ANY ( {process_var}.pred_dyn.decreasing is TRUE)THEN ALL ( ?variable.p_dyn_status.string is “decreasing”)endRuleRule@name = qual_statusjhigh@priority =0IF ?variable = ANY ( {process_var}.pred_amt.high is TRUE)THEN ALL (?variable.pred_amt_status.string is “high”)endRuleRule@name = qual_statusj_inc@priorit’ 0IF ?variable ANY ( {process_var}.pred_dyn.increasing is TRUE)THEN ALL ( ?variable.p_dyn_status.@string is “increasing”)endRuleRule@name = qual_statusj,jow@priority =0IF ?variable = ANY ( {process_var).pred_anit.low is TRUE)THEN ALL ( ?variable.pred_amt_status.string is “low”)endRuleRule@name = qual_statusj_medium@priorit’ 0IF ?variable = ANY ( {process_var).pred_amt.medium is TRUE)THEN ALL (?variable.pred_amt_status.string is “medium”)endRuleRule@name = qual_status_real_cnt@priorit’ =0IF ?variable = ANY ( {process_var}.real_dyn.constant is TRUE)THEN ALL ( ?variable.real_dyn_status.@string is “constant”)endRuleRule@name = qual_status_realjiec@priorit’ =0IF ?variable = ANY ( {process_var}.real_dyn.decreasing is TRUE)THEN ALL ( ?variable.real_dyn_status.string is “decreasing”)endRuleRule@name = qualstatus_real_highpriority 0IF ?variable = ANY ( {process_var}.real_amt.high is TRUE)THEN ALL (?variable.real_amt_status.string is “high”)endRuleRule@name = qual_status_real_inc217@priority 0IF ?variable = ANY ( {process_var}.real_dyn.increasing is TRUE)THEN ALL ( ?variable.real_dyn_status.@string is “increasing”)endRuleRule@name = qual_status_real_low@priority 0IF ?variable = ANY ( (process_var}.real_amt.low is TRUE)THEN ALL ( ?variable.real_amt_status.@string is “low”endRuleRule@name = qual_statusjeal_medium@prioritY 0IF ?variable = ANY ( {process_var}.real_amt.medium is TRUE)THEN ALL ( ?variable.real_amt_status.string is “medium”)endRuleRule@name rrjust finishedIF rr_any.restriction.exists is FALSEAND rr_any.restriction.existedTHEN rr_any.do_not_accumulate.tonnage_current_rr is FALSEendRuleRule@name = run_simulation_again_i@priority = 10IF TRUETHEN GETPOINTDATA ( “runx.simulation.again’)THEN FREERULE ( $Rule, “run_simulation_again_2”)THEN GOTO ( “run_simulation_again_2”)endRuleRule@name = run_simulation_again_2@priority = 10IF runx.simulation.againTHEN DONOTHING ()ELSE FREERULE ( $Rule, “run_simulation_again_i”)ELSE GOTO (“run_simulation_again_I”)endRuleRule@name sampling_time_iIF TRUETI-lEN timexsincejast_sampling.integer = AGE ( timex.last_sampling.instant)endRuleRule@name = sampling_time_2IF timex.since_last_sampling.@integer < timex.sampling_time.floatTHEN dummy.integer.@integer = timex.sampling_time.float - timex.since_last_sampling.@integerTHEN SLEEP ( dummy.integer.integer)ELSE TEXT (‘WARNING! It took longer than sampling time ( !$ timex.since_last_sampling.i $! secs.) “, “developer”endRuleRule@name = sampling_time_3218IF timex.last_sampling.instantTHEN timex.last_sampling.instant is FALSEELSE timex.last_sampling.instant is TRUEendRuleRulename = testIF GETPOINTDATA ( “feeder! .status.@float”)THEN TEXT ( “ feederl: !$ feeder! .status.@float $! successful”, ‘rr_indep”)ELSE TEXT ( “feederl: !$ feederl.status.@float $! .. it could not read feederl’, “rr_indep”)endRuleRule@name test2IF GETPOINTDATA ( “fresh_feed.real_amt.@float”)THEN TEXT ( “ fresh-feed: !$ fresh_feed.real_amt.@f$! successfUl”, “rr_indep’)ELSE TEXT ( “ else fresh - feed: !$ feeder2.status.@float $! .. it could not read fresh feed”, “rr_indep”)endRuleRule@name test3IF ?feed ANY ( {feeder}.status.@float = 1)THEN ALL ( ?feed.status.running is TRUE)endRuleRule@name = test4IF ?feed = ANY ( {feeder}.status.@float 0)TFIEN ALL ( ?feed.status.running is FALSE)endRuleRule@name = test5IF TRUETHEN dummy.a.@float = IendRuleRule@name = test6IF TRUETHEN a.c.@float = TIMEAVERAGE ( fresh_feed.real_amt.@float , rr_speed.time_elapsed.@float , (rr_speed.time_elapsed.@float +30))THEN a.d.@float = TIMEAVERAGE (fresh_feed.real_amt.@float , 0, rr_speed.time_elapsed.@float )THEN TEXT ( “ ifeed prior= !$ a.c.@f$’ now: !$ a.d.@f$’ “, “rr_dep”)endRuleRule@name = testlIF ?listx = CLASSTOLIST (“restriction_category”)THEN ALL ( ?listx.current_restriction.exists is FALSE)TI-lEN soft_ore.current_restriction.exists is TRUEendRuleRule@name = test70IF ?listl = ANY ( {restriction_category}.current_restriction.exists is TRUE)TI-lEN ?list2 = LISTADDOBJECT ( ?listl, ‘ball_miiills”)THEN dummy.integer.integer = 1THEN a.b_1.@float = 0.000000THEN a.\b_\<dummy.integer.integer>.float = 12.000000THEN TEXT (“result: !S a.b_l.@f$!”)219THEN dummy.string.string is LISTFIRSTOBJECT ( ?list2)THEN TEXT (“ !$ dummy.string.@s $!“)endRuleRule@name = test7lIF ?listx = ANY ( {restriction_category}.current_restriction.exists is TRUE)THEN dummy.string.@string is LISTALLOBJECT ( ?listl, ““,“)THEN TEXT ( “ttying’)THEN TEXT ( “mit !$ dummy.string.s $! “)THEN ?listx = LISTADDOBJECT ( ?listx, “ball_mills’)THEN ?listy = LISTMERGE (?listl, ?listx)THEN a.a1.string is LISTALLOBJECT ( ?listy,”.””)THEN TEXT ( “result: !$ $! “)THEN a.a1.string is LISTFIRSTOBJECT ( ?listy)THEN TEXT (“ !$ $!“)endRuleRule@name = test80IF TRUETHEN a.cI.integer= 1endRuleRule@name = test8 1IF TRUETHEN a.\b_\<a.cI .integer>.float = 15.400000THEN TEXT ( “the result is !$ a.b_1.@f$!”)endRuleRule@name = test90IF ?listx = CLASSTOLIST ( “restriction_id”)THEN LISTNUMOBJECT( ?listx)THEN dummy.integer.@integer = 1endRuleRule@name = test9lIF dummy. integer.integer <= .integerTHEN dwnmy.string.string is LISTNTHOBJECT ( ?listx, dummy.integer.integer)THEN FREERULE ( $Rule, “test92”)THEN GOTO ( “test92”)endRuleRule@name test92IF TRUETHEN dummy.integer.integer = dummy.integer.integer + 1THEN FREERULE ( $Rule, “test9 1”)THEN GOTO ( “test9 1”)endRuleRule@name = timing_rr_depIF <rr_any.current_restriction.@string>.restriction.initialized is FALSETHEN <rr_any.current_restriction.string>.time_initial.time is rr_speed.time_initial.@timeTHEN <rr_any.current_restriction.string>.restriction.initialized is TRUETHEN TEXT (“restriction !$ rr_any.current_restriction.@s $! detected at !$ timex.current_timex.@t $! “, “restrictions”)THEN <rr_any.current_restriction.string>.possib1e_cause.determined is FALSE220THEN FREERULE ( $Rule, “estimate_init_tonnage*”)THEN MACRO ( “estimate_init_tonnage*”)THEN <rr_any.current_restriction.string>.lost_current_rr.doubIe = rr_speed.lost_current_rr.@doubleTHEN MACRO ( “follow_up_rr*”)endRuleRule@name = timing_rr_dep_elapsedIF <rr_any.current_restriction.string>.restriction.initializedTHEN <rr_any.current_restriction.string>.time_elapsed.float = rr_speed.time_elapsed.@floatTHEN <rr_any.currentJestriction.string>.hour_elapsed.integer = ff_speed.hourelapsed.(integerTHEN <rr_any.current_restriction.string>.minute_elapsed.integer= rr_speed.minute_elapsed.integerTHEN <rr_any.current_restriction.string>.second_elapsed.integer= rr_speed.second_elapsed.integerTHEN <rr_any.current_restriction.string>.lost_current_rr.double = rr_speed.Iost_current_rr.@doubleendRuleRule@name = timingjr_finalIF TRUETHEN <rr_any.current_restriction.string>.timefinal.time is timex.current_timex.@timeTHEN <rr_any.current_restriction.string>.time_total.float = <rr_any.current_restriction.string>.time_elapsed.floatTHEN <rr_any.current_restriction.string>.restriction.initialized is FALSETHEN TEXT (“restriction !$ rr_any.currentjestriction.@s $! is over at !$<rr_any.current_restriction.string>.time_final.time $ ! “, “restrictions”)THEN TEXT ( “- Total time: !$ <rr_any.current_restriction.@string>.hour_elapsed.@i$! : !$<rr_any.current_restriction.string>.minute_elapsed.i$! : !$<rr_any.current_restriction.string>.second_elapsed.i$!“, “restrictions” )THEN TEXT ( “Tonnage lost: !$ <rr_any.current_restriction.string>.1ost_current_rr.db $1 Tons.”, “restrictions”)THEN FREERULE ( $Rule, “accumulate_Iosses*”)THEN MACRO ( “accumulate Iosses*”)THEN FREERULE ( $Rule, ‘follow_up_end_rr*”)THEN MACRO ( “follow_up_end_rr*”)endRuleRule@name = timing_rr_indepIF <rr_any.current_restriction.@string>.restriction.initialized is FALSETHEN <rr_any.currentjestriction.string>.time_initial.time is timex.current_timex.@timeTHEN <rr_any.current_restriction.string>.restriction.initialized is TRUETHEN <rr_any.current_restriction.string>.possible_cause.determined is FALSETHEN <rr_any.current_restriction.@string>.time_elapsed.@float = 0.000000THEN <rr_any.currentjestriction.string>.lost_current_rr.double = 0.000000THEN TEXT ( “ “, “restrictions” )THEN TEXT (“restriction !$ rrany.current_restriction.string $! detected at !$<rr_any.current_restriction.string>.time_initial.time$! “, “restrictions”)THEN FREERULE ( $Rule, “estimate_init_tonnage*”)THEN MACRO (“estimate mit tonnage*”)endRuleRule@name = timing_rr_indep_elapsedIF <rr_any.current_restriction.string>.restriction.initiaIizedTHEN dummy.timej,revious.@float = <rr_any.current_restriction.@string>.timeelapsed.@floatTHEN <rr_any.current_restriction.string>.time_elapsed.@float = AGE (<rr_any.current_restriction.string>.restriction.exists)THEN <rr_any.current_restriction.string>.time_delta_elapsed.float =<rr_any.current_restriction.string>.time_elapsed.float - dummy.timejrevious.floatTHEN <rr_any.current_restriction.string>.hour_elapsed.integer =<rr_any.current_restriction.@string>.time_elapsed.@float / 3600.000000THEN dummy.remainder.@float = <rr_any.currentjestriction.string>.time_elapsed.@float -<rr_any.current_restriction.@string>.hour_elapsed.@integer * 3600221THEN <rr_any.current_restriction.@string>.minute_elapsed.@integer = dummy.remainder.@float /60.0000001’HEN <rr_any.current_restriction.string>.second_eiapsed.integer= dummy.remainder.@float -<rr_any.current_restriction.@string>.minute_elapsed.integer * 60THEN FREERULE ( $Rule, “tonnage_lost_lower”)1’HEN MACRO ( “tonnage_lost_lower”)endRuleRule@name = tonnage_adjustment_0IF TRUETHEN rr_adjustment. change in_final tonnage.float = rr_adjustment.finai_tonnage.float -rr_adjustment.pred_tonnage_during_rr.floatTHEN rr_adjustment.change_in_initial_tonnage.float = rr_adjustment.initial_tonnage.@float -rr_adjustment.pred_tonnage_during_rr.floatTHEN rr_adjustment.rr_being_adjusted.@integer = 1THEN ASNCERTA1NTY ( rr_adjustment.rr_being_adjusted.integer, 100)THEN ASNCERTAINTY ( rr_adjustment.number_of_rr.integer, 100)THEN rr_adjustinent.change_in_tonnage_previous.@float = 0.000000THEN dummy.timeaccumulated.@float = 0.000000endRuleRule@name = tonnage_adjustment_iIF rr_adjustment.rr_being_adjusted.integer <= rr_adjustment.number_of_rr.integerTHEN dummy.timeaccumulated.@float = dummy.time_accumulated.@float +rr_adjustment.\time elapsed \<rr_adjustment.rr_being_adjusted.integer>.floatTHEN rr_adjustment.change_in_tonnage.float = dummy.time_accumulated.@float /rr_adjustment.time_e1apsed_total.float * rr_adjustment.change_in_final_tonnage.floatTHEN dummy.rectangle.doubie = rr_adjustment.change_in_initiai_tonnage.float *rr_adjustment.\time_elapsed_\<rr_adjustment.rr_being_&ljusted.@integer>.@floatTHEN dummy.triangie.doubie = rr_adjustment.\time_elapsed_\<rr_adjustment.rr_being_adjusted.@integer>.@float * (rr_adjustment.change_in_tonnage.float + rr_adjustment.change_in_tonnage_previous.float ) / 2.000000THEN rr_adjustment.correction_tons_accumulated.@doubie = ( dummy.rectangle.@double + dummy.triang1e.double/ 3600.000000TI-lEN rr_any.current_restriction.@string isrr_adjustment.\restriction_\<rr_adjustment.rr_being_adjusted.integer>.stringTHEN category_any.current_category.string isrr_adjustment.\cause\<rr_adjustment.rr_being_adjusted.integer>.stringTHEN FREERULE ( $Rule, “accumulate_adjusted*”)THEN MACRO ( “accumuiate_adjusted*”)THEN FREERULE ( $Rule, “tonnage_adjustment_2”)THEN GOTO (“tonnage_adjustment_2”)ELSE IGNORE ( $Rule, “tonnage_adjustment*”)endRuleRule@name = tonnage_adjustment_2IF TRUETHEN rr_adjustment.rr_being_adjusted.integer = rr_adjustment.rr_being_adjusted.(äjinteger + 1THEN rr_adjustment.change_in_tonnage_previous.float = rr_adjustment.change_in_tonnage.floatTHEN FREERULE ( $Rule, “tonnage_adjustment_i”)THEN GOTO (“tonnage_adjustment_i”)endRuleRule@name = tonnage_final_aborted_i@comment = “called from ???“IF rr_adjustment.final_tonnage.was_in_progressAND rr_any.timelastrrdisappeared.@float >= rr_any.time_no_exists_restriction.@floatTHEN MACRO ( “tonnage_adjustment*”)THEN TEXT (“final aborted an rr BEFORE time is up!”, “developer”)222endRuleRule@name = tonnage_final_aborted_2@comment = “called from ???“IF rr_adjustment.final_tonnage.was_in_progressAND rr_any.time_last_rr_disappeared.@float <rr_any.time_no_exists_restriction.@floatTHEN dummy. integer.integer = rr_any.time_no_exists_restrictions.@float /60THEN TEXT ( “A restriction appeared BEFORE !$ dummy.integer.i $! mm; Lost tonnage adjustment IGNORED!”,“restrictions” )endRuleRule@name = tonnage_final_average_0IF rr_adjustment.ignore_tonnage.correctionOR rr_adjustment.do_not_correct.tonnage_lostOR rr_any.do_not_accumulate.tonnage_current_rrOR rr_any.stop_accumulating.tonnage_lostTHEN IGNORE ( $Rule, “tonnage_final_average*”)endRuleRule@name tonnage_final_average_iIF rr_any.restriction.exists is FALSEAND rr_any.restriction.existedTHEN rr_adjustment.final_tonnage. in_progress is TRUEendRuleRule@name = tonnage_final_average_2IF rr_adjustment.final_tonnage.in_progressAND AGE ( rr_any.last_restriction.disappeared ) <= rr_adjustment.maximum_time.floatTFIEN rr_adjustment.final_tonnage.@float = TIMEAVERAGE ( fresh_feed.real_amt.@float , 0, AGE (rr_any.last_restriction.disappeared))endRuleRule@name = tonnage_final_average_3IF rr_adjustment.final_tonnage.in_progressAND AGE (rr_any.last_restriction.disappeared ) > rr_adjustment.maximum_time.floatTHEN rr_adjustment.final_tonnage.in_progress is FALSETHEN IGNORE ( $Rule, “tonnage_final_average*’)THEN MACRO ( “tonnage_adjustment*’)endRuleRule@name = tonnage_lost_lowerIF fresh_feed.pred_amt.@float > fresh_feed.real_amt.@floatTHEN dummy.current_loss.@double = <rr_any.current_restriction.string>.lost_current_rr.doubleTHEN <rr_any.current_restriction.string>.lost_current_rr.double dummy.current_loss.@double + (fresh_feed.pred_amt.@float - fresh_feed.real_amt.@float ) *<rr_any.current_restriction.@string>.time_delta_elapsed.@float / 3600.000000endRuleRule@name = update_db_correct_tonnageIF rr_adjustment.do_not_correct.tonnage_lostTHEN rr_adjustment.did_not_correct.tonnage_lost is TRUEELSE rr_adjustment.did_not_correct.tonnage_lost is FALSEendRule223Rule@name = update_db_equipment_1IF TRUETHEN ?bmill = ANY ( {ball_mill}.status.running)THEN ALL ( ?bmill.status.was_running is TRUE)THEN ?feedx = ANY ( {feeder}.status.running)THEN ALL ( ?feedx.status.was_running is TRUE)endRuleRule@name = update_db_equipment_2IF ?bmill = ANY ( {ball_mill}.status.running is FALSE)THEN ALL ( ?bmill.status.was running is FALSE)endRuleRule@name = update_db_equipment_3IF ?feedx = ANY ( {feeder}.status.running is FALSE)THEN ALL ( ?feedx.status.was_running is FALSE)endRuleRule@name = update_db_fresh_feed_cutIF fresh_feed.has_been.cutTHEN fresh_feed.was.cut is TRUEELSE fresh_feed.was.cut is FALSEendRuleRule@name = update_db_restrictions_1IF ?restriction = ANY ( {restriction_id}.restriction.exists is FALSE)THEN ALL ( ?restriction.restriction.existed is FALSE)THEN ALL ( ?restriction.restriction.initialized is FALSE)THEN ALL ( ?restriction.time_elapsed.@float = 0.000000)THEN ALL ( ?restriction.hour_elapsed.integer 0)THEN ALL ( ?restriction.minute_e1apsed.integer = 0)THEN ALL ( ?restriction.second e1apsed.integer = 0)THEN ALL ( ?restriction.restriction.has_been_identified is FALSE)endRuleRule@name = update_db_restrictions_l 1IF ?restrictionx = AI’JY ( {restrietion_id).restriction.exists is TRUE)THEN ALL ( ?restrictionx.restriction.existed is TRUE)endRuleRule@name = update_db_restrictions_2IF rr_any.restriction.existsTHEN rr_any.restriction.existed is TRUEELSE rr_any.restriction.existed is FALSEendRuleRule@name = update_db_restrictions_3IF rr_speed.restriction.detected is TRUETHEN rr_speed.restriction.detectedjast_sampling is TRUEELSE rr_speed.restriction.detectedjast_sampling is FALSEendRuleRule224@name = update_db_restrictions_4IF rr_adjustment.final_tonnage.in_progressTHEN rr_adjustment.final_tonnage.was_in_progress is TRUEELSE rr_adjustment.final_tonnage.was_in_progress is FALSEendRuleRule@name = variables_highIF ?v_high = ANY ( {process_var}.real_amt.high)THEN DONOTHING ()endRuleRule@name = variables_high_2IF tail boxi .level.highOR tail_box2.level.highTHEN DONOTH1NG ()endRuleRule@name = water_ratio_iIF fresh_feed.real_amt.@float <1700THEN water_ratio.pred_amt.@float = 0.650000ELSE water_ratio.pred_amt.@float = 0.650000 - 0.150000 / 300.000000 * (fresh_feed.real_amt.@float - 1700.000000)endRuleFacets@triplet = {restriction_id}.restriction.has_been_identified@default = 0.000000endFacetsFacets@triplet = ball_mill_i .status.@floatifchange = equipment_statusendFacetsFacets@triplet = ball_milI_2.status.@floatifchange = equipment_statusendFacetsFacets@triplet = dumniy.number_of_rr.@integer@ifchange = max_certaintyendFacetsFacets@triplet = dummy.rr_analyzed.integerifchange = max_certaintyendFacetsFacets@triplet = fresh_feed.agrees_with.setpoint@fuzz3’ = agrees_with_ifeedendFacetsFacets@triplet = fresh_feed.is_approaching_to.setpoint@default = 0.000000endFacets225Facets@triplet = fresh_feed.is_close_to.setpoint@fuzzy = close_to_ifeedendFacetsFacets@triplet = fresh_feed.real_amt.positive@fuzzy positive_fresh_feedendFacetsFacets@triplet = = zero_fresh_feedendFacetsFacets@triplet = fresh_feed.real_dyn.constant@fuzzy = constant ifeedendFacetsFacets@triplet = fresh_feed.real_dyn.decreasing@fuzz3’= decreasing_ifeeciendFacetsFacets@triplet = fresh_feed.real_dyn.increasing@fuzzy = increasing_ffeedendFacetsFacets@triplet = Ievel_tailing_box.real_amt.high@fuzzy level_tailings_highendFacetsFacets@triplet = rr_adjustment.number_of_rr.@integerifchange max_certaintyendFacetsFacets@triplet = rr_adjustment.rr_being_adjusted.integer@ifchange = max_certaintyendFacetsFacets@triplet = rr_ffeed_Iimit.restriction.exists@default = 0.000000endFacetsFacets@triplet = rr_ffeed_limit.restriction.has_been_identified@default = 0.000000endFacetsFacets@triplet = sag_mi1l.status.floatifchange = equipment_statusendFacetsFacets226@triplet = sag_speed.real_amt.positive@fuzzy = positive_sag_speedendFacetsFacets@triplet =’ = zero_sag_speedendFacetsFacets@triplet = tail_box 1 .Ievel.high@fuzzy = tail_box1_highendFacetsFacets@triplet tail_box2.Ievel.high@fuzzy = tail_box2_highendFacets!*** LoadStrategy must go at the end of the Knowledge Base ***!LoadStrategy@name “rr-hvc.stg”EndLoadStrategy227


Citation Scheme:


Citations by CSL (citeproc-js)

Usage Statistics



Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            async >
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:


Related Items