Printer nozzle control method and device, computer equipment and storage medium

By calculating the media thickness in response to the pulse signal of the printing medium and dynamically adjusting the printhead height through the encoder, the problem of incompatibility between cost and accuracy in printer printhead control is solved, achieving high-precision and stable printing results.

CN121608533APending Publication Date: 2026-03-06SHENZHEN SUNTHINKS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610054689.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-15
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing printer printhead control solutions struggle to balance cost and accuracy. High-precision solutions are expensive and susceptible to interference, while low-cost solutions lack sufficient accuracy to meet the demands of fine printing.

Method used

The encoder responds to the target pulse signal triggered by the printing medium, calculates the medium thickness by the encoder's rotation scale and circumference, and corrects the thickness by combining it with a preset sampling period, dynamically adjusting the printhead height.

Benefits of technology

It achieves cost reduction while ensuring accuracy, avoids printhead collision damage and poor printing results, and ensures stable and reliable printing quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121608533A_ABST
    Figure CN121608533A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of printers, and relates to a printer nozzle control method and device, computer equipment and a storage medium, and the method comprises the steps: responding to a target pulse signal triggered by a to-be-printed medium on the printer, and determining the rotation scale of an encoder according to the target pulse signal; determining the thickness of the medium to be printed according to the perimeter of the encoder and the rotation scale; correcting the thickness according to a preset sampling period and the target pulse signal to obtain a target thickness; and adjusting the height of the nozzle according to the target thickness. The space between the printer nozzle and the to-be-printed medium is ensured to be matched, the nozzle is prevented from scraping the to-be-printed medium and damaging the printing nozzle, meanwhile, the printing precision is guaranteed, and compatibility of cost and precision is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of printer technology, and in particular to a printer printhead control method, device, computer equipment, and storage medium. Background Technology

[0002] With the continuous development of printing technology, inkjet, laser, and other types of printers have been widely used in various scenarios such as offices and industrial production. The market's requirements for printing accuracy and equipment safety are increasing day by day. Among them, the control of the distance between the printhead and the media to be printed is a key link, which directly affects the print quality and the life of the printhead. Precise height measurement has become one of the important technical requirements for printers.

[0003] Currently, the mainstream printer printhead control solutions in the industry are mainly divided into two categories: one is the high-precision optical height measurement solution, which relies on a laser rangefinder to emit optical signals and obtain the thickness of the printing medium by calculating the round-trip time of the signal. Although it can achieve micron-level accuracy, the sensor hardware is expensive and easily affected by reflections and dust on the surface of the printing medium, limiting its adaptability; the other is the low-cost mechanical height measurement solution, which uses a mechanical contact rod to contact the printing medium and link a potentiometer to provide height feedback. Although it has a simple structure and low cost, the mechanical parts are prone to wear, and the measurement accuracy can only reach the millimeter level, which cannot meet the needs of fine printing.

[0004] In view of the above, this application is hereby submitted. Summary of the Invention

[0005] The purpose of this application is to provide a printer printhead control method, device, computer equipment, and storage medium to solve the technical problem that cost and accuracy are difficult to reconcile when determining the height of the printer printhead.

[0006] To address the aforementioned technical problems, this application provides a printhead control method for a printer, employing the following technical solution: the printer includes an encoder, comprising: In response to a target pulse signal triggered on the printer by the medium to be printed, the rotation scale of the encoder is determined based on the target pulse signal; The thickness of the printing medium is determined based on the circumference of the encoder and the rotation scale. The thickness is corrected according to the preset sampling period and the target pulse signal to obtain the target thickness; Adjust the height of the nozzle according to the target thickness.

[0007] Furthermore, determining the rotation scale of the encoder based on the target pulse signal includes: Obtain the resolution of the encoder; The rotation scale is determined based on the resolution and the target pulse signal.

[0008] Furthermore, the step of correcting the thickness according to the preset sampling period and the target pulse signal to obtain the target thickness includes: Based on the sampling period and the target pulse signal, determine whether the printer is in an abnormal state; When the printer is in an abnormal state, the thickness is corrected, and the corrected thickness is determined as the target thickness. When the printer is in normal operation, the thickness is taken as the target thickness.

[0009] Furthermore, there are multiple sampling periods, and determining whether the printer is in an abnormal state based on the sampling period and the target pulse signal includes: Multiple frequency deviation values ​​corresponding to multiple sampling periods are extracted from the target pulse signal, with one sampling period corresponding to one frequency deviation value; If any of the multiple frequency deviation values ​​is greater than a preset deviation threshold, then the printer is determined to be in an abnormal state. If all the frequency fluctuation values ​​are less than the preset fluctuation threshold, then the printer is determined to be in normal condition.

