Electric energy meter field operation environment simulation system and simulation method thereof

文档序号:1323438 发布日期:2020-07-14 浏览:8次 中文

阅读说明:本技术 一种电能表现场运行环境仿真系统及其仿真方法 (Electric energy meter field operation environment simulation system and simulation method thereof ) 是由 陈锦胜 何俊锋 陈建钊 陈勤娟 于 2020-04-07 设计创作,主要内容包括:本发明公开了一种电能表现场运行环境仿真系统及其仿真方法,仿真系统包括PCB板,在PCB板上设置有中央处理器和嵌入式单片机,中央处理器上还电性连接有温湿度传感器和pH值采集传感器,嵌入式单片机上设置有若干个用于连接外设装置的IO输出口,在每个IO输出口上均设置有IO引脚,且对应每个IO输出口在嵌入式单片机上设置有GND引脚,所述嵌入式单片机通过内置的监控电路读取各个IO输出口上IO引脚的实时状态;还包括一种仿真方法;本发明通过嵌入式单片机控制加热器、加湿器,从而使装置在预先设定的温度、湿度下运行,结合中央处理器控制分级开关使装置在不同负载下运行,达到真实模拟实际环境的温湿度和电表的负载。(The invention discloses an electric energy meter field operation environment simulation system and a simulation method thereof, wherein the simulation system comprises a PCB (printed Circuit Board), a central processing unit and an embedded single chip microcomputer are arranged on the PCB, a temperature and humidity sensor and a pH value acquisition sensor are also electrically connected to the central processing unit, a plurality of IO output ports for connecting peripheral devices are arranged on the embedded single chip microcomputer, an IO pin is arranged on each IO output port, a GND pin is arranged on the embedded single chip microcomputer corresponding to each IO output port, and the embedded single chip microcomputer reads the real-time state of the IO pin on each IO output port through a built-in monitoring circuit; also included is a simulation method; the invention controls the heater and the humidifier through the embedded single chip microcomputer, thereby enabling the device to operate under preset temperature and humidity, and controlling the grading switch by combining the central processing unit to enable the device to operate under different loads, thereby truly simulating the temperature and humidity of the actual environment and the load of the ammeter.)

1. The utility model provides an on-spot operational environment simulation system of electric energy meter, its characterized in that, includes the PCB board be provided with on the PCB board central processing unit and with central processing unit electric connection's embedded singlechip, last atmospheric temperature and humidity sensor and the pH value of still electric connection of central processing unit gather the sensor, be provided with a plurality of IO delivery outlet that is used for connecting peripheral equipment on the embedded singlechip, every IO delivery outlet has the same characteristic and mutual independence, every all be provided with the IO pin that is used for connecting the positive pole of peripheral equipment power on the IO delivery outlet, and correspond every the IO delivery outlet is provided with the GND pin that is used for connecting peripheral equipment power negative pole on the embedded singlechip, embedded singlechip reads the real-time status of IO pin on each IO delivery outlet through built-in supervisory circuits, central processing unit controls the switch and the power change of peripheral equipment through the level of IO pin on drawing high or drawing low IO delivery outlet .

2. The system for simulating the on-site operation environment of the electric energy meter according to claim 1, wherein the temperature and humidity sensor is a DHT11 sensor, the DHT11 sensor comprises a resistive humidity measuring element and an NTC temperature measuring element, and the resistive humidity measuring element and the NTC temperature measuring element are packaged to form a VCC pin, a GND pin and a DATA pin.

3. The system of claim 2, wherein the VCC pin is an anode of DHT11 and is connected to any available VCC port on the PCB, the GND pin is a cathode of DHT11 and is connected to any available GND pin on the PCB, and the DATA is a DATA output port for receiving real-time DATA of the temperature and humidity sensor and is connected to an IO pin on the PCB.

