WO2020124302A1 - Sensor pulse signal processing method - Google Patents

Sensor pulse signal processing method Download PDF

Info

Publication number
WO2020124302A1
WO2020124302A1 PCT/CN2018/121397 CN2018121397W WO2020124302A1 WO 2020124302 A1 WO2020124302 A1 WO 2020124302A1 CN 2018121397 W CN2018121397 W CN 2018121397W WO 2020124302 A1 WO2020124302 A1 WO 2020124302A1
Authority
WO
WIPO (PCT)
Prior art keywords
pulse
period
sensor
main control
group
Prior art date
Application number
PCT/CN2018/121397
Other languages
French (fr)
Chinese (zh)
Inventor
李贵生
郑文辉
柯盛海
林开荣
代艳
Original Assignee
智恒科技股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 智恒科技股份有限公司 filed Critical 智恒科技股份有限公司
Priority to PCT/CN2018/121397 priority Critical patent/WO2020124302A1/en
Priority to SG11202101384WA priority patent/SG11202101384WA/en
Publication of WO2020124302A1 publication Critical patent/WO2020124302A1/en

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors

Definitions

  • the invention relates to the field of sensors, in particular to a method for processing sensor pulse signals.
  • the pulse output by the sensor usually includes two forms of negative logic level and positive logic level. Among them, the form of negative logic level is shown in Figure 1, and the form of positive logic level is shown in Figure 2. As shown.
  • the effective pulse width of the sensor is generally less than 100MS; while in the field of smart meter reading and smart water affairs, the acquisition device or the main control MCU are usually in a sleep state. And work in a mode of regularly awakening processing tasks.
  • the above two time periods are basically the same, we usually say It is a vacuum period. Due to the fast cycle frequency of the output pulses used for high-precision and high-density acquisition, this leads to the pulse signal may appear in the vacuum period, and makes the collection equipment or the main control MCU unable to collect valid pulses, which will cause measurement Error, can not meet the high-precision measurement requirements.
  • the technical problem to be solved by the present invention is to provide a processing method of sensor pulse signals.
  • the processing method of the present invention can effectively solve the problem that the acquisition device or the main control MCU existing in the prior art misses the pulse interruption due to sleep, which leads to measurement. The problem of error.
  • a method for processing a sensor pulse signal including:
  • Step S1 add a high-frequency pulse group on each edge of the effective pulse output of the sensor;
  • Step S2 If the high-frequency pulse group is encountered during the vacuum period of pulse detection, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU; if the high frequency pulse group is not encountered during the vacuum period of pulse detection Frequency pulse group, it will not generate an interrupt immediately after the vacuum period to wake up the acquisition device or the main control MCU.
  • step S1 is specifically:
  • a first high-frequency pulse group is added at the beginning of the effective pulse output of the sensor, and a second high-frequency pulse group is added at the end of the effective pulse output of the sensor.
  • step S2 is specifically:
  • the vacuum period of pulse detection is entered, and if the second high-frequency pulse group is encountered during the vacuum period, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU, so that the collection device or the main control MCU enters the detection state; if the second high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the collection device or the main control MCU.
  • the number of pulses of the first high-frequency pulse group is greater than or equal to 2
  • the pulse period of the first high-frequency pulse group is greater than or equal to twice the period of the vacuum period.
  • the number of pulses of the second high-frequency pulse group is greater than or equal to 2
  • the pulse period of the second high-frequency pulse group is greater than or equal to twice the period of the vacuum period.
  • the period of the effective pulse of the sensor is greater than or equal to three times the sampling period.
  • the effective pulse output of the sensor is specifically a negative logic level output of the sensor.
  • the effective pulse output of the sensor is specifically a positive logic level output of the sensor.
  • the present invention adds a high-frequency pulse group to the two edges of the effective pulse output of the sensor, so that when the pulse signal cannot be recognized by the acquisition device or the interruption of the main control MCU, the level can be generated by the high-frequency pulse group Changes to wake up the acquisition device or the main control MCU, thereby ensuring that the acquisition device or the main control MCU will not miss the pulse interruption, which can effectively avoid measurement errors and improve the detection accuracy and density of the sensor;
  • FIG. 1 is a schematic diagram of a negative logic level output by a conventional pulse output type sensor.
  • FIG. 2 is a schematic diagram of the positive logic level output by the existing pulse output type sensor.
  • FIG. 3 is a schematic diagram of the positive logic level output by the sensor in the first embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a negative logic level output by a sensor in a second embodiment of the present invention.
  • FIG. 5 is a block diagram of an execution flow of a method for processing a sensor pulse signal according to the present invention.
  • a preferred embodiment 1 of a method for processing a sensor pulse signal according to the present invention includes:
  • Step S1 add a high-frequency pulse group on both edges of the effective pulse output of the sensor; where the purpose of increasing the high-frequency pulse group is: when the detection accuracy and density of the sensor are high, the pulse frequency of the sensor will be greater than 10HZ ;
  • the collection device or the main control MCU is usually powered by a disposable battery, therefore, the device is periodically awakened; while the collection device or the main control MCU is about to enter a sleep state At this time, there will be a vacuum period of pulse detection.
  • the sensor detects a signal at this time, it will not be recognized by the acquisition device or the main control MCU, resulting in a measurement error; similarly, the pulse signal of the sensor will be released soon When entering the idle state, there is also a vacuum period of pulse detection. If the sensor detects a signal at this time, it will not be recognized by the interruption of the collection device or the main control MCU, resulting in a measurement error.
  • a high-frequency pulse group is added to both edges of the effective pulse output of the sensor, so that when the signal cannot be recognized by the interruption of the collection device or the main control MCU, the high-frequency pulse group can generate a level change to wake up the collection device or the main Control MCU.
  • step S1 is specifically:
  • a first high-frequency pulse group is added at the beginning of the effective pulse output of the sensor, and a second high-frequency pulse group is added at the end of the effective pulse output of the sensor.
  • the pulse waveform output by the sensor is composed of the idle state, the first high-frequency pulse group, the effective pulse, and the second high-frequency pulse group.
  • the pulse waveform output by the sensor when the pulse waveform output by the sensor is idle, it will not be sampled; when the pulse waveform output by the sensor is an effective pulse, it will be sampled multiple times; when the pulse waveform output by the sensor is at the first high-frequency pulse When the group and the second high-frequency pulse group, it will wake up the acquisition device or the main control MCU.
  • the effective pulse output of the sensor is specifically the positive logic level output of the sensor, and the specific output pulse waveform is shown in FIG. 3.
  • the number of pulses of the first high-frequency pulse group is greater than or equal to 2, and the pulse period of the first high-frequency pulse group is greater than or equal to the vacuum period. Twice the period.
  • the present invention is not limited to this. In the specific implementation of the present invention, if the power consumption problem is not considered, the number of pulses of the first high-frequency pulse group may be set to be larger (for example, 10); if necessary If power consumption is a problem, the number of pulses of the first high-frequency pulse group needs to be set smaller (for example, 2).
  • the number of pulses of the second high-frequency pulse group is greater than or equal to 2, and the pulse period of the second high-frequency pulse group is greater than or equal to the period of the vacuum period Twice.
  • the present invention is not limited to this.
  • the number of pulses of the second high-frequency pulse group may be set larger (for example, 8); if necessary In case of power consumption problems, the number of pulses of the second high-frequency pulse group needs to be set smaller (for example, 3).
  • the period of the effective pulse of the sensor is set to be greater than or equal to three times the sampling period.
  • the present invention sets the duty cycle of the sensor pulse signal to 50%, mainly for the sake of ensuring the consistency and stability of the pulse. If the consistency and stability of the pulse are not considered, other duty cycles are adopted. Ratio is also achievable.
  • Step S2 If the high-frequency pulse group is encountered during the vacuum period of pulse detection, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU; if the high frequency pulse group is not encountered during the vacuum period of pulse detection Frequency pulse group, it will not generate an interrupt immediately after the vacuum period to wake up the acquisition device or the main control MCU.
  • step S2 is specifically:
  • the vacuum period of pulse detection is entered.
  • the collection device or the main control MCU will not be able to recognize a valid pulse signal, and if the first high frequency is encountered during the vacuum period Pulse group (because the level change will occur immediately when the first high-frequency pulse group is encountered, and the pulse period of the first high-frequency pulse group is greater than or equal to twice the period of the vacuum period, so after the vacuum period, the first The high-frequency pulse group will continue the validity of the pulse signal, which can generate an interrupt to wake up the acquisition device or main control MCU), then an interrupt is generated immediately after the vacuum period to wake up the acquisition device or main control MCU, so that the acquisition device or main control MCU enters Detect the status to avoid measurement errors; if the first high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the acquisition device or the main control MCU;
  • the vacuum period of pulse detection is entered.
  • the collection device or the main control MCU will not be able to recognize the valid pulse signal, and if the second high-frequency pulse is encountered during the vacuum period Group (because the level change will occur immediately when the second high-frequency pulse group is encountered, and the pulse period of the second high-frequency pulse group is greater than or equal to twice the period of the vacuum period, so after the vacuum period, the second high The frequency pulse group will continue the validity of the pulse signal, which can generate an interrupt to wake up the collection device or the main control MCU), then immediately generate an interrupt to wake up the collection device or the main control MCU after the vacuum period, so that the collection device or the main control MCU enters the detection In order to avoid measurement errors; if the second high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the acquisition device or the main control MCU.
  • a preferred embodiment 2 of a method for processing a sensor pulse signal according to the present invention includes:
  • Step S1 add a high-frequency pulse group on both edges of the effective pulse output of the sensor; among them, the purpose of increasing the high-frequency pulse group is: when the detection accuracy and density of the sensor is high, the pulse frequency of the sensor will be greater than 10HZ ;
  • the collection device or the main control MCU is usually powered by a disposable battery, therefore, the device is periodically awakened; while the collection device or the main control MCU is about to enter a sleep state At this time, there will be a vacuum period of pulse detection.
  • the sensor detects a signal at this time, it will not be recognized by the acquisition device or the main control MCU, resulting in a measurement error; similarly, the pulse signal of the sensor will be released soon When entering the idle state, there is also a vacuum period of pulse detection. If the sensor detects a signal at this time, it will not be recognized by the interruption of the collection device or the main control MCU, resulting in a measurement error.
  • a high-frequency pulse group is added to both edges of the effective pulse output of the sensor, so that when the signal cannot be recognized by the interruption of the collection device or the main control MCU, the high-frequency pulse group can generate a level change to wake up the collection device or the main Control MCU.
  • step S1 is specifically:
  • a first high-frequency pulse group is added at the beginning of the effective pulse output of the sensor, and a second high-frequency pulse group is added at the end of the effective pulse output of the sensor.
  • the pulse waveform output by the sensor is composed of the idle state, the first high-frequency pulse group, the effective pulse, and the second high-frequency pulse group.
  • the pulse waveform output by the sensor when the pulse waveform output by the sensor is idle, it will not be sampled; when the pulse waveform output by the sensor is an effective pulse, it will be sampled multiple times; when the pulse waveform output by the sensor is at the first high-frequency pulse When the group and the second high-frequency pulse group, it will wake up the acquisition device or the main control MCU.
  • the effective pulse output of the sensor is specifically the negative logic level output of the sensor, and the specific output pulse waveform is shown in FIG. 4.
  • the number of pulses of the first high-frequency pulse group is greater than or equal to 2, and the pulse period of the first high-frequency pulse group is greater than or equal to the vacuum period. Twice the period.
  • the present invention is not limited to this. In the specific implementation of the present invention, if the power consumption problem is not considered, the number of pulses of the first high-frequency pulse group may be set to be larger (for example, 10); if necessary If power consumption is a problem, the number of pulses of the first high-frequency pulse group needs to be set smaller (for example, 3).
  • the number of pulses of the second high-frequency pulse group is greater than or equal to 2, and the pulse period of the second high-frequency pulse group is greater than or equal to the period of the vacuum period Twice.
  • the present invention is not limited to this.
  • the number of pulses of the second high-frequency pulse group may be set to be larger (for example, 10); if necessary In case of power consumption problems, the number of pulses of the second high-frequency pulse group needs to be set smaller (for example, 3).
  • the period of the effective pulse of the sensor is set to be greater than or equal to three times the sampling period, for example, the sampling period is 1ms, then, the sensor The effective pulse period is ⁇ 3*1ms (ie 3ms).
  • the vacuum period of the collection device is 150us
  • the sampling period is 0.5ms
  • the pulse period of the first high-frequency pulse group the pulse period of the second high-frequency pulse group ⁇ 2*150us (ie 300us)
  • the sensor is effective
  • the period of the pulse is ⁇ 3*0.5ms (that is, 1.5ms)
  • the present invention sets the duty cycle of the sensor pulse signal to 50%, mainly for the sake of ensuring the consistency and stability of the pulse. If the consistency and stability of the pulse are not considered, other duty cycles are adopted. Ratio is also achievable.
  • Step S2 If the high-frequency pulse group is encountered during the vacuum period of pulse detection, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU; if the high frequency pulse group is not encountered during the vacuum period of pulse detection Frequency pulse group, it will not generate an interrupt immediately after the vacuum period to wake up the acquisition device or the main control MCU.
  • step S2 is specifically:
  • the vacuum period of pulse detection is entered.
  • the collection device or the main control MCU will not be able to recognize a valid pulse signal, and if the first high frequency is encountered during the vacuum period Pulse group (because the level change will occur immediately when the first high-frequency pulse group is encountered, and the pulse period of the first high-frequency pulse group is greater than or equal to twice the period of the vacuum period, so after the vacuum period, the first The high-frequency pulse group will continue the validity of the pulse signal, which can generate an interrupt to wake up the acquisition device or the main control MCU), then an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU, so that the acquisition device or the main control MCU enters Detect the status to avoid measurement errors; if the first high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the acquisition device or the main control MCU;
  • the vacuum period of pulse detection is entered.
  • the collection device or the main control MCU will not be able to recognize the valid pulse signal, and if the second high-frequency pulse is encountered during the vacuum period Group (because the level change will occur immediately when the second high-frequency pulse group is encountered, and the pulse period of the second high-frequency pulse group is greater than or equal to twice the period of the vacuum period, so after the vacuum period, the second high The frequency pulse group will continue the validity of the pulse signal, which can generate an interrupt to wake up the collection device or the main control MCU), then immediately generate an interrupt to wake up the collection device or the main control MCU after the vacuum period, so that the collection device or the main control MCU enters the detection In order to avoid measurement errors; if the second high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the acquisition device or the main control MCU.
  • the present invention has the following advantages:
  • the present invention adds a high-frequency pulse group to the two edges of the effective pulse output of the sensor, so that when the pulse signal cannot be recognized by the acquisition device or the interruption of the main control MCU, the level can be generated by the high-frequency pulse group Changes to wake up the acquisition device or the main control MCU, thereby ensuring that the acquisition device or the main control MCU will not miss the pulse interruption, which can effectively avoid measurement errors and improve the detection accuracy and density of the sensor;

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Measuring Fluid Pressure (AREA)