[0010] Furthermore, the step of extracting multiple frequency deviation values ​​corresponding to multiple sampling periods from the target pulse signal, wherein one sampling period corresponds to one frequency deviation value, includes: The target pulse signal is divided according to multiple sampling periods to obtain multiple pulse signal sets. One sampling period corresponds to one pulse signal set, and one pulse signal set includes multiple pulse signals. Based on each sampling period and the pulse signal in each sampling period, determine the frequency deviation value corresponding to each sampling period.

[0011] Furthermore, when the printer is in an abnormal state, correcting the thickness and determining the corrected thickness as the target thickness includes: The historical pulse signal frequency of the printer when printing the medium to be printed, and the abnormal pulse signal frequency when the printer is in an abnormal state are obtained. The thickness is corrected based on the historical pulse signal frequency and the abnormal pulse signal frequency to obtain the target thickness.

[0012] Furthermore, adjusting the height of the nozzle according to the target thickness includes: Obtain the initial height value of the nozzle; The target height value of the nozzle is determined based on the target thickness and the initial height value; Adjust the height of the nozzle according to the target height value.

[0013] To address the aforementioned technical problems, this application also provides a printhead control device for a printer, employing the following technical solution: A printhead control device for a printer, the printer including an encoder, comprising: The first determining module is used to determine the rotation scale of the encoder in response to a target pulse signal triggered on the printer by the medium to be printed; The second determining module is used to determine the thickness of the printing medium based on the circumference of the encoder and the rotation scale. The correction module is used to correct the thickness according to the preset sampling period and the target pulse signal to obtain the target thickness; An adjustment module is used to adjust the height of the nozzle according to the target thickness.

[0014] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution: A computer device includes a memory and a processor, the memory storing computer-readable instructions, the processor executing the computer-readable instructions to implement the steps of the printhead control method for a printer as described above.

[0015] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below: A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the printer nozzle control method as described above.

[0016] Compared with the prior art, this application has the following main advantages: The printhead control method disclosed in this application determines the encoder rotation scale by responding to the target pulse signal triggered by the printing medium, capturing minute rotational changes of the encoder shaft to provide a solid signal foundation for media thickness calculation; the media thickness is derived based on the encoder circumference and rotation scale, realizing the conversion from pulse signal to actual thickness and ensuring the objectivity and accuracy of the initial thickness data; the thickness is corrected by combining a preset sampling period, which can effectively offset the influence of printer abnormalities such as belt slippage and fluctuations, making the final target thickness more consistent with the actual situation of the medium; the printhead height is dynamically adjusted according to the target thickness, which can avoid printhead collision damage due to excessively low height, and avoid printhead height affecting printing effect due to excessively high height, making the printing quality more stable and reliable. Attached Figure Description

[0017] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is an exemplary system architecture diagram to which this application can be applied; Figure 2 This is a flowchart of one embodiment of the printer nozzle control method according to this application; Figure 3 This is a schematic diagram of one embodiment of the printhead control device for a printer according to this application; Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.

[0020] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.

[0022] like Figure 1 As shown, the system architecture 100 may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0023] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0024] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 (Moving Picture Experts Group Audio Layer Ⅲ) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptops, and desktop computers, etc.

[0025] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.

[0026] It should be noted that the printhead control method of the printer provided in this application embodiment is generally executed by the terminal device, and correspondingly, the printhead control device of the printer is generally set in the terminal device.

[0027] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0028] Continue to refer to Figure 2 A flowchart of an embodiment of a printer printhead control method according to this application is shown. The printer printhead control method includes the following steps: Step S201: In response to a target pulse signal triggered on the printer by the medium to be printed, determine the rotation scale of the encoder based on the target pulse signal.

[0029] In this embodiment, the printer's printhead control method operates on electronic devices (e.g., Figure 1 The terminal device shown can send or receive data via wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, Wi-Fi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra-wide band) connections, and other currently known or future wireless connection methods.

