Electromagnetic interference protection and reinforcement method for X-ray thickness gauge controlled by single chip microcomputer

文档序号:1019244 发布日期:2020-10-27 浏览:19次 中文

阅读说明:本技术 一种单片机控制的x射线测厚仪电磁干扰防护加固方法 (Electromagnetic interference protection and reinforcement method for X-ray thickness gauge controlled by single chip microcomputer ) 是由 冯德仁 于 2019-04-18 设计创作,主要内容包括:本发明公开了一种单片机控制的X射线测厚仪电磁干扰软件防护加固方法,该方法首先启动看门狗程序,当单片机控制系统受到周期或非周期性信号的干扰时,执行中断服务子程序ISR,在ISR中调用软件陷阱程序;将单片机控制系统中重要变量信息保存到外部ROM中,然后调用复位内核程序;在系统重新启动后,判断系统复位是否正常,从而能够有效的抑制周期性和非周期性的电磁干扰,使单片机控制的X射线测厚仪系统适应于各种突发中断环境。(The invention discloses a method for protecting and reinforcing electromagnetic interference software of an X-ray thickness gauge controlled by a single chip microcomputer, which comprises the steps of firstly starting a watchdog program, executing an interrupt service subroutine ISR when a single chip microcomputer control system is interfered by periodic or aperiodic signals, and calling a software trap program in the ISR; storing important variable information in a singlechip control system into an external ROM, and calling a reset kernel program; after the system is restarted, whether the system is normally reset is judged, so that the periodic and aperiodic electromagnetic interference can be effectively inhibited, and the X-ray thickness gauge system controlled by the single chip microcomputer is suitable for various sudden interruption environments.)

1. An electromagnetic protection reinforcing method of a single chip microcomputer control system is characterized by comprising the following steps:

a, starting a watchdog program in the single chip microcomputer control system, wherein when the single chip microcomputer control system is interfered by aperiodic signals, the watchdog program sends interrupt signals to the single chip microcomputer, and the single chip microcomputer immediately responds and calls a software trap program;

b, storing important variable information in the single chip microcomputer control system into an external ROM, and calling a reset kernel program;

step C, after the single chip microcomputer control system is restarted, firstly, the initialization of a clock, interruption, each peripheral module and system non-key global variables is completed, an abnormal interruption flag bit is read in from the external ROM, and whether the previous system reset is normal reset or abnormal reset is judged;

step D, if the previous system reset is abnormal reset, reading the saved variable values related to the previous system work from the external ROM, giving the variable values to corresponding variables, and restoring the running state of the previous system;

and E, if the previous system reset is normal reset, resetting the saved variable value, waiting for the setting of a new working state, and starting a new running state, thereby preventing the system from being halted due to non-periodic interference.

2. The electromagnetic protection reinforcing method of the single chip microcomputer control system according to claim 1, wherein the process of the step a specifically includes:

when the single chip microcomputer control system is initialized, a counter of a watchdog program is selected to overflow to generate an interrupt signal;

when the single chip microcomputer control system normally operates, the counter is cleared in time before the watchdog counter overflows so as to prevent the generation of an interrupt signal;

when the single chip microcomputer control system is interfered by a non-periodic signal, a program flies or crashes due to the interference, and the counter cannot be cleared normally, the watchdog program sends an interrupt signal to the single chip microcomputer, the single chip microcomputer immediately responds and executes a watchdog interrupt service subprogram ISR, and a software trap program is called in the ISR.

3. The method for reinforcing electromagnetic protection of the single-chip microcomputer control system according to claim 1, wherein the method further comprises:

when the singlechip control system has the interference which can not be prevented, unconditionally jumping to the address where the program of the singlechip control system starts in the residual memory space and filling the address to prevent the program from flying away.

Technical Field

The invention relates to the technical field of electromagnetic protection, in particular to a protection and reinforcement method for electromagnetic interference of an X-ray thickness gauge controlled by a single chip microcomputer.

Background

The X-ray thickness gauge generally adopts a singlechip as a control system, when high-voltage flashover occurs, due to the change of instantaneous current, the interference of larger conducted electromagnetic pulse is often generated, the interference of the electromagnetic pulse can cause the singlechip to be incapable of executing a set program, and the phenomenon of singlechip crash and the like is caused in serious cases. Electromagnetic pulse interference can be generally divided into periodic interference and aperiodic interference in form, the electromagnetic anti-interference protection method of the traditional singlechip control system generally adopts hardware protection, the so-called hardware protection adopts hardware shielding and circuit structure change to realize anti-interference capability, can effectively inhibit electromagnetic pulse periodic conducted interference and space radiation interference, and is a main means of electromagnetic protection. However, the hardware protection measures are high in cost and complex in structure and process, and meanwhile, although a common single chip microcomputer control system shielding box is still provided with a conductive rubber pad and coated with conductive paint, low-frequency components still can be coupled into the shielding box to interfere the normal operation of the single chip microcomputer system, especially for non-periodic interference, due to the position of an interference source and the randomness of frequency spectrum distribution, the position of an inlet of the interference source coupled into the equipment also has high randomness, and part of interference can also be coupled into the single chip microcomputer control system through a heat dissipation hole seam, a power supply and an input/output feeder line, so that the system is interfered and blocked. Therefore, it is difficult for hardware protection with determined position and structure to play an effective protection role.

Disclosure of Invention

