Modelling electromechanical systems from multiple perspectives K. Nakata, M.H. Lee, A.R.T. Ormsby, P.L. Olivier Centre for Intelligent Systems, University of Wales, Aberystwyth SY23 3DB, UK Abstract This paper argues that model-based techniques, in particular those dealing with electromechanical systems in engineering applications, will benefit considerably by incorporating multiple perspectives. This can be achieved by integrating different representations from engineering notations, e.g. structural and functional knowledge, and different domain attributes, e.g. mechanical and electrical aspects. An example case study is used to illustrate and evaluate the approach. 1 Introduction Model-based reasoning is an approach toward building intelligent systems that are able to predict the consequences of events in an application problem domain. This has many applications in engineering: it can be used to deduce the effects of alternatives in a design, it can predict outcomes of a control decision, but perhaps the most developed area is in diagnosis where models are used to explain observed symptoms (Davis 1984, Reiter 1987, de Kleer, Mackworth & Reiter 1992). The model-based approach has the potential to be more robust, more flexible and less ad hoc than the rule-based approaches found in current expert systems. Moreover, rule-based systems are only capable of reasoning about previously experienced cases, while a model-based approach may be able to reason about unforeseen and novel events. This paper reports on some work undertaken as part of a project to develop software models of electromechanical systems in the automotive industry. Our collaborators include a luxury car manufacturer and a company that implements
228 Artificial Intelligence in Engineering software tools for diagnosing electrical car faults. Our models are intended to simulate vehicle systems so that they may be used to validate the diagnostic tools without recourse to real faults on actual automobiles. Such models may also prove useful in constructing the diagnostic procedures and in early design; however our main aim is to investigate the nature of an effective modelling framework. As in all AI, the choice of model representation is crucial and a key issue is finding an efficient and expressive modelling framework. Our experience suggests that several different forms of description are frequently used in concert, in particular, both structural and functional data seem to be essential. Engineers adopt several different perspectives when they reason about systems and we believe a multiple perspective model will have considerable advantage over a monolithic approach. In the next section we explain our approach and current modelling tools. A case study illustrates an application problem in section three, and then follows an evaluation of this approach. 2 Multiple-perspective modelling Although a large part of the design documentation for electromechanical devices consists of mechanical and electrical CAD drawings, the description of how devices work or operate is usually provided in the form of functional specifications. These are typically textual descriptions of the behaviour of a device for certain operations. Such being the nature of functional specifications, the representation of functional knowledge relies on the conceptual understanding of engineers and this underpins the idea of functional reasoning (Freeman & Newell 1971, Sembugamoorthy & Chandrasekaran 1986, Goel & Chandrasekaran 1989). We consider functional reasoning to be an attempt to emulate how engineers think about devices in the context of envisaging the behaviour of dynamic systems. Structural knowledge, by comparison, relates to components and the connections between them, conveying data on how things are physically organised. In our domain, circuit diagrams are examples of electrical structural knowledge while engineering drawings capture the mechanical structure. The main characteristic of this kind of knowledge is that it does not proscribe any operation or imply any particular use but acts as a repository of information. Thus, structural models record how a system is constructed while functional models are useful in modelling the intention of the designer. In the electromechanical domain experienced engineers often make extensive use of both these kinds of knowledge. Table 1 illustrates four perspectives from our application domain. It is important to develop methods for integrating knowledge of function and structure. To effect this, we have used the rapid-prototyping functional modelling
Artificial Intelligence in Engineering 229 Table 1: Looking at a device from different perspectives Structural Functional Mechanical Mechanical relations between components How do the mechanical components work? Electrical Electrical circuits What do the electrical circuits do? language Raphael (Hunt 1992) which has a facility to incorporate the qualitative electrical circuit analysis tool CIRQ (Lee & Ormsby 1994). For certain functions of devices which rely on the correct behaviour of relevant circuits, Raphael can call for a circuit analysis by CIRQ, which returns the status of the particular circuit. The basic concepts in Raphael are devices, events, and functions. Each device consists of the device name, the functions that device has, and relevant structures where available. A device may have subdevices which are part of, or dependent upon that device. Functions have a function name, preconditions (to be satisfied for that function to activate), actions, and postconditions (the result of the activation of the function). Functions serve to change the value of state variables. For instance, in our model of a car electrical system, the function start-ignition changes the value of the state variable IGNITION-STATE from off to on. Events are the external inputs to the system such as turning the ignition key. After an event has been specified, a simulation generates the system behaviour by following state transitions in accordance with the functions! activation pattern. 3 A case study in electromechanical systems As a representative case study in modelling electromechanical systems using Raphael, we have built a prototype model of the seat-mirror system of a luxury class car. The seat-mirror system enables the driver and the passenger of the car to adjust and record seat positions and door mirror angles by pressing the control buttons. It is electrically operated and controlled, and drives a well defined mechanical mechanism. Here we describe the seat-motor system, a subsystem of the seat-mirror system, to illustrate the features of our modelling approach. Wefirstbegin by decomposing the seat-motor device into a number of subdevices, some of which in turn are decomposed further. As illustrated in Figure 1, the seat-motor device (the top-level device) can be decomposed into ignition, motor, control-unit and seat (sub)devices, with the control-unit device further decomposed into seat-switchpack, door-switchpack and door-switch (sub)devices. Each of these devices has one or more functions, which describe how the device
230 Artificial Intelligence in Engineering Figure 1: Decomposition of the seat-motor system. circuit descriptions relevant to each device. Italics denote electrical operates given some input conditions. For instance, the function start-ignition of the ignition device is described as follows: define.function start.ignition; preconditions [ [[ ignition-switch of seat-motor ] = ON ] and [[ ignition ^state ofseatjnotor ] = OFF ]] and [[ operate Jgnition of the Jgnition = ACTIVE]]; ON»ignition.state; postcondition ignition.state; enddefine-function; The first two precondition statements require the current values of the state variables ignition.switch and ignition-state in the seat-motor system to be ON and OFF respectively. The third condition calls the function operate-ignition, which performs a circuit analysis of the ignition circuit, and requires the result to be ACTIVE, i.e., that part of the circuit which is responsible for energising the ignition is active. Note that this third condition acts as an interface between the functional knowledge (i.e. the functional description) and the structural knowledge (i.e. the electrical circuit). Once all the preconditions are satisfied, the function start-ignition sets the value of the state variable ignition-state to ON. The value of state variables can either be decided as a result of executing a function, as seen above, or by means of an event. An event may be seen as an operation caused by an agent outside the system, e.g., a human diagnostician, and, in Raphael, it is modelled by a simple assignment to state variables. The event switch-on Jgnition is described as follows: define-event switch jon Jgnition; ON»ignition.switch; enddefine-event;
Artificial Intelligence in Engineering 231 The main functions of each device are described in Table 2, and Table 3 lists the events available for the model. Table 2: Examples of devices and their main functions. Devices ignition motor control-unit seat Main functions Switches on/off the ignition Operates the seat motor Controls various operations via ECU Positions seat and monitors positional feedback Table 3: Examples of events and corresponding operations. Event name switch JOH Jgn ition switch joff-ignition select-forward select-backward release-movement ^switch select-exit.button Description turn the ignition key to 'on' turn the ignition key to 'off' press 'forward' on the control switch press 'backward' on the control switch release any depression of the control switch press the 'exit switch' and move the seat backwards 4 Using multiple-perspective models for diagnosis The aim of our project is to provide a modelling framework for electromechanical devices which can be used to aid both the construction and verification of manually compiled diagnosis procedures. We hope these models will eventually find application in other areas of engineering support. From the case study described we have learned the strengths and problems of modelling using Raphael. We list below some of the features that our modelling work has confronted. Integrating functional and structural models An analysis of the diagnosis procedure for the seat-mirror system shows that more than 40% of the test procedures are electrical tests and circuit analysis covers a significant proportion of the information required. It must also be emphasised that nearly all electrical tests are qualitative, i.e. it is not necessary to obtain exact numeric values but
232 Artificial Intelligence in Engineering simply determine whether they are above or below certain thresholds. Raphael models make use of qualitative circuit analysis data to obtain a state-transition based simulation and this successfully integrates the functional and structural aspects of electromechanical devices. Initialisation of diagnosis states An important aspect of diagnosis is the need to know exactly what state the device is in before carrying out any tests. Initialising the system to known states constitutes a considerable proportion of any diagnosis procedure. Such initialisation of states can be done either at the outset of diagnosis or while other tests are being carried out. Our current model is useful for verification since it can identify those state variables where initialisation is ambiguous or incomplete. Prediction of attainable states Models which help the developer of the diagnosis system to understand the ways in which the device can move from one state to another appear to have considerable power, and the model is useful in this respect. For example, if the seat is moving forwards, the transition to the 'seat stopped' state might be either (a) the seat has reached the end-stop, (b) the seat has been blocked by some object, or (c) the seat control button has been released. Such scenarios all need to be taken into account by engineers to construct a complete diagnostic. Modularity of devices and functions One of the important features of an automotive diagnosis system is that it should be capable of dealing with variants of the same type of car. It is both expensive and inefficient to supply a separate diagnosis system for each and every variant of a car. Most of the differences in such variants concern the presence or absence of certain functions. Such functions should be easy to add or remove according to a range of options selected by clients. This has serious implications for modelling it is impractical to build a model for each and every version of car produced. In order to deal with this, functions should be modular, and capable of being readily added or removed. Modelling malfunctions An issue related to the modularity of function is modelling the functioning of devices under abnormal modes. Some devices behave abnormally in certain circumstances, resulting in often undesirable behaviour. There is an ongoing debate as to whether or not such malfunctions need to be modelled explicitly (van Soest & Bakker 1993);firstly,there is a limit to how much can be known in advance about the malfunctioning of a device; secondly, if there are many possible malfunctions for a device, it is almost impossible to represent them all; and thirdly, aggregation of non-functioning (as opposed to malfunctioning) of a device would cater for most 'undesired' behaviours.
Artificial Intelligence in Engineering 233 However, none of these issues should prevent us from incorporating data on previously known malfunction modes to enhance the degree of completeness of the model, and in some cases, make it more efficient in terms of computing abnormal behaviours. Such malfunction knowledge must also be modelled in a similar manner as for normal mode behaviour for the reasons given above. Spatio-temporal issues Apart from electrical circuits, important structural information is found in the mechanical interactions and relations between devices. This requires a reasoning facility for dealing with mechanical relations, basic kinematics and limited spatial awareness. Another aspect of spatial reasoning is in determining the accessibility of devices and terminals to decide whether certain test can physically be carried out. Finally, being based on state-transitions, the main model does not contain temporal information such as the duration of events and functions. In some cases, these become crucial when certain tests need to be carried out while changes are in progress. We are currently building additions to our model to further investigate the last three issues mentioned above. 5 Summary The main argument in this paper is that reasoning with a multiple perspective model, with several different formalisms of the modelled system, is considerably more powerful than a single view model. Looking at devices from different points of view offers a richer description and provide access to information which is interleaved among those perspectives. We have seen that when the limitations of one perspective are reached it is possible to continue exploiting a model by engaging another view. Our system shows how different perspectives can be integrated to work together in achieving the goals of a particular modelling task. As a case study, a model of a seat-mirror subsystem has been constructed using the functional modelling language, Raphael, which has a facility to integrate both functional and structural device descriptions. The model covers important aspects of the application task (diagnosis procedure generation) such as electrical tests and initialisation features. Our ongoing research is developing a more robust and representation-rich framework which interacts with inference engines corresponding to descriptions from different perspectives to achieve desirable features of multiple perspective modelling.
234 Artificial Intelligence in Engineering Acknowledgements We would like to thank Mike Peters of GenRad Ltd. for providing information and many useful comments. This work is funded by EPSRC ref. GR/H 53440. References Davis, R. (1984), 'Diagnostic reasoning based on structure and behaviour', Artificial Intelligence 24, 347-410. de Kleer, J. & Williams, B. C. (1987), 'Diagnosing multiple faults', Artificial Intelligence 32, 97-130. de Kleer, J., Mackworth, A. K. & Reiter, R. (1992), 'Characterizing diagnoses and systems', Artificial Intelligence 56, 197-222. Freeman, P. & Newell, A. (1971), A model for functional reasoning in design, in 'Proc. IJCAI-71', pp. 621-640. Goel, A. & Chandrasekaran, B. (1989), Functional representation of designs and redesign problem solving, in 'IJCAI-89', pp. 1388-1394. Hunt, J. E. (1992), Integrating multiple domain models using a functional representation, in 'Applications of Artificial Intelligence in Engineering VIF, pp. 1185-1208. Lee, M. H. & Ormsby, A. R. T. (1993), 'Qualitatively modelling the effects of electrical circuit faults', AI in Engineering 8 (4), pp. 293-300. Reiter, R. (1987), 'A theory of diagnosis fromfirstprinciples', Artificial Intelligence 32, 57-95. Sembugamoorthy, V. & Chandrasekaran, B. (1986), Functional Representation of Devices and Compilation of Diagnostic Problem-Solving Systems, in J. L. Kolodner & C. K. Riesbeck, eds, 'Experience, Memory and Reasoning', Lawrence Erlbaum Associates, Hillsdale, NJ, pp. 47-73. van Soest, D. C. & Bakker, R. R. (1993), Modeling for model-based diagnosis, in 'DX-93 Fourth International Workshop on Principles of Diagnosis', pp. 316-326.