Abstract

A sensor pulse signal processing method comprises: step S1, adding a group of high-frequency bursts at two respective edges of a valid pulse output from a sensor; and step S2, if the group of high-frequency bursts is found within a window period of pulse detection, generating an interruption to wake up an acquisition device or a main control unit (MCU) immediately following the window period, or if the group of high-frequency bursts is not found within a window period of the pulse detection, refraining from generating an interruption to wake up the acquisition device or the main control unit (MCU) immediately following the window period. In the method, groups of high-frequency bursts are added to cause a change in an electric level so as to wake up an acquisition device or a main control unit (MCU); and accordingly, ensure that the acquisition device or the main control unit (MCU) does not experience interruptions due to missed pulses, thereby effectively preventing measurement errors, and increasing the detection precision and intensity of a sensor.

Description

一种传感器脉冲信号的处理方法Method for processing sensor pulse signal 技术领域Technical field
本发明涉及传感器领域,特别涉及一种传感器脉冲信号的处理方法。The invention relates to the field of sensors, in particular to a method for processing sensor pulse signals.
背景技术Background technique
近几年来,随着物联网技术以及传感器技术的快速发展,在智能抄表和智慧水务领域中,用户对传感器的精度和采集密度的要求也越来越高,这也就意味着脉冲输出型传感器输出脉冲的频率也越来越快。In recent years, with the rapid development of Internet of Things technology and sensor technology, in the field of smart meter reading and smart water affairs, users have higher and higher requirements on sensor accuracy and collection density, which means that the pulse output sensor The frequency of the output pulse is getting faster and faster.
在传统的脉冲输出型传感器中,传感器输出的脉冲通常包括负逻辑电平和正逻辑电平两种形式,其中,负逻辑电平的形式如图1所示,正逻辑电平的形式如图2所示。In the traditional pulse output sensor, the pulse output by the sensor usually includes two forms of negative logic level and positive logic level. Among them, the form of negative logic level is shown in Figure 1, and the form of positive logic level is shown in Figure 2. As shown.
当脉冲输出型传感器被用在高精度或者高密度场景时,传感器的有效脉冲宽度一般都小于100MS;而在智能抄表和智慧水务领域中,采集设备或者主控MCU通常都是处于休眠状态,并以定时唤醒处理任务的模式进行工作。When the pulse output sensor is used in high-precision or high-density scenes, the effective pulse width of the sensor is generally less than 100MS; while in the field of smart meter reading and smart water affairs, the acquisition device or the main control MCU are usually in a sleep state. And work in a mode of regularly awakening processing tasks.
在采集设备或者主控MCU跳过脉冲判断任务即将进入休眠状态的这个时间段,以及传感器的脉冲信号即将释放进入空闲状态的这个时间段,以上两个时间段基本上是一致的,我们通常称为真空期。由于用于高精度和高密度采集的输出脉冲的周期频率较快,这导致了脉冲信号可能会在真空期内出现,并使得采集设备或者主控MCU无法采集到有效脉冲,从而会导致出现计量误差,无法满足高精度计量要求。During the time period when the acquisition device or the main control MCU skips the pulse to determine that the task is about to enter the sleep state, and the time period when the sensor's pulse signal is about to be released and enters the idle state, the above two time periods are basically the same, we usually say It is a vacuum period. Due to the fast cycle frequency of the output pulses used for high-precision and high-density acquisition, this leads to the pulse signal may appear in the vacuum period, and makes the collection equipment or the main control MCU unable to collect valid pulses, which will cause measurement Error, can not meet the high-precision measurement requirements.
发明内容Summary of the invention
本发明要解决的技术问题,在于提供一种传感器脉冲信号的处理方法,通过本发明处理方法可有效解决现有技术中存在的采集设备或者主控MCU因休眠而错过脉冲中断,进而导致出现计量误差的问题。The technical problem to be solved by the present invention is to provide a processing method of sensor pulse signals. The processing method of the present invention can effectively solve the problem that the acquisition device or the main control MCU existing in the prior art misses the pulse interruption due to sleep, which leads to measurement. The problem of error.
本发明是这样实现的:一种传感器脉冲信号的处理方法,所述方法包括:The present invention is implemented as follows: A method for processing a sensor pulse signal, the method including:
步骤S1、在传感器的有效脉冲输出的两个边沿各增加一个高频脉冲群;Step S1, add a high-frequency pulse group on each edge of the effective pulse output of the sensor;
步骤S2、在脉冲检测的真空期内如果遇到所述高频脉冲群,则在真空期过后立即产生中断唤醒采集设备或者主控MCU;在脉冲检测的真空期内如果未遇到所述高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU。Step S2. If the high-frequency pulse group is encountered during the vacuum period of pulse detection, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU; if the high frequency pulse group is not encountered during the vacuum period of pulse detection Frequency pulse group, it will not generate an interrupt immediately after the vacuum period to wake up the acquisition device or the main control MCU.
进一步地,所述步骤S1具体为:Further, the step S1 is specifically:
在传感器的有效脉冲输出的开始位置增加一个第一高频脉冲群,在传感器的有效脉冲输出的结束位置增加一个第二高频脉冲群。A first high-frequency pulse group is added at the beginning of the effective pulse output of the sensor, and a second high-frequency pulse group is added at the end of the effective pulse output of the sensor.
进一步地,所述步骤S2具体为:Further, the step S2 is specifically:
在采集设备或者主控MCU即将进入休眠状态时,进入脉冲检测的真空期,且如果在真空期内遇到所述第一高频脉冲群,则在真空期过后立即产生中断唤醒采集设备或者主控MCU,以使采集设备或者主控MCU进入检测状态;如果在真空期内未遇到所述第一高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU;When the acquisition device or the main control MCU is about to enter the sleep state, enter the vacuum period of pulse detection, and if the first high-frequency pulse group is encountered during the vacuum period, an interrupt will be generated immediately after the vacuum period to wake up the acquisition device or the master Control the MCU, so that the collection device or the main control MCU enters the detection state; if the first high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the collection device or the main control MCU;
在传感器的脉冲信号即将释放进入空闲状态时,进入脉冲检测的真空期,且如果在真空期内遇到所述第二高频脉冲群,则在真空期过后立即产生中断唤醒采集设备或者主控MCU,以使采集设备或者主控MCU进入检测状态;如果在真空期内未遇到所述第二高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU。When the pulse signal of the sensor is about to be released and enter the idle state, the vacuum period of pulse detection is entered, and if the second high-frequency pulse group is encountered during the vacuum period, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU, so that the collection device or the main control MCU enters the detection state; if the second high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the collection device or the main control MCU.
进一步地,所述第一高频脉冲群的脉冲个数大于等于2个,且所述第一高频脉冲群的脉冲周期大于等于真空期的周期的两倍。Further, the number of pulses of the first high-frequency pulse group is greater than or equal to 2, and the pulse period of the first high-frequency pulse group is greater than or equal to twice the period of the vacuum period.
进一步地,所述第二高频脉冲群的脉冲个数大于等于2个,且所述第二高频脉冲群的脉冲周期大于等于真空期的周期的两倍。Further, the number of pulses of the second high-frequency pulse group is greater than or equal to 2, and the pulse period of the second high-frequency pulse group is greater than or equal to twice the period of the vacuum period.
进一步地,所述传感器的有效脉冲的周期大于等于采样周期的三倍。Further, the period of the effective pulse of the sensor is greater than or equal to three times the sampling period.
进一步地,设置所述传感器脉冲信号的占空比为50%,即使传感器脉冲信号的总周期等于有效脉冲总周期的两倍,其中,有效脉冲总周期=第一高频脉冲群的脉冲周期+传感器的有效脉冲的周期+第二高频脉冲群的脉冲周期。Further, the duty cycle of the sensor pulse signal is set to 50%, even if the total period of the sensor pulse signal is equal to twice the total period of the effective pulse, where the total period of the effective pulse=the pulse period of the first high-frequency pulse group+ The period of the effective pulse of the sensor + the pulse period of the second high-frequency pulse group.
进一步地,在所述步骤S1中,所述传感器的有效脉冲输出具体为传感器的负逻辑电平输出。Further, in the step S1, the effective pulse output of the sensor is specifically a negative logic level output of the sensor.
进一步地,在所述步骤S1中,所述传感器的有效脉冲输出具体为传感器的正逻辑电平输出。Further, in the step S1, the effective pulse output of the sensor is specifically a positive logic level output of the sensor.
本发明具有如下优点:The present invention has the following advantages:
1、本发明通过在传感器的有效脉冲输出的两个边沿各增加一个高频脉冲群,可使得在脉冲信号无法被采集设备或者主控MCU的中断识别时,可以通过高频脉冲群产生电平变化来唤醒采集设备或者主控MCU,进而保证采集设备或者主控MCU不会错过脉冲中断,从而可有效避免出现计量误差,并提高传感器的检测精度和密度;1. The present invention adds a high-frequency pulse group to the two edges of the effective pulse output of the sensor, so that when the pulse signal cannot be recognized by the acquisition device or the interruption of the main control MCU, the level can be generated by the high-frequency pulse group Changes to wake up the acquisition device or the main control MCU, thereby ensuring that the acquisition device or the main control MCU will not miss the pulse interruption, which can effectively avoid measurement errors and improve the detection accuracy and density of the sensor;
2、设置传感器的有效脉冲的周期大于等于采样周期的三倍,可保证传感器的有效脉冲的准确性;2. Set the period of the effective pulse of the sensor to be greater than or equal to three times the sampling period to ensure the accuracy of the effective pulse of the sensor;
3、设置传感器脉冲信号的占空比为50%,可保证脉冲的一致性以及稳定性;同时,还可以通过计算传感器脉冲信号的总周期来得到传感器的最高检测精度。3. Set the duty cycle of the sensor pulse signal to 50% to ensure the consistency and stability of the pulse; at the same time, the maximum detection accuracy of the sensor can also be obtained by calculating the total period of the sensor pulse signal.
附图说明BRIEF DESCRIPTION
下面参照附图结合实施例对本发明作进一步的说明。The present invention will be further described below with reference to the drawings and embodiments.
图1为现有脉冲输出型传感器输出的负逻辑电平的示意图。FIG. 1 is a schematic diagram of a negative logic level output by a conventional pulse output type sensor.
图2为现有脉冲输出型传感器输出的正逻辑电平的示意图。FIG. 2 is a schematic diagram of the positive logic level output by the existing pulse output type sensor.
图3为本发明具体实施例一中传感器输出的正逻辑电平的示意图。FIG. 3 is a schematic diagram of the positive logic level output by the sensor in the first embodiment of the present invention.
图4为本发明具体实施例二中传感器输出的负逻辑电平的示意图。4 is a schematic diagram of a negative logic level output by a sensor in a second embodiment of the present invention.
图5为本发明一种传感器脉冲信号的处理方法的执行流程框图。5 is a block diagram of an execution flow of a method for processing a sensor pulse signal according to the present invention.
具体实施方式detailed description
具体实施例一:Specific example one:
请参阅图3和图5所示,本发明一种传感器脉冲信号的处理方法的较佳实施例一,所述方法包括:Please refer to FIGS. 3 and 5, a preferred embodiment 1 of a method for processing a sensor pulse signal according to the present invention, the method includes:
步骤S1、在传感器的有效脉冲输出的两个边沿各增加一个高频脉冲群; 其中,增加高频脉冲群的目的是:当传感器的检测精度和密度较高时,传感器的脉冲频率将大于10HZ;在智能抄表和智慧水务领域中,采集设备或者或主控MCU通常都是采用一次性电池供电,因此,设备都是处于周期性唤醒工作;而在采集设备或主控MCU即将进入休眠状态时,会有一个脉冲检测的真空期,如果这时候传感器检测到信号,将无法被采集设备或者主控MCU的中断识别,从而导致出现计量误差的情况;同理,在传感器的脉冲信号即将释放进入到空闲状态时,也存在有一个脉冲检测的真空期,如果这时候传感器检测到信号,也将无法被采集设备或者主控MCU的中断识别,从而导致出现计量误差的情况;本发明通过在传感器的有效脉冲输出的两个边沿各增加一个高频脉冲群,可使得在信号无法被采集设备或者主控MCU的中断识别时,可以通过高频脉冲群产生电平变化来唤醒采集设备或者主控MCU。Step S1, add a high-frequency pulse group on both edges of the effective pulse output of the sensor; where the purpose of increasing the high-frequency pulse group is: when the detection accuracy and density of the sensor are high, the pulse frequency of the sensor will be greater than 10HZ ; In the field of smart meter reading and smart water affairs, the collection device or the main control MCU is usually powered by a disposable battery, therefore, the device is periodically awakened; while the collection device or the main control MCU is about to enter a sleep state At this time, there will be a vacuum period of pulse detection. If the sensor detects a signal at this time, it will not be recognized by the acquisition device or the main control MCU, resulting in a measurement error; similarly, the pulse signal of the sensor will be released soon When entering the idle state, there is also a vacuum period of pulse detection. If the sensor detects a signal at this time, it will not be recognized by the interruption of the collection device or the main control MCU, resulting in a measurement error. A high-frequency pulse group is added to both edges of the effective pulse output of the sensor, so that when the signal cannot be recognized by the interruption of the collection device or the main control MCU, the high-frequency pulse group can generate a level change to wake up the collection device or the main Control MCU.
在本具体实施例一中,所述步骤S1具体为:In this specific embodiment 1, the step S1 is specifically:
在传感器的有效脉冲输出的开始位置增加一个第一高频脉冲群,在传感器的有效脉冲输出的结束位置增加一个第二高频脉冲群。在增加完第一高频脉冲群和第二高频脉冲群后,传感器输出的脉冲波形就由空闲状态、第一高频脉冲群、有效脉冲以及第二高频脉冲群组成。其中,当传感器输出的脉冲波形处于空闲状态时,是不会进行采样的;当传感器输出的脉冲波形处于有效脉冲时,则会进行多次采样;当传感器输出的脉冲波形处于第一高频脉冲群和第二高频脉冲群时,则会唤醒采集设备或者主控MCU。A first high-frequency pulse group is added at the beginning of the effective pulse output of the sensor, and a second high-frequency pulse group is added at the end of the effective pulse output of the sensor. After adding the first high-frequency pulse group and the second high-frequency pulse group, the pulse waveform output by the sensor is composed of the idle state, the first high-frequency pulse group, the effective pulse, and the second high-frequency pulse group. Among them, when the pulse waveform output by the sensor is idle, it will not be sampled; when the pulse waveform output by the sensor is an effective pulse, it will be sampled multiple times; when the pulse waveform output by the sensor is at the first high-frequency pulse When the group and the second high-frequency pulse group, it will wake up the acquisition device or the main control MCU.
在本具体实施例一中,所述传感器的有效脉冲输出具体为传感器的正逻辑电平输出,其具体输出的脉冲波形如图3所示。In the first specific embodiment, the effective pulse output of the sensor is specifically the positive logic level output of the sensor, and the specific output pulse waveform is shown in FIG. 3.
在本具体实施例一中,为了有效避免出现计量误差,设置所述第一高频脉冲群的脉冲个数大于等于2个,且所述第一高频脉冲群的脉冲周期大于等于真空期的周期的两倍。当然,本发明并不仅限于此,本发明在具体实施时,如果不考虑功耗问题的话,则可以将第一高频脉冲群的脉冲个数设置得大一些(例如10个);如果需要考虑功耗问题的话,则需要将第一高频脉冲群的脉冲个数设置得小一些(如2个)。In the first embodiment, in order to effectively avoid measurement errors, the number of pulses of the first high-frequency pulse group is greater than or equal to 2, and the pulse period of the first high-frequency pulse group is greater than or equal to the vacuum period. Twice the period. Of course, the present invention is not limited to this. In the specific implementation of the present invention, if the power consumption problem is not considered, the number of pulses of the first high-frequency pulse group may be set to be larger (for example, 10); if necessary If power consumption is a problem, the number of pulses of the first high-frequency pulse group needs to be set smaller (for example, 2).
在本具体实施例一中,为了有效避免出现计量误差,所述第二高频脉冲群的脉冲个数大于等于2个,且所述第二高频脉冲群的脉冲周期大于等于真空期的周期的两倍。当然,本发明并不仅限于此,本发明在具体实施时,如果不考虑功耗问题的话,则可以将第二高频脉冲群的脉冲个数设置得大一些(例如8个);如果需要考虑功耗问题的话,则需要将第二高频脉冲群的脉冲个数设置得小一些(如3个)。In the first embodiment, in order to effectively avoid measurement errors, the number of pulses of the second high-frequency pulse group is greater than or equal to 2, and the pulse period of the second high-frequency pulse group is greater than or equal to the period of the vacuum period Twice. Of course, the present invention is not limited to this. In the specific implementation of the present invention, if the power consumption problem is not considered, the number of pulses of the second high-frequency pulse group may be set larger (for example, 8); if necessary In case of power consumption problems, the number of pulses of the second high-frequency pulse group needs to be set smaller (for example, 3).
为了保证传感器的有效脉冲的准确性,通常会在有效脉冲期间进行多次采样,因此,设置所述传感器的有效脉冲的周期大于等于采样周期的三倍。In order to ensure the accuracy of the effective pulse of the sensor, usually multiple samplings are performed during the effective pulse. Therefore, the period of the effective pulse of the sensor is set to be greater than or equal to three times the sampling period.
为了保证脉冲的一致性以及稳定性,设置所述传感器脉冲信号的占空比为50%,即使传感器脉冲信号的总周期等于有效脉冲总周期的两倍,其中,有效脉冲总周期=第一高频脉冲群的脉冲周期+传感器的有效脉冲的周期+第二高频脉冲群的脉冲周期。同时,通过传感器脉冲信号的总周期我们还可以知道传感器的最高检测精度。当然,本发明设置所述传感器脉冲信号的占空比为50%,主要是出于保证脉冲的一致性以及稳定性的考虑,如果不考虑脉冲的一致性以及稳定性的话,采用其它的占空比也是可以实现的。In order to ensure pulse consistency and stability, the duty cycle of the sensor pulse signal is set to 50%, even if the total period of the sensor pulse signal is equal to twice the total period of the effective pulse, where the total period of the effective pulse = the first high The pulse period of the high-frequency pulse group + the period of the effective pulse of the sensor + the pulse period of the second high-frequency pulse group. At the same time, we can also know the highest detection accuracy of the sensor through the total period of the sensor pulse signal. Of course, the present invention sets the duty cycle of the sensor pulse signal to 50%, mainly for the sake of ensuring the consistency and stability of the pulse. If the consistency and stability of the pulse are not considered, other duty cycles are adopted. Ratio is also achievable.
下面以一具体例子来对传感器的最高检测精度做进一步说明:假设采集设备的真空期的周期为100us,采样周期为1ms,由此就可以计算出第一高频脉冲群的脉冲周期=第二高频脉冲群的脉冲周期≥2*100us(即200us),传感器的有效脉冲的周期≥3*1ms(即3ms),有效脉冲总周期≥200us+3ms+200us=3.4ms,总周期≥2*3.4ms=6.8ms,所以就可以得出道传感器的最高检测精度6.8ms,也就是说,通过该传感器可以检测到周期大于等于6.8ms的脉冲信号。A specific example is used to further explain the maximum detection accuracy of the sensor: assuming that the vacuum period of the collection device is 100us and the sampling period is 1ms, from which the pulse period of the first high-frequency pulse group=second The pulse period of the high-frequency pulse group ≥ 2*100us (ie 200us), the effective pulse period of the sensor ≥ 3*1ms (ie 3ms), the total effective pulse period ≥ 200us+3ms+200us=3.4ms, the total period ≥ 2* 3.4ms=6.8ms, so it can be concluded that the highest detection accuracy of the track sensor is 6.8ms, that is, a pulse signal with a period greater than or equal to 6.8ms can be detected by the sensor.
步骤S2、在脉冲检测的真空期内如果遇到所述高频脉冲群,则在真空期过后立即产生中断唤醒采集设备或者主控MCU;在脉冲检测的真空期内如果未遇到所述高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU。Step S2. If the high-frequency pulse group is encountered during the vacuum period of pulse detection, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU; if the high frequency pulse group is not encountered during the vacuum period of pulse detection Frequency pulse group, it will not generate an interrupt immediately after the vacuum period to wake up the acquisition device or the main control MCU.
在本具体实施例一中,所述步骤S2具体为:In this specific embodiment 1, the step S2 is specifically:
在采集设备或者主控MCU即将进入休眠状态时,进入脉冲检测的真空 期,此时采集设备或者主控MCU将无法识别到有效脉冲信号,且如果在真空期内遇到所述第一高频脉冲群(由于在遇到第一高频脉冲群时会马上产生电平变化,且第一高频脉冲群的脉冲周期大于等于真空期的周期的两倍,因此,在真空期过后,第一高频脉冲群会延续脉冲信号的有效性,从而可产生中断唤醒采集设备或者主控MCU),则在真空期过后立即产生中断唤醒采集设备或者主控MCU,以使采集设备或者主控MCU进入检测状态,从而避免出现计量误差;如果在真空期内未遇到所述第一高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU;When the collection device or the main control MCU is about to enter the sleep state, the vacuum period of pulse detection is entered. At this time, the collection device or the main control MCU will not be able to recognize a valid pulse signal, and if the first high frequency is encountered during the vacuum period Pulse group (because the level change will occur immediately when the first high-frequency pulse group is encountered, and the pulse period of the first high-frequency pulse group is greater than or equal to twice the period of the vacuum period, so after the vacuum period, the first The high-frequency pulse group will continue the validity of the pulse signal, which can generate an interrupt to wake up the acquisition device or main control MCU), then an interrupt is generated immediately after the vacuum period to wake up the acquisition device or main control MCU, so that the acquisition device or main control MCU enters Detect the status to avoid measurement errors; if the first high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the acquisition device or the main control MCU;
在传感器的脉冲信号即将释放进入空闲状态时,进入脉冲检测的真空期,此时采集设备或者主控MCU将无法识别到有效脉冲信号,且如果在真空期内遇到所述第二高频脉冲群(由于在遇到第二高频脉冲群时会马上产生电平变化,且第二高频脉冲群的脉冲周期大于等于真空期的周期的两倍,因此,在真空期过后,第二高频脉冲群会延续脉冲信号的有效性,从而可产生中断唤醒采集设备或者主控MCU),则在真空期过后立即产生中断唤醒采集设备或者主控MCU,以使采集设备或者主控MCU进入检测状态,从而避免出现计量误差;如果在真空期内未遇到所述第二高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU。When the pulse signal of the sensor is about to be released and enter the idle state, the vacuum period of pulse detection is entered. At this time, the collection device or the main control MCU will not be able to recognize the valid pulse signal, and if the second high-frequency pulse is encountered during the vacuum period Group (because the level change will occur immediately when the second high-frequency pulse group is encountered, and the pulse period of the second high-frequency pulse group is greater than or equal to twice the period of the vacuum period, so after the vacuum period, the second high The frequency pulse group will continue the validity of the pulse signal, which can generate an interrupt to wake up the collection device or the main control MCU), then immediately generate an interrupt to wake up the collection device or the main control MCU after the vacuum period, so that the collection device or the main control MCU enters the detection In order to avoid measurement errors; if the second high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the acquisition device or the main control MCU.
具体实施例二:Specific embodiment two:
请参阅图4和图5所示,本发明一种传感器脉冲信号的处理方法的较佳实施例二,所述方法包括:Please refer to FIGS. 4 and 5. A preferred embodiment 2 of a method for processing a sensor pulse signal according to the present invention includes:
步骤S1、在传感器的有效脉冲输出的两个边沿各增加一个高频脉冲群;其中,增加高频脉冲群的目的是:当传感器的检测精度和密度较高时,传感器的脉冲频率将大于10HZ;在智能抄表和智慧水务领域中,采集设备或者或主控MCU通常都是采用一次性电池供电,因此,设备都是处于周期性唤醒工作;而在采集设备或主控MCU即将进入休眠状态时,会有一个脉冲检测的真空期,如果这时候传感器检测到信号,将无法被采集设备或者主控MCU的中断识别,从而导致出现计量误差的情况;同理,在传感器的脉冲 信号即将释放进入到空闲状态时,也存在有一个脉冲检测的真空期,如果这时候传感器检测到信号,也将无法被采集设备或者主控MCU的中断识别,从而导致出现计量误差的情况;本发明通过在传感器的有效脉冲输出的两个边沿各增加一个高频脉冲群,可使得在信号无法被采集设备或者主控MCU的中断识别时,可以通过高频脉冲群产生电平变化来唤醒采集设备或者主控MCU。Step S1, add a high-frequency pulse group on both edges of the effective pulse output of the sensor; among them, the purpose of increasing the high-frequency pulse group is: when the detection accuracy and density of the sensor is high, the pulse frequency of the sensor will be greater than 10HZ ; In the field of smart meter reading and smart water affairs, the collection device or the main control MCU is usually powered by a disposable battery, therefore, the device is periodically awakened; while the collection device or the main control MCU is about to enter a sleep state At this time, there will be a vacuum period of pulse detection. If the sensor detects a signal at this time, it will not be recognized by the acquisition device or the main control MCU, resulting in a measurement error; similarly, the pulse signal of the sensor will be released soon When entering the idle state, there is also a vacuum period of pulse detection. If the sensor detects a signal at this time, it will not be recognized by the interruption of the collection device or the main control MCU, resulting in a measurement error. A high-frequency pulse group is added to both edges of the effective pulse output of the sensor, so that when the signal cannot be recognized by the interruption of the collection device or the main control MCU, the high-frequency pulse group can generate a level change to wake up the collection device or the main Control MCU.
在本具体实施例二中,所述步骤S1具体为:In the second specific embodiment, the step S1 is specifically:
在传感器的有效脉冲输出的开始位置增加一个第一高频脉冲群,在传感器的有效脉冲输出的结束位置增加一个第二高频脉冲群。在增加完第一高频脉冲群和第二高频脉冲群后,传感器输出的脉冲波形就由空闲状态、第一高频脉冲群、有效脉冲以及第二高频脉冲群组成。其中,当传感器输出的脉冲波形处于空闲状态时,是不会进行采样的;当传感器输出的脉冲波形处于有效脉冲时,则会进行多次采样;当传感器输出的脉冲波形处于第一高频脉冲群和第二高频脉冲群时,则会唤醒采集设备或者主控MCU。A first high-frequency pulse group is added at the beginning of the effective pulse output of the sensor, and a second high-frequency pulse group is added at the end of the effective pulse output of the sensor. After adding the first high-frequency pulse group and the second high-frequency pulse group, the pulse waveform output by the sensor is composed of the idle state, the first high-frequency pulse group, the effective pulse, and the second high-frequency pulse group. Among them, when the pulse waveform output by the sensor is idle, it will not be sampled; when the pulse waveform output by the sensor is an effective pulse, it will be sampled multiple times; when the pulse waveform output by the sensor is at the first high-frequency pulse When the group and the second high-frequency pulse group, it will wake up the acquisition device or the main control MCU.
在本具体实施例二中,所述传感器的有效脉冲输出具体为传感器的负逻辑电平输出,其具体输出的脉冲波形如图4所示。In the second specific embodiment, the effective pulse output of the sensor is specifically the negative logic level output of the sensor, and the specific output pulse waveform is shown in FIG. 4.
在本具体实施例二中,为了有效避免出现计量误差,设置所述第一高频脉冲群的脉冲个数大于等于2个,且所述第一高频脉冲群的脉冲周期大于等于真空期的周期的两倍。当然,本发明并不仅限于此,本发明在具体实施时,如果不考虑功耗问题的话,则可以将第一高频脉冲群的脉冲个数设置得大一些(例如10个);如果需要考虑功耗问题的话,则需要将第一高频脉冲群的脉冲个数设置得小一些(如3个)。In the second embodiment, in order to effectively avoid measurement errors, the number of pulses of the first high-frequency pulse group is greater than or equal to 2, and the pulse period of the first high-frequency pulse group is greater than or equal to the vacuum period. Twice the period. Of course, the present invention is not limited to this. In the specific implementation of the present invention, if the power consumption problem is not considered, the number of pulses of the first high-frequency pulse group may be set to be larger (for example, 10); if necessary If power consumption is a problem, the number of pulses of the first high-frequency pulse group needs to be set smaller (for example, 3).
在本具体实施例二中,为了有效避免出现计量误差,所述第二高频脉冲群的脉冲个数大于等于2个,且所述第二高频脉冲群的脉冲周期大于等于真空期的周期的两倍。当然,本发明并不仅限于此,本发明在具体实施时,如果不考虑功耗问题的话,则可以将第二高频脉冲群的脉冲个数设置得大一些(例如10个);如果需要考虑功耗问题的话,则需要将第二高频脉冲群的脉冲个数设置得小一些(如3个)。In the second embodiment, in order to effectively avoid measurement errors, the number of pulses of the second high-frequency pulse group is greater than or equal to 2, and the pulse period of the second high-frequency pulse group is greater than or equal to the period of the vacuum period Twice. Of course, the present invention is not limited to this. In the specific implementation of the present invention, if the power consumption problem is not considered, the number of pulses of the second high-frequency pulse group may be set to be larger (for example, 10); if necessary In case of power consumption problems, the number of pulses of the second high-frequency pulse group needs to be set smaller (for example, 3).
为了保证传感器的有效脉冲的准确性,通常会在有效脉冲期间进行多次采样,因此,设置所述传感器的有效脉冲的周期大于等于采样周期的三倍,例如,采样周期为1ms,那么,传感器的有效脉冲的周期≥3*1ms(即3ms)。In order to ensure the accuracy of the effective pulse of the sensor, multiple sampling is usually performed during the effective pulse. Therefore, the period of the effective pulse of the sensor is set to be greater than or equal to three times the sampling period, for example, the sampling period is 1ms, then, the sensor The effective pulse period is ≥3*1ms (ie 3ms).
为了保证脉冲的一致性以及稳定性,设置所述传感器脉冲信号的占空比为50%,即使传感器脉冲信号的总周期等于有效脉冲总周期的两倍,其中,有效脉冲总周期=第一高频脉冲群的脉冲周期+传感器的有效脉冲的周期+第二高频脉冲群的脉冲周期。例如,采集设备的真空期的周期为150us,采样周期为0.5ms,则第一高频脉冲群的脉冲周期=第二高频脉冲群的脉冲周期≥2*150us(即300us),传感器的有效脉冲的周期≥3*0.5ms(即1.5ms),有效脉冲总周期≥300us+1.5ms+300us=2.1ms,总周期≥2*2.1ms=4.2ms。同时,通过传感器脉冲信号的总周期我们还可以知道传感器的最高检测精度。当然,本发明设置所述传感器脉冲信号的占空比为50%,主要是出于保证脉冲的一致性以及稳定性的考虑,如果不考虑脉冲的一致性以及稳定性的话,采用其它的占空比也是可以实现的。In order to ensure pulse consistency and stability, the duty cycle of the sensor pulse signal is set to 50%, even if the total period of the sensor pulse signal is equal to twice the total period of the effective pulse, where the total period of the effective pulse = the first high The pulse period of the high-frequency pulse group + the period of the effective pulse of the sensor + the pulse period of the second high-frequency pulse group. For example, the vacuum period of the collection device is 150us, and the sampling period is 0.5ms, then the pulse period of the first high-frequency pulse group = the pulse period of the second high-frequency pulse group ≥ 2*150us (ie 300us), the sensor is effective The period of the pulse is ≥3*0.5ms (that is, 1.5ms), the total period of the effective pulse is ≥300us+1.5ms+300us=2.1ms, and the total period is ≥2*2.1ms=4.2ms. At the same time, we can also know the highest detection accuracy of the sensor through the total period of the sensor pulse signal. Of course, the present invention sets the duty cycle of the sensor pulse signal to 50%, mainly for the sake of ensuring the consistency and stability of the pulse. If the consistency and stability of the pulse are not considered, other duty cycles are adopted. Ratio is also achievable.
步骤S2、在脉冲检测的真空期内如果遇到所述高频脉冲群,则在真空期过后立即产生中断唤醒采集设备或者主控MCU;在脉冲检测的真空期内如果未遇到所述高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU。Step S2. If the high-frequency pulse group is encountered during the vacuum period of pulse detection, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU; if the high frequency pulse group is not encountered during the vacuum period of pulse detection Frequency pulse group, it will not generate an interrupt immediately after the vacuum period to wake up the acquisition device or the main control MCU.
在本具体实施例二中,所述步骤S2具体为:In the second specific embodiment, the step S2 is specifically:
在采集设备或者主控MCU即将进入休眠状态时,进入脉冲检测的真空期,此时采集设备或者主控MCU将无法识别到有效脉冲信号,且如果在真空期内遇到所述第一高频脉冲群(由于在遇到第一高频脉冲群时会马上产生电平变化,且第一高频脉冲群的脉冲周期大于等于真空期的周期的两倍,因此,在真空期过后,第一高频脉冲群会延续脉冲信号的有效性,从而可产生中断唤醒采集设备或者主控MCU),则在真空期过后立即产生中断唤醒采集设备或者主控MCU,以使采集设备或者主控MCU进入检测状态,从而避免出现计量误差;如果在真空期内未遇到所述第一高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU;When the collection device or the main control MCU is about to enter the sleep state, the vacuum period of pulse detection is entered. At this time, the collection device or the main control MCU will not be able to recognize a valid pulse signal, and if the first high frequency is encountered during the vacuum period Pulse group (because the level change will occur immediately when the first high-frequency pulse group is encountered, and the pulse period of the first high-frequency pulse group is greater than or equal to twice the period of the vacuum period, so after the vacuum period, the first The high-frequency pulse group will continue the validity of the pulse signal, which can generate an interrupt to wake up the acquisition device or the main control MCU), then an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU, so that the acquisition device or the main control MCU enters Detect the status to avoid measurement errors; if the first high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the acquisition device or the main control MCU;
在传感器的脉冲信号即将释放进入空闲状态时,进入脉冲检测的真空期,此时采集设备或者主控MCU将无法识别到有效脉冲信号,且如果在真空期内遇到所述第二高频脉冲群(由于在遇到第二高频脉冲群时会马上产生电平变化,且第二高频脉冲群的脉冲周期大于等于真空期的周期的两倍,因此,在真空期过后,第二高频脉冲群会延续脉冲信号的有效性,从而可产生中断唤醒采集设备或者主控MCU),则在真空期过后立即产生中断唤醒采集设备或者主控MCU,以使采集设备或者主控MCU进入检测状态,从而避免出现计量误差;如果在真空期内未遇到所述第二高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU。When the pulse signal of the sensor is about to be released and enter the idle state, the vacuum period of pulse detection is entered. At this time, the collection device or the main control MCU will not be able to recognize the valid pulse signal, and if the second high-frequency pulse is encountered during the vacuum period Group (because the level change will occur immediately when the second high-frequency pulse group is encountered, and the pulse period of the second high-frequency pulse group is greater than or equal to twice the period of the vacuum period, so after the vacuum period, the second high The frequency pulse group will continue the validity of the pulse signal, which can generate an interrupt to wake up the collection device or the main control MCU), then immediately generate an interrupt to wake up the collection device or the main control MCU after the vacuum period, so that the collection device or the main control MCU enters the detection In order to avoid measurement errors; if the second high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the acquisition device or the main control MCU.
综上所述,本发明具有如下优点:In summary, the present invention has the following advantages:
1、本发明通过在传感器的有效脉冲输出的两个边沿各增加一个高频脉冲群,可使得在脉冲信号无法被采集设备或者主控MCU的中断识别时,可以通过高频脉冲群产生电平变化来唤醒采集设备或者主控MCU,进而保证采集设备或者主控MCU不会错过脉冲中断,从而可有效避免出现计量误差,并提高传感器的检测精度和密度;1. The present invention adds a high-frequency pulse group to the two edges of the effective pulse output of the sensor, so that when the pulse signal cannot be recognized by the acquisition device or the interruption of the main control MCU, the level can be generated by the high-frequency pulse group Changes to wake up the acquisition device or the main control MCU, thereby ensuring that the acquisition device or the main control MCU will not miss the pulse interruption, which can effectively avoid measurement errors and improve the detection accuracy and density of the sensor;
2、设置传感器的有效脉冲的周期大于等于采样周期的三倍,可保证传感器的有效脉冲的准确性;2. Set the period of the effective pulse of the sensor to be greater than or equal to three times the sampling period to ensure the accuracy of the effective pulse of the sensor;
3、设置传感器脉冲信号的占空比为50%,可保证脉冲的一致性以及稳定性;同时,还可以通过计算传感器脉冲信号的总周期来得到传感器的最高检测精度。3. Set the duty cycle of the sensor pulse signal to 50% to ensure the consistency and stability of the pulse; at the same time, the maximum detection accuracy of the sensor can also be obtained by calculating the total period of the sensor pulse signal.
虽然以上描述了本发明的具体实施方式,但是熟悉本技术领域的技术人员应当理解,我们所描述的具体的实施例只是说明性的,而不是用于对本发明的范围的限定,熟悉本领域的技术人员在依照本发明的精神所作的等效的修饰以及变化,都应当涵盖在本发明的权利要求所保护的范围内。Although the specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments we have described are only illustrative, and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by a technician in accordance with the spirit of the present invention should be covered by the scope of the claims of the present invention.