4. The system for simulating the on-site operation environment of the electric energy meter according to claim 1, wherein the peripheral devices comprise a heater, a humidifier and a plurality of mutually independent loads, and the loads are specifically simulation load modules.

5. The system for simulating the field operation environment of the electric energy meter as claimed in claim 2, wherein the DATA pin selects PG9 for receiving real-time DATA of a temperature and humidity sensor.

6. An electric energy meter field operation environment simulation method based on the simulation system of any one of claims 1-5, which is characterized by comprising the following steps:

step 100, initializing a central processing unit, an embedded single chip microcomputer, a temperature and humidity sensor and a pH value acquisition sensor;

200, after the initialization of a central processing unit, an embedded single chip microcomputer, a temperature and humidity sensor and a pH value acquisition sensor is completed, establishing a script through the central processing unit for trial operation;

and 300, simulating the operation environment through a feedback regulation central processing unit for data acquisition on the basis of test operation.

7. The method for simulating the field operation environment of the electric energy meter according to claim 6, wherein the specific steps for initializing the central processing unit, the embedded single chip microcomputer, the temperature and humidity sensor and the pH value acquisition sensor are as follows:

step 1, calling RCC _ AHB1PeriphClockCmd to set the clock to RCC _ AHB1Periph _ GPIOE, and enabling the clock to be in an available state;

step 2, establishing a GPIO _ IntStructure object, wherein the IO output port is sequentially set to GPIO _ Pin _2 to GPIO _ Pin _7, and additionally, GPIO _ Mode _ OUT is set to be in a common output Mode, and GPIO _ PuPd _ UP is set to be in a pull-UP Mode; and setting the circuit frequency to GPIO _ Speed _50MHz, grouping GPIOE, and initializing by using a GPIO _ IntStructureobject, thereby completing the initialization of IO pins corresponding to GPIO _ Pin _2 to GPIO _ Pin _ 7.

8. The method for simulating the field operation environment of the electric energy meter according to claim 7, wherein after the initialization of the central processing unit, the embedded single chip microcomputer, the temperature and humidity sensor and the pH value acquisition sensor is completed, a script is established by the central processing unit for trial operation, and the specific steps comprise:

step A, a dialog box is created by using a GUI _ CreateDialogBox, a corresponding switch BUTTON and control of a display text are created on the dialog box, and IDs of the switch BUTTONs of IO pins corresponding to GPIO _ Pin _2 to GPIO _ Pin _7 are set to be ID _ BUTTON _1 to ID _ BUTTON _6 respectively;

step B, appointing a callback function through a GUI _ CreateDialogBox, monitoring all events of the switch BUTTONs from ID _ BUTTON _1 to ID _ BUTTON _6, coding the events in WM _ NOTIFICATION _ RE L EASED of the switch BUTTONs, and controlling the switch;

and step C, respectively using GPIO _ SetBs or GPIO _ ResetBits to carry out high level or low level pulling operation on the corresponding IO pins according to the state of each group of corresponding IO pins, so as to control the on-off state of the power supply of the peripheral device, and reading the real-time state of the corresponding IO pins through a GPIO _ ReadInputDataBit function to ensure the operation to be effective or invalid.

9. The method for simulating the field operation environment of the electric energy meter according to claim 8, wherein the specific steps of the central processing unit for simulating the operation environment are as follows:

step 100, calling RCC _ AHB1PeriphClockCmd to set to RCC _ AHB1Periph _ GPIOG clock and to be in available state;

step 200, establishing a GPIO _ IntStructure object, wherein the IO output port is set to GPIO _ Pin _9, and GPIO _ Mode _ OUT is set to be in a common output Mode; GPIO _ PuPd _ UP is in a pull-UP mode; setting the circuit frequency to GPIO _ Speed _50MHz, grouping GPIOE, and initializing by using a GPIO _ IntStructure object, thereby completing the initialization of an IO pin corresponding to PG 9;

step 300, setting a callback function for WM _ HBKWIN by using WM _ SetCallback;

step 400, setting a timer for WM _ HBKWIN by using WM _ CreateTimer, and executing the timer once every 1000 ms;

step 500, in the callback function set by WM _ SetCallback, all window messages of the top window of the program are monitored, and after capturing the message created by WM _ CreateTimer, the data of DHT11 is read and displayed.

Technical Field

The embodiment of the invention relates to the technical field of simulation systems, in particular to a simulation system and a simulation method for an on-site operation environment of an electric energy meter.

Background

The damage of the electric energy meter is a production problem of distribution network operation and maintenance personnel and measurement operation and maintenance personnel at present, the damage factors of the electric energy meter are many, and the defects of electric overload, installation mode defects of wiring points and the like exist. At present, main influence factors of electric energy meter damage need to be determined through research so as to carry out targeted maintenance, a large number of experiments need to be carried out for determining the influence factors, and the operation environment of the electric energy meter needs to be simulated in order to ensure the simulation effect. The simulation device of the operation environment can preset parameters such as temperature, humidity, load and the like to simulate the field operation environment of the electric meter, and aims to observe and analyze the reason of the electric meter burning out through the simulation device, so that different countermeasures are implemented.

In the full-performance test of the existing electric energy meter, the test is carried out under the steady-state ideal condition of a laboratory, and because the field operation environment is sometimes extremely severe, the dynamic process of continuous load change and continuous high temperature and high humidity is often encountered, and the test condition of the laboratory cannot be truly reproduced under the prior art condition.

Disclosure of Invention

Therefore, the embodiment of the invention provides a simulation system and a simulation method for an electric energy meter field operation environment, and aims to solve the problem that the laboratory test conditions in the prior art cannot truly reproduce the field operation environment.

In order to achieve the above object, an embodiment of the present invention provides the following:

an electric energy meter field operation environment simulation system comprises a PCB board, a central processing unit and an embedded single chip microcomputer electrically connected with the central processing unit are arranged on the PCB board, the central processing unit is also electrically connected with a temperature and humidity sensor and a pH value acquisition sensor, the embedded single chip microcomputer is provided with a plurality of IO output ports for connecting peripheral devices, each IO output port has the same characteristic and is mutually independent, an IO pin used for connecting the positive electrode of a power supply of a peripheral device is arranged on each IO output port, and a GND pin used for connecting the cathode of a power supply of a peripheral device is arranged on the embedded single chip corresponding to each IO output port, the embedded single chip microcomputer reads the real-time state of the IO pins on each IO output port through the built-in monitoring circuit, the central processing unit controls the power switch and the power change of the peripheral device by pulling up or pulling down the level of the IO pin on the IO output port.

As a preferable scheme of the present invention, the temperature and humidity sensor is specifically a DHT11 sensor, the DHT11 sensor includes a resistance-type humidity-measuring element and an NTC temperature-measuring element, and the resistance-type humidity-measuring element and the NTC temperature-measuring element are packaged and then are provided with a VCC pin, a GND pin, and a DATA pin.

As a preferable scheme of the present invention, the VCC pin is an anode of DHT11, and is connected to any available VCC port on the PCB, the GND pin is a cathode of DHT11, and is connected to any available GND pin on the PCB, and the DATA is a DATA output port for receiving real-time DATA of the temperature and humidity sensor, and is connected to an IO pin on the PCB.

As a preferred aspect of the present invention, the peripheral device includes a heater, a humidifier, and a plurality of mutually independent loads, and the load is specifically a simulated load module.

As a preferred aspect of the present invention, the DATA pin selects PG9, which is used for receiving real-time DATA of the temperature and humidity sensor.

In addition, the invention also provides a simulation method of the electric energy expression field operation environment of the simulation system, which comprises the following steps:

step 100, initializing a central processing unit, an embedded single chip microcomputer, a temperature and humidity sensor and a pH value acquisition sensor;