The invention aims to provide a method for reinforcing electromagnetic protection software of an X-ray thickness gauge, which overcomes the defects of poor stability, narrow application range and poor electromagnetic suppression efficiency of hardware protection equipment in the prior art and can effectively suppress periodic and aperiodic electromagnetic interference.

The reinforcement method of the electromagnetic protection software of the X-ray thickness gauge controlled by the single chip microcomputer comprises the following steps:

a, starting a watchdog program in the single chip microcomputer control system, wherein when the single chip microcomputer control system is interfered by aperiodic signals, the watchdog program sends interrupt signals to the single chip microcomputer, and the single chip microcomputer immediately responds and calls a software trap program;

b, storing important variable information in the single chip microcomputer control system into an external ROM, and calling a reset kernel program;

step C, after the single chip microcomputer control system is restarted, firstly, the initialization of a clock, interruption, each peripheral module and system non-key global variables is completed, an abnormal interruption flag bit is read in from the external ROM, and whether the previous system reset is normal reset or abnormal reset is judged;

step D, if the previous system reset is abnormal reset, reading the saved variable values related to the previous system work from the external ROM, giving the variable values to corresponding variables, and restoring the running state of the previous system;

and E, if the previous system reset is normal reset, resetting the saved variable value, waiting for the setting of a new working state, and starting a new running state, thereby preventing the system from being halted due to non-periodic interference.

According to the technical scheme provided by the invention, the method overcomes the defects of poor stability, narrow application range and poor electromagnetic suppression efficiency of hardware protection equipment in the prior art, and can effectively suppress periodic and aperiodic electromagnetic interference, so that the high-repetition-frequency electromagnetic pulse simulator control system is suitable for various burst interruption environments.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.

Fig. 1 is a schematic flowchart of an electromagnetic protection reinforcing method for a single chip microcomputer control system according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.

The embodiment of the present invention will be further described in detail with reference to the accompanying drawings, and as shown in fig. 1, a schematic flow chart of an electromagnetic protection reinforcing method for a single chip microcomputer control system provided in the embodiment of the present invention is shown, where the method includes:

a, starting a watchdog program in the single chip microcomputer control system, wherein when the single chip microcomputer control system is interfered by periodic or aperiodic signals, the watchdog program sends an interrupt signal to the single chip microcomputer, and the single chip microcomputer immediately responds and calls a software trap program;

in the step, the specific implementation process is as follows:

when the single chip microcomputer control system is initialized, a counter overflow of a watchdog program is selected to generate an interrupt signal, namely WDENINT = 1;

when the single chip microcomputer control system normally operates, the counter is cleared in time (namely, the watchdog is fed) before the watchdog counter overflows, and the generation of an interrupt signal is prevented;

when the singlechip control system is interfered by a non-periodic signal, a program flies or crashes due to the interference, so that the counter cannot be cleared normally, the watchdog program sends an interrupt signal to the singlechip, the singlechip immediately responds and executes a watchdog interrupt service subprogram ISR, a software trap program is called in the ISR, and the software trap program is used for storing important variable information in the system into an external ROM and then calling a reset kernel program.

B, storing important variable information in the single chip microcomputer control system into an external ROM, and calling a reset kernel program;

in this step, the important variable information includes one or more of: pulse output information, pulse interval information, voltage regulation information, and an abnormal interrupt flag.

Step C, after the single chip microcomputer control system is restarted, judging whether the previous system reset is normal reset or abnormal reset;

in this step, after the single chip microcomputer control system is restarted, firstly, the clock, the interrupt, the initialization of each peripheral module and the non-key global variables of the system are completed, and the abnormal interrupt flag bit is read in from the external ROM, so as to judge whether the previous system reset is normal reset or abnormal reset;

step D, if the previous system reset is abnormal reset, reading the saved variable values related to the previous system work from the external ROM, giving the variable values to corresponding variables, and restoring the running state of the previous system;

and E, if the previous system reset is normal reset, resetting the saved variable value, waiting for the setting of a new working state, and starting a new running state, thereby preventing the system from being halted due to non-periodic interference.

The steps A-E are the processing process of the interference signals, and in addition, for the condition that the periodic interference signals and the non-periodic interference signals can not be processed, namely when the single chip microcomputer control system has the interference which can not be prevented, the residual memory space is unconditionally jumped to the address where the single chip microcomputer control system program starts and is filled, so as to prevent the program from flying away.

In summary, the method provided by the embodiment of the invention has the following advantages:

(1) the electromagnetic protection measure of the high-repetition-frequency electromagnetic pulse simulator control system with software reinforcement is utilized, the efficiency is high, the electromagnetic suppression effect is obvious, the electromagnetic protection measure can be suitable for simulating high-altitude nuclear explosion electromagnetic pulse (HEMP) radiation environment, lightning stroke environment and various fast transient operation overvoltage (such as cut-off line voltage, closing overvoltage and the like) electromagnetic environments in industrial power distribution, the defects of poor stability, narrow application range, poor electromagnetic suppression efficiency and the like of hardware protection equipment in the prior art are overcome, and the electromagnetic protection measure is suitable for various fields of chemical industry, metallurgy, electric power and the like under the high-voltage environment condition;

(2) the embodiment of the invention has good anti-interference capability for periodic and aperiodic interference so as to ensure that the working state before interference can be automatically recovered under the conditions of interference, crash and the like of a control system;

(3) the embodiment of the invention has the advantages of reducing the requirement on a hardware system, better shielding effect and greatly reducing the cost.

The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

6页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:高温电磁超声测厚探头

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!