Claims (9)

  1. 一种传感器脉冲信号的处理方法,其特征在于:所述方法包括:A method for processing sensor pulse signals, characterized in that the method includes:
    步骤S1、在传感器的有效脉冲输出的两个边沿各增加一个高频脉冲群;Step S1, add a high-frequency pulse group on each edge of the effective pulse output of the sensor;
    步骤S2、在脉冲检测的真空期内如果遇到所述高频脉冲群,则在真空期过后立即产生中断唤醒采集设备或者主控MCU;在脉冲检测的真空期内如果未遇到所述高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU。Step S2. If the high-frequency pulse group is encountered during the vacuum period of pulse detection, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU; if the high frequency pulse group is not encountered during the vacuum period of pulse detection Frequency pulse group, it will not generate an interrupt immediately after the vacuum period to wake up the acquisition device or the main control MCU.
  2. 根据权利要求1所述的一种传感器脉冲信号的处理方法,其特征在于:所述步骤S1具体为:The method for processing a sensor pulse signal according to claim 1, wherein the step S1 is specifically:
    在传感器的有效脉冲输出的开始位置增加一个第一高频脉冲群,在传感器的有效脉冲输出的结束位置增加一个第二高频脉冲群。A first high-frequency pulse group is added at the beginning of the effective pulse output of the sensor, and a second high-frequency pulse group is added at the end of the effective pulse output of the sensor.
  3. 根据权利要求2所述的一种传感器脉冲信号的处理方法,其特征在于:所述步骤S2具体为:The method for processing a sensor pulse signal according to claim 2, wherein the step S2 is specifically:
    在采集设备或者主控MCU即将进入休眠状态时,进入脉冲检测的真空期,且如果在真空期内遇到所述第一高频脉冲群,则在真空期过后立即产生中断唤醒采集设备或者主控MCU,以使采集设备或者主控MCU进入检测状态;如果在真空期内未遇到所述第一高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU;When the acquisition device or the main control MCU is about to enter the sleep state, enter the vacuum period of pulse detection, and if the first high-frequency pulse group is encountered during the vacuum period, an interrupt will be generated immediately after the vacuum period to wake up the acquisition device or the master Control the MCU, so that the collection device or the main control MCU enters the detection state; if the first high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the collection device or the main control MCU;
    在传感器的脉冲信号即将释放进入空闲状态时,进入脉冲检测的真空期,且如果在真空期内遇到所述第二高频脉冲群,则在真空期过后立即产生中断唤醒采集设备或者主控MCU,以使采集设备或者主控MCU进入检测状态;如果在真空期内未遇到所述第二高频脉冲群,则不在真空期过后立即产生中断唤醒采集设备或者主控MCU。When the pulse signal of the sensor is about to be released and enter the idle state, the vacuum period of pulse detection is entered, and if the second high-frequency pulse group is encountered during the vacuum period, an interrupt is generated immediately after the vacuum period to wake up the acquisition device or the main control MCU, so that the collection device or the main control MCU enters the detection state; if the second high-frequency pulse group is not encountered during the vacuum period, an interrupt will not be generated immediately after the vacuum period to wake up the collection device or the main control MCU.
  4. 根据权利要求2所述的一种传感器脉冲信号的处理方法,其特征在于:所述第一高频脉冲群的脉冲个数大于等于2个,且所述第一高频脉冲群的脉冲周期大于等于真空期的周期的两倍。The method for processing a sensor pulse signal according to claim 2, wherein the number of pulses of the first high-frequency pulse group is greater than or equal to 2, and the pulse period of the first high-frequency pulse group is greater than Equal to twice the period of the vacuum period.
  5. 根据权利要求2所述的一种传感器脉冲信号的处理方法,其特征在 于:所述第二高频脉冲群的脉冲个数大于等于2个,且所述第二高频脉冲群的脉冲周期大于等于真空期的周期的两倍。The method for processing a sensor pulse signal according to claim 2, wherein the number of pulses of the second high-frequency pulse group is greater than or equal to 2, and the pulse period of the second high-frequency pulse group is greater than Equal to twice the period of the vacuum period.
  6. 根据权利要求1所述的一种传感器脉冲信号的处理方法,其特征在于:所述传感器的有效脉冲的周期大于等于采样周期的三倍。The method for processing a sensor pulse signal according to claim 1, wherein the period of the effective pulse of the sensor is greater than or equal to three times the sampling period.
  7. 根据权利要求1所述的一种传感器脉冲信号的处理方法,其特征在于:设置所述传感器脉冲信号的占空比为50%,即使传感器脉冲信号的总周期等于有效脉冲总周期的两倍,其中,有效脉冲总周期=第一高频脉冲群的脉冲周期+传感器的有效脉冲的周期+第二高频脉冲群的脉冲周期。The method for processing a sensor pulse signal according to claim 1, wherein the duty cycle of the sensor pulse signal is set to 50%, even if the total period of the sensor pulse signal is equal to twice the total period of the effective pulse, Wherein, the total effective pulse period=the pulse period of the first high-frequency pulse group+the period of the effective pulse of the sensor+the pulse period of the second high-frequency pulse group.
  8. 根据权利要求1所述的一种传感器脉冲信号的处理方法,其特征在于:在所述步骤S1中,所述传感器的有效脉冲输出具体为传感器的负逻辑电平输出。The method for processing a sensor pulse signal according to claim 1, wherein in step S1, the effective pulse output of the sensor is specifically a negative logic level output of the sensor.
  9. 根据权利要求1所述的一种传感器脉冲信号的处理方法,其特征在于:在所述步骤S1中,所述传感器的有效脉冲输出具体为传感器的正逻辑电平输出。The method for processing a sensor pulse signal according to claim 1, wherein in step S1, the effective pulse output of the sensor is specifically a positive logic level output of the sensor.
