Thermal printhead temperature control method, apparatus, electronic device, and storage medium
By integrating a microcontroller into the thermal printhead, the microcontroller calculates the temperature and controls the fan and heating element, solving the problem of requiring external circuitry and program support in existing technologies. This achieves autonomous temperature regulation of the thermal printhead and simplifies the main control board circuitry.
Patent Information
- Application Number
- CN202410631648.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2044-05-20
AI Technical Summary
Existing thermal printhead temperature control methods require external circuitry and software support, and cannot achieve autonomous temperature adjustment.
A microcontroller is integrated into the thermal printhead. The microcontroller is connected to the heating element, clock signal line and multiple thermistors. Preheating threshold and heat dissipation threshold are set. The microcontroller calculates the temperature and controls the switching of the fan and heating element to achieve automatic temperature regulation.
The circuitry and programming of the main control board were simplified, enabling internal preheating and heat preservation of the thermal printhead and improving the printhead's autonomous temperature control capability.
Smart Images

Figure CN118372558B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of thermal printhead temperature control technology, and in particular to a thermal printhead temperature control method, device, electronic device, and storage medium. Background Technology
[0002] As a core component of thermal printing technology, the performance of the thermal printhead directly affects print quality and speed. Preheating and heat preservation are crucial steps to ensure the thermal printhead operates in optimal condition, especially for high-speed printing or applications requiring high print quality.
[0003] Thermal printheads are equipped with thermistors and heating elements, but a main control board is needed to detect the thermistors and control the heating elements, and the main control board needs to be connected to a fan. Currently, during printing, thermal printheads require external control of the heating elements or fan and temperature detection; that is, they need the support of external circuitry and software to keep the thermal printhead within a certain temperature range. Summary of the Invention
[0004] This invention provides a thermal printhead temperature control method, apparatus, electronic device, and storage medium, which solves or partially solves the technical problem that existing thermal printhead temperature control methods require external circuitry and program support.
[0005] This invention provides a method for temperature control of a thermal printhead, wherein a microcontroller is integrated into the thermal printhead, and the heating element and clock signal line of the thermal printhead are respectively connected to the microcontroller. An external interface of the thermal printhead is connected to a fan. The method includes:
[0006] Determine whether the preheating threshold and heat dissipation threshold of the thermal printhead are within the effective temperature range. If so, calculate the temperature of the thermal printhead using the microcontroller.
[0007] If the temperature of the thermal printhead is less than the preheating threshold and the heating time of the thermal printhead has not exceeded the timeout, then it is determined whether the temperature of the thermal printhead is greater than the heat dissipation threshold. If so, the fan is turned on by controlling the microcontroller.
[0008] When a signal transition is detected on the clock signal line, the microcontroller controls the heating element to shut down and simultaneously controls the fan to dissipate heat.
[0009] Optionally, multiple thermistors on the thermal printhead are connected to the microcontroller, and the calculation of the thermal printhead temperature by the microcontroller includes:
[0010] The microcontroller reads the resistance values of the multiple thermistors respectively.
[0011] For each of the thermistors, the thermistor temperature at the resistance value is calculated based on the thermistor temperature calculation formula.
[0012] The average value of the multiple thermal temperatures is calculated to obtain the thermal printhead temperature.
[0013] Optionally, determining whether the thermal printhead temperature is greater than the heat dissipation threshold if the thermal printhead temperature is less than the preheating threshold and the heating time of the thermal printhead has not exceeded the timeout includes:
[0014] Determine whether the temperature of the thermal printhead is lower than the preheating threshold. If so, determine whether a heating timeout has been set for the thermal printhead. If so, determine whether the heating time of the thermal printhead has exceeded the timeout.
[0015] If the heating time of the thermal printhead has not exceeded the time limit, then it is determined whether the temperature of the thermal printhead is greater than the heat dissipation threshold.
[0016] Optionally, the method further includes:
[0017] When the temperature of the thermal printhead is greater than or equal to the preheating threshold, the heating element is turned off by the microcontroller, and the process jumps to the step of determining whether the temperature of the thermal printhead is greater than the heat dissipation threshold.
[0018] Optionally, the method further includes:
[0019] If no heating timeout is set, a heating timeout is set for the thermal printhead, and the heating element is turned on by the microcontroller.
[0020] Optionally, the method further includes:
[0021] If the heating time of the thermal printhead exceeds the limit, the microcontroller records the timeout error and controls the heating element to be turned off.
[0022] Optionally, the method further includes:
[0023] When the preheating threshold and / or the heat dissipation threshold are not within the effective temperature range, the microcontroller records a temperature error flag and sets the preheating threshold to the default preheating threshold and / or the heat dissipation threshold to the default heat dissipation threshold.
[0024] This invention also provides a thermal printhead temperature control device, wherein a microcontroller is integrated into the thermal printhead, and the heating element and clock signal line of the thermal printhead are respectively connected to the microcontroller. An external interface of the thermal printhead is connected to a fan. The device includes:
[0025] The thermal printhead temperature calculation module is used to determine whether the preheating threshold and heat dissipation threshold of the thermal printhead are within the effective temperature range. If so, the thermal printhead temperature is calculated by the microcontroller.
[0026] The thermal printhead temperature judgment module is used to determine whether the thermal printhead temperature is greater than the heat dissipation threshold when the thermal printhead temperature is less than the preheating threshold and the heating time of the thermal printhead has not exceeded the timeout. If so, the microcontroller controls the fan to turn on.
[0027] The signal transition detection module is used to control the microcontroller to shut down the heating element and simultaneously control the fan to dissipate heat when a signal transition is detected on the clock signal line.
[0028] The present invention also provides an electronic device, the device comprising a processor and a memory:
[0029] The memory is used to store program code and transmit the program code to the processor;
[0030] The processor is used to execute the thermal printhead temperature control method as described above, according to the instructions in the program code.
[0031] The present invention also provides a computer-readable storage medium for storing program code for performing the thermal printhead temperature control method as described in any of the preceding claims.
[0032] As can be seen from the above technical solutions, the present invention has the following advantages:
[0033] A method for temperature control of a thermal printhead is provided. This method integrates a microcontroller into the thermal printhead, connecting components such as the heating element and clock signal line to the microcontroller. An external interface is provided for connecting a fan, thus eliminating the need for separate circuitry and programming on the main control board for thermal printhead temperature control, simplifying the main control board's circuitry and programming. During printing, the method checks whether the preheating and heat dissipation thresholds of the thermal printhead are within the effective temperature range. If so, the microcontroller calculates the thermal printhead temperature. If the thermal printhead temperature is lower than the preheating threshold, and the heating time has not exceeded the timeout, the method checks whether the thermal printhead temperature exceeds the heat dissipation threshold. If so, the microcontroller controls the fan to turn on. When a signal transition is detected on the clock signal line, the microcontroller controls the heating element to turn off and simultaneously controls the fan for heat dissipation. Therefore, based on microcontroller control and by setting a series of corresponding temperature control measures, the thermal printhead has an automatic temperature adjustment function. When the main control board is connected to the thermal printhead, the internal preheating and heat preservation functions of the thermal printhead can be realized. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1a A schematic bottom view showing the distribution of electronic components on a thermal printhead;
[0036] Figure 1b A top view showing the distribution of electronic components on a thermal printhead;
[0037] Figure 2 This is a schematic diagram of an interface connection for a single-chip microcomputer (MCU).
[0038] Figure 3 This is a schematic diagram of a temperature detection circuit for a thermistor.
[0039] Figure 4 This is a schematic diagram of the control circuit for a heating element;
[0040] Figure 5 A schematic diagram of a fan control circuit;
[0041] Figure 6 A flowchart illustrating the steps of a thermal printhead temperature control method;
[0042] Figure 7 This is a schematic diagram of the overall process of a thermal printhead temperature control method.
[0043] Figure 8 This is a structural block diagram of a thermal printhead temperature control device. Detailed Implementation
[0044] This invention provides a thermal printhead temperature control method, apparatus, electronic device, and storage medium to solve or partially solve the technical problem that existing thermal printhead temperature control methods require external circuitry and program support.
[0045] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0046] As an example, a thermal printhead is equipped with a thermistor and a heating element, but a main control board is needed to detect the thermistor and control the heating element, and the main control board needs to be connected to a fan. Currently, during printing, the thermal printhead requires external control of the heating element or fan and temperature detection; that is, it requires the support of external circuitry and software to keep the thermal printhead within a certain temperature range.
[0047] Therefore, one of the core inventive points of this invention is to provide a temperature control method for a thermal printhead, addressing the shortcomings of existing technologies. By integrating a microcontroller onto the thermal printhead, the thermistor, heating element, and clock signal line on the thermal printhead are connected to the microcontroller. Simultaneously, the external interfaces for the thermistor and heating element on the thermal printhead are eliminated, while an external interface is reserved for connecting a fan. This eliminates the need for circuitry and programming related to thermal printhead temperature control on the main control board, simplifying its circuitry and programming. Based on microcontroller control, a series of corresponding temperature control methods are set up, enabling the thermal printhead to automatically adjust its temperature. When the main control board is connected to the thermal printhead, the internal preheating and heat preservation functions of the thermal printhead can be realized.
[0048] In this embodiment of the invention, a microcontroller is integrated into the thermal printhead. For example, Figure 1a This is a schematic bottom view illustrating the distribution of electronic components on a thermal printhead according to an embodiment of the present invention. Figure 1b This will be the corresponding top view.
[0049] in, Figure 1a This is mainly to provide supplementary explanation of the positional relationship between the microcontroller and the thermal printhead. Figure 1b The purpose of this description is to briefly explain the location of the main electronic components of the thermal printhead (thermal resistor, heating element, capacitor, and external fan interface), therefore other unrelated components are not labeled.
[0050] The thermal printhead includes a heating element, clock signal lines (corresponding to CLK1, CLK2, and CLK3 pins in the CON1 interface), and multiple thermistors (up to five thermistors can be supported simultaneously). Figure 1b The five thermistors shown are connected to the microcontroller, and the external interface of the thermal printhead (corresponding to the CON4 interface) is used to connect the fan.
[0051] CON1 is the data and control port for the thermal printhead, primarily used for printing images. The specific definitions of its pins are shown in Table 1 below:
[0052] 1 VDD Logic Power Supply 31 GND land 2 GND land 32 CLK3 Clock 3 3 GND land 33 DI13 Data 13 4 GND land 34 DI12 Data 12 5 GND land 35 DI11 Data 11 6 GND land 36 DI10 Data 10 7 GND land 37 DI9 Data 9 8 GND land 38 DI8 Data 8 9 GND land 39 DI7 Data 7 10 GND land 40 DI6 Data 6 11 GND land 41 DI5 Data 5 12 GND land 42 DI4 Data 4 13 GND land 43 D13 Data 3 14 GND land 44 CLK2 Clock 2 15 GND land 45 GND land 16 CLK1 Clock 1 46 GND land 17 DI2 Data 2 47 GND land 18 DI1 Data 1 48 / STB2 Select 2 19 GND land 49 / LAT2 Latch 2 20 GND land 50 GND land 21 / LAT1 Latch 1 51 GND land 22 / STB1 Select 1 52 GND land 23 NC null 53 NC null 24 GND land 54 SDA IIC data cable 25 GND land 55 SCL IIC clock line 26 GND land 56 GND land 27 NC null 57 NC null 28 GND land 58 GND land 29 GND land 59 GND land 30 GND land 60 VH Power supply
[0053] Table 1: CON1 Pin Definitions for Thermal Printhead
[0054] CON2 is the logic power port for the thermal printhead. The specific definitions of its pins are shown in Table 2 below.
[0055] 1 VDD Logic Power Supply 2 VDD Logic Power Supply 3 GND land 4 GND land
[0056] Table 2: CON2 Pin Definitions for Thermal Printhead
[0057] CON3 is the power supply port for the thermal printhead. The specific definitions of its pins are shown in Table 3 below:
[0058] 1 GND land 6 VH Power supply 2 GND land 7 VH Power supply 3 GND land 8 VH Power supply 4 GND land 9 VH Power supply 5 GND land 10 VH Power supply
[0059] Table 3: CON3 Pin Definitions for Thermal Printhead
[0060] CON4 is the fan control detection port. The specific definitions of its pins are shown in Table 4 below:
[0061] 1 FAN1_CTL Fan 1 control 2 GND land 3 FAN1_CHECK Fan 1 Detection 4 FAN2_CTL Fan 2 control 5 GND land 6 FAN2_CHECK Fan 2 detection
[0062] Table 4: CON4 Pin Definitions for Thermal Printhead
[0063] For example, Figure 2 This is a schematic diagram of the interface connection of a single-chip microcomputer (MCU).
[0064] Among them, FAN1 and FAN2 are the control signals for fan 1 and fan 2, respectively. TEMP1, TEMP2, TEMP3, TEMP4, and TEMP5 are the ADC (Analog-to-Digital Converter) detection signals for thermistors 1 to 5, respectively. NRST is the reset signal for the microcontroller unit (MCU). HEAT_CTL is the control signal for the heating element. FAN1_CHECK and FAN2_CHECK are the detection signals for fan 1 and fan 2, respectively. SDA and SCL are the data and clock lines of the IIC (Inter-Integrated Circuit) bus, respectively. CLOCK1, CLOCK2, and CLOCK3 are the detection signals for the clock signal line of the thermal printhead. The SWIM signal is used for programming.
[0065] Based on the above design, during temperature control, the microcontroller can detect the thermistors on the thermal printhead (up to 5 thermistors are supported) and calculate the temperature of the thermal printhead based on the detection results. The thermal printhead can communicate externally via the IIC bus. Technicians can preset a preheating threshold (also known as a heating threshold) and a heat dissipation threshold, storing both thresholds in the microcontroller's flash memory (a non-volatile memory integrated within the microcontroller chip).
[0066] If the temperature of the thermal printhead is lower than the preheating threshold, the heating element is turned on by the microcontroller. If the temperature of the thermal printhead is higher than the heat dissipation threshold, the external fan (up to two fans can be supported) connected to the thermal printhead is turned on by the microcontroller for heat dissipation.
[0067] The thermal printhead can determine whether to print an image via a clock signal line (supporting up to 3 clock signals). If printing is required, the heating resistor on the thermal printhead will generate high temperatures during printing, and the temperature will only increase. At this time, the heating element cannot heat up. The microcontroller can be used to control and shut down the heating element to stop heating, while an external fan is turned on for auxiliary cooling to prevent overheating during printing.
[0068] For example, taking a thermal printhead with 5 thermistors as an example, Figure 3 A schematic diagram of a temperature detection circuit using a thermistor is shown.
[0069] Figure 4 A schematic diagram of the control circuit for a heating element is shown.
[0070] The HEAT_CTL heating element control signal drives the NMOS component Q9 to the off state through a high level, grounding HEAT_CTL_OUT and thus heating the heating element.
[0071] Figure 5 A schematic diagram of a fan control circuit;
[0072] Specifically, the FAN1 fan control signal drives the NMOS component Q7 to the off state via a high level, grounding FAN1_OUT and thus enabling fan 1 to run. The FAN2 fan control signal drives the NMOS component Q8 to the off state via a high level, grounding FAN2_OUT and thus enabling fan 2 to run.
[0073] To better illustrate the technical solution of the present invention, the following description is provided in conjunction with the foregoing embodiments and references. Figure 6The diagram illustrates a flowchart of a thermal printhead temperature control method according to an embodiment of the present invention, which may specifically include the following steps:
[0074] Step 601: Determine whether the preheating threshold and heat dissipation threshold of the thermal printhead are within the effective temperature range. If so, calculate the temperature of the thermal printhead using the microcontroller.
[0075] In practical implementation, we can first determine whether the preheating threshold and heat dissipation threshold of the thermal printhead are within the effective temperature range, such as 35℃ < preheating threshold < 45℃, 40℃ < heat dissipation threshold < 50℃, and preheating threshold + 5℃ <= heat dissipation threshold. If these conditions are met, then we can proceed to calculate the thermal printhead problem.
[0076] When the preheating threshold and / or the heat dissipation threshold are not within the effective temperature range, the microcontroller records a temperature error flag indicating that the preset temperature value is not within the effective range, and sets the preheating threshold to the default preheating threshold and / or the heat dissipation threshold to the default heat dissipation threshold. If the preheating threshold does not meet the above conditions, the default preheating threshold of 40℃ is set; if the heat dissipation threshold does not meet the above conditions, the default heat dissipation threshold of 45℃ is set.
[0077] When both the preheating threshold and the heat dissipation threshold are within the effective temperature range, the temperature of the thermal printhead is further calculated by the microcontroller, specifically as follows:
[0078] The microcontroller reads the resistance values of multiple thermistors; for each thermistor, the thermistor temperature is calculated based on the thermistor temperature calculation formula at the resistance value; the average of the multiple thermistor temperatures is obtained to get the thermal printhead temperature.
[0079] The formula for calculating the temperature of a thermistor is shown below:
[0080] R=R25×exp B{1 / (T+273)-1 / (25+273)}
[0081] In the above formula, R represents the resistance value of the thermistor at temperature T (unit: degrees Celsius °C); R25 represents the resistance value of the thermistor at the reference temperature T_ref (unit: degrees Celsius °C), which is usually 25 °C; B represents the temperature coefficient of the thermistor, also known as the B value, which is a material constant specific to the thermistor; T represents the actual temperature corresponding to the thermistor value to be calculated; 273 represents the conversion constant from Kelvin K to degrees Celsius °C.
[0082] Step 602: If the temperature of the thermal printhead is less than the preheating threshold and the heating time of the thermal printhead has not exceeded the timeout, then determine whether the temperature of the thermal printhead is greater than the heat dissipation threshold. If so, then control the fan to be turned on through the microcontroller.
[0083] In the specific implementation, if the temperature of the thermal printhead is lower than the preheating threshold and the heating time of the thermal printhead has not exceeded the timeout, then it is determined whether the temperature of the thermal printhead is greater than the heat dissipation threshold. This can be done by: determining whether the temperature of the thermal printhead is lower than the preheating threshold; if so, determining whether a heating timeout has been set for the thermal printhead; if so, determining whether the heating time of the thermal printhead has exceeded the timeout; if the heating time of the thermal printhead has not exceeded the timeout, then determining whether the temperature of the thermal printhead is greater than the heat dissipation threshold.
[0084] As an optional embodiment, when the temperature of the thermal printhead is greater than or equal to the preheating threshold, it indicates that the temperature of the thermal printhead is high. The heating element can be turned off by the microcontroller, and the process can jump to the step of determining whether the temperature of the thermal printhead is greater than the heat dissipation threshold.
[0085] As an alternative embodiment, when no heating timeout is set, a heating timeout can be set for the thermal printhead, and the heating element can be turned on by controlling the microcontroller.
[0086] As an optional embodiment, when the heating time of the thermal printhead exceeds the limit, the microcontroller records the timeout error flag and controls the heating element to be turned off.
[0087] When the thermal printhead temperature is below the preheating threshold, the thermal printhead heating time has not exceeded the timeout, and the thermal printhead temperature is above the heat dissipation threshold, the microcontroller controls the fan to turn on for auxiliary heat dissipation.
[0088] Furthermore, to enable technicians to better understand the fan's status and to avoid problems such as insufficient heat dissipation due to fan malfunctions, fan feedback can be pre-configured via IIC communication. When the microcontroller controls the fan's on / off state, it can determine whether fan feedback is configured. If no feedback is configured, it directly jumps to the signal transition judgment step. If feedback is configured, it checks whether the fan feedback is normal. If the fan feedback is normal, it continues to the next signal transition judgment step. If the fan feedback is abnormal, a fan abnormality error flag is recorded (this error flag can also be fed back via IIC communication so that technicians can understand it in real time), and then the signal transition judgment step is executed.
[0089] Step 603: When a signal transition is detected on the clock signal line, the microcontroller controls the heating element to turn off and simultaneously controls the fan to dissipate heat.
[0090] The system checks if a rising edge transition has occurred on clock1, clock2, or clock3 (a rising edge on any of the clock signals indicates that the thermal printhead is printing an image). When a rising edge transition is detected on the clock signal line, the microcontroller controls the heating element to shut down and simultaneously controls the fan for heat dissipation. If no rising edge transition occurs on the clock signal line, the system jumps to the step of reading the resistance value of the thermistor to calculate the temperature of the thermal printhead.
[0091] This invention provides a method for temperature control of a thermal printhead. By integrating a microcontroller into the thermal printhead, components such as the heating element and clock signal line on the printhead are connected to the microcontroller. An external interface is provided for connecting a fan, thus eliminating the need for separate circuitry and programming for temperature control on the main control board, simplifying its circuitry and programming. During printing, based on microcontroller control, a series of corresponding temperature control measures enable the thermal printhead to automatically adjust its temperature. When the main control board is connected to the thermal printhead, internal preheating and heat preservation functions of the thermal printhead can be achieved.
[0092] For better explanation, refer to Figure 7 This diagram illustrates the overall flow of a thermal printhead temperature control method according to an embodiment of the present invention. It should be noted that this embodiment only provides a brief description of the general flow of thermal printhead temperature control. The specific implementation process of each step can be understood by referring to the relevant content in the foregoing embodiments, and will not be elaborated upon here. It is understood that the present invention does not impose any limitations on this.
[0093] 1. Read the preheating threshold and heat dissipation threshold stored in the microcontroller's internal flash memory, and determine whether these two thresholds are within a valid range. For example, based on general experience, set 35℃ < preheating threshold < 45℃, 40℃ < heat dissipation threshold < 50℃, and preheating threshold + 5℃ <= heat dissipation threshold. These two thresholds can be set and obtained through IIC communication.
[0094] 2. If the preheating threshold and heat dissipation threshold are not within the valid range, record the corresponding error flag, and set the default preheating threshold to 40℃ and the heat dissipation threshold to 45℃. The error flag can be reported during IIC communication.
[0095] 3. The ADC inside the microcontroller reads the pins corresponding to all thermistors, calculates the temperature of each thermistor according to the thermistor temperature calculation formula, and calculates the temperature of the thermal printhead by using the arithmetic mean method.
[0096] 4. Determine if the temperature of the thermal printhead is lower than the preheating threshold. If yes, proceed to step 5; otherwise, turn off the heating element and proceed to step 7.
[0097] 5. Determine if a heating timeout has been set. If yes, proceed to step 6; otherwise, set the heating timeout and control the heating element to turn on via the microcontroller.
[0098] 6. Determine if the heating timeout has occurred. If not, proceed to step 7. If the heating timeout has occurred, record the corresponding error flag and control the heating element to shut down via the microcontroller.
[0099] 7. Determine if the temperature of the thermal printhead is greater than the heat dissipation threshold. If so, turn on the fan via the microcontroller and proceed to step 8; otherwise, turn off the fan and proceed to step 10.
[0100] 8. Determine whether fan feedback is set (whether the fan needs feedback can be set via IIC communication). If yes, proceed to step 9; otherwise, proceed to step 10.
[0101] 9. Determine if the fan feedback is normal. If yes, proceed to step 10; otherwise, record the corresponding error flag and then proceed to step 10.
[0102] 10. Determine whether clock1, clock2, or clock3 has experienced a rising edge transition (a rising edge of one of the clock signals indicates that the print head is printing an image). If so, control the microcontroller to turn off the heating element to stop heating, and simultaneously control the fan to dissipate heat. Then, proceed to step 8; otherwise, proceed to step 3.
[0103] Reference Figure 8 This diagram illustrates a structural block diagram of a thermal printhead temperature control device according to an embodiment of the present invention. The thermal printhead integrates a microcontroller, and the heating element and clock signal line on the thermal printhead are respectively connected to the microcontroller. An external interface of the thermal printhead is connected to a fan. Specifically, the device may include:
[0104] The thermal printhead temperature calculation module 801 is used to determine whether the preheating threshold and heat dissipation threshold of the thermal printhead are within the effective temperature range. If so, the thermal printhead temperature is calculated by the microcontroller.
[0105] The thermal printhead temperature judgment module 802 is used to determine whether the thermal printhead temperature is greater than the heat dissipation threshold when the thermal printhead temperature is less than the preheating threshold and the heating time of the thermal printhead has not exceeded the timeout. If so, the microcontroller controls the fan to turn on.
[0106] The signal transition judgment module 803 is used to control the microcontroller to turn off the heating element and control the fan to dissipate heat when a signal transition is detected on the clock signal line.
[0107] In one optional embodiment, a plurality of thermistors on the thermal printhead are connected to the microcontroller, and the thermal printhead temperature calculation module 801 includes:
[0108] A thermistor value reading module is used to read the resistance values of multiple thermistors respectively through the microcontroller;
[0109] The thermistor temperature calculation module is used to calculate the thermistor temperature of each thermistor at the resistance value based on the thermistor temperature calculation formula.
[0110] The thermal temperature average value calculation module is used to calculate the average value of multiple thermal temperatures to obtain the thermal printhead temperature.
[0111] In one optional embodiment, the thermal printhead temperature determination module 802 is specifically used for:
[0112] Determine whether the temperature of the thermal printhead is lower than the preheating threshold. If so, determine whether a heating timeout has been set for the thermal printhead. If so, determine whether the heating time of the thermal printhead has exceeded the timeout.
[0113] If the heating time of the thermal printhead has not exceeded the time limit, then it is determined whether the temperature of the thermal printhead is greater than the heat dissipation threshold.
[0114] In an optional embodiment, the thermal printhead temperature determination module 802 is further specifically used for:
[0115] When the temperature of the thermal printhead is greater than or equal to the preheating threshold, the heating element is turned off by the microcontroller, and the process jumps to the step of determining whether the temperature of the thermal printhead is greater than the heat dissipation threshold.
[0116] In an optional embodiment, the thermal printhead temperature determination module 802 is further specifically used for:
[0117] If no heating timeout is set, a heating timeout is set for the thermal printhead, and the heating element is turned on by the microcontroller.
[0118] In an optional embodiment, the thermal printhead temperature determination module 802 is further specifically used for:
[0119] If the heating time of the thermal printhead exceeds the limit, the microcontroller records the timeout error and controls the heating element to be turned off.
[0120] In one alternative embodiment, the device further includes:
[0121] The default temperature setting module is used to record a temperature error flag by the microcontroller and set the preheating threshold to the default preheating threshold and / or the heat dissipation threshold to the default heat dissipation threshold when the preheating threshold and / or the heat dissipation threshold are not within the effective temperature range.
[0122] As the device embodiment is basically similar to the method embodiment, it is described in a relatively simple way. For relevant details, please refer to the description of the method embodiment above.
[0123] This invention also provides an electronic device, which includes a processor and a memory:
[0124] The memory is used to store program code and transfer the program code to the processor;
[0125] The processor is used to execute the thermal printhead temperature control method of any embodiment of the present invention according to the instructions in the program code.
[0126] This invention also provides a computer-readable storage medium for storing program code for executing the thermal printhead temperature control method of any embodiment of the invention.
[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0128] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0130] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0132] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for controlling the temperature of a thermal printhead, characterized in that, The thermal printhead integrates a microcontroller. The heating element and clock signal line on the thermal printhead are connected to the microcontroller. The external interface of the thermal printhead is connected to a fan. The clock signal line is used to determine whether to print an image, and supports three clock signals. The method includes: Determine whether the preheating threshold and heat dissipation threshold of the thermal printhead are within the effective temperature range. If so, calculate the temperature of the thermal printhead using the microcontroller. If the temperature of the thermal printhead is less than the preheating threshold and the heating time of the thermal printhead has not exceeded the timeout, then it is determined whether the temperature of the thermal printhead is greater than the heat dissipation threshold. If so, the fan is turned on by controlling the microcontroller. When a signal transition is detected in any of the clock signals on the clock signal line, the microcontroller controls the heating element to shut down and simultaneously controls the fan to dissipate heat. The step of determining whether the thermal printhead temperature is greater than the heat dissipation threshold if the thermal printhead temperature is less than the preheating threshold and the heating time of the thermal printhead has not exceeded the timeout includes: determining whether the thermal printhead temperature is less than the preheating threshold; if so, determining whether a heating timeout time has been set for the thermal printhead; if so, determining whether the heating time of the thermal printhead has exceeded the timeout; if the heating time of the thermal printhead has not exceeded the timeout, determining whether the thermal printhead temperature is greater than the heat dissipation threshold.
2. The thermal printhead temperature control method according to claim 1, characterized in that, The multiple thermistors on the thermal printhead are connected to the microcontroller, and the calculation of the thermal printhead temperature by the microcontroller includes: The microcontroller reads the resistance values of the multiple thermistors respectively. For each of the thermistors, the thermistor temperature at the resistance value is calculated based on the thermistor temperature calculation formula. The average value of the multiple thermal temperatures is calculated to obtain the thermal printhead temperature.
3. The thermal printhead temperature control method according to claim 1, characterized in that, Also includes: When the temperature of the thermal printhead is greater than or equal to the preheating threshold, the heating element is turned off by the microcontroller, and the process jumps to the step of determining whether the temperature of the thermal printhead is greater than the heat dissipation threshold.
4. The thermal printhead temperature control method according to claim 1, characterized in that, Also includes: If no heating timeout is set, a heating timeout is set for the thermal printhead, and the heating element is turned on by the microcontroller.
5. The thermal printhead temperature control method according to claim 1, characterized in that, Also includes: If the heating time of the thermal printhead exceeds the limit, the microcontroller records the timeout error and controls the heating element to be turned off.
6. The thermal printhead temperature control method according to claim 1, characterized in that, Also includes: When the preheating threshold and / or the heat dissipation threshold are not within the effective temperature range, the microcontroller records a temperature error flag and sets the preheating threshold to the default preheating threshold and / or the heat dissipation threshold to the default heat dissipation threshold.
7. A thermal printhead temperature control device, characterized in that, The thermal printhead integrates a microcontroller. The heating element and clock signal line on the thermal printhead are connected to the microcontroller. An external interface of the thermal printhead is connected to a fan. The clock signal line is used to determine whether to print an image, and supports three clock signals. The device includes: The thermal printhead temperature calculation module is used to determine whether the preheating threshold and heat dissipation threshold of the thermal printhead are within the effective temperature range. If so, the thermal printhead temperature is calculated by the microcontroller. The thermal printhead temperature judgment module is used to determine whether the thermal printhead temperature is greater than the heat dissipation threshold when the thermal printhead temperature is less than the preheating threshold and the heating time of the thermal printhead has not exceeded the timeout. If so, the microcontroller controls the fan to turn on. The signal transition detection module is used to control the microcontroller to shut down the heating element and control the fan to dissipate heat when a signal transition is detected in any of the clock signals on the clock signal line. Specifically, the thermal printhead temperature judgment module is used to: determine whether the temperature of the thermal printhead is less than the preheating threshold; if so, determine whether a heating timeout has been set for the thermal printhead; if so, determine whether the heating time of the thermal printhead has exceeded the timeout; if the heating time of the thermal printhead has not exceeded the timeout, determine whether the temperature of the thermal printhead is greater than the heat dissipation threshold.
8. An electronic device, characterized in that, The device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the thermal printhead temperature control method according to any one of claims 1-6 according to the instructions in the program code.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code for executing the thermal printhead temperature control method according to any one of claims 1-6.
Citation Information
Patent Citations
Thermal printing head
CN202764430U
Intelligence control by temperature change thermal printer
CN206551708U
Method for controlling temperature of heat generating element of thermal printing head and circuit for practising same
US4496824A