Alberto bonastre, juan V. Capella, rafael ors



Download 196.81 Kb.
Page2/2
Date05.05.2018
Size196.81 Kb.
#48319
1   2

3.2 Distribution of RN

Given a distributed system formed by n nodes, it is possible to implement a control system through a Distributed RN (DRN), so that each one posses a part of the global reasoning, i.e., a part of the variables and the rules of the system. For this purpose, each node Ni will handle a sub-set of variables and rules of the system, represented by a sub-vector Si of the states vector S and three sub-matrices Ai, Ci and Di of matrices A, C and D, respectively.

After defining the set of all system variables, two cases may arise. Some variables will be used in more than one node and others only in one. Those variables required in more than one node are global variables (they will need a global variable identifier), whereas if they only affect one node will be known as local variables.

Obviously, a variable will be local if all the rules referring to it are in the corresponding node, whilst those appearing in rules of different nodes will necessarily be defined as global.

By minimizing the number of global variables, network traffic will be reduced. Besides, the variables referring to a physical input or output will necessarily be located in the node of the corresponding port. Taking this into account, there is an algorithm, explained in [6], that permits the optimum assignment of variables and rules to each node (i.e. sub-matrices Si, Ai, Ci and Di). Optimal versions of this complex algorithm have been implemented successfully. It is possible to distribute the RN applying other criteria, such as fault tolerance approaches that allow several nodes to update any global variable.

Write-Through propagation mechanism guarantees that if the rule net meets a set of properties, once it is distributed and working on a broadcast network, the information will be coherent and the whole system will run in a coordinated way.



4 House automation

One of the lines that are considered more appropriate for the application of the distributed expert systems it is the market of the smart house control systems. The simplicity required in the used devices, their low cost, flexibility and power, besides the necessity of allowing that non expert programming users could specify the system behavior, make this proposal very interesting in this field.



The architecture of the proposed system appears in figure 1. As shown, the distributed system is placed on a CAN network [7] to which a group of nodes are connected. One of them is denominated Programming and Supervision Node (PSN). The rest corresponds to the so-called control nodes (CN), which are connected by means of the corresponding inputs and outputs to the process to be controlled.


The implementation of simple generic nodes just as it appears in the figure 2a is proposed. Each node consists of two modules, implemented each one of them in a small card:

A. The communications module, that consists on a system with a low power microcontroller with CAN (for example the T89C51CC01 of Atmel, the Siemens 515, etc.). It is the one in charge of the communications and the execution of the proposed protocol. This circuit also would contain the CAN driver and the rest of necessary basic elements for the system operation (quartz clock, reset circuit, CAN connector, etc.). This module would exist in all the system control nodes, being able to produce in mass, reducing the production costs considerably.

B. The interface module, with as many variants as different node types required in the system, it would be constituted by the necessary input/output elements and it would provide the interface with the process. It is possible to implement modules with an only one digital input and/or output, even modules that offers a group of several digital and/or analog inputs and/or outputs.

It is sought with this design that the nodes finally result very simple, reducing the functions from the interface module to the strictly necessary ones. For example, a node in charge of a switch control only requires a digital input. Another example constitutes a node for the control of a lamp that contemplates an output with a triac to activate the bulb and a digital input, connected to a light sensor to assure that the lamp has lit. Thanks to this philosophy it is also possible to install simple nodes in the registrations boxes that would control the elements to them connected, as for example appliances, heating, presence sensors, etc.

Given the system characteristics, with each one of these nodes a set of rules is given that allows the standard operation of the same ones, leaving the user the possibility to complete and to particularize the system operation according to its necessities.

For example, two types of nodes are exclusively employees for the implementation of basic illumination systems:



A. Nodes Switch: Allow the user to light or turn off the different lights. It would consist basically of a digital input, with the possibility of adding a digital output to illuminate a position led when the light is turn off.

B. Nodes Lamp: It manages only one bulb. They have a digital output that acts on a TRIAC that illuminates the bulb. Optionally, they can incorporate a digital input that, connected to a current or illumination sensor, allow to detect that the bulb is fused.

The small size of these nodes make possible its incorporation to the same carry-lamp.

For each one of these types of nodes predetermined profiles settle down, defined by a standard set of rules. The user uses this standard set of rules directly, establishing the global system behavior by means of the global variables that export each one of them, or he has the possibility to modify the set of rules to adapt the behavior in a more precise way or even to optimize the set of rules.

The node switch would have a digital input, to which will denominate position, with states A and B. Also, would have a digital output, neon, with on and off values. To communicate each switch node with the rest of the system a global switch variable will be used with two states: stable and modified. To avoid internal oscillations, the switch node has a internal variable previous state with two possible values A and B.

The node is accessible from the rest of the system through the global variable switch. The set of rules that defines the behavior of a switch node would be the following one:

If position is A and the previous state is B

then the previous state should be A and the switch should be modified.

If position is B and the previous state is A

then the previous state should be B and the switch should be modified.

On the other hand, a lamp node will have an digital output denominated bulb, with on and off values. The sensor variable corresponds with the digital input, being able to be in two states: illuminated and not illuminated.

The lamp global variable allows the access to the node functions, with three possible states: on, off and fused. The set of rules for the node would be the following one:

If the lamp is on then the bulb should be on.

If the lamp is off then the bulb should be off.

If the bulb is on and the sensor is not illuminated then the lamp should be fused.

As example of this profiles capacities it is implemented two applications. The first of them consists on a typical switch - lamp system, while the second of them implements a system with a lamp governed from three switches (corresponding to a typical system with two switches and a crossing key).



Application 1: In the system they are only one bulb node and only one switch. Besides the rules foreseen in the previous profiles, it would be necessary to add the following rules:

To light the lamp the following rule will be used:



If the switch is modified and the lamp is off

then the lamp should be on and the switch should be stable.

To turn off it, it is necessary to indicate the following rule:



If the switch is modified and the lamp is on

then the lamp should be off and the switch should be stable.

Finally, to upgrade the global variable neon we will use the value of the variable lamp



If the lamp is off then the neon should be on

If the lamp is on then the neon should be off

If the lamp is fused then the neon should be on

Application 2: We have three switches, denominated switch one, switch two and switch three. The internal variables of each one of them are supposed implemented in the same way. The set of rules that would implement a switch would be the following one:

To light the lamp the following rules will be used:



If the switch one is modified and the lamp is off

then the lamp should be on and the switch one should be stable.

If the switch two is modified and the lamp is off

then the lamp should be on and the switch two should be stable.

If the switch three is modified and the lamp is off

then the lamp should be on and the switch three should be stable.

For turn off, rules contrary to the previous ones will be used:



If the switch one is modified and the lamp is on

then the lamp should be off and the switch one should be stable.

If the switch two is modified and the lamp is on

then the lamp should be off and the switch two should be stable.

If the switch three is modified and the lamp is on

then the lamp should be off and the switch three should be stable.

Finally, the same as in the current case, the global variable neon is upgraded according to the value of the lamp variable:



If the lamp is off then the neon should be on.

If the lamp is on then the neon should be off.

If the lamp is fused then the neon should be on.

Following this line, the design of a completely automated smart house in all the aspects can be studied and carried out. Among others, the following aspects, features and variables should be kept in mind:

The system should have an illumination control loop. Also, the presence should be detected by means of adequate sensors and optical barriers at doors, for lit or turn off the adequate lights and maintain the optimum habitability conditions together with the heating, conditioned air and fan nodes.

The node that takes charge of the heating can be implemented by means of a CANary processor with a digital output. The node that controls the conditioned air of the room can be also implemented with a CANary processor, using a digital output (ON/OFF) and an another that, by means of a triack, controls the fan speed. Finally, the node that controls external climatic variables is located outside the house, and it is necessary not only for maintain the climatic conditions of the house, but also to decide in function of the sun, wind, etc. when the windows and blinds should be closed or open.

After the design process and the specification of all the necessary rules, the protocol performance has been evaluated and was completely successful, although some design matters of the RN should need further revision. In addition, nowadays new features are being introduced.

The proposed system will execute the following protocol phases [8]:



1. Initial phase

The PSN diffuses a RESET message and subsequently a WHO message, to begin the protocol and to discover that nodes are in the network. Each CN responds with an IDENT message for each port (native variable) that possesses, indicating for each one of these like it is: variable type (digital input, analog input, digital output or analog output), the variable resolution and identifier.

To know in that moment all the variables have been received, after a certain prudential time the PSN sends a message with minimum priority (IDENT message), and waits until it has been sent. If this message is sent, it is because the rest of messages of the other nodes has been already sent (they have a bigger priority), and that therefore the PSN has already received all the variables.

2. System calibration