200, after the initialization of a central processing unit, an embedded single chip microcomputer, a temperature and humidity sensor and a pH value acquisition sensor is completed, establishing a script through the central processing unit for trial operation;

and 300, simulating the operation environment through a feedback regulation central processing unit for data acquisition on the basis of test operation.

As a preferred scheme of the invention, the specific steps for initializing the central processing unit, the embedded single chip microcomputer, the temperature and humidity sensor and the pH value acquisition sensor are as follows:

step 1, calling RCC _ AHB1PeriphClockCmd to set the clock to RCC _ AHB1Periph _ GPIOE, and enabling the clock to be in an available state;

step 2, establishing a GPIO _ IntStructure object, wherein the IO output port is sequentially set to GPIO _ Pin _2 to GPIO _ Pin _7, and additionally, GPIO _ Mode _ OUT is set to be in a common output Mode, and GPIO _ PuPd _ UP is set to be in a pull-UP Mode; and setting the circuit frequency to GPIO _ Speed _50MHz, grouping GPIOE, and initializing by using a GPIO _ IntStructureobject, thereby completing the initialization of IO pins corresponding to GPIO _ Pin _2 to GPIO _ Pin _ 7.

As a preferred scheme of the invention, after the initialization of the central processing unit, the embedded single chip microcomputer, the temperature and humidity sensor and the pH value acquisition sensor is completed, a script is established by the central processing unit for trial operation, and the specific steps comprise:

step A, a dialog box is created by using a GUI _ CreateDialogBox, a corresponding switch BUTTON and control of a display text are created on the dialog box, and IDs of the switch BUTTONs of IO pins corresponding to GPIO _ Pin _2 to GPIO _ Pin _7 are set to be ID _ BUTTON _1 to ID _ BUTTON _6 respectively;

step B, appointing a callback function through a GUI _ CreateDialogBox, monitoring all events of the switch BUTTONs from ID _ BUTTON _1 to ID _ BUTTON _6, coding the events in WM _ NOTIFICATION _ RE L EASED of the switch BUTTONs, and controlling the switch;

and step C, respectively using GPIO _ SetBs or GPIO _ ResetBits to carry out high level or low level pulling operation on the corresponding IO pins according to the state of each group of corresponding IO pins, so as to control the on-off state of the power supply of the peripheral device, and reading the real-time state of the corresponding IO pins through a GPIO _ ReadInputDataBit function to ensure the operation to be effective or invalid.

As a preferred scheme of the present invention, the specific steps of the central processing unit performing the simulation on the operating environment are as follows:

step 100, calling RCC _ AHB1PeriphClockCmd to set to RCC _ AHB1Periph _ GPIOG clock and to be in available state;

step 200, establishing a GPIO _ IntStructure object, wherein the IO output port is set to GPIO _ Pin _9, and GPIO _ Mode _ OUT is set to be in a common output Mode; GPIO _ PuPd _ UP is in a pull-UP mode; setting the circuit frequency to GPIO _ Speed _50MHz, grouping GPIOE, and initializing by using a GPIO _ IntStructure object, thereby completing the initialization of an IO pin corresponding to PG 9;

step 300, setting a callback function for WM _ HBKWIN by using WM _ SetCallback;

step 400, setting a timer for WM _ HBKWIN by using WM _ CreateTimer, and executing the timer once every 1000 ms;

step 500, in the callback function set by WM _ SetCallback, all window messages of the top window of the program are monitored, and after capturing the message created by WM _ CreateTimer, the data of DHT11 is read and displayed.

The embodiment of the invention has the following advantages:

according to the invention, the heater and the humidifier are controlled by using the STM32 series embedded single-chip microcomputer, so that the device runs at preset temperature and humidity, the processing signal data of the embedded single-chip microcomputer is from the processing result of the central controller on the sensing data of the temperature and humidity sensor, and the hierarchical switch is controlled by combining the central processor to enable the device to run at different loads, so that the running environment of the ammeter is changed, and the temperature and humidity and the load of the ammeter in the actual environment are truly simulated.