[0030] In this embodiment, the printing medium refers to various printing materials that the printer is about to print on, such as common ordinary printing paper, coated paper, kraft paper, or PET film, cardstock, and thin sheets used in industrial printing scenarios. When using the printer, the printing medium is placed on the printer's conveyor belt, and the medium moves at a constant speed towards the paper pressure shaft inside the printer. When the front end of the medium moves directly below the paper pressure shaft, the thickness of the medium overcomes the initial gravity of the paper pressure shaft, lifting it upwards. During this lifting process, the paper pressure shaft drives a swing mechanism connected to the shaft, which in turn drives the encoder to rotate synchronously via gears. The encoder rotates with the shaft, generating a raw pulse signal. This raw pulse signal is converted from the mechanical rotation of the encoder into an electrical signal that can be processed by a programmable logic controller (PLC). After preprocessing the raw pulse signal, a target pulse signal is obtained. By identifying the correspondence between the accumulated amount of the target pulse signal and the encoder's rotation state, the rotation scale generated by the encoder during the medium lifting process is directly determined. The rotation scale is the rotation angle value generated by the encoder due to the lifting of the paper pressure shaft by the medium to be printed. In addition, the number of rotations of the encoder can also be determined by the target pulse signal.

[0031] Preprocessing aims to eliminate interference noise from the printer motor, such as electromagnetic radiation and mechanical component vibration, which can distort the signal. Specifically, differential amplification is used to suppress interference signals from the printer motor's electromagnetic radiation, filtering out superimposed noise in the signal. Next, median filtering is used for further data processing. Pulse data is continuously acquired and stored in a buffer according to a preset sampling period. The buffered data is sorted by size, and extreme outliers caused by mechanical vibration are removed. The median value after sorting is taken as the effective pulse characteristic of the current period, correcting instantaneous signal jumps. Besides median filtering, amplitude limiting filtering can also be used. Amplitude limiting filtering removes abnormal sampled values ​​exceeding a set allowable deviation threshold. Alternatively, wavelet transform denoising can be used. Wavelet transform can analyze the signal simultaneously in the time and frequency domains, removing high-frequency noise through thresholding while retaining the key characteristics of the pulse signal.

[0032] Step S202: Determine the thickness of the printing medium based on the circumference of the encoder and the rotation scale.

[0033] In this embodiment, the encoder's circumference is the actual physical circumference of the encoder's rotating shaft, obtained by multiplying the circumference C by the diameter d, based on the encoder shaft's diameter. The arc length corresponding to the rotation scale is the thickness of the printing medium. Therefore, the thickness H of the printing medium is calculated as (encoder circumference C × rotation scale θ) ÷ 360°. For example, if the rotation scale is 1.08° and the encoder circumference is 100mm, the thickness of the printing medium is calculated to be 0.3mm.

[0034] Step S203: Based on the preset sampling period and the target pulse signal, the thickness is corrected to obtain the target thickness.

[0035] In this embodiment, the preset sampling period is determined based on the speed of the conveyor belt. If the conveyor belt speed is 100 mm / s, then the corresponding sampling period could be 10 ms. Within the 10 ms sampling period, the pulse frequency data of the target pulse signal is continuously acquired. If the frequency of the target pulse signal is stable within the period, it indicates that the correspondence between the signal and the thickness is consistent, and no adjustment of the thickness is required. If the frequency of the target pulse signal fluctuates within the period, resulting in a frequency deviation, the thickness can be fine-tuned by combining the historical pulse frequency data before the anomaly occurred to obtain the target thickness.

[0036] Step S204: Adjust the height of the nozzle according to the target thickness.

[0037] In this embodiment, the distance between the bottom of the printhead and the surface of the medium to be printed is the target thickness plus the safety gap for spraying. An adjustment command is sent to the printhead drive module, converting the target thickness into the number of steps for the stepper motor. The stepper motor operates according to the number of steps, controlling the printhead lifting mechanism to move smoothly down or up until the target height of the printhead is reached. This ensures that the printhead height is not too low and could damage the printhead. At the same time, the printhead height adjusted according to the target thickness also ensures printing accuracy.

[0038] This application determines the encoder rotation scale by responding to the target pulse signal triggered by the printing medium, capturing minute rotational changes of the encoder shaft to provide a solid signal foundation for medium thickness calculation; it derives the medium thickness based on the encoder circumference and rotation scale, realizing the conversion from pulse signal to actual thickness and ensuring the objectivity and accuracy of the initial thickness data; it corrects the thickness by combining a preset sampling period, which can effectively offset the influence of printer anomalies such as belt slippage and fluctuations, making the final target thickness more consistent with the actual condition of the medium; it dynamically adjusts the printhead height according to the target thickness, which can avoid printhead collision damage due to excessively low height, and avoid printhead impact on printing effect due to excessively high height, making the printing quality more stable and reliable.

[0039] In some optional implementations of this embodiment, the step of determining the encoder's rotation scale based on the target pulse signal includes: Obtain the resolution of the encoder; The rotation scale is determined based on the resolution and the target pulse signal.

[0040] In this embodiment, the encoder resolution refers to the total number of pulses output per revolution of the encoder, measured in lines per revolution (L / revolution). For example, 1000 L / revolution means 1000 pulses per revolution. The target pulse signal, i.e., the pulses generated by the encoder rotating due to the printing medium, is known. Therefore, the rotation scale of the encoder can be obtained by dividing the number of pulses in the target pulse signal by the encoder resolution and then multiplying by 360°. For example, if the encoder resolution is 1000 L / revolution and the total number of target pulse signals is 3, then the rotation scale θ = (3 ÷ 1000) × 360° = 1.08°.

[0041] In addition, the higher the encoder resolution, the smaller the rotation angle corresponding to each pulse (e.g., 1000 lines / revolution corresponds to 0.36° / pulse, 2000 lines / revolution corresponds to 0.18° / pulse). This allows the encoder to capture minute rotational changes in the shaft, thereby accurately calculating the media thickness and avoiding printhead collisions or blurry printing due to thickness calculation errors. The appropriate encoder can be selected flexibly based on the printer's precision requirements. For general precision printing, a low-resolution encoder (e.g., 500 lines / revolution) is suitable, while a high-resolution encoder is chosen for high-precision printing (e.g., thin sheets, intricate patterns), balancing cost and reliability.

[0042] This application determines the rotation scale by combining encoder resolution with the target pulse signal. Through the quantization and correlation of pulses and rotation angles, it accurately captures minute rotational changes of the encoder shaft. This provides reliable intermediate support for the subsequent accurate conversion of media thickness, effectively reducing thickness calculation errors. It also avoids problems such as printhead collisions or blurry printing, and can adapt to different printing accuracy requirements, balancing cost and reliability.

[0043] In some optional implementations of this embodiment, the step of correcting the thickness according to a preset sampling period and the target pulse signal to obtain the target thickness includes: Based on the sampling period and the target pulse signal, determine whether the printer is in an abnormal state; When the printer is in an abnormal state, the thickness is corrected, and the corrected thickness is determined as the target thickness. When the printer is in normal operation, the thickness is taken as the target thickness.

[0044] In this embodiment, the preset sampling period parameter can be between 10ms and 100ms, depending on the uniform running speed of the printer conveyor belt, the encoder resolution, and the signal stability. If the encoder resolution is high (e.g., ≥1000 lines / revolution) or the conveyor belt speed is fast, 10ms-30ms can be selected to ensure the capture of subtle changes in the pulse signal. If the frequency characteristics of the target pulse signal are analyzed using a 10ms sampling period, the frequency of the target pulse signal is directly related to the encoder rotation speed, and thus reflects the conveyor belt speed. Under normal circumstances, the conveyor belt and encoder speeds are synchronized. If the frequency of the target pulse signal remains stable within the preset range (e.g., 100Hz ± 2%, corresponding to uniform conveyor belt operation) during the sampling period, it indicates that the encoder rotation speed is normal, and the conveyor belt is in a normal state, meaning the printer is also in a normal state. If the frequency of the target pulse signal fluctuates significantly during the sampling period (e.g., a sudden drop from 100Hz to 90Hz, deviating from the preset range), it indicates that the encoder rotation speed and conveyor belt speed are not synchronized, and the conveyor belt is in an abnormal state. For example, if the conveyor belt slips, causing it to run slower than the encoder speed, the printer is in an abnormal state. When the conveyor belt is in normal condition, the calculated thickness accurately reflects the true thickness of the medium and no correction is needed; this thickness is directly used as the target thickness. However, when the conveyor belt is in an abnormal condition, such as when conveyor belt slippage causes the encoder speed to become disjointed with the conveyor belt speed, the calculated thickness may overestimate the true thickness of the medium due to the encoder rotating too fast during slippage. In this case, the calculated thickness is corrected based on the frequency fluctuation amplitude, and the corrected thickness is used as the target thickness.

[0045] This application determines the printer status by combining the sampling period and the target pulse signal, balancing measurement accuracy and adaptability: when the printer is functioning normally, the original thickness value is directly used without additional processing, improving efficiency; when the printer malfunctions, the thickness value is corrected to avoid measurement deviations caused by the malfunction. Ultimately, a precise target thickness can be obtained, providing a reliable basis for printhead adjustment, effectively preventing the printhead from scratching the printing medium, and ensuring print quality and equipment stability.

