A method for adaptively detecting label gaps in thermal label printers

By controlling the current of the photoelectric emission tube through the main control chip and combining the signal conditioning circuit and data judgment model, the thermal label printer can adaptively detect the label gap, solving the detection difficulties caused by unstable photoelectric emission power and diversity of label paper in the existing technology, and improving detection accuracy and system stability.

CN119636271BActive Publication Date: 2025-09-30ZHUHAI XPRINTER ELECTRONICS TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411811280.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-09-30
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

When detecting label gaps, existing thermal label printers have problems such as unstable photoelectric emission power, inaccurate detection results, hardware aging and degradation, and difficulty in identification caused by the diversity of label paper. In addition, existing adjustment methods are complex and costly.

Method used

The DAC or PWM function in the main control chip outputs a voltage to control the current of the photoelectric emitting tube. Combined with the signal conditioning circuit and data judgment model, the luminous flux of the photoelectric emitting tube is dynamically adjusted to achieve adaptive detection of label gaps.

Benefits of technology

The accuracy of label gap detection and the printer's adaptability to different label papers are improved, reducing maintenance costs and enhancing system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119636271B_ABST
    Figure CN119636271B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of printers, and specifically discloses a method for adaptively detecting label gaps in a thermal label printer. The method comprises: utilizing an I / O output voltage of a DAC in a main control chip to control the current of a photoelectric emitting diode, obtaining information such as label height, determining the paper feed length and the total number of paper feed point rows, collecting DAC data groups under different current data sequences during the paper feed process through a signal conditioning circuit, obtaining ADC data groups corresponding to the voltage data of a photoelectric receiving tube, calculating the maximum value, minimum value, and difference of the data in each data group, obtaining a gap voltage threshold, determining the label gap, and saving relevant parameters if the requirements are met, thereby achieving adaptive detection of the label gap. The method can adapt to different application scenarios through self-learning calibration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of printers, and in particular to a method for adaptively detecting label gaps in a thermal label printer. Background Art

[0002] Thermal label printers detect the gap between labels using a through-beam or reflective photoelectric sensor. To address issues such as label paper diversity, product structure variations, photoelectric device consistency, aging degradation, and environmental interference, the photoelectric transmitter power must be precisely adjusted according to the application scenario to accurately detect the gap between labels.

[0003] The existing technology controls the emission power of the photoelectric transmitting tube by switching the current limiting resistor gear by the main control chip or improving the software logic control and algorithm, which has the following problems: the selectable gears are limited and cannot be finely adjusted; the voltage control method is affected by various factors, resulting in unstable emission power, affecting the detection results and the normal operation of the printer; the multi-gear control circuit is complex, occupies a lot of resources, is costly and has a large system size; after the performance of the photoelectric tube deteriorates, it needs to be sent back to the manufacturer to change the current limiting resistor, and the after-sales cost is high; due to the diversity of label paper and aging and degradation of hardware, the existing technology is difficult to accurately identify the gaps between some label papers and, in certain circumstances, cannot accurately detect the label gaps through software algorithms.

[0004] By utilizing an I / O with DAC or PWM function in the main control chip to output voltage, the controllable constant current source current, that is, the photoelectric emitting diode current, is controlled. By adjusting the current of the photoelectric emitting tube, the light flux emitted and received by the photoelectric emitting tube is adjusted, and then the received light flux is converted into a voltage signal, achieving the effect of adaptive and accurate detection of label gaps.

[0005] To this end, the present invention provides a method for adaptively detecting label gaps in a thermal label printer. Summary of the Invention

[0006] The object of the present invention is to provide a method for adaptively detecting label gaps in a thermal label printer to solve the above-mentioned background problems.

[0007] The purpose of the present invention can be achieved through the following technical solutions:

[0008] A method for adaptively detecting label gaps in a thermal label printer, comprising:

[0009] Get the paper feed length, calculate the total number of paper feed point rows LT, store the number of each paper feed point row moved by the motor into the point row data group, and the MCU calculates the total number of collected data ST;

[0010] Based on the signal conditioning circuit, the DAC value corresponding to the current value of the photoelectric emission tube is obtained and stored in the DAC data group, and the DAC minimum value DacMin, the DAC maximum value DacMax, and the DAC increment DACinc are calculated;

[0011] Establish a data judgment model, analyze the data of the DAC data group and the ADC data group, calculate the conversion difference ratio Zh, obtain the variance of the DAC increment DACinc and the variance of the ADC increment, calculate the data variance ratio Fc, and calculate the detection target value Jc based on the conversion difference ratio Zh and the data variance ratio Fc. If the detection target value Jc ≥ the detection target threshold Jcz, further detect and analyze the gap data;

[0012] The height difference deviation ratio PI is calculated by comparing the gap height of the thermal sensitive label with the gap target height. The number of paper feeding dot rows is calculated with the total number of paper feeding dot rows LT to obtain the dot row proximity ratio Dh. The error level value Wc is calculated based on the height difference deviation ratio PI and the dot row proximity ratio Dh. If the error level value Wc is greater than or equal to the error level threshold Wcz, an error detection signal is generated.

[0013] Based on the error detection signal, a paper feed length-DAC value change curve is drawn, and the DAC maximum and minimum values ​​corresponding to the curve peaks are obtained. The DAC change difference Bh is calculated, and the detection curve is divided into multiple curve segments. The mean of each curve segment is obtained and difference processing is performed to obtain the fluctuation difference. The fluctuation difference mean Bd is further calculated. The signal stability value Wd is calculated based on the DAC change difference Bh and the fluctuation difference mean Bd. The optimal detection current is obtained based on the signal stability value Wd, and the optimal detection current is used as the photoelectric emission tube current for detecting gap labels.

[0014] As a further technical solution of the present invention: the total number of paper feed point rows LT is obtained as follows:

[0015] The paper feed length is ratioed to the height of each dot row to obtain the total number of paper feed dot rows, which is marked as LT.

[0016] As a further technical solution of the present invention: the total number of collected data ST is obtained as follows:

[0017] The number of each paper-feeding dot row moved by the motor is taken as dot row data and stored in the dot row data group;

[0018] The MCU calculates the total number of point row data that needs to be collected, obtains the total number of collected data, and marks the total number of collected data as ST.

[0019] As a further technical solution of the present invention: the DAC minimum value DacMin, the DAC maximum value DacMax, and the DAC increment DACinc are obtained as follows:

[0020] Get the minimum value of DAC in the DAC data group, mark the minimum DAC value as DacMin, and mark the maximum DAC value as DacMax;

[0021] In the acquired DAC data group, adjacent DAC values ​​are subtracted in ascending order of the data group to obtain a DAC increment, which is marked as DACinc.

[0022] As a further technical solution of the present invention: the data judgment model is constructed as follows:

[0023] S1. Starting from the DacMin value corresponding to the minimum current, the MCU outputs a voltage signal, which is then transmitted to the controlled constant current source through the signal conditioning circuit.

[0024] After S2 and DAC values ​​increase in sequence, the photoelectric transmitting tube in the controlled constant current source transmits light to the photoelectric receiving tube, and the ADC sampling receiving tube converts the voltage value into an ADC value and stores the ADC value in the ADC data group;

[0025] S3. Calculate the number of dot-row data in the dot-row data group and compare the number of dot-row data with the total number of collected data ST. If the number of dot-row data is equal to the total number of collected data ST, the motor moves the paper forward one dot row. Otherwise, repeat S2.

[0026] S4. Compare the number of point row data with the total number of paper feeding point rows LT. If the number of paper feeding point rows ≥ the total number of paper feeding point rows LT, further analysis of the paper feeding point row data is required. Otherwise, return to S1.

[0027] As a further technical solution of the present invention: the detection target value Jc is obtained as follows:

[0028] Calculate the detection target value Jc based on the conversion difference ratio Zh and the data variance ratio Fc;

[0029] By formula: , the detection target value Jc is calculated, where a1=0.321 and a2=0.679.

[0030] As a further technical solution of the present invention: the acquisition method based on the conversion difference ratio Zh is:

[0031] Get the DAC data generated by the MCU every time the motor moves a certain distance, and store the DAC data in the DAC data group;

[0032] Perform difference processing on the DAC maximum value DacMax and the DAC minimum value DacMin of the DAC data group to obtain the DAC value difference;

[0033] The DAC values ​​in the DAC data group are summed and averaged to obtain the DAC mean value, and the DAC value difference is compared with the DAC mean value to obtain the DAC difference ratio;

[0034] Based on the acquisition method of the DAC difference ratio, the ADC difference ratio is obtained;

[0035] Performing difference processing on the DAC difference ratio and the ADC difference ratio to obtain a conversion difference ratio, which is marked as Zh;

[0036] The data variance ratio Fc is obtained as follows:

[0037] The variance of the DAC increment DACinc in the DAC data group is calculated, and the variance of the ADC increment in the ADC data group is calculated. The variance of the DAC increment DACinc is compared with the variance of the ADC increment to obtain a data variance ratio, which is marked as Fc.

[0038] As a further technical solution of the present invention: the error degree value Wc is obtained as follows:

[0039] Calculate the error degree value Wc based on the height difference deviation ratio PI and the point row proximity ratio Dh;

[0040] By formula: , calculate the error degree value Wc, where c1=0.425, c2=0.575, and ln(c1*Dh+c2*Wc+1.011) is the logarithmic function with base e.

[0041] As a further technical solution of the present invention: the height difference deviation ratio PI and the point row proximity ratio Dh are obtained as follows:

[0042] The difference between the detected label gap height and the gap target height is calculated and the absolute value is taken to obtain the gap height difference;

[0043] Obtain the height difference between all the labels, sum and average the height differences between all the labels, and obtain the average height difference;

[0044] The height difference mean is compared with the clearance target height to obtain the height difference deviation ratio, which is marked as P1.

[0045] Perform subtraction processing on the number of paper feeding point rows and the total number of paper feeding point rows LT to obtain the paper feeding point row difference;

[0046] The paper feeding dot row difference is ratioed with the total number of paper feeding dot rows LT to obtain the dot row difference proximity ratio, which is marked as Dh.

[0047] As a further technical solution of the present invention: the current acquisition method of the photoelectric emission tube for detecting the gap label is:

[0048] Obtain the maximum and minimum values ​​of the paper feed length-DAC value change curve under different photoelectric emission tube currents, and perform subtraction processing on the maximum and minimum values ​​to obtain the DAC change difference, which is marked as Bh;

[0049] Obtain the curve portion of the paper feed length-DAC value change curve excluding the peak, obtain the detection curve, and calculate the fluctuation degree of the curve;

[0050] The detection curve is divided into multiple curve segments, and the DAC value of each curve segment is summed and averaged to obtain the curve segment mean;

[0051] Perform difference processing on the curve segment means of adjacent curve segments to obtain the fluctuation difference;

[0052] Calculate the fluctuation difference of all curve segments, sum and average the fluctuation differences of all curve segments to obtain the mean fluctuation difference, and mark the mean fluctuation difference as Bd;

[0053] Calculate the signal stability value Wd based on the DAC change difference Bh and the fluctuation difference mean Bd;

[0054] By formula: , calculate the signal stability value Wd, where d1=0.578, d2=0.422;

[0055] Calculate the signal stability value Wd of different photoelectric emission tube currents and sort them in order from high to low;

[0056] Select the paper feed length-DAC value change curve with the maximum signal stability value Wd, obtain the photoelectric emission tube current corresponding to the curve, and obtain the optimal detection current;

[0057] The optimal detection current is used as the photoelectric emission tube current for detecting gap tags.

[0058] Beneficial effects of the present invention:

[0059] By precisely controlling the current of the photoelectric emitting diode through the DAC function in the main control chip, the printer can dynamically output the DAC voltage according to the transmittance and reflectivity characteristics of different label papers, and then dynamically adjust the intensity of the light wave of the photoelectric emitting tube, which is beneficial to improve the accuracy of label gap detection and enhance the printer's adaptability to different label paper types.

[0060] By collecting voltage data under different current data sequences and calculating the maximum, minimum and difference voltages, the printer can determine the optimal data series. When changes in label gaps or label characteristics are detected, the printer can automatically self-calibrate, reducing maintenance costs and improving system stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] The present invention will be further described below with reference to the accompanying drawings.

[0062] Figure 1 This is a flow chart of a method for adaptively detecting label gaps in a thermal label printer according to the present invention;

[0063] Figure 2 is a signal conditioning circuit diagram of the present invention;

[0064] Figure 3 This is a paper feed length-DAC value variation curve diagram of the present invention. DETAILED DESCRIPTION

[0065] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention. Example 1

[0066] See also Figure 1 As shown, the present invention is a method for adaptively detecting label gaps in a thermal label printer, comprising:

[0067] Step 1: Initialize the printer and obtain thermal label information. If the thermal label printer button is in a long press state, it enters the self-learning mode;

[0068] The initialization of the thermal label printer includes: powering on the thermal label printer, initializing the main control chip MCU, initializing the sensor, and initializing the motor. The thermal label information includes the label height of the thermal label;

[0069] Determine the button pressing status of the thermal label printer;

[0070] If the thermal label printer button is in long press state, it enters the self-learning mode;

[0071] If the button is in the normal pressing state, the thermal label printer enters the normal printing mode and executes the printing task;

[0072] Step 2: Based on the self-learning mode and the information from the thermal label, the paper feed length is obtained and the total number of paper feed dot rows LT is calculated. The number of each paper feed dot row moved by the motor is stored in the dot row data group. The MCU calculates the total number of dot row data to be collected and obtains the total number of collected data ST.

[0073] It should be noted that the paper feed length refers to the distance the thermal label printing paper moves from the initial position when the thermal label printer is working. The paper feed length is set to 1.2-1.5 times the label height to ensure that a label gap can be detected.

[0074] Obtain paper feed length based on the information on the thermal label;

[0075] The paper feeding length is ratioed to the height of each dot row to obtain the total number of paper feeding dot rows, which is marked as LT.

[0076] It should be noted that the dot row height refers to the smallest unit of paper movement during the paper feeding process of the thermal label printer, that is, a dot row. The dot row height is set by professional technicians in this field based on experience.

[0077] The number of each paper-feeding dot row moved by the motor is taken as dot row data and stored in the dot row data group;

[0078] The MCU calculates the total number of point row data to be collected, obtains the total number of collected data, and marks the total number of collected data as ST;

[0079] Step 3: Based on Figure 2 The signal conditioning circuit shown obtains the DAC value corresponding to the current value of the photoelectric emission tube, stores it in the DAC data group, and calculates the DAC minimum value DacMin, the DAC maximum value DacMax, and the DAC increment DACinc;

[0080] based on Figure 2 In the signal conditioning circuit shown, the main control chip MCU outputs voltage through the DAC_IO pin;

[0081] It should be noted that in thermal label printers, the MCU controls the analog voltage signal output by providing different DAC values ​​to the DAC; the signal conditioning circuit is output through a DAC_IO pin of the MCU, and passes through a secondary low-pass filter composed of R1, C1, R2, and C2 to generate a stable DC voltage signal. The controlled constant current source composed of U1, C3, R3, Q1, R4 and the photoelectric transmitter is determined by the MCU output voltage. U2 consists of a photoelectric transmitter and a photoelectric receiver.

[0082] Obtain the DAC value corresponding to the current value of the photoelectric emission tube, and store different DAC values ​​in the DAC data group in ascending order;

[0083] Get the minimum value of DAC in the DAC data group, mark the minimum DAC value as DacMin, and mark the maximum DAC value as DacMax;

[0084] Obtain the DAC data group, in the increasing order of the data group, the adjacent DAC values ​​are processed to obtain the DAC increment, and the DAC increment is marked as DACinc;

[0085] It should be noted that every time the motor moves a certain distance, it collects current data output by N ADCs (N is determined by the MCU's own resources). The ADC values ​​in the ADC data group correspond one to one with the DAC values ​​output by the MCU. The current data of the photoelectric emission tube increases from small to large, and each DAC value corresponds to the current data of one emission tube.

[0086] The technical solution of this embodiment is as follows: initialize the printer, obtain the thermal label information, if the thermal label printer button is in a long-press state, enter the self-learning mode, based on the self-learning mode, obtain the paper feed length according to the thermal label information, calculate the total number of paper feed point rows LT, store the number of each paper feed point row moved by the motor in the point row data group, the MCU calculates the total number of point row data to be collected, obtains the total number of collected data ST, based on Figure 2 The signal conditioning circuit shown obtains the DAC value corresponding to the current value of the photoelectric emission tube, stores it in the DAC data group, and calculates the DAC minimum value DacMin, the DAC maximum value DacMax, and the DAC increment DACinc. Example 2

[0087] Step 4: Based on Figure 2 The signal conditioning circuit shown establishes a data judgment model. The ADC sampling receiving tube converts the voltage value into an ADC value, and stores the ADC value in the ADC data group. If the number of paper feeding point rows ≥ the total number of paper feeding point rows LT, the data of the DAC data group and the ADC data group are calculated to obtain the DAC difference ratio and the ADC difference ratio. The DAC difference ratio and the ADC difference ratio are subjected to difference processing to obtain a conversion difference ratio Zh. The variance of the DAC increment DACinc and the variance of the ADC increment are obtained. The variance of the DAC increment DACinc and the variance of the ADC increment are subjected to ratio processing to obtain a data variance ratio Fc. Based on the conversion difference ratio Zh and the data variance ratio Fc, the detection target value Jc is calculated. If the detection target value Jc ≥ the detection target threshold value Jcz, a detection analysis signal is generated.

[0088] It should be noted that the DAC starts to output a voltage signal according to the minimum current of the photoelectric emitting tube. The photoelectric emitting tube converts the current into a light source of a specific wavelength. The light source passes through the label paper or is reflected by the label paper to the photoelectric receiving tube. Due to the difference in transmittance and reflectivity between labels, the light flux received by the photoelectric receiving tube also varies. The load resistor R5 converts the light flux received by the photoelectric receiving tube into a voltage signal. The voltage signal is filtered by R6 / C4 and sent to the ADC sampling pin of the MCU. The ADC sampling receiving tube and the main control program convert the analog signal into a digital signal, which is then calculated and identified.

[0089] Through the data judgment model, the point row data is analyzed. The data judgment model is constructed as follows:

[0090] S1. Starting from the DacMin value corresponding to the minimum current, the MCU outputs the corresponding voltage signal, which is then transmitted to the controlled constant current source through the signal conditioning circuit.

[0091] After S2 and DAC values ​​increase in sequence, the photoelectric transmitting tube in the controlled constant current source transmits light to the photoelectric receiving tube, and the ADC sampling receiving tube converts the voltage value into an ADC value and stores the ADC value in the ADC data group;

[0092] S3. Calculate the number of dot-row data in the dot-row data group and compare the number of dot-row data with the total number of collected data ST. If the number of dot-row data is equal to the total number of collected data ST, the motor moves the paper forward one dot row. Otherwise, repeat S2.

[0093] S4. Compare the number of point-row data with the total number of paper-feeding point-rows LT. If the number of paper-feeding point-rows ≥ the total number of paper-feeding point-rows LT, further analysis of the paper-feeding point-row data is required. Otherwise, return to S1.

[0094] Get the DAC data generated by the MCU every time the motor moves a certain distance, and store the DAC data in the DAC data group;

[0095] Perform difference processing on the DAC maximum value DacMax and the DAC minimum value DacMin of the DAC data group to obtain the DAC value difference;

[0096] The DAC values ​​in the DAC data group are summed and averaged to obtain the DAC mean value, and the DAC value difference is compared with the DAC mean value to obtain the DAC difference ratio;

[0097] It should be noted that the ADC difference ratio and the DAC difference ratio are obtained in the same way. Here, only the DAC difference ratio is described.

[0098] Performing difference processing on the DAC difference ratio and the ADC difference ratio to obtain a conversion difference ratio, which is marked as Zh;

[0099] Calculate the variance of the DAC increment DACinc in the DAC data group, calculate the variance of the ADC increment in the ADC data group, and perform ratio processing on the variance of the DAC increment DACinc and the variance of the ADC increment to obtain a data variance ratio, which is marked as Fc;

[0100] Calculate the detection target value Jc based on the conversion difference ratio Zh and the data variance ratio Fc;

[0101] By formula: , the detection target value Jc is calculated, where a1=0.321, a2=0.679;

[0102] Compare the detection target value Jc with the detection target threshold Jcz;

[0103] If the detection target value Jc ≥ the detection target threshold Jcz, it means that the detection target value Jc meets the recognition gap requirement, and a detection analysis signal is generated to continue analyzing the detection parameters;

[0104] If the detection target value Jc is less than the detection target threshold Jcz, the corresponding voltage data in the ADC data group is obtained, the maximum and minimum voltage values, and the difference between the maximum and minimum voltages are printed, and the self-calibration result NG is output, an alarm is generated, and the printing process ends;

[0105] Step 5: Based on the detection and analysis signal, obtain the test voltage difference marked as Dyc and the test maximum voltage Dyz, calculate the gap voltage threshold Yz, and output a self-calibration OK signal if the gap voltage threshold Yz ≥ the gap target voltage;

[0106] Acquire multiple point-by-point data of the motor, and merge multiple DAC data groups with a detection target value Jc ≥ a detection target threshold Jcz into a test data group;

[0107] Obtain the DAC output voltage corresponding to the test data group, calculate the difference between the maximum and minimum values ​​of the DAC output voltage of the test data group, and obtain the test voltage difference;

[0108] The test voltage difference is marked as Dyc, and the maximum value of the DAC output voltage of the test data group is marked as the test maximum voltage Dyz;

[0109] Based on the test voltage difference marked as Dyc and the test maximum voltage Dyz, the gap voltage threshold Yz is calculated;

[0110] The gap voltage threshold Yz is obtained by the formula Yz=Zx+Dyc*b1, where b1=0.812;

[0111] Compare the gap voltage threshold Yz with the gap target voltage;

[0112] If the gap voltage threshold Yz ≥ the gap target voltage, analyze the thermal printer label gap, obtain the currently identified label gap height, and output the label gap height, ADC voltage maximum and minimum values, ADC voltage difference to the system, and output a self-calibration OK signal at the same time;

[0113] If the gap voltage threshold Yz is less than the gap target voltage, no processing is performed;

[0114] It should be noted that the system detects the self-calibration OK signal, exits the self-learning mode, and executes the printing task;

[0115] The technical solution of this embodiment is: based on Figure 2 The signal conditioning circuit shown establishes a data judgment model. If the number of paper feeding point rows ≥ the total number of paper feeding point rows LT, the data of the DAC data group and the ADC data group are calculated to obtain the DAC difference ratio and the ADC difference ratio. The DAC difference ratio and the ADC difference ratio are subjected to difference processing to obtain the conversion difference ratio Zh. The variance of the DAC increment DACinc and the variance of the ADC increment are obtained. The variance of the DAC increment DACinc and the variance of the ADC increment are subjected to ratio processing to obtain the data variance ratio Fc. Based on the conversion difference ratio Zh and the data variance ratio Fc, the detection target value Jc is calculated. If the detection target value Jc ≥ the detection target threshold value Jcz, a detection analysis signal is generated. Based on the detection analysis signal, the test voltage difference marked as Dyc and the test maximum voltage Dyz are obtained, the gap voltage threshold Yz is calculated, the gap voltage threshold Yz ≥ the gap target voltage, and a self-calibration OK signal is output. Example 3

[0116] Step 6: Based on the self-calibration OK signal, the gap height of the thermal sensitive label is calculated with the gap target height to obtain the height difference deviation ratio PI. The number of paper feeding dot rows is calculated with the total number of paper feeding dot rows LT to obtain the dot row proximity ratio Dh. The error level value Wc is calculated based on the height difference deviation ratio PI and the dot row proximity ratio Dh. If the error level value Wc ≥ the error level threshold Wcz, an error detection signal is generated.

[0117] The difference between the detected label gap height and the gap target height is calculated and the absolute value is taken to obtain the gap height difference;

[0118] Obtain the height difference between all the labels, sum and average the height differences between all the labels, and obtain the average height difference;

[0119] The height difference mean is compared with the clearance target height to obtain the height difference deviation ratio, which is marked as P1.

[0120] Perform subtraction processing on the number of paper feeding point rows and the total number of paper feeding point rows LT to obtain the paper feeding point row difference;

[0121] The paper feeding dot row difference is processed by ratio processing with the total number of paper feeding dot rows LT to obtain the dot row difference close ratio, which is marked as Dh;

[0122] Calculate the error degree value Wc based on the height difference deviation ratio PI and the point row proximity ratio Dh;

[0123] By formula: , calculate the error degree value Wc, where c1=0.425, c2=0.575, ln(c1*Dh+c2*Wc+1.011) is the logarithmic function with base e;

[0124] Compare the error degree value Wc with the error degree threshold Wcz;

[0125] If the error degree value Wc ≥ the error degree threshold Wcz, it indicates that the current tag gap recognition error is too large, and an error detection signal is generated;

[0126] If the error level Wc is less than the error level threshold Wcz, it indicates that the current tag gap recognition error is within the expected range, and it is still necessary to continuously monitor the change of the error level Wc.

[0127] Step 7: Based on the error detection signal, draw a paper feed length-DAC value change curve, obtain the DAC maximum and minimum values ​​corresponding to the curve peak, calculate the DAC change difference Bh, divide the detection curve into multiple curve segments, obtain the mean of each curve segment and perform difference processing to obtain the fluctuation difference, further calculate the fluctuation difference mean Bd, calculate the signal stability value Wd based on the DAC change difference Bh and the fluctuation difference mean Bd, obtain the optimal detection current based on the signal stability value Wd, and use the optimal detection current as the photoelectric emission tube current for detecting the gap label;

[0128] like Figure 3 As shown in the figure, the DAC value output by the MCU is obtained under different paper feed lengths, and the paper feed length-DAC value change curve is drawn;

[0129] It should be noted that Figure 3 The 9 curves shown represent the photoelectric tube receiving voltage results corresponding to the 9 transmitting tube currents;

[0130] Obtain the maximum and minimum values ​​of the paper feed length-DAC value change curve under different photoelectric emission tube currents, and perform subtraction processing on the maximum and minimum values ​​to obtain the DAC change difference, which is marked as Bh;

[0131] Obtain the curve portion of the paper feed length-DAC value change curve excluding the peak, obtain the detection curve, and calculate the fluctuation degree of the curve;

[0132] Specifically, the detection curve is divided into multiple curve segments, and the DAC value of each curve segment is summed and averaged to obtain the curve segment mean;

[0133] Perform difference processing on the curve segment means of adjacent curve segments to obtain the fluctuation difference;

[0134] Calculate the fluctuation difference of all curve segments, sum and average the fluctuation differences of all curve segments to obtain the mean fluctuation difference, and mark the mean fluctuation difference as Bd;

[0135] Calculate the signal stability value Wd based on the DAC change difference Bh and the fluctuation difference mean Bd;

[0136] By formula: , calculate the signal stability value Wd, where d1=0.578, d2=0.422;

[0137] Calculate the signal stability value Wd of different photoelectric emission tube currents and sort them in order from high to low;

[0138] Select the paper feed length-DAC value change curve with the maximum signal stability value Wd, obtain the photoelectric emission tube current corresponding to the curve, and obtain the optimal detection current;

[0139] The optimal detection current is used as the photoelectric emission tube current for detecting gap tags.

[0140] It should be noted that if Figure 3 As shown in the figure, the signal stability value Wd of series 5 is the highest, that is, the transmitting tube current corresponding to series 5 and the receiving signal collected by the ADC receiving tube are the most stable, which can reliably identify the tag gap and reduce the recognition error;

[0141] The technical solution of this embodiment is as follows: based on the self-calibration OK signal, the gap height of the thermosensitive label is calculated with the gap target height to obtain the height difference deviation ratio PI, the number of paper feed point rows is calculated with the total number of paper feed point rows LT to obtain the point row proximity ratio Dh, the error degree value Wc is calculated based on the height difference deviation ratio PI and the point row proximity ratio Dh, if the error degree value Wc ≥ the error degree threshold Wcz, an error detection signal is generated, based on the error detection signal, the DAC value output by the MCU under different paper feed lengths is obtained, a paper feed length-DAC value change curve is plotted, the DAC change difference Bh and the fluctuation difference mean Bd of the curve are calculated to calculate the signal stability value Wd, and the current of the photoelectric emission tube corresponding to the signal stability value Wd is selected as the photoelectric emission tube current for detecting the gap label.

[0142] The above is a detailed description of an embodiment of the present invention. However, the content is only a preferred embodiment of the present invention and should not be considered to limit the scope of the present invention. All equivalent changes and improvements made within the scope of the present invention should still fall within the scope of the present invention.

Claims

1. A method for adaptively detecting label gaps in a thermal label printer, characterized by: include: Get the paper feed length, calculate the total number of paper feed point rows LT, store the number of each paper feed point row moved by the motor into the point row data group, and the MCU calculates the total number of data to be collected to obtain the total number of collected data ST; Based on the signal conditioning circuit, the DAC value corresponding to the current value passing through the photoelectric emission tube is obtained and stored in the DAC data group, and the DAC minimum value DacMin, DAC maximum value DacMax, and DAC increment DACinc are calculated; Establish a data judgment model. The ADC sampling receiving tube converts the voltage value into an ADC value and stores it in the ADC data group. Analyze the data in the DAC data group and the ADC data group to calculate the conversion difference ratio Zh. Obtain the variance of the DAC increment DACinc and the variance of the ADC increment to calculate the data variance ratio Fc. Based on the conversion difference ratio Zh and the data variance ratio Fc, calculate the detection target value Jc. If the detection target value Jc ≥ the detection target threshold Jcz, further detect and analyze the gap data. The height difference deviation ratio PI is calculated by comparing the gap height of the thermal label with the gap target height. The number of paper feeding dot rows is calculated with the total number of paper feeding dot rows LT to obtain the dot row proximity ratio Dh. The error level value Wc is calculated based on the height difference deviation ratio PI and the dot row proximity ratio Dh. If the error level value Wc is greater than or equal to the error level threshold Wcz, an error detection signal is generated. Based on the error detection signal, a paper feed length-DAC value change curve is drawn, and the DAC maximum and minimum values ​​corresponding to the curve peaks are obtained. The DAC change difference Bh is calculated, and the detection curve is divided into multiple curve segments. The mean of each curve segment is obtained and difference processing is performed to obtain the fluctuation difference. The fluctuation difference mean Bd is further calculated. The signal stability value Wd is calculated based on the DAC change difference Bh and the fluctuation difference mean Bd. The optimal detection current is obtained based on the signal stability value Wd, and the optimal detection current is used as the photoelectric emission tube current for detecting gap labels.

2. The method for adaptively detecting label gaps in a thermal label printer according to claim 1, wherein: The total number of paper feed point rows LT is obtained as follows: The paper feed length is ratioed to the height of each dot row to obtain the total number of paper feed dot rows, which is marked as LT.

3. The method for adaptively detecting label gaps in a thermal label printer according to claim 1, wherein: The total number of collected data ST is obtained as follows: The number of each paper-feeding dot row moved by the motor is taken as dot row data and stored in the dot row data group; The MCU calculates the total number of point row data that needs to be collected, obtains the total number of collected data, and marks the total number of collected data as ST.

4. The method for adaptively detecting label gaps in a thermal label printer according to claim 1, wherein: The DAC minimum value DacMin, the DAC maximum value DacMax, and the DAC increment DACinc are obtained as follows: Get the minimum value of DAC in the DAC data group, mark the minimum DAC value as DacMin, and mark the maximum DAC value as DacMax; In the acquired DAC data group, adjacent DAC values ​​are subjected to difference processing in the increasing order of the data group to obtain a DAC increment, which is marked as DACinc.

5. The method for adaptively detecting label gaps in a thermal label printer according to claim 1, wherein: The data judgment model is constructed as follows: S1. Starting from the DacMin value corresponding to the minimum current, the MCU outputs the corresponding voltage signal, which is then transmitted to the controlled constant current source through the signal conditioning circuit. After S2 and DAC values ​​increase in sequence, the photoelectric transmitting tube in the controlled constant current source transmits light to the photoelectric receiving tube, and the ADC sampling receiving tube converts the voltage value into an ADC value and stores the ADC value in the ADC data group; S3. Calculate the number of dot-row data in the dot-row data group and compare the number of dot-row data with the total number of collected data ST. If the number of dot-row data is equal to the total number of collected data ST, the motor moves the paper forward one dot row. Otherwise, repeat S2. S4. Compare the number of point row data with the total number of paper feeding point rows LT. If the number of paper feeding point rows ≥ the total number of paper feeding point rows LT, further analysis of the paper feeding point row data is required. Otherwise, return to S1.

6. The method for adaptively detecting label gaps in a thermal label printer according to claim 1, wherein: The detection target value Jc is obtained as follows: Calculate the detection target value Jc based on the conversion difference ratio Zh and the data variance ratio Fc; By formula: , the detection target value Jc is calculated, where a1=0.321 and a2=0.

679.

7. The method for adaptively detecting label gaps in a thermal label printer according to claim 6, wherein: The acquisition method based on the conversion difference ratio Zh is: Get the DAC data generated by the MCU every time the motor moves a certain distance, and store the DAC data in the DAC data group; Perform difference processing on the DAC maximum value DacMax and the DAC minimum value DacMin of the DAC data group to obtain the DAC value difference; The DAC values ​​in the DAC data group are summed and averaged to obtain the DAC mean value, and the DAC value difference is compared with the DAC mean value to obtain the DAC difference ratio; Based on the acquisition method of the DAC difference ratio, the ADC difference ratio is obtained; Performing difference processing on the DAC difference ratio and the ADC difference ratio to obtain a conversion difference ratio, which is marked as Zh; The data variance ratio Fc is obtained as follows: The variance of the DAC increment DACinc in the DAC data group is calculated, and the variance of the ADC increment in the ADC data group is calculated. The variance of the DAC increment DACinc is compared with the variance of the ADC increment to obtain a data variance ratio, which is marked as Fc.

8. The method for adaptively detecting label gaps in a thermal label printer according to claim 1, wherein: The error degree value Wc is obtained as follows: Calculate the error degree value Wc based on the height difference deviation ratio PI and the point row proximity ratio Dh; By formula: , calculate the error degree value Wc, where c1=0.425, c2=0.575, and ln(c1*Dh+c2*Wc+1.011) is the logarithmic function with base e.

9. The method for adaptively detecting label gaps in a thermal label printer according to claim 8, wherein: The height difference deviation ratio PI and the point row proximity ratio Dh are obtained as follows: The difference between the detected label gap height and the gap target height is calculated and the absolute value is taken to obtain the gap height difference; Obtain the height difference between all the labels, sum and average the height differences between all the labels, and obtain the average height difference; The height difference mean is compared with the clearance target height to obtain the height difference deviation ratio, which is marked as P1. Perform subtraction processing on the number of paper feeding point rows and the total number of paper feeding point rows LT to obtain the paper feeding point row difference; The paper feeding dot row difference is ratioed with the total number of paper feeding dot rows LT to obtain the dot row difference proximity ratio, which is marked as Dh.

10. The method for adaptively detecting label gaps in a thermal label printer according to claim 1, wherein: The optimal detection current is obtained as follows: Obtain the maximum and minimum values ​​of the paper feed length-DAC value change curve under different photoelectric emission tube currents, and perform subtraction processing on the maximum and minimum values ​​to obtain the DAC change difference, which is marked as Bh; Obtain the curve portion of the paper feed length-DAC value change curve excluding the peak, obtain the detection curve, and calculate the fluctuation degree of the curve; The detection curve is divided into multiple curve segments, and the DAC value of each curve segment is summed and averaged to obtain the curve segment mean; Perform difference processing on the curve segment means of adjacent curve segments to obtain the fluctuation difference; Calculate the fluctuation difference of all curve segments, sum and average the fluctuation differences of all curve segments to obtain the mean fluctuation difference, and mark the mean fluctuation difference as Bd; Calculate the signal stability value Wd based on the DAC change difference Bh and the fluctuation difference mean Bd; By formula: , calculate the signal stability value Wd, where d1=0.578, d2=0.422; Calculate the signal stability value Wd of different photoelectric emission tube currents and sort them in order from high to low; Select the paper feed length-DAC value change curve with the maximum signal stability value Wd, obtain the photoelectric emission tube current corresponding to the curve, and obtain the optimal detection current; The optimal detection current is used as the photoelectric emission tube current for detecting gap tags.

Citation Information

Patent Citations

  • Thermal printer and operation method thereof

    CN117549680A

  • Automatic calibration method for emission intensity of optical coupler in label printer and label printer

    CN118238535A