Drawings

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. It should be apparent that the drawings in the following description are merely exemplary, and that other embodiments can be derived from the drawings provided by those of ordinary skill in the art without inventive effort.

FIG. 1 is a block diagram of a system architecture in an embodiment of the present invention;

fig. 2 is a schematic flow chart of a simulation method according to an embodiment of the present invention.

Detailed Description

The present invention is described in terms of particular embodiments, other advantages and features of the invention will become apparent to those skilled in the art from the following disclosure, and it is to be understood that the described embodiments are merely exemplary of the invention and that it is not intended to limit the invention to the particular embodiments disclosed. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

As shown in FIG. 1, the invention provides an electric energy meter field operation environment simulation system, which comprises a PCB, wherein a central processing unit and an embedded single chip microcomputer electrically connected with the central processing unit are arranged on the PCB, a temperature and humidity sensor and a pH value acquisition sensor are also electrically connected with the central processing unit, a plurality of IO output ports used for connecting peripheral devices are arranged on the embedded single chip microcomputer, each IO output port has the same characteristics and is mutually independent, an IO pin used for connecting the positive pole of a peripheral device power supply is arranged on each IO output port, a GND pin used for connecting the negative pole of the peripheral device power supply is arranged on the embedded single chip microcomputer corresponding to each IO output port, the embedded single chip microcomputer reads the real-time state of the IO pin on each IO output port through a built-in monitoring circuit, and the central processing unit controls the power switch and the GND pin of the peripheral device through the level of the IO pin on the IO output port to be The power is varied.

Based on the system, the heater and the humidifier are controlled by using an STM32 series embedded single chip microcomputer, so that the device runs at preset temperature and humidity, the processing signal data of the embedded single chip microcomputer is from the processing result of the central controller on the sensing data of the temperature and humidity sensor, and the hierarchical switch is controlled by combining the central processor to enable the device to run under different loads, so that the running environment of the ammeter is changed, and the temperature and humidity of the actual environment and the load of the ammeter are truly simulated.

In the whole simulation process, the central processing unit records the operation condition in a specific environment, so that personnel can obtain different operation parameters.

In the foregoing, the temperature and humidity sensor is specifically a DHT11 sensor, the DHT11 sensor includes a resistance-type humidity measuring element and an NTC temperature measuring element, and the resistance-type humidity measuring element and the NTC temperature measuring element are packaged and then provided with a VCC pin, a GND pin, and a DATA pin.

The VCC pin is the positive pole of DHT11, is connected with arbitrary available VCC mouth on the PCB board, the GND pin is the negative pole of DHT11, is connected with arbitrary available GND pin on the PCB board, DATA is that DATA output port is used for receiving temperature and humidity sensor's real-time DATA, is connected with the IO pin on the PCB board.

In this embodiment, the peripheral device includes a heater, a humidifier, and a plurality of mutually independent loads, and the loads are specifically artificial load modules.

Based on the above simulation system, as shown in fig. 2, the present invention further provides the following steps:

step 100, initializing a central processing unit, an embedded single chip microcomputer, a temperature and humidity sensor and a pH value acquisition sensor;

200, after the initialization of a central processing unit, an embedded single chip microcomputer, a temperature and humidity sensor and a pH value acquisition sensor is completed, establishing a script through the central processing unit for trial operation;

and 300, simulating the operation environment through a feedback regulation central processing unit for data acquisition on the basis of test operation.

In the above simulation method:

the specific steps for initializing the central processing unit, the embedded single chip microcomputer, the temperature and humidity sensor and the pH value acquisition sensor are as follows:

step 1, calling RCC _ AHB1PeriphClockCmd to set the clock to RCC _ AHB1Periph _ GPIOE, and enabling the clock to be in an available state;

