Share this

Object-oriented human-machine interface design for control and protection unit of substation automation system

2026-04-06 06:25:47 · · #1
In recent years, object-oriented programming (OOP) has become the de facto standard for program construction, and many programs designed using OOP have become exemplary in program design; Windows applications are one example. Drawing on the interface design principles of Windows applications, this paper introduces object-oriented methods into the design of the human-machine interface (HMI) of the control and protection unit, making the HMI program clear and concise, while greatly improving its portability across different functional control and protection units. 1. Functional Analysis of the HMI of the Control and Protection Unit in Substation Automation System 1.1 Control and Protection Unit 1.1.1 Introduction to the Control and Protection Unit Substation integrated automation systems have evolved from early centralized single-CPU systems to today's hierarchical distributed multi-CPU systems. Currently, the development trend of substation integrated automation is to combine powerful microcomputer monitoring systems with fully digital microcomputer protection and control technology and high-speed network communication technology to replace traditional RTUs and achieve unmanned operation. The current trend in the development of substation integrated automation in China is to distribute the traditionally centralized monitoring and protection functions to various field locations. Specifically, this involves dividing the substation into units according to electrical bays, with each independent control and protection device (such as incoming lines, outgoing lines, transformers, bus couplers, capacitors, etc.) having its own independent control and protection unit. These dispersed control and protection units are then connected to the monitoring host through a communication network, forming an organic whole, thereby achieving centralized management and decentralized control. This system architecture conforms to the development trend of substation automation systems, is well-designed, easy to adjust and expand, has a neat equipment layout, and is convenient for operation and maintenance. 1.1.2 Front view of the human-machine interface of the control and protection unit Figure 1 shows the operation interface of a typical control and protection unit, which can be divided into four areas: area A is the LCD display area; area B is the keyboard input area; area C is the control command input area; and area D is the indicator light and speaker output area. Note: To prevent misoperation, the control command keys are separated from the keyboard input area B and listed separately as area C, and are password protected. 1.2 Keyboard As a major component of the human-machine interaction system of the control and protection unit, the keyboard is responsible for transmitting user commands to the control and protection unit. According to the different response processes of the human-machine interaction system, the keys can be divided into the following 5 categories: (1) Numeric keys + decimal point keys + back keys These keys are used for inputting single or consecutive numbers, and their meanings are assigned by the interactive system software. (2) Up/down selection keys These two keys are used for menu selection, screen page turning, option selection, etc. (3) Confirm key This key is used to select an operation item, similar to the [OK] key in Windows. (4) Cancel key Used to cancel the current operation item or return the menu to the previous level, similar to the [CANCEL] key in Windows. (5) Command keys These keys are used to input important commands such as closing and opening circuit breakers, remote and local switching, and fault reset. 1.3 LCD screen The LCD screen is responsible for transmitting control and protection unit information to the user in the human-machine interaction system of the control and protection unit. In order to make the operation simple and convenient, the display of information on the LCD screen adopts a hierarchical menu structure, which, with the help of the up/down selection keys, the confirm key, and the cancel key, can complete the retrieval of the entire menu. The menu structure is based on "pages". A "page" refers to a screen displayed on an LCD, which consists of two parts: static text and dynamic data. Static text includes explanatory text and prompts, which are composed of Chinese characters and symbols. In human-computer interaction software, it is represented by strings. Dynamic data refers to real-time refreshed values ​​or information that can be modified by the user. In human-computer interaction software, it is represented by numerical variables. LCD pages can be divided into the following categories according to their composition: (1) Plain text pages. Such as a table of contents. These pages do not contain data, so they only need to be refreshed once when displayed. (2) Text + real-time data pages. Such as a power measurement display page. These pages contain real-time refreshed data. When displayed, the data display part must be refreshed continuously to keep it real-time effective, but the user cannot modify the data through the keyboard. (3) Text + modifiable data pages. Such as a fixed value modification page. The modifiable data contained in these pages can be modified by the user through the number keys on the keyboard. (4) Help information pages. Such pages, such as error operation warnings, are usually composed of plain text. However, unlike the three types of pages mentioned above, the page will automatically switch to the page that triggered the help information after being displayed for a period of time. 2 Human-computer interaction design of the control and protection unit with the page as the object 2.1 Similarities between Windows application interface and control and protection unit interface The design process of Windows application is a typical object-oriented design method. At the same time, the Windows application "window" interface and the control and protection unit human-computer interaction interface have many similarities: (1) The window responds to the input information of input devices such as keyboard or mouse through the message response mechanism, and a certain page in the control and protection unit also responds to the keyboard input; (2) Both respond to external input in a simple while() loop; (3) Both use multi-level nested switch-case statements to determine what operation to perform for a certain message. Therefore, it is natural to think of using the design ideas of Windows application to design the human-computer interface of the control and protection unit. Of course, designing menus on a microcontroller is different from software development in the Windows environment, because many message response mechanisms inside Windows and data structures, objects and standard processing functions encapsulated by Windows do not exist in the microcontroller system. Nevertheless, a lot of Windows program development ideas can still be used as a reference when designing the human-computer interface of the control and protection unit. 2.2 Control and Protection Unit Page The control and protection unit page has many similarities to windows in Windows applications. First of all, the core of page processing is also a loop mechanism, which runs and responds to valid external key inputs until it receives the key code to switch windows. This is very similar to the Windows window message loop mechanism; of course, the microcontroller-based page key response mechanism cannot borrow the Windows message response mechanism, but can only process one key response at a time. A page life cycle flow is shown in Figure 2: The flow shown in Figure 2 is actually the main part of the main() entry program of the control and protection unit human-machine interface program. The main() program is formed by adding the initialization of the LCD, communication module and global variables. Several important modules in the flowchart are explained as follows: Initializing and displaying the page includes the following operations: (1) Calling a clear page function ClearPage() to clear the residue of the previous page; (2) Displaying the current page content. As mentioned earlier, the page consists of two parts: static text and dynamic data. Therefore, the page content is displayed in two steps: a. Call the DisplayTxt(unsigned char*) function to display the static text of the current page. The static text is distributed line by line on the screen. For example, on a 256*128 dot matrix LCD screen, displaying one Chinese character requires 16*16 pixels, and displaying one English character requires 8*16 pixels. Therefore, the entire screen can be divided into 8 lines, each line can display 16 Chinese characters or 32 English characters. Calling the DisplayTxt function 8 times completes the display of the static text of the page. The line parameter passed to the DisplayTxt function is a pointer to a specific line of text. b. Display the dynamic data of the current page. First, the page should refresh the dynamic data of the current page stored in the buffer. This step calls RefreshData(STRUCT*), passing a pointer to the page structure as the parameter. This function is responsible for obtaining real-time dynamic data from the data acquisition CPU of the control and protection unit and storing it in the local buffer for display. Then, the page calls DisplayData() to display the dynamic data. The keyboard scanning loop is an unconditional while() loop. It returns the key codes from the keyboard scanning function ScanKeyboard() and performs corresponding operations until a received key press causes a page switch. At this point, the program terminates the current page and enters the lifecycle of the new page, based on the new page pointed to by a pointer to the current page. In addition to the key scanning function ScanKeyboard(), the loop should also include the data refresh function RefreshData(STRUCT*) if the page has dynamic data to maintain data real-time performance. Key press handling is implemented using a two-level nested switch-case statement. As mentioned in Section 1.2, the keys are divided into 5 categories, and each category is handled differently depending on the current page type. The default handling can generally be set to no response. 3. Specific Implementation of Page Operations 3.1 Key Press Handling The key press handling function is the core of the entire application. Here, the program defines what kind of processing is performed on which key presses on a given page. The following analyzes the handling of each type of key. 3.1.1 Number keys + decimal point key + back key These keys only respond on pages with editable data, so there is only one way to process them: translate the input number keys into the corresponding numerical values. 3.1.2 Up/down selection keys The response of these two keys is different on different pages, and can be divided into: (1) Switching to a new page. For example, when displaying measured power, if one screen is not enough and multiple screens are needed, pressing the up/down selection key while displaying one of the screens will display the connected screens. (2) Moving operation items. The current operation item in the menu is represented by a reverse color display. The up/down selection key moves the reverse color display area to the operation item selected by the user. (3) Selecting optional items. Optional items refer to the values ​​that the interface provides to the user to select using the up/down selection key. For example, if the interface provides several communication rate options, the up/down selection key allows the user to switch between these optional rates until the desired communication rate is selected. 3.1.3 Confirm Key The confirmation key has the following possible responses: (1) Switch to a new page. (2) Switch the state of the current item. When setting parameters, the selected item has two states: modified and query. The confirmation key switches the setting value between inverted and normal to represent the switch between modified and query states. (3) Confirm the current input. 3.1.4 Cancel Key The cancel key has only one response: exit the current page and enter a new page display (usually returning to the previous page). 3.2 Page Structure The above analysis of the page display process and key handling provides all activities within a page's lifecycle and the page attributes required for these activities. Below, we define the page structure based on the above analysis of the page display process and key handling. Based on the above analysis, page activities are divided into two main parts: display and key response. Therefore, the page structure is also divided into two related parts, as shown below: Only some variables related to display are defined above, and only variables related to the cancel key are defined for key response. This is because the purpose of this article is only to provide a framework for page design based on Windows programs. As for the specific definition of each variable in the page structure, you only need to add the corresponding page variables based on the page attributes used in the previous process analysis and key processing analysis. Key processing depends on the actual situation, and the design style of the human-machine interface also varies from person to person. Therefore, the specific definition of page structure variables depends on the needs of the reader. 4 Complete the entire human-machine interface design of the control and protection unit The previous section completed the main process of the human-machine interface of the control and protection unit centered on the page and gave the definition of the page structure. To complete the entire human-machine interface design of the control and protection unit, the basic display, key scanning, and communication interface functions are still missing. Unlike Windows applications, which can use a large number of ready-made Windows API functions, in the design of the human-machine interface of the control and protection unit, these underlying interface functions need to be designed by ourselves. In addition, some page methods (functions) based on the interface functions also need to be designed by ourselves. Since the interface functions vary with the hardware and the page methods depend on the user's needs, they are listed below only according to their functions: (1) Functional modules related to key processing. It should include a key scanning module and an input conversion module (translating a string of numeric keys into a floating-point number). (2) Display function modules. It should include a text display module, a numerical display module, etc. (3) Communication modules. It should include a communication interface module and a conversion module (packaging and transmitting data to the communication interface and restoring received data packets). 5 Conclusion The above applies the object-oriented method to the entire process of designing the human interface of the control and protection unit, especially drawing on the design ideas of Windows applications. Although the human interface program based on the microcontroller cannot implement the core of Windows applications—the message response mechanism—it still greatly improves the user-friendliness of the interface and the portability of the program, demonstrating the superiority of the object-oriented design method.
Read next

CATDOLL 138CM Airi (TPE Body with Soft Silicone Head)

Height: 138cm Weight: 26kg Shoulder Width: 30cm Bust/Waist/Hip: 65/61/76cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22