CN110429934B - Anti-interference self-adaptive counting method - Google Patents

Anti-interference self-adaptive counting method Download PDF

Info

Publication number
CN110429934B
CN110429934B CN201910711917.5A CN201910711917A CN110429934B CN 110429934 B CN110429934 B CN 110429934B CN 201910711917 A CN201910711917 A CN 201910711917A CN 110429934 B CN110429934 B CN 110429934B
Authority
CN
China
Prior art keywords
circular
emitters
signal
period
round
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910711917.5A
Other languages
Chinese (zh)
Other versions
CN110429934A (en
Inventor
曹朋军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Xingzhou Tianqi Intelligent Equipment Co ltd
Original Assignee
Xi'an Xingzhou Tianqi Intelligent Equipment Co ltd
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 Xi'an Xingzhou Tianqi Intelligent Equipment Co ltd filed Critical Xi'an Xingzhou Tianqi Intelligent Equipment Co ltd
Priority to CN201910711917.5A priority Critical patent/CN110429934B/en
Publication of CN110429934A publication Critical patent/CN110429934A/en
Application granted granted Critical
Publication of CN110429934B publication Critical patent/CN110429934B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K21/00Details of pulse counters or frequency dividers
    • H03K21/08Output circuits
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K21/00Details of pulse counters or frequency dividers
    • H03K21/40Monitoring; Error detection; Preventing or correcting improper counter operation

Landscapes

  • Geophysics And Detection Of Objects (AREA)

Abstract

The invention discloses an anti-interference self-adaptive counting method, which adopts a self-adaptive method, wherein a singlechip detects the moving speed of a round or approximate round object on a conveyor belt, two rows of emitters respectively send infrared light to irradiate the round or approximate round object on the conveyor belt, a receiver detects light intensity values sent by the two emitters at different moments, the singlechip sets an interval period of two valley value detections, updates a clock period between two valley values inside the singlechip and a mark signal holding period of the round or elliptical object in real time, and performs the valley detection on two voltage samples through the receiver; if the two rows of emitters are in a closed state, the round or oval object marking signals are screened twice, and the single chip microcomputer counts the round or oval objects through pulse counting. The method can improve the precision, and has simple expansion and easy operation.

Description

Anti-interference self-adaptive counting method
Technical Field
The invention belongs to the technical field of signal processing, and particularly relates to an anti-interference self-adaptive counting method.
Background
With the rapid development of economy and science and technology, the living standard is continuously improved, from simple function realization to more deep humanized design, people have higher and higher requirements on the degree of production automation, and artificial intelligence becomes a hot spot at present. The counting function relates to various industries and becomes a necessity of our life. The method has the defects of time consumption, large error, high cost and the like, and does not accord with the concept of pursuing convenience, energy conservation and accuracy by people. The automatic counting device solves the problems, has the advantages of high efficiency, low cost, strong practicability and the like, meets the requirements of consumers, and is widely applied to counting systems operated by production lines.
In the transfer control of the production process, a counting device becomes necessary. The measured object is positioned on the conveying guide device, and when the measured object moves to the detection area of the counting device, the counting device carries out algorithm demodulation according to the surface area characteristics of the object, and the number of the objects is calculated. The conveyor belt used in the production conveying process runs under the driving of a motor, the running speed is not very accurate, and open-loop control is generally adopted. The speed of the conveyor belt is set to be different for different purposes of application, and even under the same application, the speed can be changed along with the change of the load on the conveyor belt when the conveyor belt runs. As the speed of the conveyor belt changes, the speed of the circular or elliptical object changes, so that the time for detecting the area by the counting device is different. If the transmission speed is higher or lower than a certain value, it is not suitable for the set period value, and exceeds the period for detecting two valleys in the fixed time, which affects the correctness of the counting device and causes the wrong counting.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide an anti-interference adaptive counting method, which solves the error of the original algorithm caused by the change of the transmission speed by detecting the moving speed of the circular or elliptical object, which is consistent with the speed of the conveyor belt, automatically adjusting the cycle number in the valley detection function in the counting method, and adopting an adaptive mode.
The invention adopts the following technical scheme:
an anti-interference self-adaptive counting method adopts a self-adaptive method, a single chip microcomputer detects the moving speed of a round or approximate round object on a conveyor belt, two rows of emitters are vertically arranged above the conveyor belt at intervals, a row of receivers are arranged between the two rows of emitters, the two rows of emitters respectively send infrared light to irradiate the round or approximate round object on the conveyor belt, the receivers detect light intensity values sent by the two emitters at different moments, the single chip microcomputer sets an interval period of two valley value detections, a clock period between two valley values in the single chip microcomputer and a mark signal holding period of the round or elliptical object are updated in real time, the valley detection is carried out on two voltage samplings through the receivers, and if a first row of emitters is in an open state, the first valley detection is started; if the second row of emitters is in an open state, entering second trough detection; if the two rows of emitters are in a closed state, the round or oval object marking signals are screened twice, and the single chip microcomputer counts the round or oval objects through pulse counting.
Specifically, the method comprises the following steps:
s1, initializing parameters;
s2, a timer is adopted to interrupt to generate two paths of low-level pulse signals, the two paths of voltage pulse signals are respectively output to two ends of two rows of emitters, the opening and closing time of the emitters is controlled, and the width of the low level determines the opening time of the emitters;
s3, starting a wave trough detection process according to the state mark signal in the periodic signal;
s4, detecting the moving speed of the circular or elliptical object, counting the period difference of two wave troughs on the same channel, and updating the next wave trough detection period T1 and the mark signal holding period T2 of the circular or elliptical object;
and S5, when the periodic signal marking state is that the two rows of emitters are in a closed state, and in the third stage, performing secondary screening output judgment on the existing unprocessed marking signals of the circular or elliptical object, and judging whether the circular or elliptical object is a first effective marking signal generated by the counting device.
Further, in step S2, the timer of the single chip generates a periodic signal with a width of 3ms low level and 30ms high level and outputs the periodic signal to both ends of the first row of transmitters, and then generates a same periodic signal and outputs the same periodic signal to both ends of the second row of transmitters, the signal of the second row of transmitters is delayed by 3ms compared with the signal of the first row of transmitters, and the receiver marks the following states respectively: the power on state of the first row of emitters, the power on state of the second row of emitters, and the lights in both rows being off.
Further, in step S3, if the first row of emitters is marked as on, performing first trough detection, performing a/D sampling on voltages at two ends of each receiver, setting an upper limit value for a voltage signal, and sequentially performing trough detection on each receiving channel by using a five-point method; the upper limit of the voltage of the A/D sampling is set to be 0.6 times of the maximum voltage, and when the wave trough is detected, the first wave trough detection mark of the corresponding channel is true.
Further, in step S3, if the mark state is that the second row of transmitters is turned on, performing second trough detection, performing a/D sampling on the voltage at both ends of each receiver, before performing the second trough detection, determining whether the first trough detection mark in the same channel is true, if true, sequentially performing the second trough detection on each receiving channel by using the same method in the period T1, and if two troughs are detected in the same receiving channel setting period, determining that the signal is a qualified circular or elliptical object mark signal; and buffering the circular or elliptical object signal for T2 periods, wherein the T2 period covers two or three mark signal occurrence times.
Further, the time interval T between two troughs generated by the circular or elliptical object passing through the counting device is calculated as follows:
Figure BDA0002154078380000031
wherein, L is the distance between two rows of emitters, and V is the moving speed of the circular or elliptical object.
Further, in step S4, counting is started from when the first row of emitters is detected to generate a trough in an internal counting manner, and after the second trough is detected in the same channel, the cycle difference occurring between the two troughs is counted; while the valley detection period T1 is updated twice, the circular or elliptical object mark signal holding period T2 is updated to 1.5 times T1.
Furthermore, if two or more channels detect two dips in one period, the average value of the period difference of each channel is calculated to be the final period difference value, and 5 periods should be added to the detected period value to expand the boundary value when the next two-time dip detection period T1 is updated.
Further, in step S5, first, it is checked whether a circular or elliptical object mark signal exists for each channel in sequence; if so, checking whether to process the marking signal; if not, the method enters twice screening;
in the first screening process, adjacent channels of the marking signals of the circular or elliptical object which is not processed currently are judged and processed, and if no marking signal is generated in the adjacent channels, the marking signals of the circular or elliptical object which is not processed currently are considered as the first effective marking signals generated by the circular or elliptical object;
and carrying out secondary screening after the primary screening is finished, sequentially judging each channel during the secondary screening, judging whether a marking signal exists on the right side if a valid marking signal exists in a certain channel, outputting a counting pulse of a circular or elliptical object if the marking signal does not exist, and entering the next channel for judgment.
Furthermore, in the first screening process, if a marking signal exists on the right side, judging whether an effective round or oval object marking signal exists on the second right side, if so, clearing the effective marking, if not, outputting round or oval object counting pulses, and performing pulse counting on the round or oval object by using a pulse counting circuit;
in the second screening process, if the adjacent channel on the right side has a circular or elliptical object marking signal generated, and the left side does not have the circular or elliptical object marking signal, judging the second on the right side; if the adjacent channel on the left side has a circular or elliptical object marking signal generated, and the right side does not have the circular or elliptical object marking signal generated, judging the second channel on the left side; if there are round or oval object mark signals on both left and right sides, then the signals on both left and right sides need to be judged.
Compared with the prior art, the invention at least has the following beneficial effects:
the anti-interference self-adaptive counting method adopts the self-adaptive counting method, can set different parameters according to the speed of the conveyor belt, is applied to different occasions, and has good external anti-interference performance. The speed detection adopts an internal period counting mechanism, the clock period between two wave troughs is counted on the same receiver, the counted value is continuously updated to the period setting parameter, the improvement measures of the method are realized internally, and no equipment is required to be added. When multiple circular or elliptical objects are passed through the counting device, the voltage waveform across each receiver is complex, typically several envelopes connected together. The algorithm can set parameters according to the period, distinguish trough values generated by a circular or elliptical object at different moments, provide basis for further counting algorithm of the circular or elliptical object, and improve the accuracy of detecting a plurality of circular or elliptical objects simultaneously. Different circular or elliptical objects have different sizes and shapes, and when passing through the counting device, may produce a qualified trough in the voltage across one or two or even three receivers. There are two cases where three valleys are generated: the first is that the valley value occurs at the two ends of the three receivers simultaneously, and the second is that the valley value occurs at different moments at the two ends of the three receivers. For the second case, the tag signal of each receiver needs to be buffered and kept for a certain period, in the second screening, the tag signal is judged, one tag signal appearing first is selected from all the tag signals of a circular or elliptical object to be used as an effective counting signal, and other signals are subjected to invalidation processing.
Furthermore, two low-level pulse signals generated by the timer are output to two ends of the two rows of emitters, the emitters are controlled to be switched on and off in a time-sharing mode, the emitters in the first row are switched off after being switched on for 3ms, the emitters in the second row are switched off after being switched on for 3ms, and the switching-on time of the emitters in the second row is delayed by 3ms compared with that of the emitters in the first row. Set up two rows of transmitters, when same circular or oval object passes through detection device, can detect twice voltage trough signal at receiver both ends timesharing, detect twice trough signal and count more accurately effectively to the object.
Further, the voltage that the light that detects first row of transmitter sent produced at the receiver both ends detects for the trough for the first time, and the trough detects for the first time is the prerequisite to the object count, must detect behind the trough value that first row of transmitter produced, just begins the second row to detect, counts the object that passes through the device and must detect two trough values successively, just can correctly count.
Further, the voltage generated at the two ends of the receiver by the light emitted by the second row of emitters is detected as second trough detection, the second trough detection is to avoid the error caused by the first trough detection, the second trough detection is more strict relative to the first trough detection, the condition is stricter, the false detection rate is lower, and the accuracy of the counting method is improved.
Further, different detection areas can be set according to different width settings of the conveyor belt. The width of the conveyor belt can be adapted by increasing or decreasing the number of detection lamps, and only the number of detection channels needs to be modified.
Furthermore, the storage period of the mark signal is changed along with the moving speed of the circular or elliptical object, and is 1.5 times of the period between two trough values. The mark signal storage period is automatically updated according to the number of periods corresponding to the detected moving speed of the circular or elliptical object, secondary screening of circular or elliptical object quantity statistics is carried out, and influence of redundant mark signals on a counting value is eliminated.
Furthermore, the number of each row of transmitting lamps and receiving lamps is determined by the width of different transmission belts, the distance (vertical to the moving direction of an object) between two adjacent lamps is fixed and about 13mm, and because of the installation height of the device, the size and the shape of a reflection area of the object to be measured and different wave trough detection voltage thresholds, when one object to be measured passes through the device, marking signals of wave troughs may be detected twice in 1-3 adjacent channels, and the marking signals need to be processed, namely secondary screening, whether the marking signals of different channels are generated by the same object or different objects are generated, each object only has one effective marking signal, and other marking signals do not serve as counting values.
In conclusion, the invention can adapt to different speeds of the conveyor belt according to different application occasions, and can also adapt to speed change caused by load change on the conveyor belt. The mode that adopts inside to detect need not pass through any extra check out test set with the help of, and reduce cost can accurately detect a plurality of circular or oval objects and pass through counting assembly in succession side by side, through caching the mark signal, carries out the secondary screening, improves the precision, and the extension is simple, easy operation.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
FIG. 1 is a schematic view of a counting apparatus for the method of the present invention;
FIG. 2 is a graph of light intensity versus voltage;
FIG. 3 is a hardware schematic of the implementation of the present invention;
FIG. 4 is a periodic diagram of a demodulated square wave of the present invention;
FIG. 5 is a flow chart of the present invention.
Wherein: 1. a transmitter; 2. a receiver; 3. a conveyor belt; 4. an object.
Detailed Description
The invention provides an anti-interference self-adaptive counting method, which solves the error caused by the change of the conveying speed in a self-adaptive mode, and adapts to different conveyor belt running speeds by detecting the moving speed of a round or approximately round object and automatically setting the interval period of two times of valley detection.
Referring to fig. 5, the anti-interference adaptive counting method of the present invention updates the clock period between two internal valley values and the mark signal holding period of the circular or elliptical object in real time based on the automatic detection of the moving speed of the circular or elliptical object, and correctly counts the circular or elliptical object passing through the counting device, and includes five steps of initialization, emitter control, valley detection, speed detection and secondary screening output, and the specific steps are as follows:
s1, initializing global parameters, and performing initialization setting on peripheral equipment and interrupts;
configuring a pin of a singlechip according to requirements, setting parameters of a timer, setting parameters of an A/D sampling module in the singlechip, configuring an interrupt register, starting global interrupt, entering a main cycle and responding to interrupt signals of the relevant timer after initialization setting is completed.
S2, the emitter is controlled to generate two paths of low-level pulse signals by adopting a timer to interrupt, two paths of voltage pulse signals are respectively output to two ends of the two rows of emitters to control the on-off and on-off time of the emitters, and the on-off time of the emitters is determined by the width of the low level;
the timer in the single chip microcomputer firstly generates a periodic signal with the width of 3ms low level and 30ms high level and outputs the periodic signal to two ends of the first row of emitters, then generates the same periodic signal and outputs the periodic signal to the second row of emitters, the second signal is delayed by 3ms compared with the first signal, as shown in fig. 4, a solid line represents signals at two ends of the first row of emitters, and a dotted line represents signals at two ends of the second row of emitters. The two rows of emitters are controlled to send infrared light at different moments, the receiver detects light intensity values sent by the corresponding emitters at different moments, if voltage signals at two ends of the receiver present comb waves with different heights, each comb wave is provided with two steps, and each step correspondingly receives the light intensity of the infrared light sent by the different emitters.
The two paths of pulse output control signals are generated, state marks of each state are given, the power-on states of the emitters in the first row and the power-on states of the emitters in the second row are marked respectively, and the two rows of lamps are in a closed state.
S3, wave trough detection is to start a wave trough detection process according to a state mark signal in a periodic signal;
if the marking state is that the first row of emitters is on, the first trough detection is carried out. A/D sampling is carried out on the voltage at the two ends of each receiver, and after the voltage signal is set with an upper limit value, a five-point method is adopted to carry out wave trough detection on each receiving channel in sequence. The judgment is important after the upper limit value is set for the voltage of the A/D sampling, and some interference signals can be filtered. The setting of the upper limit value of the voltage is important, and if the setting is too small, some effective round or oval object marking signals are likely to be missed; if the setting is too large, the marking signals meeting the conditions are too many, and the algorithm complexity is increased. According to the results of multiple experiments, the voltage upper line is set to be 0.6 times of the maximum voltage. After the upper voltage limit is set, the algorithm overhead increased by interference signals can be reduced. When the trough is detected, the first trough detection flag is true for the corresponding channel.
If the flag state is that the second row of emitters is on, then a second valley detection is performed. The method comprises the steps that A/D sampling is carried out on the voltage at two ends of each receiver, before second-time trough detection is carried out, whether a first-time trough detection mark in the same channel is true or not is judged, if true, second-time trough detection is carried out on each receiving channel in sequence by adopting the same method in a period T1, two troughs are detected in the same receiving channel set period, the signal is considered to be a qualified circular or elliptical object mark signal, and one, two or even three continuous mark signals can be generated by the same circular or elliptical object. A different number of marker signals, two or three, may be present at the same time, or at different times. The circular or elliptical object signal needs to be buffered for T2 periods, and the T2 period should cover the occurrence time of two or three mark signals, in this case, it can be distinguished that the two or three mark signals are generated from the same circular or elliptical object.
S4, speed detection is to detect the moving speed of the circular or elliptical object, count the period difference of two wave troughs on the same channel, and update the next wave trough detection period T1 and the mark signal holding period T2 of the circular or elliptical object;
the speed detection adopts an internal counting mode, the wave troughs generated by the first row of emitters are counted from detection, and the cycle difference of the two wave troughs is counted after the wave troughs are detected for the second time on the same channel. If two or more channels detect the valleys twice in one period, the period difference of each channel is subjected to an averaging process, and as a final period difference, 5 periods should be added to the detected period value when updating the next two valley detection periods T1, so as to enlarge the boundary value and prevent the detection instability caused by the secondary valley detection being located on the boundary.
At the same time of updating the valley detection period T1 twice, the circular or elliptical object mark signal holding period T2 is updated to be 1.5 times as long as T1. The mark signal of the circular or elliptical object is kept for T2 periods, which has great significance for subsequent algorithms. The method can judge the previous T2 periods of the marking signals of each channel after detecting two troughs, wherein the two adjacent channels are arranged around the marking signals, and receivers at two ends only have one adjacent channel, so that the marking signals of each circular or elliptical object are required to keep T2 periods.
And S5, secondary screening output is to judge the existing unprocessed round or oval object marking signal twice when the periodic signal marking state is that the two rows of emitters are both in a closed state, and to judge whether the marking signal is the first effective marking signal generated by the round or oval object passing through the counting device.
Firstly, checking whether a circular or elliptical object marking signal exists in each channel in sequence; if so, it should be checked whether the flag signal is processed; if not, go to two screening processes.
In the first screening process, judging and processing adjacent channels of the current unprocessed round or oval object marking signals, and if no round or oval object marking signal is generated in adjacent channels, considering the current unprocessed round or oval object marking signal as a first effective marking signal generated by a round or oval object;
if the adjacent channel on the right side also has a circular or elliptical object marking signal generated, but the left side does not, the second on the right side also needs to be judged; if the adjacent channel on the left side also has a circular or elliptical object marking signal generated, but the right side does not, the second on the left side also needs to be judged; if there are round or oval object mark signals on both the left and right sides, the signals on both the left and right sides need to be judged.
Carrying out second screening after the first screening is finished, sequentially judging each channel during the second screening, judging whether a marking signal exists on the right side if a valid marking signal exists in a certain channel, outputting a counting pulse of a circular or elliptical object if the marking signal does not exist, and entering the next channel for judgment; if the marking signal exists on the right side, whether an effective round or oval object marking signal exists on the second right side or not is judged, if yes, the effective marking is cleared, the two marking signals belong to a round or oval object to be generated, only one counting is needed, if not, the counting pulse of the round or oval object is directly output without processing, and a circuit for counting the pulse is arranged outside to count the round or oval object pulse.
The main function firstly carries out initialization setting on the used parameters and the peripheral equipment, starts global interruption, enters the circulation flow processing and responds to the interruption of the timer.
The timer interrupts and outputs two paths of periodic signals, and the second path of signals is delayed by 3ms compared with the first path of signals. In each cycle, different flag signals represent different states that determine which branch the main loop process enters.
If the first row of emitters is in an open state, entering first trough detection;
if the second row of emitters is in an open state, entering second trough detection;
if the two rows of emitters are in the closed state, two screens of the round or oval object marking signals are entered.
The trough detection is the basis of twice screening of the marking signals of the circular or elliptical object, and a certain receiving channel enters twice screening processes after detecting twice trough signals.
When the receiver is in a state 1 in a cycle, entering a first branch, wherein the first branch is mainly used for detecting the valley value of voltage at two ends of the receiver when the first row of emitters emit infrared light, and keeping T1 cycles as the premise of second valley detection;
when the signal is in the state 2 in the cycle, entering a second branch, performing second wave trough detection on the premise that the first branch detects a wave trough, keeping T2 cycles after detecting the second wave trough, and counting the cycle interval of the two wave troughs;
when the signal is in the state 3 of the cycle, the third branch is entered, and the circular or elliptical object marking signal of each channel is judged, on the premise that the circular or elliptical object marking signal must exist, if the two troughs are detected in the T1 cycles on one channel, the signal is taken as the marking signal generated by the circular or elliptical object, so the processing flow of the state 3 is determined by the state 1 and the state 2. After entering the third branch, a round or oval object marking signal is screened twice, and only one effective marking signal is ensured when a round or oval object passes through the counting device.
Referring to fig. 3, the implementation platform of the counting method of the present invention is a control circuit mainly including a single chip, a crystal oscillator, a power supply, a transmitter, a receiver and a counting module, wherein the transmitter is controlled by the transmitter and connected to the single chip, the single chip is connected to the receiver by a/D conversion, and the pulse output of the single chip is connected to the pulse counting.
The method solves the problem of wrong counting caused by the change of the moving speed of the circular or elliptical object, and expounds the algorithm principle from the function description of wave trough detection, speed detection and twice screening. The method has the advantages that the middle-period parameters are updated in real time in an internal self-testing mode, the middle-period parameters are updated along with the change of the speed, the method has the capability of automatically adapting to the change of an external environment, the algorithm has good anti-interference performance, and the problem of complex application environment is solved.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be 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 some, but not all, embodiments of the present invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. 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.
Referring to fig. 1, the counting device used in the counting method of the present invention includes a transmitter 1 and a receiver 2, two rows of transmitters 1 and one row of receivers 2 are installed at a fixed angle and distance, through the programming of a controller, the controller controls the working cycles of the two rows of transmitters 1 to transmit infrared light at a fixed frequency, the middle row of receivers 2 receives infrared light, and the voltage shows different values according to the different reflection characteristics of the surface of the circular or elliptical object 4 and the different light intensities received at the two ends of the receivers 2.
The counting device is mounted above the conveyor belt 3, the direction of movement of the conveyor belt 3 being perpendicular to the direction in which the emitters 1 and receivers 2 are arranged. The circular or oval objects 4 on the conveyor belt 3 pass the counting device at a certain speed.
The controller is used for programming and controlling the switch of the emitter 1, and controlling the first row of emitters 1 and the second row of emitters 1 to emit infrared light with fixed frequency at different time points. When the circular or elliptical object 4 moves to the detection area of the counting device at different speeds, the light intensity received by the receiver 2 changes, two ends of the receiver 2 present different voltage values to generate comb waves with fixed periods, each comb wave has two voltage step amounts, and the intensity of the light intensity generated by the infrared light emitted by the first row of emitters 1 and the intensity of the light intensity generated by the infrared light emitted by the second row of emitters 1 are respectively received by the corresponding infrared receiver at different moments.
Referring to fig. 2, the stronger the light intensity, the smaller the voltage across the receiver 2, whereas the weaker the light intensity, the larger the voltage. When the circular or elliptical object 4 moves to the position 1 as shown in fig. 1, the infrared rays transmitted by the first row of emitters 1 are reflected to the receiving end through the highest point on the surface of the circular or elliptical object 4, the maximum light intensity value is generated at this moment, and the smaller the voltage value at the two ends of the receiver 2 is, the smaller the value corresponds to the valley value of the first step in fig. 2. When the circular or elliptical object 4 continues to move to the position 2, the infrared rays sent by the first row of emitters 1 are reflected to the receiver 2 through the highest point on the surface of the circular or elliptical object 4, the maximum light intensity value is generated at the moment, and the smaller the voltage value at the two ends of the receiver 2 is, the smaller the wave valley value corresponds to the second step amount in fig. 2.
The first step corresponds to the voltage value generated by the first row of infrared emitters 1 sent to the receiver 2, and the second step corresponds to the voltage value generated by the second row of infrared emitters 1 sent to the receiver 2. After the trough values of the voltage values generated by the first row of infrared emitters 1 have been detected, the trough values of the voltage values generated by the second row of infrared emitters 1 are continuously detected, two trough values are generated, and the counting device confirms that a circular or elliptical object 4 has generated the two trough values through the counting device.
According to the counting algorithm principle of the circular or elliptical object 4, the frequency of infrared light emitted by the emitters 1 is fixed, namely the frequency of the comb waves is fixed, and the installation distance of the two rows of emitters 1 is fixed. When the speed of the conveyor belt 3 changes, the speed of the circular or elliptical objects 4 passing through the detection area of the counting device also differs, resulting in a different number of combs being possessed by the envelope of the voltage waveform across the receiver 2. When the circular or elliptical objects 4 pass through the counting device at different speeds, the voltage wave troughs of the infrared light emitted by the emitters 1 in the first row and the voltage wave troughs of the infrared light emitted by the emitters in the second row to the receivers 2 are different by different periods.
If the interval period of the two voltage wave trough values of the receiver 2 is not constrained, the anti-interference performance of the algorithm is poor, when a plurality of circular or elliptical objects 4 continuously pass through the counter device side by side, the light intensity received by the receiver 2 is simultaneously influenced by the surface reflection of the plurality of circular or elliptical objects 4, the voltage at two ends of one receiver 2 presents a plurality of continuous wave trough values, if the period interval between two wave trough values generated by the circular or elliptical object 4 passing through the counter device is not limited, it is likely that two wave trough values are detected not to be generated by one circular or elliptical object 4, or one wave trough value in the same direction is lost, and an erroneous count is generated. The period interval of two wave trough values needs to be set, and a round or oval object 4 is considered to pass through the counting device after the two wave troughs are detected in sequence in the set period.
If the period interval is set to a fixed value, when the speed of the conveyor belt 3 is high, the circular or elliptical objects 4 quickly pass through the counting device, and in the set fixed period, 2 or more circular or elliptical objects 4 may pass through, but only two wave troughs can be detected, and other circular or elliptical objects are missed to be detected, so that the counting error is caused.
On the contrary, if the period interval is set to a fixed value, when the speed of the conveyor belt 3 is very low, the circular or elliptical object 4 slowly passes through the counting device, and in a fixed period, after a first valley value is detected, because the circular or elliptical object 4 moves slowly, a second valley value is not detected in the set period, two continuous valley values are not detected, correct counting is not performed, and detection omission is caused.
The proper period interval is basically set for correctly detecting the counting of the circular or oval objects, the middle fixed period value cannot be adapted to all speed ranges of the conveyor belt, and the excessively high or excessively low speed of the conveyor belt can cause the counting error of the circular or oval objects. The invention can adapt to the demodulation of different speed algorithms by self-detecting the moving speed of the circular or elliptical object and setting the corresponding period according to the speed.
The time interval T between two troughs generated by the counting device for a circular or elliptical object is calculated as follows:
Figure BDA0002154078380000151
wherein, L is the distance between two rows of emitters, and V is the moving speed of the circular or elliptical object.
L is a fixed value, different speeds correspond to different time intervals, if the speed is high, the time is short, otherwise, the speed is low, the time is long.
And counting and storing the period between the two wave troughs, and updating the period parameters between the two wave troughs as the basis for judging the next period after the circular or elliptical object is detected to be counted, wherein different period parameters correspond to different moving speeds of the circular or elliptical object.
The infrared round or oval object counting device adopts a structure that a plurality of emitters are arranged on the device in rows, the situation that a plurality of round or oval objects continuously pass through the counting device side by side is complex, corresponding to the situation that voltages at two ends of receivers form a plurality of envelopes to be connected together, and one round or oval object can generate two voltage wave troughs on one, two or even three receivers. In such a case, the trough values at two different times do not correspond to a circular or elliptical object passing through the counting device. Depending on the design, a circular or elliptical object passing through the counting device may produce a total of six valleys at three different receivers at most. To calculate the correct number of circular or elliptical objects from all the valleys, a certain period must be maintained after detecting the mark signal of the circular or elliptical object (the signal is marked by the valleys at two different times satisfying the condition), and after maintaining the certain period, all the mark signals in the period are judged one by one. In the counting method, the holding period value of the mark signal of the circular or elliptical object is important for the demodulation method of the circular or elliptical object.
The circular or elliptical object mark signal holding period parameter is also related to the moving speed of the circular or elliptical object. For example, for one receiver, the current circular or elliptical object marker signal at that receiver must be processed before the next other circular or elliptical object marker signal, or a false determination may result.
The most extreme case is that a circular or elliptical object produces two dips on three consecutive receivers, the moment of occurrence of the last dip possibly being different, depending on the size of the circular or elliptical object and the form of the counting device. Through a plurality of test experiments, the circular or elliptical objects with different sizes and shapes can generate wave troughs twice at most on three continuous receivers, the effective reflection width of the circular or elliptical objects is twice of the distance between every two receivers and is about 24mm, and when the included angle between the central axis of the circular or elliptical object and the motion direction is 45 degrees, the wave trough value interval generated by the receivers at two ends is the largest. The distance between the two rows of emitters is about 22mm, and when a round or oval object passes through the counting device, the effective distance between the round or oval object corresponding to the two-time wave trough value is 11mm. When the included angle between the central axis of the circular or elliptical object and the motion direction is 45 degrees and the circular or elliptical object passes through the counting device at 45 degrees, the effective reflection width is 16.96mm, which is 1.5 times of the effective distance of the circular or elliptical object corresponding to the two-time valley value.
From the above analysis, the circular or elliptical object marker signal should hold a period parameter that is 1.5 times the period parameter for detecting the two-fold valley value. According to the mark signal holding period parameter of the circular or elliptical object, the mark signal generated at each receiver should be held for a set period length so as to perform secondary screening to obtain a correct circular or elliptical object count.
In summary, a reliable counting device plays an irreplaceable role in the control of the animal husbandry production process. The method not only can count the actual production value, but also can estimate the growth condition of animals, and has reference significance for the occurrence of diseases.
The above-mentioned contents are only for illustrating the technical idea of the present invention, and the protection scope of the present invention is not limited thereby, and any modification made on the basis of the technical idea of the present invention falls within the protection scope of the claims of the present invention.

Claims (10)

1. An anti-interference self-adaptive counting method is characterized in that a self-adaptive method is adopted, a single chip microcomputer detects the moving speed of a round or approximately round object on a conveyor belt, two rows of emitters are vertically arranged above the conveyor belt at intervals, a row of receivers is arranged between the two rows of emitters, the two rows of emitters respectively send infrared light to irradiate the round or approximately round object on the conveyor belt, the receivers detect light intensity values sent by the two emitters at different moments, the single chip microcomputer sets an interval period of valley value detection twice, a clock period between two valley values inside the two rows of emitters and a mark signal holding period of the round or oval object are updated in real time, the valley detection is carried out on voltage sampling twice through the receivers, and if the first row of emitters are in an open state, the first valley detection is carried out; if the second row of emitters is in an open state, entering second trough detection; if the two rows of emitters are in a closed state, the round or oval object marking signals are screened twice, and the single chip microcomputer counts the round or oval objects through pulse counting.
2. The interference-free adaptive counting method according to claim 1, comprising the steps of:
s1, initializing parameters;
s2, interrupting by using a timer to generate two paths of low-level pulse signals, respectively outputting the two paths of voltage pulse signals to two ends of the two rows of emitters, controlling the opening and closing time of the emitters, and determining the opening time of the emitters by the width of the low level;
s3, starting a wave trough detection process according to the state mark signal in the periodic signal;
s4, detecting the moving speed of the circular or elliptical object, counting the period difference of two wave troughs on the same channel, and updating the next wave trough detection period T1 and the mark signal holding period T2 of the circular or elliptical object;
and S5, when the periodic signal marking state is that the two rows of emitters are both in a closed state, and in a third stage, performing secondary screening output judgment on the existing unprocessed round or oval object marking signals, and judging whether the round or oval object marking signals are the first effective marking signals generated by the counting device.
3. The adaptive counting method for interference resistance according to claim 2, wherein in step S2, the timer of the single chip generates a periodic signal with a width of 3ms low level and 30ms high level and outputs the periodic signal to both ends of the first row of transmitters, and then generates a same periodic signal and outputs the same periodic signal to both ends of the second row of transmitters, the signal of the second row of transmitters is delayed by 3ms than the signal of the first row of transmitters, and the receiver marks the following states: the power on state of the first row of emitters, the power on state of the second row of emitters, and the lights in both rows being off.
4. The self-adaptive anti-interference counting method according to claim 2, wherein in step S3, if the transmitter in the first row is turned on, a first trough detection is performed, a/D sampling is performed on the voltage at both ends of each receiver, an upper limit value is set for the voltage signal, and a five-point method is used to perform trough detection on each receiving channel in sequence; the upper limit of the voltage of the A/D sampling is set to be 0.6 times of the maximum voltage, and when the wave trough is detected, the first wave trough detection mark of the corresponding channel is true.
5. The self-adaptive anti-interference counting method according to claim 2 or 4, wherein in step S3, if the mark status is that the second row of transmitters is on, the second trough detection is performed, a/D sampling is performed on the voltage at both ends of each receiver, before the second trough detection is performed, it is first determined whether the first trough detection mark in the same channel is true, if true, the second trough detection is sequentially performed on each receiving channel by the same method in the period T1, and if two troughs are detected in the same receiving channel setting period, it is considered as a qualified circular or elliptical object mark signal; and buffering the circular or elliptical object signal for T2 periods, wherein the T2 period covers two or three mark signal occurrence times.
6. The adaptive counting method for interference rejection according to claim 2, wherein the time interval T between two troughs generated by the counting device for the circular or elliptical object is calculated as follows:
Figure FDA0002154078370000021
wherein, L is the distance between two rows of emitters, and V is the moving speed of the circular or elliptical object.
7. The adaptive anti-interference counting method according to claim 2, wherein in step S4, counting is started from when a wave trough is generated by a transmitter in the first row is detected by using an internal counting method, and after a wave trough is detected for the second time in the same channel, a period difference occurring between two wave troughs is counted; while the valley detection period T1 is updated twice, the circular or elliptical object mark signal holding period T2 is updated to 1.5 times T1.
8. The method of claim 7, wherein if two or more channels detect two troughs in a period, averaging the period difference of each channel is performed, and the final period difference is obtained by adding 5 periods to the detected period value when updating the next two trough detection periods T1, so as to enlarge the boundary value.
9. The adaptive counting method against interference according to claim 2, wherein in step S5, it is first checked for each channel in turn whether there is a circular or elliptical object-marking signal; if so, checking whether to process the marking signal; if not, performing twice screening;
in the first screening process, adjacent channels of the marking signals of the circular or elliptical object which is not processed currently are judged and processed, and if no marking signal is generated in the adjacent channels, the marking signals of the circular or elliptical object which is not processed currently are considered as the first effective marking signals generated by the circular or elliptical object;
and performing secondary screening after the primary screening is finished, sequentially judging each channel during the secondary screening, judging whether a marking signal exists on the right side if a certain channel has an effective marking signal, outputting a counting pulse of a circular or elliptical object if the marking signal does not exist, and entering the next channel for judgment.
10. The adaptive counting method according to claim 9, wherein in the first screening process, if there is a mark signal on the right side, it is determined whether there is a valid mark signal on the second right side, if so, the valid mark is cleared, if not, the valid mark is not processed, a counting pulse for the circular or elliptical object is output, and the pulse counting circuit is used to count the pulse for the circular or elliptical object;
in the second screening process, if the adjacent channel on the right side has a circular or elliptical object marking signal generated, and the left side does not have the circular or elliptical object marking signal, judging the second on the right side; if the adjacent channel on the left side has a circular or elliptical object marking signal generated, but the right side does not, judging the second channel on the left side; if there are round or oval object mark signals on both left and right sides, then the signals on both left and right sides need to be judged.
CN201910711917.5A 2019-08-02 2019-08-02 Anti-interference self-adaptive counting method Active CN110429934B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910711917.5A CN110429934B (en) 2019-08-02 2019-08-02 Anti-interference self-adaptive counting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910711917.5A CN110429934B (en) 2019-08-02 2019-08-02 Anti-interference self-adaptive counting method

Publications (2)

Publication Number Publication Date
CN110429934A CN110429934A (en) 2019-11-08
CN110429934B true CN110429934B (en) 2023-01-31

Family

ID=68412315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910711917.5A Active CN110429934B (en) 2019-08-02 2019-08-02 Anti-interference self-adaptive counting method

Country Status (1)

Country Link
CN (1) CN110429934B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102052900A (en) * 2009-11-02 2011-05-11 重庆工商大学 Peak valley motion detection method and device for quickly measuring sub-pixel displacement
CN102243093A (en) * 2010-05-13 2011-11-16 张继昌 Optical fiber weight sorting scale and weighing method thereof
CN102829835A (en) * 2012-09-13 2012-12-19 苑颐萍 Optoelectronic data collection device of mechanical pointer counter and data processing method of optoelectronic data collection device of mechanical pointer counter
CN103426020A (en) * 2013-08-14 2013-12-04 北京凯森世纪科技发展有限公司 Exclusive infrared passenger flow counter
CN103760414A (en) * 2013-11-29 2014-04-30 成都亿盟恒信科技有限公司 Low-velocity pulse period collecting method based on anti-interference low-pass filtering
CN203719636U (en) * 2013-12-27 2014-07-16 杭州依镭科技有限公司 Inversion detecting device used for syringe needle
CN108226761A (en) * 2017-12-28 2018-06-29 合肥工大高科信息科技股份有限公司 A kind of rail traffic vehicles speed acquires the method with replacing self-test in real time
CN109729289A (en) * 2017-10-31 2019-05-07 欧姆龙株式会社 Optical sensor and detection method
CN110070558A (en) * 2019-04-11 2019-07-30 西安星舟天启智能装备有限责任公司 It is a kind of that method and device is sorted based on the statistics of image procossing and Subarea detecting

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8750857B2 (en) * 2010-06-04 2014-06-10 Qualcomm Incorporated Method and apparatus for wireless distributed computing
WO2013157283A1 (en) * 2012-04-18 2013-10-24 オリンパス株式会社 Method for detecting target particles

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102052900A (en) * 2009-11-02 2011-05-11 重庆工商大学 Peak valley motion detection method and device for quickly measuring sub-pixel displacement
CN102243093A (en) * 2010-05-13 2011-11-16 张继昌 Optical fiber weight sorting scale and weighing method thereof
CN102829835A (en) * 2012-09-13 2012-12-19 苑颐萍 Optoelectronic data collection device of mechanical pointer counter and data processing method of optoelectronic data collection device of mechanical pointer counter
CN103426020A (en) * 2013-08-14 2013-12-04 北京凯森世纪科技发展有限公司 Exclusive infrared passenger flow counter
CN103760414A (en) * 2013-11-29 2014-04-30 成都亿盟恒信科技有限公司 Low-velocity pulse period collecting method based on anti-interference low-pass filtering
CN203719636U (en) * 2013-12-27 2014-07-16 杭州依镭科技有限公司 Inversion detecting device used for syringe needle
CN109729289A (en) * 2017-10-31 2019-05-07 欧姆龙株式会社 Optical sensor and detection method
CN108226761A (en) * 2017-12-28 2018-06-29 合肥工大高科信息科技股份有限公司 A kind of rail traffic vehicles speed acquires the method with replacing self-test in real time
CN110070558A (en) * 2019-04-11 2019-07-30 西安星舟天启智能装备有限责任公司 It is a kind of that method and device is sorted based on the statistics of image procossing and Subarea detecting

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Far-Infrared and submillimeter properties of SDSS galaxies in the Herschel ATLAS science demonstration phase field;Man I Lam等;《Research in Astronomy and Astrophysics》;20130215(第02期);188-193 *
用于机械系统瞬时目标的双视角高速视觉检测系统;王耀东等;《光学精密工程》;20171015(第10期);215-221 *

Also Published As

Publication number Publication date
CN110429934A (en) 2019-11-08

Similar Documents

Publication Publication Date Title
CA2996102C (en) Seed counting sensor and method for detecting blockage of a seed conveying pipe
US5148378A (en) Sensor controller system
US7639374B2 (en) Optical displacement sensor
CN109866733B (en) Automatic defogging system and method
CN110429934B (en) Anti-interference self-adaptive counting method
CN203018326U (en) Prawn quality detecting-grading device based on machine vision technology
CN108562088A (en) A kind of shared refrigerator and method based on cloud platform
CN101951709B (en) Microwave infrared sensing control device and signal processing method thereof
CN108917086A (en) A kind of sleep pattern autocontrol method and air conditioner
CN106352497B (en) Air-conditioning sleep control method and control device
JP3569988B2 (en) Human body detection device
CN201928484U (en) Pyroelectric infrared (PIR) sensor lamp controller
CN108226175B (en) Plastic container detection system and detection method
CN111121919A (en) Stock amount detection method, apparatus, cooking appliance, and computer-readable storage medium
CN110068101B (en) Heat exchanger cleaning control method and device and air conditioner
CN210036854U (en) Intelligent water meter counting device based on light and shadow sensing
CN109156383B (en) Automatic wild pheasant egg sorting device and method
CN105425825B (en) A kind of plasterboard dynamic tracking apparatus and method
JP3548763B2 (en) Detecting device and its output setting method
CN105276747B (en) Air-conditioner control method based on intensity of illumination and control device
CN109655824B (en) Method for improving UWB (ultra wide band) distance measurement precision in gun off-position alarm system
CN104950888A (en) 17 degree of freedom humanoid robot and control method thereof
CN110418941A (en) For obtaining the method and system of information from utility meter
CN110000116B (en) Free-fall fruit and vegetable sorting method and system based on deep learning
CN103048049A (en) Obstacle avoidance detecting device of intelligent assembling robot

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant