Self-adaptive label gap detection method for thermosensitive label printer

By using the DAC function in the thermal label printer to accurately control the current of the photoelectric emitting diode, the problems of inaccurate detection label gaps and high maintenance costs in the prior art are solved, and higher detection accuracy and adaptability are achieved.

CN119636271AActive Publication Date: 2025-03-18ZHUHAI XPRINTER ELECTRONICS TECHNOLOGY CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

Existing thermal label printers have problems such as difficulty in fine adjustment, unstable transmission power, inaccurate detection results and high maintenance costs when detecting label gaps.

Method used

Through the DAC function in the main control chip, the current of the photoelectric emitter is accurately controlled, and the optical wave strength of the photoelectric emitter is dynamically adjusted, so as to realize adaptive detection of different label papers.

Benefits of technology

Improves the accuracy of label gap detection, enhances printer adaptability to different label paper types, and reduces maintenance costs with automatic calibration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119636271A_ABST
    Figure CN119636271A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of printers, and particularly discloses a self-adaptive label gap detection method for a thermosensitive label printer, which comprises the following steps of: controlling the current of a photoelectric emitting diode by using an I / O output voltage with a DAC in a main control chip, acquiring information such as label height, determining the paper feeding length and the total number of paper feeding point rows, and outputting a signal through a signal conditioning circuit; in the paper feeding process, DAC data sets under different current data sequences are collected, ADC data sets corresponding to voltage data of photoelectric receiving tubes are obtained, the maximum value, the minimum value and the difference value of data of all the data sets are calculated, a gap voltage threshold value is obtained, the label gap is judged, and if the requirements are met, relevant parameters are stored, self-adaptive detection of the label gap is achieved, and the detection efficiency is improved. And through self-learning calibration, the method can adapt to different application scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] The principle of thermal label printers detecting the gap between labels is achieved through a beam or reflective photoelectric sensor. In order to deal with the diversity of label paper, product structure differences, consistency and aging attenuation of photoelectric devices, environmental interference and other issues, it is necessary to accurately adjust the emission power of the photoelectric transmitting tube according to different application scenarios in order to accurately detect the label gap.

[0003] The existing technology controls the emission power of the photoelectric transmitting tube by switching the current limiting resistor position through the main control chip or improving the software logic control and algorithm, which has the following problems: the selectable positions 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-position control circuit is complex, occupies a lot of resources, is costly and has a large system size; after the performance of the photoelectric tube decays, 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 decay of hardware, etc., the existing technology is difficult to accurately identify the gaps between some label papers and cannot accurately detect the label gaps through software algorithms under certain circumstances.

[0004] By using 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 emission and reception of the photoelectric emitting tube is adjusted, and then the received light flux is converted into a voltage signal, thereby 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 of 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: A method for adaptively detecting label gaps of a thermal label printer, comprising: 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; Based on the signal conditioning circuit, the DAC value corresponding to the current value of the photoelectric transmitting 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; 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 value Jcz, further detect and analyze the gap data; 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 feeding point rows is calculated with the total number of paper feeding point rows LT to obtain the point row proximity ratio Dh, and 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, draw the 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.

[0008] As a further technical solution of the present invention: the total number of paper feeding 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, and the total number of paper feed dot rows is marked as LT.

[0009] As a further technical solution of the present invention: the total number of collected data ST is obtained in the following manner: The number of each paper feeding dot line moved by the motor is taken as dot line data and stored in the dot line data group; The MCU calculates the total number of point row data that need to be collected, obtains the total number of collected data, and marks the total number of collected data as ST.

[0010] 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: Get the maximum value of DAC in the DAC data group, mark the minimum DAC value as DacMin, and mark the maximum DAC value as DacMax; In acquiring the DAC data group, adjacent DAC values ​​are subtracted in ascending order of the data group to obtain a DAC increment, and the DAC increment is marked as DACinc.

[0011] As a further technical solution of the present invention: the data judgment model is constructed as follows: 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. After S2 and DAC values ​​are increased successively, 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-line data in the dot-line data group, and compare the number of dot-line data with the total number of collected data ST. If the number of dot-line data is equal to the total number of collected data ST, the motor moves the paper forward one dot line, 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.

[0012] As a further technical solution of the present invention: the detection target value Jc is obtained in the following manner: Based on the conversion difference ratio Zh and the data variance ratio Fc, the detection target value Jc is calculated; By formula: , the detection target value Jc is calculated, where a1=0.321 and a2=0.679.

[0013] As a further technical solution of the present invention: 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 a DAC average value, and the DAC numerical difference is ratioed with the DAC average value to obtain a DAC difference ratio; Based on the method of obtaining 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, and marking the conversion difference ratio 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, the variance of the ADC increment in the ADC data group is calculated, and the variance of the DAC increment DACinc is ratioed with the variance of the ADC increment to obtain a data variance ratio, which is marked as Fc.