[0046] In some optional implementations of this embodiment, there are multiple sampling periods, and the step of determining whether the printer is in an abnormal state based on the sampling period and the target pulse signal includes: Multiple frequency deviation values ​​corresponding to multiple sampling periods are extracted from the target pulse signal, with one sampling period corresponding to one frequency deviation value; If any of the multiple frequency deviation values ​​is greater than a preset deviation threshold, then the printer is determined to be in an abnormal state. If all the frequency fluctuation values ​​are less than the preset fluctuation threshold, then the printer is determined to be in normal condition.

[0047] In this embodiment, each frequency deviation value reflects the degree of deviation between the actual frequency of the target pulse signal and the standard frequency during normal printer operation within the corresponding sampling period. A preset deviation threshold is pre-calibrated based on the characteristics of the printer's drive system and printing accuracy requirements, used to define the normal fluctuation range of the pulse signal frequency. This deviation threshold can be set to 5%, or it can be set to other values. For example, when printing thin and brittle materials, to avoid misjudgment due to slight fluctuations, the threshold can be lowered to 3%; when printing thick and hard materials, because the material's resistance to the conveyor belt is more stable, the threshold can be relaxed to 4%-6%. Specifically, after extracting the frequency deviation values ​​corresponding to each sampling period from the target pulse signal, if all deviation values ​​are less than the threshold, the printer is determined to be in normal condition, and the calculated thickness value is directly used as the target thickness. If the frequency changes abruptly in a certain period, resulting in a frequency deviation value of 6%, which is greater than the deviation threshold of 5%, the printer is determined to be abnormal.

[0048] This application improves the reliability of printer status determination by using multi-cycle frequency analysis. Deviations from thresholds can be flexibly adapted to different printing media conditions, avoiding misjudgments. Accurate status determination provides a basis for subsequent height measurement; data is efficiently used under normal conditions and timely corrections are triggered in case of anomalies, ensuring printing accuracy and equipment stability.

[0049] In some optional implementations of this embodiment, the step of extracting multiple frequency deviation values ​​corresponding to multiple sampling periods from the target pulse signal, wherein one sampling period corresponds to one frequency deviation value, includes: The target pulse signal is divided according to multiple sampling periods to obtain multiple pulse signal sets. One sampling period corresponds to one pulse signal set, and one pulse signal set includes multiple pulse signals. Based on each sampling period and the pulse signal in each sampling period, determine the frequency deviation value corresponding to each sampling period.

[0050] In this embodiment, the continuously output target pulse signal is time-sequentially divided using the sampling period as the time boundary. The target pulse signal is split into multiple independent pulse signal sets according to chronological order, with each pulse signal set comprising multiple pulse signals. Next, the signal frequency for each period is calculated by dividing the number of pulse signals within a period by the sampling period. Multiple sets of signal frequencies are obtained through calculation, and these five sets of signal frequencies are summed and averaged to obtain the average frequency. This average frequency reflects the standard frequency level during stable printer operation. Finally, the frequency deviation is calculated by dividing the average frequency by |each set of signal frequencies - average frequency| ÷ average frequency × 100%.

[0051] This application accurately captures the signal fluctuation characteristics within each sampling period by dividing the pulse signal set according to the sampling period and quantifying the deviation between the actual frequency and the standard frequency of each period. This provides standardized and quantifiable basic data for subsequent judgment of whether the printer is abnormal by the frequency deviation value, further improving the accuracy and operability of anomaly judgment.

[0052] In some optional implementations of this embodiment, the step of correcting the thickness when the printer is in an abnormal state and determining the corrected thickness as the target thickness includes: The historical pulse signal frequency of the printer when printing the medium to be printed, and the abnormal pulse signal frequency when the printer is in an abnormal state are obtained. The thickness is corrected based on the historical pulse signal frequency and the abnormal pulse signal frequency to obtain the target thickness.

[0053] In this embodiment, when the printer is in an abnormal state, the signal frequencies of the previous 5 consecutive sampling cycles that were determined to be normal for the printer can be acquired as historical data samples. The number of these samples can be 3 or any other value, as long as it is data from when the printer was determined to be normal while printing the medium to be printed. The historical pulse signal frequency is determined by the formula of summing the frequencies of multiple historical normal cycles and dividing by the number of historical cycles. Furthermore, the abnormal cycles of the printer malfunction are acquired, and the abnormal pulse signal frequency is calculated based on the number of pulses corresponding to the abnormal cycle. When the printer malfunctions, it could be due to conveyor belt slippage, causing relative sliding between the conveyor belt and the roller. When the roller rotates once, the actual distance the conveyor belt travels is shortened, resulting in a reduction in the distance the encoder travels once, and a decrease in the number of encoder rotations per unit time. Consequently, the signal frequency within the sampling cycle decreases. If the original thickness value is used, the medium may be misjudged as thin due to insufficient pulse count. The deviation needs to be compensated for by frequency ratio. The formula Target Thickness = Thickness × (Historical Pulse Signal Frequency ÷ Abnormal Pulse Signal Frequency) can be used to compensate for the height measurement deviation caused by conveyor belt slippage, thus accurately reflecting the actual thickness of the medium to be printed.

[0054] This application corrects the height measurement value by frequency ratio, which can avoid misjudgment of media thickness due to abnormalities, and make the target measurement value closely match the actual thickness of the media. This provides an accurate basis for printhead adjustment, effectively prevents printhead scratching, and ensures printing accuracy and stable equipment operation.

[0055] In some optional implementations of this embodiment, the step of adjusting the height of the nozzle according to the target thickness includes: Obtain the initial height value of the nozzle; The target height value of the nozzle is determined based on the target thickness and the initial height value; Adjust the height of the nozzle according to the target height value.

[0056] In this embodiment, the initial height value of the printhead is first obtained. This initial height value is the reference height of the printhead relative to the conveyor belt surface when there is no printing media. It is pre-stored in the control system based on printer assembly calibration and default printing scenario presets. Next, the control system, in conjunction with the determined target thickness of the printing media, performs a correlation calculation with the initial height value of the printhead to determine the target height value of the printhead. That is, the initial height value plus the target thickness gives the target height that the printhead needs to reach. Finally, a control signal corresponding to the target height value is sent to the printhead's lifting actuator (such as a lifting module driven by a stepper motor). This drives the actuator to move the printhead vertically until the actual height of the printhead matches the target height value, completing the height adjustment.

[0057] This application establishes a unified benchmark by first obtaining the initial height value of the nozzle, providing a stable reference for height adjustment and avoiding adjustment deviations caused by the lack of a benchmark; it then accurately calculates the target height by combining the target thickness with the initial height value, allowing the nozzle height to dynamically adapt to the actual thickness of the medium.

[0058] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0059] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0060] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).

[0061] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0062] Further reference Figure 3 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of a printer printhead control device, which is similar to... Figure 2Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.

[0063] like Figure 3 As shown, the printhead control device 300 of the printer described in this embodiment includes: a first determining module 301, a second determining module 302, a correction module 303, and an adjustment module 304. Wherein: The first determining module 301 is used to determine the rotation scale of the encoder in response to a target pulse signal triggered on the printer by the medium to be printed; The second determining module 302 is used to determine the thickness of the printing medium based on the circumference of the encoder and the rotation scale. The correction module 303 is used to correct the thickness according to the preset sampling period and the target pulse signal to obtain the target thickness; The adjustment module 304 is used to adjust the height of the nozzle according to the target thickness.

[0064] The printhead control device for the printer provided in this application determines the encoder rotation scale by responding to the target pulse signal triggered by the medium to be printed, capturing minute rotational changes of the encoder shaft to provide a solid signal foundation for medium thickness calculation; it derives the medium thickness based on the encoder circumference and rotation scale, realizing the conversion from pulse signal to actual thickness, ensuring the objectivity and accuracy of the initial thickness data; it corrects the thickness by combining a preset sampling period, which can effectively offset the influence of printer anomalies such as belt slippage and fluctuations, making the final target thickness more consistent with the actual medium condition; it dynamically adjusts the printhead height according to the target thickness, which can avoid printhead collision damage due to excessively low height, and avoid printhead height affecting printing effect due to excessively high height, making the printing quality more stable and reliable.

[0065] In some optional implementations of this embodiment, the first determining module 301 is further configured to: Obtain the resolution of the encoder; The rotation scale is determined based on the resolution and the target pulse signal.

[0066] The printhead control device for the printer provided in this application determines the rotation scale by combining the encoder resolution with the target pulse signal. Through the quantization and correlation between the pulse and the rotation angle, it accurately captures minute rotational changes of the encoder shaft. This provides reliable intermediate support for the accurate conversion of subsequent media thickness, effectively reducing thickness calculation errors. It also avoids problems such as printhead collisions or blurry printing, and can be adapted to different printing accuracy requirements, balancing cost and reliability.

[0067] In some optional implementations of this embodiment, the correction module 303 is further configured to: Based on the sampling period and the target pulse signal, determine whether the printer is in an abnormal state; When the printer is in an abnormal state, the thickness is corrected, and the corrected thickness is determined as the target thickness. When the printer is in normal operation, the thickness is taken as the target thickness.