When everything is already designed, the limit values of the analogical variables should be assigned. This task can be carried out by means of the calibration. The calibration consists on seeing physically the values that are introduced in design time. For example an output calibration consists on write physically the output (WRITE message), and an input calibration is to see in the PSN screen the logical value of the physical input that there is in the system in that moment (READ message).



3. Distribution phase

It is one of the most important phases, since in this phase the matrices are generated, divided and distributed among the executioners nodes. Also, the result influences in a very decisive way in the response and execution time of the Distributed Rule Net (DRN).



4. Execution phase

Once arrived to this point, the PSN has already distributed the RN, and the execution begins. This phase begins with a START message, and from this point the controller node can already retire of the protocol and to leave alone the executioners nodes to carry out its task.

This phase is the normal system operation, in which the RN is executed. The CN’s begins to read their inputs, to execute their assigned rules and to write their outputs. In case of detecting a change in a global variable, will inform to the rest of nodes by means of a VAL message.

In this stage the PSN can adopt monitoring functions or be removed off the system.

If the PSN remains in the system, fault tolerance mechanisms can be implemented. It can work this way as system watch dog. In this case, PSN would send a WHO message periodically, which would be replied by means of an ALIVE message. If that message does not arrive, and after several tries, the PSN will assume a failure in the corresponding node.

More sophisticated methods are contemplated. PSN knows which rules and variables belong to each node, so PSN can watch the network for variable updates. In this case, the PSN only would transmit a WHO message when no variable of the node has been updated for a fixed amount of time. It is also possible for the PSN to keep a copy of the distributed RN, simulate it and detect if an update that should have been transmitted is lost.

When the PSN notices that a node has fallen, several actions are available. PSN always will inform the user of the failure, but is also able to restart the system with the same RN, or distribute a new RN for degraded working mode.

Also the system has bounded response time. Mathematical form of Rule Net allows the execution time evaluation of a determined RN. In this sense, and taking into account that this execution consists on simple binary operations (AND & OR) between bit matrices (usually implemented by bytes), a worst case (WCET) is defined, thus response time can be bounded.

Communication time on a CAN network can be limited, at the worst-case and in absence of transmission errors, because of the minimum latency between variable updates and deterministic collision resolution.

In this way, this system allows deterministic time responses, making it suitable for a great range of applications.



5 Conclusion

The application of Distributed Expert Systems to the smart house has been presented. The proposed system incorporates some interesting features as automatic capture of distributed nodes and their characteristics, simple programming by means of production rules and distribution of the control algorithm on the nodes in a user friendly way. Everything has been carried out using generic nodes that can be implemented with low-power microcontrollers, which means a compact, low cost, as well as powerful and flexible system.

Rule Net theory has been utilized to implement the distributed expert system, which allows the easy control of the previously mentioned system, even correcting transient faults. In the case of facing a permanent fault, the crashed subsystem is isolated and the user is notified accordingly.

Given the excellent results obtained, new approaches are being applied. One of them consists on the implementation of algorithms that take into account other user restrictions, more fault tolerance mechanisms by means of redundancy, etc.

Other interesting question to study is the impact of fault tolerance mechanisms when a fault occurs, in the response time of the proposed system.

References:

[1] J. Yen, R. Langari, A. Zadeh, "Industrial Applications of Fuzzy Logic and Intelligent Systems," IEEE Trans., Piscataway, NJ, 1995.

[2] M. Gupta and N. K. Sinha (editors), "Intelligent control systems: theory and applications," IEEE Trans., Piscataway, NJ, 1998.

[3] M. Peris, A. Bonastre and R. Ors, "Distributed Expert System for the Monitoring and Control of Chemical Processes," Laboratory Robotics and Automation, 10, 163, 1998.

[4] J. Liebowitz, Introduction to Expert Systems, Mitchell Publishing, Inc., 1988.

[5] M. Silva, The Petri Nets in Automation and in Computer science, Editorial AC, Madrid, 1985.

[6] A. Bonastre, Industrial Local Area Network: A new architecture for control distributed systems, Ph. D. on Computer Science, Polytechnical University of Valencia, 2001.

[7] CAN specification version 2.0, Robert Bosch GmbH, Stuttgart, 1991.



[8] A. Bonastre, R. Ors and M. Peris, "A CAN Application Layer Protocol for the implementation of Distributed Expert Systems," in Proceedings of the 6th International CAN Conference, November 1999.


Download 196.81 Kb.

Share with your friends:
1   2




The database is protected by copyright ©ininet.org 2024
send message

    Main page