PCT/CN2018/121397 2018-12-17 2018-12-17 Sensor pulse signal processing method WO2020124302A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/121397 WO2020124302A1 (en) 2018-12-17 2018-12-17 Sensor pulse signal processing method
SG11202101384WA SG11202101384WA (en) 2018-12-17 2018-12-17 Sensor pulse signal processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/121397 WO2020124302A1 (en) 2018-12-17 2018-12-17 Sensor pulse signal processing method

Publications (1)

Publication Number Publication Date
WO2020124302A1 true WO2020124302A1 (en) 2020-06-25

Family

ID=71100076

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/121397 WO2020124302A1 (en) 2018-12-17 2018-12-17 Sensor pulse signal processing method

Country Status (2)

Country Link
SG (1) SG11202101384WA (en)
WO (1) WO2020124302A1 (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0609997A2 (en) * 1993-02-05 1994-08-10 Hewlett-Packard Company Method of reducing drive energy in a high speed thermal ink jet printer
CN1450720A (en) * 2003-05-15 2003-10-22 上海联欣科技发展有限公司 Intelligent meter set signal identifying method
CN105050115A (en) * 2015-06-29 2015-11-11 小米科技有限责任公司 Method and device for waking up MCU
CN105703749A (en) * 2014-11-24 2016-06-22 中国科学院沈阳自动化研究所 Low-power consumption and accurate sleep timer circuit and method
CN107276871A (en) * 2017-06-16 2017-10-20 山东省科学院自动化研究所 A kind of Low-power-consumptiocontrol control method, controller and the control system of CAN nodes
CN107515662A (en) * 2016-06-15 2017-12-26 深圳市博巨兴实业发展有限公司 Low-power consumption management method in a kind of MCU chip towards the application of keying class
CN107862231A (en) * 2017-11-23 2018-03-30 重庆华虹电子有限公司 A kind of method for preventing electronic tag false wake-up
CN109634168A (en) * 2018-12-05 2019-04-16 智恒科技股份有限公司 A kind of processing method of sensor pulse signal

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0609997A2 (en) * 1993-02-05 1994-08-10 Hewlett-Packard Company Method of reducing drive energy in a high speed thermal ink jet printer
CN1450720A (en) * 2003-05-15 2003-10-22 上海联欣科技发展有限公司 Intelligent meter set signal identifying method
CN105703749A (en) * 2014-11-24 2016-06-22 中国科学院沈阳自动化研究所 Low-power consumption and accurate sleep timer circuit and method
CN105050115A (en) * 2015-06-29 2015-11-11 小米科技有限责任公司 Method and device for waking up MCU
CN107515662A (en) * 2016-06-15 2017-12-26 深圳市博巨兴实业发展有限公司 Low-power consumption management method in a kind of MCU chip towards the application of keying class
CN107276871A (en) * 2017-06-16 2017-10-20 山东省科学院自动化研究所 A kind of Low-power-consumptiocontrol control method, controller and the control system of CAN nodes
CN107862231A (en) * 2017-11-23 2018-03-30 重庆华虹电子有限公司 A kind of method for preventing electronic tag false wake-up
CN109634168A (en) * 2018-12-05 2019-04-16 智恒科技股份有限公司 A kind of processing method of sensor pulse signal

Also Published As

Publication number Publication date
SG11202101384WA (en) 2021-03-30

Similar Documents

Publication Publication Date Title
CN102035455B (en) M/T speed measuring method for frequency converter
WO2015014162A1 (en) Apparatus and method for awakening mcu of soc chip
CN101206235A (en) Method for measuring frequency of single-chip
CN103176042B (en) A kind of frequency measurement method, device and frequency meter
CN103487649B (en) Method and device capable of measuring both frequency of continuous waves and frequency of pulse modulation carrier waves
CN207586312U (en) A kind of digital frequency meter based on FPGA
CN201749316U (en) Intelligent electric energy meter clock multi-function quick tester
CN109634168B (en) Method for processing sensor pulse signal
WO2020124302A1 (en) Sensor pulse signal processing method
CN101865951A (en) Anti-interference frequency measuring method
CN104897219A (en) High-accuracy low-power consumption ultrasonic flowmeter
CN104407213B (en) Power network signal fundamental frequency measurement method
CN109188077A (en) A kind of signal frequency measuring method, system, device and readable storage medium storing program for executing
CN104391176A (en) Software and hardware frequency measurement circuit compatible with electric power system signals
CN116358652A (en) Multi-feature point ultrasonic transit time measurement method based on cross-correlation algorithm assistance
CN105866542A (en) High-accuracy sliding frequency measurement method
CN102130682A (en) Phase discriminator
CN203216937U (en) Wide-range high-accuracy rotation speed measuring circuit
CN109557332B (en) Rotation speed signal conversion device based on Taylor algorithm
WO2021093579A1 (en) Waveform measuring method
CN106643930A (en) Improved ultrasonic flowmeter
CN206696338U (en) Time delay estimating circuit based on zero passage detection
CN106655960A (en) Elevator speed detection system
CN102353408B (en) Output signal detection circuit and detection method of dish-washing machine flowmeter
CN104459314A (en) High-precision frequency measurement method in RFID system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18943793

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18943793

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 18943793

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22/12/2021)