[0014] As a further technical solution of the present invention: 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.

[0015] 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: 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 of the gaps of all the labels, sum and average the height differences of the gaps of all the labels, and obtain the average value of the height difference; The height difference mean value is processed by ratio with the clearance target height to obtain the height difference deviation ratio, which is marked as Pl; Perform difference 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.

[0016] As a further technical solution of the present invention: the current acquisition method of the photoelectric emission tube for detecting the gap label is: Obtain the maximum and minimum values ​​of the peaks of the paper feed length-DAC value change curve under different photoelectric transmitting tube currents, and perform difference processing on the maximum and minimum values ​​to obtain the DAC change difference, which is marked as Bh; Obtain the curve part of the paper feed length-DAC value change curve except 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 difference of all curve segments to obtain the average fluctuation difference, and mark the average fluctuation difference as Bd; Calculate the signal stability value Wd based on the DAC change difference Bh and the fluctuation difference mean value Bd; By formula: , calculate the signal stability value Wd, where d1=0.578, d2=0.422; Calculate the signal stability values ​​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 largest 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 phototransmitter current of the detection gap tag.

[0017] Beneficial effects of the present invention: The DAC function in the main control chip can accurately control the current of the photoelectric emitting diode, so that the printer can dynamically output the DAC voltage according to the transmittance and reflectivity characteristics of different label papers, and then dynamically adjust the strength 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 types of label paper.

[0018] By collecting voltage data under different current data sequences and calculating the maximum, minimum and difference values ​​of the voltage, the printer can determine the best data series. When changes in label gap or label characteristics are detected, the printer can automatically calibrate itself, reducing maintenance costs and improving system stability. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The present invention will be further described below in conjunction with the accompanying drawings.

[0020] Figure 1 It is a flow chart of a method for adaptively detecting label gaps of a thermal label printer of the present invention; Figure 2 is a signal conditioning circuit diagram of the present invention; Figure 3 It is a paper feed length-DAC value variation curve diagram of the present invention. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention. Example 1

