Friday, May 20, 2011
【 Weak current College 】 object-oriented design in building control system
Summary describes object-oriented programming to improve reliability, more flexibility and reduce the cost of preparation, and introduces a complete object-oriented design also includes a form control system communication protocols based on object-oriented. BACnet protocol will each control subunits into object form, which simplifies the communication between the device and operation.
A keyword object-oriented design, control systems, BACnet, Protocol
Abstractlllutrateshowobject-orientedprogrammingimprovesreliability,providesgreaterflexibilityandreducesprogrammingcosts,andfurtherpresentsthatanobject-orientedprotocolasabaseofcommunicationmakesawholeobject-orienteddesign.BACnetchangescontrolunitstoacontrolunitstoacollectionofobjects,whichfacilitatesthecommunicationandoperationofthedevices.
Keywordsobject-orienteddesign,controlsystem,BACnet,protocol
1 Introduction
Since the 1980s, object-oriented approach has been widely used in computers and related areas, it is not only applied to the programming phase, but also applied in system design and system analysis. Object-oriented design for use in the control system reduces the cost of the control system, improved the system's ease of use, increased system serviceability, thus becoming the development direction of the control system. Control systems of object-oriented design is mainly divided into two parts:
① object-oriented programming
Traditional procedural programming language (such as BASIC, and C) as does not have the characteristics of the object, the preparation of the program have to line-by-line, so that only professionals can easily apply these tools [1]. But even if these professionals also inevitable in the programming process produces an error, but this control system can be disastrous. Because of the control system of control of the actual device, any omissions may cause the equipment appears the breakdown or even scrap to owners of huge losses.
Object-oriented programming enables programming of simplistic and visualization, which greatly reduce the workload of the programmer. At the same time members of the object and the function are managed by professionals who have repeated testing and inspection, the possibility of error is therefore significantly diminished. Relative to conventional programming language, lack of programming background in construction equipment engineers can skilled use of "object" to finish his task of control required, without the help of software professionals.
② object-oriented protocol
Protocol is to control the system each other communicate, object-oriented design must be determined by the object-oriented protocol to perfection. Traditional distributed control systems (DCS) mainly consists of analog input (AI), analogue outputs (AO), digital input (DI) and digital output (DO) control system of individual channels, they are independent of each other. DCS in this structure makes it easy for project personnel according to the characteristics of the project to any combination of control system consists of, but the channel between independent data caused by a large number of redundant data and information of blindness that data interpretation become very complex and very difficult to find useful information. Object-oriented data underlying protocol will explain, classification, and judging by the early designers is complete, the useless data into useful information, which greatly facilitates the application of engineering personnel.
Object-oriented techniques to control the system in real applications, you must complete these two levels of the object. The lack of any of these, the entire object-oriented systems are incomplete.
2 object-oriented programming
2.1 control language for object
With object-oriented programming language c++, object-oriented programming is widely known as cognitive. But for various reasons, the control system of programming languages are mostly produced by non-line by line object-oriented languages, object-oriented language is also less application. We all know, object-oriented technology is built on the "objects" and "class" basis, so they should have an accurate definition. The object is defined as "the problem domain or its implementation, something abstract, it reflects the system to save the information and (or) to interact with it. It is the number of properties and their dedicated service in a package body "[2]. While the class is defined as "one or more of the object's description, use a set of properties and services forms to describe" [1]. For control systems of object-oriented language, "object" should have the following characteristics:
① independence
An object is independent of the module, the object dependencies between each other. The system can consist of separate objects, regardless of mutual interference.
② connectivity
An isolated object can only be completed very little part of the function, only the object organically to play its role. Object-oriented system excitation by message object interaction, interrelated and form a close-knit overall.
③ easy maintenance
An object's internal functions and external environment does not have any inherent link on an object maintenance, release does not affect other objects and functionality of the outside world.
In the object's independence, control language should be separate objects internal operational variables and the actual action variables. For example, collecting and distributingControl system (DCS) direct manipulation device is 4 ~ 20mA/0-10V analog output or digital output, and fieldbus control system (FCS) direct manipulation of the valves, motors, and other intelligent controllers. Control language variables to direct is AO, DO or specific valves, motors, etc., although that seems more intuitive, but it lose the versatility and object encapsulation features. When the system control program to have the same characteristics of another system, the user will need to put the program in each of the variables changes to adapt to the new system, this is not only time-consuming and prone to error. Therefore you need to program operation and the actual action variables, so that the object of independence and operability of the system.
Control system of the scene control module typically program capacity and computing speed is much lower than the corresponding properties of the computer, so the hardware constraints make control language minimize class application of complex processes. At the same time the member functions in a class should also be minimized, constructors and destructors are completed by an assignment expression. In short, control language class consists of two parts:
Variable declaration table; ② perform calculations on the variable and method of operation.
Control in the language of the class is defined as:
Class name:
Class variable declaration table:
Variable type variables 1
…
Variant type variable, n
Class code:
Method 1
…
Method m
The end of the class description
2.2 messages sent and received
An object-oriented program consists of several interrelated set of objects, and objects of completion of all functions. Contact between the objects is the message and incentive mechanisms, the message is used to request object executes a process or answer some of the information request "[3]. In object-oriented system, the links between objects is through the delivery of messages, objects only after receiving the message to respond. And to respond to the object member function that is called "methods", method is to implement specific functionality of the message.
The message has the following properties:
① the same object can receive different forms of more than one message, produce different responses.
② a message can be sent to different objects, messages explain fully completed by the receiving object.
③ object on message response is not required. Objects can either respond to the message, or you can return no answer.
According to the table, control the language will include equipment, clock and data exchange system events to be able to respond to these events. Equipment event is the control system of the actual device's status changes, and other device information, control system informs the appropriate action on the object. Clock event is used to satisfy the system requirements of the time control, the timer clock time conditions have sent to the object under the condition of "time expired" message object based on this information for a fixed time steps or absolute time operation.
Because the control procedures to take account of all the devices in the system, so the program does not exist in an infinite loop waiting for an external variable changes. If the system halted "phenomenon. When an object to another object for sending data when it creates a data exchange messages to motivate the object, the object is excited to be sent accordingly to receive data. Data exchange of messages at the same time the incentive mechanism can be used for internal objects under certain conditions to trigger their own.
In the control system event is not law, at a time may appear more than one message at the same time. And what message should first be addressed, which last processing requires a control system to manage. Message management usually uses the queue means that is generated by message to queue time series, first come first to handle later post processing. If the message is the same as the time it happens, the message class or device, time, data communication in order to arrange. Device message corresponding to the actual on-site equipment, the message generated description field equipment has changed, the control system should be the first to respond.
An object may be on more than one trigger message response, each message will have to be a member function on its response, this member function is called "methods". System events are mapped to objects used by the tool is called the message table. Object-oriented language for easy control of the message map and the corresponding methods in accordance with the uniform format to write. In the message table in a predefined system events are mapped to methods, when the message triggers the object corresponding to this message after finding the method name, and perform the appropriate method.
Control language in a complete object should include object name, message tables, the object variable declaration and data exchange table and the entity object. Object variable declaration and data exchange tables within the system and the variable declarations and external device data exchange. When the message is triggered when the object is a table of system equipment status and data are mapped to corresponding variables. The overall structure as objects:
Object name:
Message table:
Method name 1 (trigger condition 1)
…
Method name k (trigger condition k)
Object variable declaration and data exchange table:
Variable type variables 1 = system equipment 1
…
Variant type variable, n = system device n
Object entities:
Method name 1
Method source code 1
Method name 2:
Method of the source code
…
End
In order to simply describe objects in a building control system of practical application, to the most commonly used PID algorithm, for example to constitute a PID object. Figure 1 shows the PID algorithm for regulating the actuator v make the managed object's temperature t daTo temperature setpoint tset. For this adjustment algorithm, a simple object can be summarized.
Discrete PID algorithm is cyclical operation, so it's triggered messages to the time period. PID algorithm and the outside world exist 3 data exchange, which is the temperature setting values, temperature measurement and actuator. Complete a PID objects only need to set time period, at the same time will be mapped to the data object's internal variables correspond with the actual device. This is a very simple process, an expert in PID algorithm can expertly action PID algorithm. Simple PID algorithm is only one example, but the practical application of the object in a complex algorithm. Typically engineers need to spend much time to understand complex algorithms, such as adaptive algorithms, etc. The algorithm of eliminates these problems, saving staff time and effort.
Because the objects on different messages to different responses, so you can add the PID object on failure processing to enrich the PID algorithm. The following example on temperature overrun of signal processing. When the temperature gauge, object directly to fault handling procedures, no PID calculation. Users also can increase other methods to handle different situations, thereby greatly improving the flexibility of the object.
PID algorithm:
Message table:
PID calculation (interval time 10s)
Troubleshooting (temperature overrun alarm signal)
Object variable declaration and data exchange table:
Tset = temperature setpoint
T = temperature measurement
V = actuator
The entity object
PID calculation
PID calculation source code
Troubleshooting:
Troubleshooting source code
End
3 object-oriented protocol
In the control system only belong to the management of object-oriented programming language is not enough, including on-site layer of object-oriented communication protocol will constitute a complete object-oriented control system. Object-oriented design of the original is the programming process greatly simplified, and traditional object-oriented point of control systems would only increase the burden on the programmer. For example a DO AI and two pairs of control valve, the valve to open degree AI measurement, two DO are valve motor reverse, in control valve when AI measurement value is less than the value being set for the valve to DO output signal up valve, on the other hand down valve. These simple functions in traditional object-oriented point of control systems require the programmer to write, increased system design costs and commissioning costs.
Object-oriented BACnet protocol is used for all devices in the help system of mutual understanding of the "common language". For unified building control agreements, ASHRAE has published 1995, BACnet protocol [4]. BACnet protocol defines include air-conditioning control system, fire protection, building equipment control system communication protocols between the data. It follows the OSI open network protocols, the data to be combined into objects in network transmission. At the same time as the building control network is a network, it only preserves the physical layer and data link layer, network layer and application layer.
BACnet protocol does not specifically provide for the physical layer and data link layers of the form, it could be based on a number of different protocols. Shown in Figure 2, paragraphs 1, 2 option is to establish standards in IEEE802 LAN, it will be the data link layer is subdivided into logical link control sublayer (LLC) and media access control sublayer (MAC), logical link control sublayer primarily addressing, sorting, error control, and other functions, the media access control sublayer provide transmission media and access control capabilities. Figure ISO8802-2 (IEEE802.2) is the logical link control sublayer, ISO8802-3 (IEEE802.3) is the media access control sublayer, specific methods for conflict detection of carrier sense multiple access (CSMA/CD). The third option in the data link layer is the primary way from/token, physical layer the slave's standard, RS-485 RS-485 standard allows up to 32 drives in parallel, and 32 single receiver, multiple points of interconnection is very convenient. 4 alternative is point-to-point protocol, corresponding physical layer standards for RS-232. 5 alternative is LonTalk Protocol of Echelon Corporation. BACnet network layer is to connect different network, no matter what is the physical layer and data link layers. For example the establishment of a BACnet router to IEEE802.3 and ARCNET consists of different network organizations.
BACnet is not the physical layer and data link layers of specific agreements in the hope that BACnet can be applied in a variety of network infrastructure. The true essence of the BACnet protocol is the application-tier defines open device object, and thus become the object-oriented. BACnet almost covers building control all possible scenarios, it defines the device object, schedule object, the program object, file objects, and so on, and provides the management and operation of the service object.
BACnet currently defines 18 kinds of objects, which are the analog input, analog output, analog and digital input, digital output, digital value, equipment, multi-state input, multiple-output, orders, schedules, timeline, event registration, file, rings, groups, notification class and program objects. BACnet is the object defines a specific data structure and properties, the property on behalf of the information in the device, the system may through property on the device for reading or writing information. In this 18 object, input and output objects of 6, they represent all possible input and output types. Multi-state input output object 2, which indicates that the object is located in the BACnet device operations program results and physical output. 1 the command object to a group object attributes wroteIn a set of values. Schedule object 2, which is used to represent a cyclical time or calendar. Event registration object 1, it records the management event the requested information. The file object to manage access to files and read-write. Group object is similar to the device is defined as a group, make the operation more convenient. Central object for feedback control object. The notification class object including event notification required information. Program objects will run the program as an object.
Table 1 to digital input as it shows how to define objects BACnet.
Table for digital input properties of the object. Object ID is a number representing the object, the object name and object type as the name suggests is the object name and type of the object. The device type is a description string of the device, and device status and events on behalf of the device status is normal or not. Service status property represents the actual input value and measurement values in the object are the same. When it is true the actual input value and measurement values, the user can freely change regardless of the actual input value for the debugger has brought about tremendous convenience. Polarity property represents the object's polarity, when polarity is positive when the object of the measured value and the actual input value are the same, both when polarity is negative. For example the actual input value is "ON", when negative polarity of the object value is "OFF". "Open", "off" State description describes the object off or off State for explanation, for example "off" State description can be written as "Fan 1 off". The most recent State transformation time attribute is the digital signal from the counter was reset the number of State and State transformation transforms counter reset time attribute that records the time of the last reset. "Open" status reset time and experience the time attributes are documented reduction of time and was reset "on" State time (s) combined. The remaining properties describe the operation of the alarm information, here is a detail.
BACnet protocol enables object-oriented programming becomes more simple and secure. Users only need to program simply calls the object's properties, you can get a lot of features that enable control programs became short and thus applies to the control system. At the same time, users can focus on a control algorithm to prepare, compile the program from the original heavy complex work turned into a fun process, saves programming time and cost of personnel.
4 conclusions
Because the object-oriented design advantages, now there is a wide range of control systems support the concept of object-oriented. Compared with traditional object-oriented point of control systems, object-oriented control system more economical programming and debugging costs, reducing the error rate, the program improves system reliability, increased system flexibility. Therefore the object-oriented control system will replace the control system for points, as the development direction of the control system.
Reference documents
1JonathanCFrench.Object-orientedprogrammingofHVACcontroldevices.ASHRAEJ,1999(12).
2Pertercord,EdwardYourdon.Object-orienteddesign.YourdonPress,1991.
3 Tang Yong, structured and object-oriented software method, Beijing: Science Press, 1998
4ASHRAEStandard,ANSI/ASHRAE135-1995.BACnet,aDataCommunicationProtocolforBuildingAutomationandControlNetworks.
5-Xiao Shi, Liu xiande, Shiyan, BACnet's object model, engineering design and CAD and intelligent building, 200 (1)
6-Xiao Shi, Liu xiande, Shiyan, BACnet services--the BACnet protocol standards technology system seminar (6). Engineering design and CAD and intelligent building, 2002 (2)
7 Yang Shou to building automation system of three-tier architecture, engineering, CAD and intelligent building, 2000 (3)
No comments:
Post a Comment