A label printer, and sensor calibration method and system thereof
By adjusting the duty cycle of the label printer's PWM signal and controlling the luminous intensity of the light-emitting module, the problem of inaccurate printing positioning caused by inconsistent sensor luminous intensity is solved, and the consistency and accuracy of printing positioning are achieved.
Patent Information
- Application Number
- CN202310389625.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-13
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2043-04-13
AI Technical Summary
In existing label printers, inconsistent sensor luminous intensity leads to inconsistent and inaccurate printing positioning, and the same label paper will be offset on different printers.
By adjusting the duty cycle of the PWM signal of the label printer, the luminous intensity of the light-emitting module is controlled so that the sensor collection value is within the preset range, thus achieving sensor calibration.
Improves the printing positioning consistency and accuracy of different label printers, and avoids printing deviation and paper jumping.
Smart Images

Figure CN116330854B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of printing technology, and more particularly, relates to a label printer, and a sensor calibration method and system thereof. Background Art
[0002] Labels refer to the text, graphics, and other descriptive materials on products. Labels are widely used in retail, industrial production, express delivery, clothing, and office management. Examples include price tags, product description labels, shelf labels, barcode labels, clothing labels, document labels, archive labels, various item and stationery labels, and express delivery labels. Label printers can be used to print labels.
[0003] During the printing process of a label printer, print positioning is very important. Print positioning involves whether the printed content can be accurately placed in the specified position and whether it can be accurately stopped at the paper cutter position to facilitate the user to tear the paper. Print positioning mainly relies on sensors. The sensor collects the light intensity of the light emitted by the light-emitting module passing through the label paper and converts it into a digital signal. However, in the prior art, there are problems with inconsistent and inaccurate print positioning. For example, when the same label paper is printed on different label printers, the print content will be offset and the offset distance and direction of different label printers will be inconsistent. The reason for this problem is that under the same PWM duty cycle drive, the light intensity of the light-emitting module of each label printer is inconsistent. The inconsistent light intensity of the light-emitting module will cause the sensors of different label printers to collect different data for the same label paper, resulting in inconsistent and inaccurate print positioning. Summary of the Invention
[0004] In response to the above-mentioned defects or improvement needs of the prior art, the present invention provides a label printer, and a sensor calibration method and system thereof, which can improve the consistency and accuracy of printing positioning of different label printers.
[0005] To achieve the above object, according to one aspect of the present invention, a sensor calibration method for a label printer is provided, comprising the steps of:
[0006] Controlling the label paper conveying assembly to convey label paper, the label paper comprising a base paper and a surface paper on top of the base paper, with a gap between the surface paper and the base paper; obtaining a value collected by a sensor, the sensor being configured to collect light intensity emitted by a light-emitting module passing through the label paper and converting the intensity into a digital signal; the light-emitting module being driven by a PWM signal to emit light;
[0007] Adjust the duty cycle of the PWM signal so that the collected value is within a preset collection value interval when the tissue paper passes through the sensor, record the duty cycle value of the PWM signal when the collected value is within the collection value interval, and fix the duty cycle of the PWM signal to the duty cycle value.
[0008] Furthermore, the collection value intervals corresponding to the different models of label printers are predetermined, the collection value interval corresponding to the model of the label printer currently to be calibrated is determined, and the corresponding collection value interval is stored in the label printer currently to be calibrated.
[0009] Furthermore, fixing the duty cycle of the PWM signal to the duty cycle value comprises the steps of:
[0010] If the duty cycle value is greater than zero and less than the AD resolution of the single chip microcomputer providing the PWM signal, the duty cycle value is stored in the fixed parameter area of the label printer.
[0011] Furthermore, during the label paper conveying process, if the difference between the collected values of two adjacent samples within a preset time is within a preset difference range, it is determined that the sensor detects the surface paper, and the conveying of the label paper is stopped.
[0012] Furthermore, the light intensity of the light emitted by the light emitting module passing through the label paper is the transmitted light intensity or the reflected light intensity of the light emitted by the light emitting module passing through the label paper.
[0013] Furthermore, the frequency of the PWM signal is more than twice the frequency of the sensor's response to light.
[0014] Furthermore, the frequency of the PWM signal is three times the frequency of the sensor's response to light.
[0015] Furthermore, the step of adjusting the duty cycle of the PWM signal so that the collected value is within a preset collection value range when the tissue paper passes through the sensor includes the following steps:
[0016] S1, obtaining the collected value when the tissue paper passes through the sensor;
[0017] S2. If the collected value is greater than the maximum value of the collected value interval, reduce the duty cycle of the PWM signal and jump to S1;
[0018] S3: If the collected value is less than the minimum value of the collected value interval, increase the duty cycle of the PWM signal and jump to S1.
[0019] S4. If the collected value is within the collected value interval, the process ends.
[0020] Furthermore, after the duty cycle of the PWM signal is fixedly set to the duty cycle value, automatic threshold calibration is started after receiving a preset signal, and the automatic threshold calibration includes the steps of:
[0021] The average value of the collected values when the surface paper passes the sensor is obtained, recorded as A, and the average value of the collected values when the bottom paper gap passes the sensor is obtained, recorded as B. The median of A and B is used as the threshold for positioning the gap between the surface paper and the bottom paper.
[0022] Furthermore, the preset signal is a signal for detecting that the label printer cover is closed or a power-on signal.
[0023] Furthermore, the category of the label paper is identified, and during the automatic threshold calibration process, it is determined according to the category of the label paper whether the collected value is a collected value corresponding to the intensity of the transmitted light passing through the label paper or a collected value corresponding to the intensity of the reflected light passing through the label paper.
[0024] Furthermore, the step of adjusting the duty cycle of the PWM signal so that the collected value is within a preset collection value range when the tissue paper passes through the sensor includes the following steps:
[0025] Store the corresponding collection value intervals for different types of label paper;
[0026] Determine the label paper type in the label printer to be calibrated and its corresponding collection value interval as the target collection value interval;
[0027] The duty cycle of the PWM signal is adjusted so that the collected value is within the target collected value range when the tissue paper passes through the sensor.
[0028] Furthermore, the collected value intervals corresponding to different types of label papers are stored in the label printer.
[0029] According to a second aspect of the present invention, there is provided a sensor calibration system for a label printer, comprising:
[0030] A control module is used to control the label paper conveying assembly to convey label paper, wherein the label paper includes a base paper and a surface paper on the base paper, with a gap between the surface paper and the base paper;
[0031] An acquisition module, configured to obtain an acquisition value from a sensor, wherein the sensor is configured to acquire the light intensity of light emitted by a light-emitting module passing through the label paper and convert the light into a digital signal, wherein the light-emitting module emits light under the drive of a PWM signal;
[0032] A dimming module is used to adjust the duty cycle of the PWM signal so that the collected value is within a preset collection value interval when the tissue paper passes through the sensor, record the duty cycle value of the PWM signal when the collected value is within the collection value interval, and fix the duty cycle of the PWM signal to the duty cycle value.
[0033] According to a third aspect of the present invention, there is provided a label printer comprising the above-mentioned sensor calibration system.
[0034] In general, compared with the prior art, the above technical solution conceived by the present invention adjusts the luminous intensity of the light-emitting module by adjusting the duty cycle of the PWM signal provided to the light-emitting module, so that the collection value of the sensor is within the preset collection value range, thereby ensuring the consistency and accuracy of the printing positioning of different label printers. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a waveform diagram collected by a label paper in a label printer in the prior art;
[0036] Figure 2 It is a waveform diagram collected by the same label paper in another label printer in the prior art;
[0037] Figure 3 is a flow chart of a sensor calibration method according to an embodiment of the present invention;
[0038] Figure 4 This is a waveform diagram collected before PWM dimming in an embodiment of the present invention;
[0039] Figure 5 This is a waveform diagram collected after PWM dimming in an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
[0041] In the description of the embodiments of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly specifying the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of such features. "Multiple" means at least two, for example, two, three, etc., unless otherwise specifically defined.
[0042] Unless otherwise specified, "plurality" means two or more.
[0043] The terms "including" and "having" and any variations thereof in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product or device comprising a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to these processes, methods, products or devices.
[0044] The naming or numbering of the steps in the embodiments of the present invention does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The execution order of the named or numbered process steps can be changed according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.
[0045] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0046] In the existing technology, under the same PWM duty cycle, inconsistent sensor light intensity can cause one printer to print normally while another printer skips. Because the light intensity of each label printer's light module varies, the sensors of different label printers collect different data for the same label paper, resulting in inconsistent and inaccurate printing positioning.
[0047] like Figure 1 and Figure 2 As shown in the figure, the waveforms collected from the two label printers for the same roll of label paper are different. In the waveform collected from label printer 1, the peak value is 1642, the trough value is 1352, and the difference is 290, indicating that the sensor light module of label printer 1 is emitting normally. In the waveform collected from label printer 2, the peak value is 1282, the trough value is 1168, and the difference is 114, indicating that the sensor light module of label printer 2 is emitting weakly.
[0048] Different waveforms can lead to inconsistent and inaccurate printing positioning. For example, the same roll of label paper may print normally in label printer 1, but skip in label printer 2.
[0049] In order to solve the above-mentioned problem of inconsistent and inaccurate printing positioning, the present invention provides a label printer, and a sensor calibration method and system thereof, which are described below respectively.
[0050] like Figure 3 As shown, an embodiment of the present invention provides a sensor calibration method for a label printer, comprising the steps of:
[0051] S301, controlling the label paper conveying assembly to convey label paper, wherein the label paper includes a bottom paper and a surface paper on the bottom paper, with a bottom paper gap formed between the surface paper and the bottom paper.
[0052] Label paper consists of a backing paper and a face paper. The face paper is adhered to the backing paper by adhesives and can also be peeled off from the backing paper. The gap between the face paper and the backing paper is the backing paper gap.
[0053] S302, obtaining a collection value of a sensor, wherein the sensor is used to collect the light intensity of light emitted by a light-emitting module passing through the label paper and convert it into a digital signal, and the light-emitting module emits light under the drive of a PWM signal.
[0054] The thickness and material of the gap between the bottom paper and the top paper are different, and their ability to reflect or transmit light is different. As the label paper moves, the sensor's collected value will change.
[0055] Furthermore, the light intensity of the light emitted by the light-emitting module passing through the label paper is the transmitted light intensity or the reflected light intensity of the light emitted by the light-emitting module passing through the label paper. The transmitted light intensity or the reflected light intensity is selected based on the purpose of the collected values. For example, during PWM dimming, the collected values are all values corresponding to the transmitted light intensity. During automatic threshold calibration, the collected values can be values corresponding to the reflected light intensity.
[0056] S303, if the sensor detects the surface paper, stop feeding the label paper, adjust the duty cycle of the PWM signal so that the collection value is within the preset collection value range when the surface paper passes through the sensor, record the duty cycle value of the PWM signal when the collection value is within the collection value range, and fix the duty cycle of the PWM signal to the duty cycle value.
[0057] Because PWM signals exhibit regular rectangular pulse waveforms, they can be expanded using the Fourier series of periodic signals. By performing a Fourier series expansion on a PWM signal with any duty cycle and analyzing the resulting expression, it is clear that, given a constant PWM frequency (fundamental component), the duty cycle and PWM output voltage / current are linearly related. This allows the voltage of the sensor circuit to be controlled by controlling the duty cycle of the PWM signal, indirectly controlling the luminous intensity of the photoelectric sensor's light-emitting module.
[0058] When the sensor detects the paper, PWM dimming is activated. PWM dimming adjusts the light intensity of the light module by adjusting the duty cycle of the PWM signal, ensuring that the collected value when the paper passes the sensor is within a preset collection value range. Once a satisfactory duty cycle value is found, the duty cycle of the PWM signal of the light module is fixed to that value. This ensures that the light intensity of the light module remains within a fixed range during subsequent printing positioning, thereby maintaining the sensor collected value within the preset collection value range.
[0059] For different label printers of the same model, since the structure and hardware design are the same, only the light-emitting modules are different, so the same collection value range is set. For the same label printer, even if the intensities of the light-emitting modules of different label printers are different, as long as the above-mentioned PWM dimming process is carried out, the light-emitting intensity of the sensor light-emitting module can be at the same level, and thus the collection values of the sensor collection module are all within the same collection value range.
[0060] The above invention is verified by experiment. In the same label printer, before PWM dimming, the waveform is collected as follows: Figure 4 As shown, the peak value is 1672, the valley value is 1486, and the difference is 186. After adjusting the duty cycle for PWM dimming, the PWM value is 11, the peak value is 1524, the valley value is 1264, and the difference is 260. The collected waveform is as follows Figure 5 Before PWM dimming calibration is performed, paper skipping may occur during printing. After PWM dimming calibration, printing positioning becomes normal.
[0061] Furthermore, the duty cycle of the PWM signal is adjusted so that the collected value is within a preset collection value range when the surface paper passes through the sensor, including the steps of: storing the collection value ranges corresponding to different types of label paper; determining the label paper category and its corresponding collection value range in the label printer currently to be calibrated as the target collection value range; and adjusting the duty cycle of the PWM signal so that the collected value is within the target collection value range when the surface paper passes through the sensor.
[0062] In other words, the collection value interval is not unique; instead, multiple collection value intervals are stored, each corresponding to a specific label type. The label type information can be stored in the label RFID chip definition field. When the label is placed in the label printer to be calibrated, the printer reads the label type information in the RFID chip, determines the corresponding collection value interval, and uses this collection value interval for PWM dimming.
[0063] The collected value intervals corresponding to different types of label papers are stored in the label printer, for example, in a Flash device of the label printer.
[0064] Furthermore, the collection value intervals corresponding to the different models of label printers are predetermined, the collection value interval corresponding to the model of the label printer currently to be calibrated is determined, and the corresponding collection value interval is stored in the label printer currently to be calibrated.
[0065] In other words, different label printer models have different sensor distances, angles, and even sensor models due to differences in hardware and structural design. The acquisition value range corresponds to the label printer model. Testing can be used to determine the acquisition value range for each label printer model.
[0066] In another embodiment, a sensor calibration method for a label printer includes steps 1 to 5:
[0067] Step 1, PWM dimming preparation stage: select and set the PWM frequency and period parameters according to the hardware parameters of the selected photoelectric sensor.
[0068] Furthermore, the frequency of the PWM signal is more than twice the frequency of the sensor's response to light.
[0069] Considering the sensor's light reception time, the PWM signal frequency controlling the LED must be at least twice the sensor's light response frequency to ensure a stable response to light during the LED's high-frequency on-off cycles. Assuming the sensor's light response time is 25µs and the frequency is 40kHz, the PWM signal frequency should be at least 80kHz.
[0070] Furthermore, the frequency of the PWM signal is three times the frequency of the sensor's response to light. In this case, the sensor's collected waveform will be smoother.
[0071] Step 2, PWM dimming startup phase: used to start PWM dimming, apply for a certain amount of memory to store the sensor's collected values, and initialize related variables.
[0072] Step 3, searching for facial paper: Place the specified paper into the printer, start the motor, and collect sensor values at regular intervals. Set the facial paper judgment condition: If the difference between the collected values of two adjacent samples within a preset time (for example, within the time of conveying 10mm) is within the preset difference range, it is determined that the sensor has detected facial paper; compare the collected sensor data, find the position that meets the facial paper conditions, and then find the facial paper.
[0073] Step 4, adjusting the luminous intensity stage: regularly collect sensor values and compare the collected values with the preset collection value range [MIN, MAX]. If the collected value is greater than MAX, reduce the duty cycle; if the collected value is less than MIN, increase the duty cycle; repeatedly adjust the duty cycle until the collected value is within the range of [MIN, MAX] and stop adjusting the duty cycle.
[0074] Step 5, PWM dimming end stage: If the paper is not found within a certain distance (usually 200mm), or the PWM duty cycle cannot meet the specified range of the acquisition value after adjusting from the minimum to the maximum, the PWM dimming is judged to have failed; on the contrary, if the PWM duty cycle value is greater than zero and less than the AD resolution of the microcontroller providing the PWM signal, the PWM dimming is judged to have succeeded, and the duty cycle at this time is recorded and stored in the fixed parameter area as the PWM dimming value of the machine, and the applied memory is released, the relevant variables are cleared, and the PWM dimming ends.
[0075] Furthermore, automatic threshold calibration can be introduced to ensure printing consistency, accuracy and no paper skipping through PWM dimming and automatic threshold calibration.
[0076] The principle of automatic threshold calibration is described as follows.
[0077] After the duty cycle of the PWM signal is fixedly set to the duty cycle value, automatic threshold calibration is started after receiving a preset signal, and the automatic threshold calibration includes the steps of:
[0078] The average value of the top paper passing the sensor is obtained, recorded as A. The average value of the gap between the bottom paper and the sensor is obtained, recorded as B. The median of A and B (A + B) / 2 is used as the threshold for positioning the gap between the top and bottom papers. The paper positioning threshold is stored in the MCU's designated memory space, the allocated memory is released, and the relevant variables are cleared.
[0079] Furthermore, the preset signal is a signal for detecting that the label printer cover is closed or a power-on signal, that is, each time the label printer cover is detected to be closed, the automatic threshold calibration is performed.
[0080] Furthermore, the category of the label paper is identified, and during the automatic threshold calibration process, it is determined according to the category of the label paper whether the collected value is a collected value corresponding to the intensity of the transmitted light passing through the label paper or a collected value corresponding to the intensity of the reflected light passing through the label paper.
[0081] For example, if the label paper is black label paper, during the automatic threshold calibration process, the collected value is a collected value corresponding to the intensity of reflected light when light passes through the label paper.
[0082] According to a second aspect of the present invention, there is provided a sensor calibration system for a label printer, comprising:
[0083] A control module is used to control the label paper conveying assembly to convey label paper, wherein the label paper includes a base paper and a surface paper on the base paper, with a gap between the surface paper and the base paper;
[0084] A dimming module is used to obtain a value collected by a sensor, wherein the sensor is used to collect the light intensity of the light emitted by the light-emitting module passing through the label paper and convert it into a digital signal. The light-emitting module emits light under the drive of the PWM signal;
[0085] A dimming module is used to stop conveying the label paper if the sensor detects the surface paper, adjust the duty cycle of the PWM signal so that the collection value is within a preset collection value range when the surface paper passes through the sensor, record the duty cycle value of the PWM signal when the collection value is within the collection value range, and fix the duty cycle of the PWM signal to the duty cycle value.
[0086] Furthermore, the collection value intervals corresponding to the different models of label printers are predetermined, the collection value interval corresponding to the model of the label printer currently to be calibrated is determined, and the corresponding collection value interval is stored in the label printer currently to be calibrated.
[0087] Furthermore, during the label paper conveying process, if the difference between the collected values of two adjacent samples within a preset time is within a preset difference range, it is determined that the sensor detects the surface paper, and the conveying of the label paper is stopped.
[0088] Furthermore, the frequency of the PWM signal is more than twice the frequency of the sensor acquisition module's response to light.
[0089] Furthermore, the frequency of the PWM signal is three times the frequency of the sensor acquisition module's response to light.
[0090] Furthermore, after the duty cycle of the PWM signal is fixedly set to the duty cycle value, automatic threshold calibration is started after receiving a preset signal, and the automatic threshold calibration includes the steps of:
[0091] The average value of the collected values when the surface paper passes the sensor is obtained, recorded as A, and the average value of the collected values when the bottom paper gap passes the sensor is obtained, recorded as B. The median of A and B is used as the threshold for positioning the gap between the surface paper and the bottom paper.
[0092] Furthermore, the preset signal is a signal for detecting that the label printer cover is closed or a power-on signal.
[0093] Furthermore, the category of the label paper is identified. During the automatic threshold calibration process, if the label paper is transparent paper or gap paper, the collected value is the collected value corresponding to the intensity of the transmitted light passing through the label paper; if the label paper is black label paper, the collected value is the collected value corresponding to the intensity of the reflected light passing through the label paper.
[0094] Furthermore, the step of adjusting the duty cycle of the PWM signal so that the collected value is within a preset collection value range when the tissue paper passes through the sensor includes the following steps:
[0095] Store the corresponding collection value intervals for different types of label paper;
[0096] Determine the label paper type in the label printer to be calibrated and its corresponding collection value interval as the target collection value interval;
[0097] The duty cycle of the PWM signal is adjusted so that the collected value is within the target collected value range when the tissue paper passes through the sensor.
[0098] Furthermore, the collected value intervals corresponding to different types of label papers are stored in the label printer.
[0099] According to a third aspect of the present invention, there is provided a label printer comprising the above-mentioned sensor calibration system.
[0100] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A sensor calibration method for a label printer, characterized in that: Including steps: Controlling the label paper conveying assembly to convey label paper, wherein the label paper comprises a bottom paper and a surface paper on the bottom paper, with a bottom paper gap formed between the surface paper and the bottom paper; Obtaining a collection value from a sensor, wherein the sensor is configured to collect the light intensity of light emitted by a light-emitting module passing through the label paper and convert it into a digital signal, wherein the light-emitting module emits light under the drive of a PWM signal; wherein the collection value intervals corresponding to different types of label printers are predetermined, and the collection value intervals corresponding to different types of label paper within the same model are stored in the label printer, and the collection value interval corresponding to the label paper is determined after the label printer currently to be calibrated reads the type information of the label paper; The duty cycle of the PWM signal is adjusted so that the collected value is within the preset collection value range when the face paper passes through the sensor. During the label paper conveying process, if the difference between the collected values of two adjacent samples within a preset time is within the preset difference range, it is determined that the face paper has passed through the sensor, and the label paper conveying is stopped. The duty cycle value of the PWM signal when the collected value is within the collection value range is recorded, and the duty cycle of the PWM signal is fixed to the duty cycle value. If the face paper is not found within a certain distance, or the PWM duty cycle cannot meet the collection value range after being adjusted from the minimum to the maximum, it is determined that the PWM dimming has failed. Conversely, if the duty cycle value is greater than zero and less than the AD resolution of the single-chip microcomputer providing the PWM signal, it is determined that the PWM dimming has succeeded, and the duty cycle value is stored in the fixed parameter area of the label printer.
2. The sensor calibration method according to claim 1, wherein: The collected value intervals corresponding to the label printers of different models are predetermined, and after the collected value interval corresponding to the model of the label printer to be calibrated is determined, the corresponding collected value interval is stored in the label printer to be calibrated.
3. The sensor calibration method according to claim 1, wherein: The light intensity of the light emitted by the light emitting module passing through the label paper is the transmitted light intensity or the reflected light intensity of the light emitted by the light emitting module passing through the label paper.
4. The sensor calibration method according to claim 1, wherein: The frequency of the PWM signal is more than twice the frequency of the sensor's response to light.
5. The sensor calibration method according to claim 4, wherein: The frequency of the PWM signal is three times the frequency of the sensor's response to light.
6. The sensor calibration method according to claim 1, wherein: The step of adjusting the duty cycle of the PWM signal so that the collected value is within a preset collection value range when the tissue paper passes through the sensor includes the following steps: S1, obtaining the collected value when the tissue paper passes through the sensor; S2. If the collected value is greater than the maximum value of the collected value interval, reduce the duty cycle of the PWM signal and jump to S1; S3: If the collected value is less than the minimum value of the collected value interval, increase the duty cycle of the PWM signal and jump to S1. S4. If the collected value is within the collected value interval, the process ends.
7. The sensor calibration method according to claim 1, wherein: After the duty cycle of the PWM signal is fixedly set to the duty cycle value, automatic threshold calibration is started after receiving a preset signal, and the automatic threshold calibration includes the steps of: The average value of the collected values when the surface paper passes the sensor is obtained, recorded as A, and the average value of the collected values when the bottom paper gap passes the sensor is obtained, recorded as B. The median of A and B is used as the threshold for positioning the gap between the surface paper and the bottom paper.
8. The sensor calibration method according to claim 7, wherein: The preset signal is a signal for detecting that the label printer cover is closed or a power-on signal.
9. The sensor calibration method according to claim 7, wherein: Identify the category of the label paper, and during the automatic threshold calibration process, determine whether the collected value is a collected value corresponding to the intensity of the transmitted light of the light passing through the label paper or a collected value corresponding to the intensity of the reflected light of the light passing through the label paper according to the category of the label paper.
10. The sensor calibration method according to claim 1, wherein: The step of adjusting the duty cycle of the PWM signal so that the collected value is within a preset collection value range when the tissue paper passes through the sensor includes the following steps: Store the corresponding collection value intervals for different types of label paper; Determine the label paper type in the label printer to be calibrated and its corresponding collection value interval as the target collection value interval; The duty cycle of the PWM signal is adjusted so that the collected value is within the target collected value range when the tissue paper passes through the sensor.
11. The sensor calibration method according to claim 10, wherein: The collected value intervals corresponding to different types of label paper are stored in the label printer.
12. A sensor calibration system for a label printer, characterized in that: include: A control module is used to control the label paper conveying assembly to convey label paper, wherein the label paper includes a base paper and a surface paper on the base paper, with a gap between the surface paper and the base paper; An acquisition module, configured to obtain an acquisition value from a sensor, wherein the sensor is configured to acquire the light intensity of light emitted by a light-emitting module passing through the label paper and convert the light into a digital signal, wherein the light-emitting module emits light under the drive of a PWM signal; wherein the acquisition value intervals corresponding to different types of label printers are predetermined, and the acquisition value intervals corresponding to different types of label paper within the same model are stored in the label printer, and the acquisition value interval corresponding to the label paper is determined by the label printer currently to be calibrated after reading the type information of the label paper; A dimming module adjusts the duty cycle of the PWM signal so that the collected value is within a preset collection value range when the face paper passes through the sensor. During the label paper conveying process, if the difference between the collected values of two adjacent samples within a preset time is within a preset difference range, it is determined that the face paper has passed through the sensor, and the label paper conveying is stopped. The duty cycle value of the PWM signal when the collected value is within the collection value range is recorded, and the duty cycle of the PWM signal is fixed to the duty cycle value. If the face paper is not found within a certain distance, or the PWM duty cycle cannot meet the collection value range after being adjusted from the minimum to the maximum, it is determined that the PWM dimming has failed. Conversely, if the duty cycle value is greater than zero and less than the AD resolution of the single-chip microcomputer providing the PWM signal, it is determined that the PWM dimming is successful, and the duty cycle value is stored in the fixed parameter area of the label printer.
13. The sensor calibration system according to claim 12, wherein: The collection value intervals corresponding to the label printers of different models are predetermined, and after the collection value interval corresponding to the model of the label printer to be calibrated is determined, the corresponding collection value interval is stored in the label printer to be calibrated.
14. The sensor calibration system according to claim 12, wherein: The frequency of the PWM signal is more than twice the frequency of the sensor acquisition module's response to light.
15. The sensor calibration system according to claim 14, wherein: The frequency of the PWM signal is three times the frequency of the sensor acquisition module's response to light.
16. The sensor calibration system according to claim 12, wherein: After the duty cycle of the PWM signal is fixedly set to the duty cycle value, automatic threshold calibration is started after receiving a preset signal, and the automatic threshold calibration includes the steps of: The average value of the collected values when the surface paper passes the sensor is obtained, recorded as A, and the average value of the collected values when the bottom paper gap passes the sensor is obtained, recorded as B. The median of A and B is used as the threshold for positioning the gap between the surface paper and the bottom paper.
17. The sensor calibration system according to claim 16, wherein: The preset signal is a signal for detecting that the label printer cover is closed or a power-on signal.
18. The sensor calibration system according to claim 16, wherein: Identify the category of the label paper. During the automatic threshold calibration process, if the label paper is transparent paper or gap paper, the collected value is the collected value corresponding to the intensity of the transmitted light passing through the label; if the label paper is black label paper, the collected value is the collected value corresponding to the intensity of the reflected light passing through the label paper.
19. The sensor calibration system according to claim 12, wherein: The step of adjusting the duty cycle of the PWM signal so that the collected value is within a preset collection value range when the tissue paper passes through the sensor includes the following steps: Store the corresponding collection value intervals for different types of label paper; Determine the label paper type in the label printer to be calibrated and its corresponding collection value interval as the target collection value interval; The duty cycle of the PWM signal is adjusted so that the collected value is within the target collected value range when the tissue paper passes through the sensor.
20. The sensor calibration system according to claim 13, wherein: The collected value intervals corresponding to different types of label paper are stored in the label printer.
21. A label printer, characterized in that: Comprising a sensor calibration system as claimed in any one of claims 12 to 20.
Citation Information
Patent Citations
Photoelectric sensing device of printer
CN115107382A
Thermal demand printer
US5657066A