[0022] See also Figure 1As shown, the present invention is a method for adaptively detecting label gaps of a thermal label printer, comprising: Step 1: Initialize the printer and obtain the thermal label information. If the thermal label printer button is in a long press state, it will enter the self-learning mode; Among them, initializing 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; Determine the button pressing status of the thermal label printer; If the thermal label printer button is in long press state, it enters the self-learning mode; If the button is in normal pressing state, the thermal label printer enters normal printing mode and executes the printing task; Step 2: Based on the self-learning mode, the paper feeding length is obtained according to the information of the thermal label, and the total number of paper feeding point lines LT is calculated. The number of each paper feeding point line traveled by the motor is stored in the point line data group. The MCU calculates the total number of point line data to be collected and obtains the total number of collected data ST. It should be noted that the paper feed length refers to the distance that 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. According to the information of the thermal label, the paper feeding length is obtained; The paper feeding length is processed by ratio with the height of each dot line to obtain the total number of paper feeding dot lines, and the total number of paper feeding dot lines is marked as LT; It should be noted that the height of each dot row refers to the smallest unit of paper movement during the paper feeding process of the thermal label printer, that is, a dot row. The height of each dot row is set by professional and technical personnel in this field based on experience; The number of each paper feeding dot line moved by the motor is taken as dot line data and stored in the dot line data group; 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; Step 3: Based on Figure 2 The signal conditioning circuit shown obtains the DAC value corresponding to the current value of the photoelectric transmitting 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; based on Figure 2 The signal conditioning circuit shown, the main control chip MCU outputs voltage through the DAC_IO pin; It should be noted that in the thermal label printer, 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, which is a controlled constant current source composed of U1, C3, R3, Q1, R4 and a photoelectric transmitting tube. The current of the photoelectric tube is determined by the output voltage of the MCU, and U2 is composed of a photoelectric transmitting tube and a photoelectric receiving tube; Obtain the DAC value corresponding to the current value of the photoelectric transmitting tube, and store different DAC values ​​in the DAC data group in ascending order; Get the maximum value of DAC in the DAC data group, mark the minimum DAC value as DacMin, and mark the maximum DAC value as DacMax; Obtain the DAC data group, in the data group increasing order, the adjacent DAC values ​​are processed for difference, the DAC increment is obtained, and the DAC increment is marked as DACinc; It should be noted that the current data of N ADC outputs is collected every time the motor moves a bit (N is determined by the MCU's own resources). The ADC values ​​in the ADC data group correspond one by one to the DAC values ​​output by the MCU. The current data of the photoelectric transmitting tube increases from small to large, and each DAC value corresponds to a transmitting tube current data.

[0023] 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 traveled by the motor in the point row data group, 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 transmitting 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

[0024] Step 4: Based on Figure 2The signal conditioning circuit shown in the figure 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 is ≥ 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, and 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, and 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 is ≥ the detection target threshold value Jcz, a detection analysis signal is generated. It should be noted that the DAC starts to output a voltage signal according to the minimum current of the photoelectric transmitting tube. The photoelectric transmitting 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 the labels, the light flux received by the photoelectric receiving tube is also different. 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 analog signal is converted into a digital signal and calculated and identified through the ADC sampling receiving tube and the main control program. Through the data judgment model, the point line data is analyzed. 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 ​​are increased successively, 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-line data in the dot-line data group, and compare the number of dot-line data with the total number of collected data ST. If the number of dot-line data is equal to the total number of collected data ST, the motor moves the paper forward one dot line, 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; 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 a DAC average value, and the DAC numerical difference is ratioed with the DAC average value to obtain a DAC difference ratio; It should be noted that the ADC difference ratio and the DAC difference ratio are obtained in the same manner, and only the DAC difference ratio is described here; Performing difference processing on the DAC difference ratio and the ADC difference ratio to obtain a conversion difference ratio, and marking the conversion difference ratio as Zh; 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, perform ratio processing on the variance of the DAC increment DACinc and the variance of the ADC increment to obtain a data variance ratio, and mark the data variance ratio as Fc; Based on the conversion difference ratio Zh and the data variance ratio Fc, the detection target value Jc is calculated; By formula: , the detection target value Jc is calculated, where a1=0.321, a2=0.679; Compare the detection target value Jc with the detection target threshold Jcz; If the detection target value Jc ≥ the detection target threshold value Jcz, it means that the detection target value Jc meets the identification gap requirement, and a detection analysis signal is generated to continue analyzing the detection parameters; If the detection target value Jc is less than the detection target threshold value Jcz, the corresponding voltage data in the ADC data group is obtained, the maximum and minimum voltage values, and the difference between the maximum voltage and the minimum voltage are printed, and the self-calibration result NG is output, an alarm is generated, and the printing work is terminated; 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, the gap voltage threshold Yz ≥ the gap target voltage, and output a self-calibration OK signal; Acquire multiple point data of the motor, and merge multiple DAC data groups with detection target value Jc≥detection target threshold value Jcz into the test data group; Obtaining the DAC output voltage corresponding to the test data group, calculating the difference between the maximum value and the minimum value of the DAC output voltage of the test data group, and obtaining the test voltage difference; 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; Based on the test voltage difference marked as Dyc and the test maximum voltage Dyz, the gap voltage threshold Yz is calculated; The gap voltage threshold Yz is obtained by the formula Yz=Zx+Dyc*b1, where b1=0.812; Compare the gap voltage threshold value Yz with the gap target voltage; 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; If the gap voltage threshold Yz is less than the gap target voltage, no processing is performed; It should be noted that the system detects the self-calibration OK signal, exits the self-learning mode, and executes the printing task; The technical solution of this embodiment is: based on Figure 2 The signal conditioning circuit shown in the figure 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 value Yz is calculated. The gap voltage threshold value Yz ≥ the gap target voltage, and a self-calibration OK signal is output. Example 3

[0025] Step 6: 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 feeding point rows is calculated with the total number of paper feeding point rows LT to obtain the point row proximity ratio Dh, and 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; 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 of the gaps of all the labels, sum and average the height differences of the gaps of all the labels, and obtain the average value of the height difference; The height difference mean value is processed by ratio with the clearance target height to obtain the height difference deviation ratio, which is marked as Pl; Perform difference 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 processed by ratio with the total number of paper feeding dot-rows LT to obtain the dot-row difference approximation ratio, which is marked as Dh; 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, ln(c1*Dh+c2*Wc+1.011) is the logarithmic function with base e; Compare the error degree value Wc with the error degree threshold Wcz; 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; If the error level value 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 value Wc; Step 7: Based on the error detection signal, draw the 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; like Figure 3 As shown in the figure, the DAC value output by the MCU under different paper feed lengths is obtained, and the paper feed length-DAC value change curve is drawn; 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; Obtain the maximum and minimum values ​​of the peaks of the paper feed length-DAC value change curve under different photoelectric transmitting tube currents, and perform difference processing on the maximum and minimum values ​​to obtain the DAC change difference, which is marked as Bh; Obtain the curve part of the paper feed length-DAC value change curve except the peak, obtain the detection curve, and calculate the fluctuation degree of the curve; 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; 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 difference of all curve segments to obtain the average fluctuation difference, and mark the average fluctuation difference as Bd; Calculate the signal stability value Wd based on the DAC change difference Bh and the fluctuation difference mean value Bd; By formula: , calculate the signal stability value Wd, where d1=0.578, d2=0.422; Calculate the signal stability values ​​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 largest 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 phototransmitter current of the detection gap tag.

[0026] It should be noted that if Figure 3 As shown, the signal stability value Wd of series 5 is the highest, that is, the transmitting tube current corresponding to series 5, the receiving signal collected by the ADC receiving tube is the most stable, which can reliably identify the tag gap and reduce the recognition error; The technical solution of this embodiment is: based on the self-calibration OK signal, the gap height of the thermosensitive label and the gap target height are calculated to obtain the height difference deviation ratio PI, the number of paper feeding point rows and the total number of paper feeding point rows LT are calculated to obtain the point row proximity ratio Dh, and 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, and based on the error detection signal, the DAC value output by the MCU under different paper feeding lengths is obtained, and a paper feeding length-DAC value change curve is drawn, and 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 transmitting tube corresponding to the signal stability value Wd is selected as the photoelectric transmitting tube current for detecting the gap label.

[0027] The above is a detailed description of an embodiment of the present invention, but the content is only a preferred embodiment of the present invention and cannot be considered to limit the scope of implementation 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 in that: 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 transmitting 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; 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 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 value Jcz, further detect and analyze the gap data. The gap height of the thermal label is calculated with the gap target height to obtain the height difference deviation ratio PI, the number of paper feeding point rows is calculated with the total number of paper feeding point rows LT to obtain the point row proximity ratio Dh, and 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, draw the 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.

2. The method for adaptively detecting label gaps of a thermal label printer according to claim 1, characterized in that: The method for obtaining the total number of paper feeding point rows LT is 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, and the total number of paper feed dot rows is marked as LT.

3. The method for adaptively detecting label gaps of a thermal label printer according to claim 1, characterized in that: The method for obtaining the total number of collected data ST is as follows: The number of each paper feeding dot line moved by the motor is taken as dot line data and stored in the dot line data group; The MCU calculates the total number of point row data that need 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 of a thermal label printer according to claim 1, characterized in that: The DAC minimum value DacMin, the DAC maximum value DacMax, and the DAC increment DACinc are obtained as follows: Get the maximum value of DAC in the DAC data group, mark the minimum DAC value as DacMin, and mark the maximum DAC value as DacMax; In acquiring the DAC data group, adjacent DAC values ​​are subjected to difference processing in the increasing order of the data group to obtain the DAC increment, and the DAC increment is marked as DACinc.

5. The method for adaptively detecting label gaps of a thermal label printer according to claim 1, characterized in that: 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 ​​are increased successively, 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-line data in the dot-line data group, and compare the number of dot-line data with the total number of collected data ST. If the number of dot-line data is equal to the total number of collected data ST, the motor moves the paper forward one dot line, 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 of a thermal label printer according to claim 1, characterized in that: The detection target value Jc is obtained as follows: Based on the conversion difference ratio Zh and the data variance ratio Fc, the detection target value Jc is calculated; 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 of a thermal label printer according to claim 6, characterized in that: 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 a DAC average value, and the DAC numerical difference is ratioed with the DAC average value to obtain a DAC difference ratio; Based on the method of obtaining 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, and marking the conversion difference ratio 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, the variance of the ADC increment in the ADC data group is calculated, and the variance of the DAC increment DACinc is ratioed 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 of a thermal label printer according to claim 1, characterized in that: 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 of a thermal label printer according to claim 8, characterized in that: The height difference deviation ratio PI and the point line 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 of the gaps of all the labels, sum and average the height differences of the gaps of all the labels, and obtain the average value of the height difference; The height difference mean value is processed by ratio with the clearance target height to obtain the height difference deviation ratio, which is marked as Pl; Perform difference 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 of a thermal label printer according to claim 1, characterized in that: The optimal detection current is obtained as follows: Obtain the maximum and minimum values ​​of the peaks of the paper feed length-DAC value change curve under different photoelectric emission tube currents, and perform difference processing on the maximum and minimum values ​​to obtain the DAC change difference, which is marked as Bh; Obtain the curve part of the paper feed length-DAC value change curve except 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 difference of all curve segments to obtain the average fluctuation difference, and mark the average fluctuation difference as Bd; Calculate the signal stability value Wd based on the DAC change difference Bh and the fluctuation difference mean value Bd; By formula: , calculate the signal stability value Wd, where d1=0.578, d2=0.422; Calculate the signal stability values ​​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 largest 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 phototransmitter current of the detection gap tag.

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

  • Paper width detection method for a label printer, printing control method for a label printer, and a label printer

    US20100026738A1

Cited By

  • Thermal printer paper type identification and paper shortage detection method and system based on single reflection sensor

    CN120620882A