[0068] The printhead control device for the printer provided in this application determines the printer status by combining the sampling period and the target pulse signal, balancing height measurement accuracy and adaptability: when the printer is functioning normally, the original thickness value is directly used without additional processing, improving efficiency; when the printer malfunctions, the thickness value is corrected to avoid height measurement deviations caused by the malfunction. Ultimately, a precise target thickness can be obtained, providing a reliable basis for printhead adjustment, effectively preventing the printhead from scratching the printing medium, and ensuring print quality and equipment stability.

[0069] In some optional implementations of this embodiment, the correction module 303 is further configured to: Multiple frequency deviation values ​​corresponding to multiple sampling periods are extracted from the target pulse signal, with one sampling period corresponding to one frequency deviation value; If any of the multiple frequency deviation values ​​is greater than a preset deviation threshold, then the printer is determined to be in an abnormal state. If all the frequency fluctuation values ​​are less than the preset fluctuation threshold, then the printer is determined to be in normal condition.

[0070] The printhead control device for the printer provided in this application improves the reliability of printer status determination by analyzing the printer's status over multiple cycles. Deviations from thresholds can be flexibly adapted to different printing media conditions, avoiding misjudgments. Accurate status determination provides a basis for subsequent height measurement, efficiently utilizing data during normal operation and triggering timely corrections during abnormal operations, ensuring printing accuracy and equipment stability.

[0071] In some optional implementations of this embodiment, the correction module 303 is further configured to: The target pulse signal is divided according to multiple sampling periods to obtain multiple pulse signal sets. One sampling period corresponds to one pulse signal set, and one pulse signal set includes multiple pulse signals. Based on each sampling period and the pulse signal in each sampling period, determine the frequency deviation value corresponding to each sampling period.

[0072] The printhead control device for the printer provided in this application accurately captures the signal fluctuation characteristics within each sampling period by dividing the pulse signal set according to the sampling period and quantifying the deviation between the actual frequency and the standard frequency of each period. This provides standardized and quantifiable basic data for subsequent judgment of whether the printer is abnormal by the frequency deviation value, further improving the accuracy and operability of abnormal judgment.

[0073] In some optional implementations of this embodiment, the correction module 303 is further configured to: The historical pulse signal frequency of the printer when printing the medium to be printed, and the abnormal pulse signal frequency when the printer is in an abnormal state are obtained. The thickness is corrected based on the historical pulse signal frequency and the abnormal pulse signal frequency to obtain the target thickness.

[0074] The printhead control device for the printer provided in this application corrects the height measurement value by frequency ratio, which can avoid misjudgment of media thickness due to abnormalities, make the target measurement value close to the actual thickness of the media, provide an accurate basis for printhead adjustment, effectively prevent printhead scratching, and ensure printing accuracy and stable operation of the equipment.

[0075] In some optional implementations of this embodiment, the adjustment module 304 is further configured to: Obtain the initial height value of the nozzle; The target height value of the nozzle is determined based on the target thickness and the initial height value; Adjust the height of the nozzle according to the target height value.

[0076] The printhead control device for the printer provided in this application establishes a unified benchmark by first obtaining the initial height value of the printhead, providing a stable reference for height adjustment and avoiding adjustment deviations caused by the lack of a benchmark; it accurately calculates the target height by combining the target thickness with the initial height value, allowing the printhead height to dynamically adapt to the actual thickness of the medium.

[0077] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0078] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components 41, 42, and 43 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0079] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.

[0080] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for printer nozzle control methods. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.

[0081] In some embodiments, the processor 42 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or to process data, for example, to execute computer-readable instructions for the printhead control method of the printer.

[0082] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.

[0083] The computer device provided in this application determines the encoder rotation scale by responding to the target pulse signal triggered by the medium to be printed, capturing minute rotational changes of the encoder shaft, and providing a solid signal foundation for medium thickness calculation; it derives the medium thickness based on the encoder circumference and rotation scale, realizing the conversion from pulse signal to actual thickness, ensuring the objectivity and accuracy of the initial thickness data; it corrects the thickness by combining a preset sampling period, which can effectively offset the influence of printer abnormalities such as belt slippage and fluctuations, making the final target thickness more consistent with the actual situation of the medium; it dynamically adjusts the printhead height according to the target thickness, which can avoid printhead collision damage caused by excessively low height, and avoid printhead height affecting the printing effect, making the printing quality more stable and reliable.

[0084] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the printer nozzle control method described above.

[0085] The computer-readable storage medium provided in this application determines the encoder rotation scale by responding to the target pulse signal triggered by the medium to be printed, capturing minute rotational changes of the encoder shaft, and providing a solid signal foundation for medium thickness calculation; it derives the medium thickness based on the encoder circumference and rotation scale, realizing the conversion from pulse signal to actual thickness, ensuring the objectivity and accuracy of the initial thickness data; it corrects the thickness by combining a preset sampling period, which can effectively offset the influence of printer anomalies such as belt slippage and fluctuations, making the final target thickness more consistent with the actual situation of the medium; it dynamically adjusts the printhead height according to the target thickness, which can avoid printhead collision damage caused by excessively low height, and avoid printhead height affecting the printing effect, making the printing quality more stable and reliable.

[0086] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0087] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.

Claims

1. A method of controlling a printhead of a printer, characterized by, The printer comprises an encoder, comprising the following steps: in response to a target pulse signal triggered by a to-be-printed medium on the printer, determining a rotation scale of the encoder according to the target pulse signal; determining a thickness of the to-be-printed medium according to a circumference of the encoder and the rotation scale; correcting the thickness according to a preset sampling period and the target pulse signal to obtain a target thickness; adjusting a height of the nozzle according to the target thickness.

2. The printhead control method of claim 1, wherein The step of determining the rotation scale of the encoder according to the target pulse signal comprises: obtaining a resolution of the encoder; determining the rotation scale according to the resolution and the target pulse signal.

3. The printhead control method of claim 1, wherein The step of correcting the thickness according to the preset sampling period and the target pulse signal to obtain a target thickness comprises: determining whether the printer is in an abnormal state according to the sampling period and the target pulse signal; when the printer is in the abnormal state, correcting the thickness, and determining a corrected thickness as the target thickness; when the printer is in a normal state, taking the thickness as the target thickness.

4. The method of controlling a printhead of a printer according to claim 3, wherein, The sampling period has multiple sampling periods, and the step of determining whether the printer is in an abnormal state according to the sampling period and the target pulse signal comprises: extracting multiple frequency deviation values corresponding to the multiple sampling periods from the target pulse signal, one sampling period corresponding to one frequency deviation value; if there is a frequency deviation value greater than a preset deviation threshold value in the multiple frequency deviation values, it is determined that the printer is in an abnormal state; if all the frequency fluctuation values are less than the preset fluctuation threshold value, it is determined that the printer is in a normal state.

5. The method of controlling a printhead of a printer according to claim 4, wherein, The step of extracting multiple frequency deviation values corresponding to the multiple sampling periods from the target pulse signal, one sampling period corresponding to one frequency deviation value, comprises: dividing the target pulse signal according to the multiple sampling periods to obtain multiple pulse signal sets, one sampling period corresponding to one pulse signal set, and one pulse signal set comprising multiple pulse signals; determining a frequency deviation value corresponding to each sampling period according to each sampling period and the pulse signals in each sampling period.

6. The printhead control method of claim 3, wherein, The step of correcting the thickness when the printer is in an abnormal state to determine a corrected thickness as the target thickness comprises: obtaining a historical pulse signal frequency of the to-be-printed medium printed by the printer and an abnormal pulse signal frequency when the printer is in an abnormal state; correcting the thickness according to the historical pulse signal frequency and the abnormal pulse signal frequency to obtain the target thickness.

7. The printhead control method of any one of claims 1 to 6, wherein, The step of adjusting the height of the nozzle according to the target thickness comprises: obtaining an initial height value of the nozzle; determining a target height value of the nozzle according to the target thickness and the initial height value; adjusting the height of the nozzle according to the target height value.

8. A printhead control apparatus of a printer, characterized by comprising: The printer comprises an encoder, comprising: A first determining module is configured to determine a rotation scale of the encoder according to a target pulse signal triggered by the to-be-printed medium on the printer; A second determining module is configured to determine a thickness of the to-be-printed medium according to a circumference of the encoder and the rotation scale; A correcting module is configured to correct the thickness according to a preset sampling period and the target pulse signal to obtain a target thickness; An adjusting module is configured to adjust a height of the nozzle according to the target thickness.

9. A computer device, comprising: A printer includes a memory and a processor, the memory stores computer readable instructions, and the processor implements the steps of the nozzle control method of the printer according to any one of claims 1 to 7 when executing the computer readable instructions.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by the processor to implement the steps of the nozzle control method of the printer according to any one of claims 1 to 7.