step 2, establishing a GPIO _ IntStructure object, wherein the IO output port is sequentially set to GPIO _ Pin _2 to GPIO _ Pin _7, and additionally, GPIO _ Mode _ OUT is set to be in a common output Mode, and GPIO _ PuPd _ UP is set to be in a pull-UP Mode; and setting the circuit frequency to GPIO _ Speed _50MHz, grouping GPIOE, and initializing by using a GPIO _ IntStructureobject, thereby completing the initialization of IO pins corresponding to GPIO _ Pin _2 to GPIO _ Pin _ 7.

After finishing the initialization of central processing unit, embedded singlechip, temperature and humidity sensor and pH value acquisition sensor, establish the script through central processing unit and try on the move, concrete step includes:

step A, a dialog box is created by using a GUI _ CreateDialogBox, a corresponding switch BUTTON and control of a display text are created on the dialog box, and IDs of the switch BUTTONs of IO pins corresponding to GPIO _ Pin _2 to GPIO _ Pin _7 are set to be ID _ BUTTON _1 to ID _ BUTTON _6 respectively;

step B, appointing a callback function through a GUI _ CreateDialogBox, monitoring all events of the switch BUTTONs from ID _ BUTTON _1 to ID _ BUTTON _6, coding the events in WM _ NOTIFICATION _ RE L EASED of the switch BUTTONs, and controlling the switch;

and step C, respectively using GPIO _ SetBs or GPIO _ ResetBits to carry out high level or low level pulling operation on the corresponding IO pins according to the state of each group of corresponding IO pins, so as to control the on-off state of the power supply of the peripheral device, and reading the real-time state of the corresponding IO pins through a GPIO _ ReadInputDataBit function to ensure the operation to be effective or invalid.

The DATA pin selects PG9 for receiving real-time DATA from the temperature and humidity sensor.

The specific steps of the central processing unit for carrying out simulation on the operating environment are as follows:

step 100, calling RCC _ AHB1PeriphClockCmd to set to RCC _ AHB1Periph _ GPIOG clock and to be in available state;

step 200, establishing a GPIO _ IntStructure object, wherein the IO output port is set to GPIO _ Pin _9, and GPIO _ Mode _ OUT is set to be in a common output Mode; GPIO _ PuPd _ UP is in a pull-UP mode; setting the circuit frequency to GPIO _ Speed _50MHz, grouping GPIOE, and initializing by using a GPIO _ IntStructure object, thereby completing the initialization of an IO pin corresponding to PG 9;

step 300, setting a callback function for WM _ HBKWIN by using WM _ SetCallback;

step 400, setting a timer for WM _ HBKWIN by using WM _ CreateTimer, and executing the timer once every 1000 ms;

step 500, in the callback function set by WM _ SetCallback, all window messages of the top window of the program are monitored, and after capturing the message created by WM _ CreateTimer, the data of DHT11 is read and displayed.

The programming idea of reading and converting sensor data is as follows: since the data returned by the DHT11 each time consists of 40 bits in total, and 5 bytes in total, the program reads 5 times, one byte each time, and 8 times when one byte is read, and one bit of 0 or 1 is returned each time.

In the present invention, the cpu has functions of control, processing, recording, and the like, and the project plan uses a single-machine control heater, humidifier, and classification switch. In addition, the input quantity and the output quantity also need to be controlled, wherein the heater and the humidifier are non-linear equipment, the input quantity and the output quantity need to be strictly debugged according to the calculation result to obtain the required designated numerical values, so that the situation of distortion of the simulation situation is avoided, and a simulation environment is provided for the electric meter improvement measures in the future.

Although the invention has been described in detail above with reference to a general description and specific examples, it will be apparent to one skilled in the art that modifications or improvements may be made thereto based on the invention. Accordingly, such modifications and improvements are intended to be within the scope of the invention as claimed.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:拆回单相电能表安全通电读数装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!