Method for detecting a stepper motor, device and method for detecting a thermal printer

By detecting changes in the winding current of the stepper motor and utilizing self-protection functions and preset relationship tables, the problem of inconsistent printing results caused by differences in stepper motors of different thermal printer models was solved, achieving accurate identification of printer models and parameter optimization.

CN116691174BActive Publication Date: 2026-06-05SHANGHAI SUMI TECH CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI SUMI TECH CO LTD
Filing Date
2023-06-19
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Different models of thermal printers produce inconsistent print quality due to differences in their stepper motors, and current technology cannot effectively detect and ensure compatibility.

Method used

By controlling the rise and fall of the stepper motor winding current, recording the first duration and the stopping current, and utilizing the self-protection function of the motor drive circuit, the stepper motor model is determined, and the printer model is determined by combining the preset relationship table.

Benefits of technology

The stepper motor model can be identified through software without disassembling the thermal printer, enabling accurate printer model determination, optimization of printing parameter settings, and improvement of printing results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116691174B_ABST
    Figure CN116691174B_ABST
Patent Text Reader

Abstract

The application provides a detection method and device of a stepping motor, a detection method of a thermal printer and a thermal printer comprising the detection device. The detection method comprises the following steps: S11, controlling the stepping motor to continuously rotate, so that the winding current of the stepping motor continuously rises; S12, when the winding current reaches the chopping current, the motor drive circuit starts the self-protection function, so that the winding current stops rising and starts falling, and a first time length required for the winding current to rise from 0A to the chopping current is obtained; S13, after the winding current falls for a preset second time length, the winding current reaches the stop current, and the stop current is obtained; and S14, the model of the stepping motor is judged according to the first time length and the stop current. The model of the stepping motor and the model of the printer are obtained by the software method, so that the printing parameters are set according to the model of the printer, and good printing effect is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates primarily to the technical field of thermal printers, and more particularly to a stepper motor detection method, a device, a thermal printer detection method, and a thermal printer including the detection device. Background Technology

[0002] Thermal printers are widely used in POS terminals, cash registers, medical equipment, and other applications. For devices that support thermal printers, manufacturers consider compatibility with different thermal printer models under the same hardware and software conditions, for reasons such as supply and price. For a given device, the connection methods and PIN codes for different manufacturers and models of thermal printers may be the same, so hardware compatibility is not an issue. However, even with the same software parameters, differences in the resistance of the printer's heating head and the integrated stepper motor in the printer module can lead to inconsistent printing results between different models. This means that the same software parameters cannot guarantee compatibility between different printer models.

[0003] If different printer models have inconsistent heating head resistance values, a voltage divider method can be used, with a fixed pull-up resistor and the heating head resistor as the base. By detecting the different voltage division values, the resistance values ​​of the heating heads can be determined, thus identifying the printer model. However, when different printer models have the same heating head resistance value, this method cannot be used to determine the printer model. Currently, there is no way to detect differences in the integrated stepper motors of different printer models; therefore, the differences in print quality resulting from different printer models must be accepted. Summary of the Invention

[0004] The technical problem to be solved by this application is to provide a detection method, a detection device, a detection method for a thermal printer, and a thermal printer including the detection device, which can detect differences in stepper motors.

[0005] To address the aforementioned technical problems, this application provides a method for detecting a stepper motor, comprising:

[0006] Step S11: Control the stepper motor to rotate continuously, so that the winding current of the stepper motor continues to rise.

[0007] Step S12: When the winding current reaches the chopping current, the motor drive circuit activates the self-protection function, causing the winding current to stop rising and begin to fall, thus obtaining the first time required for the winding current to reach the chopping current from 0A.

[0008] Step S13: After the winding current decreases for a preset second time period, the winding current reaches the stopping current, and the stopping current is obtained; and

[0009] Step S14: Determine the model of the stepper motor based on the first duration and the stopping current.

[0010] In one embodiment of this application, before step S11, the method further includes: step S10: pre-testing the target first duration and target stopping current of different models of stepper motors to obtain the correspondence between the model of the stepper motor and the target first duration and the target stopping current; and

[0011] Step S14 includes: comparing the first duration with the target first duration, comparing the stop current with the target stop current, and determining the model of the stepper motor based on the comparison result.

[0012] In one embodiment of this application, step S10 includes:

[0013] Step S101: Control the stepper motor to rotate continuously, so that the winding current of the stepper motor continues to rise;

[0014] Step S102: When the winding current reaches the target chopping current, the motor drive circuit activates the self-protection function, causing the winding current to stop rising and begin to fall, thereby obtaining the target first time required for the winding current to reach the target chopping current from 0A.

[0015] Step S103: After the winding current decreases for a preset target second time period, the winding current reaches the target stopping current, and the target stopping current is obtained;

[0016] Step S104: Repeatedly execute steps S101 to S103, recording the first range of the first duration of the target and the second range of the target stopping current; and

[0017] Step S105: Establish the correspondence between the model of the stepper motor and the first range and the second range.

[0018] In one embodiment of this application, step S10 further includes: measuring the first range and the second range at different power supply voltages, and establishing the correspondence between the different power supply voltages.

[0019] In one embodiment of this application, step S14 includes: when the first duration is within a first range and the stop current is within a second range, determining the model of the stepper motor according to the correspondence.

[0020] In one embodiment of this application, in step S11, the stepper motor is controlled to continuously rotate in the forward direction or in the reverse direction.

[0021] In one embodiment of this application, when performing step S11, the initial value of the winding current of the stepper motor is 0A.

[0022] In one embodiment of this application, the stopping current is greater than 0A.

[0023] In one embodiment of this application, after step S13, the method further includes:

[0024] Step S131: Repeat steps S11 to S13 to obtain multiple stopping currents; and

[0025] Step S132: Use the average value of the multiple stop currents as the stop current of the stepper motor.

[0026] In one embodiment of this application, the second duration is different for different models of stepper motors.

[0027] In one embodiment of this application, the motor drive circuit has a first control signal input terminal and a second control signal input terminal. In step S11, the controller continuously inputs a high level to the first control signal input terminal and continuously inputs a low level to the second control signal input terminal, thereby causing the stepper motor to rotate continuously and causing the winding current of the stepper motor to rise continuously.

[0028] In one embodiment of this application, the motor drive circuit has a current detection pin, and the detection method further includes: the controller acquiring the winding current in real time through the current detection pin.

[0029] In one embodiment of this application, a resistor with a fixed resistance value is connected to the current detection pin, and the detection method further includes: the controller obtains the voltage value on the resistor in real time, and calculates the winding current in real time based on the voltage value.

[0030] To address the aforementioned technical problems, this application also proposes a method for detecting a thermal printer, characterized in that the thermal printer includes a stepper motor, and the detection method includes: detecting the model of the stepper motor using the stepper motor detection method described above, and determining the printer model of the thermal printer based on the model.

[0031] To address the aforementioned technical problems, this application also proposes a stepper motor detection device, characterized in that it comprises: a motor drive circuit for driving the rotation of the stepper motor and having a self-protection function; when the winding current of the stepper motor reaches the chopping current, the motor drive circuit activates the self-protection function to stop the winding current from rising and start to fall; a memory for storing instructions that can be executed by a controller; and a controller for executing the instructions to implement the detection method described above.

[0032] To solve the above-mentioned technical problems, this application also proposes a thermal printer, characterized in that it includes a stepper motor detection device as described above.

[0033] The stepper motor detection method of this application obtains the stepper motor model by controlling the stepper motor's operation and recording the winding current and stopping current. This method is simple and easy to implement. When the stepper motor is integrated into a thermal printer, this detection method eliminates the need to disassemble the thermal printer. Instead, the stepper motor model can be obtained through software, which in turn leads to the thermal printer model. This allows for the setting of appropriate printing parameters based on the printer model, resulting in good printing quality. Attached Figure Description

[0034] The accompanying drawings are included to provide a further understanding of this application; they are incorporated into and constitute a part of this application. The drawings illustrate embodiments of this application and, together with this specification, serve to explain the principles of the invention. In the drawings:

[0035] Figure 1 This is an exemplary flowchart of a stepper motor detection method according to an embodiment of this application;

[0036] Figure 2 This is an exemplary circuit diagram of a control circuit including a stepper motor according to an embodiment of this application;

[0037] Figure 3 It is based on Figure 2 The timing waveform diagram of some signals in the control circuit of the illustrated embodiment is shown.

[0038] Figure 4 This is an exemplary circuit diagram of another control circuit, including a stepper motor according to an embodiment of this application.

[0039] Figure 5 This is a block diagram of a stepper motor detection device according to an embodiment of this application. Detailed Implementation

[0040] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some examples or embodiments of this application. For those skilled in the art, these drawings can be applied to other similar scenarios without creative effort. Unless obvious from the context or otherwise specified, the same reference numerals in the drawings represent the same structures or operations.

[0041] As indicated in this application and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" are not specifically singular and may include plural forms. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of explicitly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0042] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of this application. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following drawings denote similar items; therefore, once an item is defined in one drawing, it need not be further discussed in subsequent drawings.

[0043] Furthermore, it should be noted that the use of terms such as "first" and "second" to define components is merely for the purpose of distinguishing the corresponding components. Unless otherwise stated, these terms have no special meaning and therefore should not be construed as limiting the scope of protection of this application. In addition, although the terminology used in this application is selected from commonly known and used terms, some terms mentioned in this application's specification may have been chosen by the applicant according to his or her judgment, and their detailed meanings are explained in the relevant sections of this description. Moreover, this application should be understood not only through the actual terms used, but also through the meaning implied by each term.

[0044] Flowcharts are used in this application to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, various steps can be processed in reverse order or simultaneously. Furthermore, other operations may be added to these processes, or one or more steps may be removed from these processes.

[0045] The stepper motor detection method of this application can be used for any type of stepper motor, including but not limited to stepper motors integrated in thermal printers. A stepper motor can also be referred to as a stepper motor.

[0046] Figure 1 This is an exemplary flowchart of a stepper motor detection method according to an embodiment of this application. (See reference...) Figure 1 As shown, the detection method of this embodiment includes the following steps:

[0047] Step S11: Control the stepper motor to rotate continuously, so that the winding current of the stepper motor continues to rise.

[0048] Step S12: When the winding current reaches the chopping current, the motor drive circuit activates the self-protection function, causing the winding current to stop rising and begin to fall, thus obtaining the first time required for the winding current to reach the chopping current from 0A.

[0049] Step S13: After the winding current decreases for a preset second time period, the winding current reaches the stopping current, thus obtaining the stopping current; and

[0050] Step S14: Determine the model of the stepper motor based on the first duration and the stopping current.

[0051] The steps S11 to S14 described above are explained below with reference to the accompanying drawings.

[0052] Figure 2 This is an exemplary circuit diagram of a control circuit including a stepper motor according to an embodiment of this application. The following is combined with... Figure 2 First, let's explain the working principle of the stepper motor 201. (Reference) Figure 2As shown, a controller 210, a motor drive circuit 220, and a stepper motor 201 are illustrated. The motor drive circuit 220 is directly electrically connected to the stepper motor 201 and controls the movement of the stepper motor 201 according to received drive commands. Specifically, the motor drive circuit 220 includes a pulse width modulation (PWM) module 221 and a pre-drive module 222. The PWM module 221 receives control signals from the controller 210 and sends the modulated control signals to the pre-drive module 222. The pre-drive module 222 is connected to four MOSFETs Q1-Q4 and is controlled by its internal control logic, allowing the four MOSFETs Q1-Q4 to be turned on or off according to the control signals. For example, when it is necessary to drive the stepper motor 201 to rotate, the controller 210 inputs pulse width modulation signals through the two pins xIN1 and xIN2 of the pulse width modulation module 221, respectively, so that Q1 and Q4 are turned on and Q2 and Q3 are turned off, then the stepper motor 201 rotates in the forward direction; if Q2 and Q3 are turned on and Q1 and Q4 are turned off, then the stepper motor 201 rotates in the reverse direction.

[0053] Figure 2 The example shown is for illustrative purposes only and is not intended to limit the specific connection and control relationship between the MOSFET and the stepper motor 201.

[0054] It should be noted that MOSFETs Q1~Q4 belong to the internal circuitry of the motor drive circuit 220. Figure 2 VM, xOUT1, xOUT2, and xISEN are used to represent the pins of the motor drive circuit 220. VM represents the power supply pin, which is used to connect to an external power source. xOUT1 and xOUT2 are the output signal pins that output to the stepper motor 201. xISEN is the current detection pin.

[0055] The motor drive circuit 220 in this application has a self-protection function. When the set conditions are met, the motor drive circuit 220 will activate this self-protection function to prevent the stepper motor 201 from experiencing unexpected risks. (Reference) Figure 2 In this embodiment, the xISEN pin is a current sensing pin, connected to an external resistor R with a known fixed resistance value. The current value on the xISEN pin, representing the winding current of the stepper motor 201, can be obtained by detecting the voltage across the resistor R. The motor drive circuit 220 also includes a comparator 223, one input of which is connected to the xISEN pin, and the other input is connected to a fixed reference voltage REF. Figure 2The connection shown uses comparator 223 to compare the current value of the xISEN pin with the fixed reference voltage REF. Assuming REF = 200mV, when the voltage value of the xISEN pin reaches 200mV, it indicates that the winding current of the stepper motor 201 has reached the chopping current Ichop = 200mV / R. When the winding current is greater than Ichop, comparator 223 outputs a feedback signal to the pulse width modulation module 221. The pulse width modulation module 221 reverse-controls the MOSFET to turn off, preventing the winding current from exceeding the maximum current of the motor winding and burning out the stepper motor 201.

[0056] refer to Figure 1 and Figure 2 In step S11, the controller 210 can control the stepper motor 201 to rotate continuously, so that the winding current of the stepper motor 201 continues to rise.

[0057] This application does not restrict whether the stepper motor 201 rotates in the forward or reverse direction.

[0058] In some embodiments, reference Figure 2 Let xIN1 represent the first control signal input terminal of the motor drive circuit 220, and xIN2 represent the second control signal input terminal. In step S11, the controller 210 continuously inputs a high level to the first control signal input terminal xIN1 and continuously inputs a low level to the second control signal input terminal xIN2, thereby causing the stepper motor 201 to rotate continuously and causing the winding current of the stepper motor 201 to rise continuously.

[0059] Figure 3 It is based on Figure 2 The diagram shows the timing waveforms of some signals in the control circuit of the illustrated embodiment. Figure 3 As shown, the timing waveforms of four signals—xIN1, xIN2, xOUT1, and Drive Current—are illustrated. Drive Current represents the winding current of the stepper motor 201. (Combined with...) Figures 1-3 In step S11, the controller 210 keeps xIN1 at a continuous high level and xIN2 at a continuous low level, which turns on Q1 and Q4 while turning off Q2 and Q3, causing the stepper motor 201 to rotate continuously in the forward direction. (Reference) Figure 3 Since the PWM duty cycle of xIN1 is 100%, the winding current of stepper motor 201 will continue to rise.

[0060] In some embodiments, when performing step S11, the initial value of the stepper motor winding current is 0A, such as... Figure 3As shown. Therefore, this detection method can be performed when the stepper motor 201 is first turned on, or immediately after power-on. When the stepper motor 201 is integrated into a thermal printer, this detection method can be performed when the thermal printer is first turned on, or immediately after power-on.

[0061] In other embodiments, stepper motor 201 can be continuously rotated in the reverse direction by keeping xIN1 continuously low and xIN2 continuously high, turning on Q2 and Q3 while turning off Q1 and Q4. This application uses the example of continuously rotating stepper motor 201 in the forward direction for illustration and is not intended to limit the rotation direction of stepper motor 201.

[0062] Combination Figures 1-3 In step S12, when the winding current reaches the chopping current Ichop, the motor drive circuit 220 activates its self-protection function, as described above, for example, by turning off the MOSFET Q1, and the winding current begins to decrease. At this time, the controller 210 can obtain the first time t required for the winding current to reach the chopping current Ichop from 0A. DRIVE It should be noted that when the MOSFET Q1 is turned off, the stepper motor 201 may still be rotating, with its speed gradually decreasing. During this process, the winding current will not suddenly become 0A, but will gradually decrease. In step S12, the specific value of the winding current detected by the xISEN pin can be obtained by the controller 210, or it can be obtained by other current detection circuits; this application does not impose any restrictions on this.

[0063] For reference Figure 2 In some embodiments, the detection method further includes: the controller 210 obtains the voltage value on the resistor R in real time, and calculates the winding current in real time based on the voltage value.

[0064] Combination Figures 1-3 In step S13, the duration of the winding current decrease is monitored. When the duration of the decrease reaches a preset second duration t... OFF When the winding current at this moment is called the stopping current I, it is called the stopping current. stop The controller 210 can obtain the stopping current I. stop The specific value.

[0065] It should be noted that the second duration t OFF This is a fixed value, related to the specific hardware settings of the stepper motor. Users can set it according to the specific model of the stepper motor. In some embodiments, the second duration t corresponds to different stepper motor models. OFF different.

[0066] In some embodiments, controller 210 controls Q1 to turn off for a second duration t. OFFThis is used to control the duration of the winding current decrease as the second duration t. OFF .

[0067] The inventors of this application have discovered that different models of stepper motors 201 correspond to different first durations t. DRIVE and stopping current I stop Therefore, based on this discovery, in step S14, the first duration t obtained from the preceding steps S11 to S13 can be used. DRIVE and stopping current I stop To determine the model of stepper motor 201. Here, it is assumed that the model of stepper motor 201 and the first duration t are known. DRIVE Stop current I stop The correspondence between them.

[0068] Step S14 can be specifically executed by controller 210.

[0069] Based on steps S11 to S14 above, the model number of stepper motor 201 can be obtained. When the stepper motor 201 is integrated into a thermal printer, according to this detection method, the model number of stepper motor 201 can be obtained through software without disassembling the thermal printer, thereby further obtaining the printer model number. This allows for setting appropriate printing parameters based on the printer model, resulting in good printing quality.

[0070] In some embodiments, the detection method of this application is in Figure 1 Before step S11 shown, the following is also included:

[0071] Step S10: Pre-test the target first duration and target stopping current of different stepper motor models to obtain the correspondence between the stepper motor model and the target first duration and target stopping current.

[0072] In these embodiments, step S14 also includes: comparing the first duration with the target first duration, comparing the stop current with the target stop current, and determining the model of the stepper motor based on the comparison result.

[0073] The purpose of step S10 is to obtain in advance the correspondence between the model number of the stepper motor 201 and the first duration and stopping current. When the correspondence is unknown, step S10 can be executed to obtain the correspondence.

[0074] Specifically, in some embodiments, step S10 includes the following steps:

[0075] Step S101: Control the stepper motor to rotate continuously, so that the winding current of the stepper motor continues to rise.

[0076] Step S102: When the winding current reaches the target chopping current, the motor drive circuit activates the self-protection function, causing the winding current to stop rising and begin to fall, thus obtaining the target first time required for the winding current to reach the target chopping current from 0A.

[0077] Step S103: After the winding current decreases for a preset target second time period, the winding current reaches the target stopping current, and the target stopping current is obtained;

[0078] Step S104: Repeat steps S101 to S103, recording the first range of the first target duration and the second range of the target stopping current; and

[0079] Step S105: Establish the correspondence between the stepper motor model and the first and second ranges.

[0080] Among them, steps S101 to S103 are respectively with Figure 1 Steps S11-S13 are similar and will not be elaborated further. Step S104 repeats steps S101-S103 to obtain multiple target first durations and multiple target stopping currents, thereby obtaining a first range and a second range respectively, taking into account data fluctuations caused by system errors. Therefore, in step S14, when the first duration is within a first range and the stopping current is within a second range, it indicates that the stepper motor 201 is the model corresponding to the first and second ranges.

[0081] It needs to be explained and referenced. Figure 3 The winding current has a first t DRIVE and t OFF The combined period T1, and including the second t DRIVE and t OFF The combination period is T2. Clearly, due to the first t... DRIVE The starting point is the moment when the winding current is 0A; therefore, the first t... DRIVE Greater than the second t DRIVE Accordingly, the combination period T1 is greater than the combination period T2.

[0082] If, during the first execution of step S103, the winding current decreases for a preset target second duration, and then reaches the target stopping current, and the target stopping current is equal to 0A, then T1 = T2. After multiple iterations, multiple target first durations can be obtained, and a first range can be determined based on these multiple target first durations.

[0083] like Figure 3As shown, in some embodiments, the stopping current Istop is greater than 0A. According to these embodiments, in step S103, after the previous round of step S102 ends, the next round of step S101 is executed immediately, therefore, the winding current is as follows: Figure 3 As shown, the ascent begins from Istop in the combined period T2, instead of starting from 0A, therefore the t in subsequent rounds... DRIVE Both are less than the first t DRIVE Therefore, only the target first duration obtained when step S101 is executed for the first time is available, and correspondingly, within the first range, only the maximum target first duration is available.

[0084] In some embodiments, step S10 further includes measuring the first range and the second range at different supply voltages. Accordingly, step S14 further includes reading the current supply voltage and comparing the obtained first duration and stop current with the first range and second range corresponding to the supply voltage to determine the model of the stepper motor.

[0085] In step S10, steps S101 to S105 are executed for different models of stepper motors to obtain the corresponding relationship of each model of stepper motor.

[0086] This application does not limit the form in which the correspondence is expressed; the correspondence can be a list, text, graph, code, etc., and can be read and used by a computer program. The correspondence can be stored in memory, for example, in the memory of a thermal printer, for the controller 210 to read and use for comparison with the measured values.

[0087] In some embodiments, Figure 1 Following step S13, the process also includes:

[0088] Step S131: Repeat steps S11 to S13 to obtain multiple stopping currents; and

[0089] Step S132: Use the average value of the multiple stop currents as the stop current of the stepper motor.

[0090] According to step S131, after obtaining a first duration and a stop current, the controller 210 can control Q1 to turn on, causing the winding current to rise again until it reaches Ichop. Then, the motor drive circuit 220 activates its self-protection function again, turning off Q1 for the predetermined second duration t. OFF By repeating this process continuously, multiple stopping currents Istop can be obtained.

[0091] Step S132 uses an average stopping current, which can reduce the error in stopping current caused by system errors, environmental interference, etc., and further improve the accuracy of stepper motor model identification.

[0092] Figure 4 This is an exemplary circuit diagram of another control circuit, including a stepper motor according to an embodiment of this application. The control circuit of this embodiment is... Figure 2 The control circuit shown is similar, except that a microprocessor 410 (MCU) is added. This microprocessor 410 obtains the winding current of the stepper motor 201 from the current sensing pin xISEN. Specifically, the current sensing pin xISEN is connected to the ADC pin of the microprocessor 410 to detect the voltage at the current sensing pin xISEN in real time, thereby obtaining the winding current. Accordingly, the controller 210 does not need to calculate the winding current based on the voltage at the current sensing pin xISEN.

[0093] In some embodiments, the controller 210 and the microprocessor 410 are electrically or communicatively connected, and the winding current can be obtained from the microprocessor 410.

[0094] This application also proposes a detection method for a thermal printer, which includes the stepper motor described above. The correspondence between printer models and stepper motor models can be known in advance, thus allowing the thermal printer model to be determined using the stepper motor model detection method described above. In this way, multiple sets of optimal parameters can be obtained for different printer models through advance calibration. When the printer model is detected using the detection method of this application, the optimal parameters for that printer can be invoked to drive the printer, thereby achieving optimal software compatibility with multiple printer models and obtaining the best printing results.

[0095] Figure 5 This is a block diagram of a stepper motor detection device according to an embodiment of this application. (Reference) Figure 5 As shown, the detection device 500 of this embodiment includes: a motor drive circuit 510, a memory 520, and a controller 530. The motor drive circuit 510 drives the rotation of the stepper motor 501 and has a self-protection function. When the winding current of the stepper motor reaches the chopping current, the motor drive circuit 510 activates the self-protection function, causing the winding current to stop rising and begin to fall. The memory 520 stores instructions that can be executed by the controller 530. The controller 530 executes these instructions to implement the detection method described above. The controller 530 can be equivalent to... Figure 2 The controller 210 and motor drive circuit 510 shown can be equivalent to motor drive circuit 220. The relevant content above can be used to describe the detection device 500, and will not be elaborated further.

[0096] The memory 520 may include a hard disk, read-only memory (ROM), and random access memory (RAM), etc., and is capable of storing various data files used for computer processing and / or communication, such as the correspondences described above, as well as possible program instructions executed by the controller 530. The controller 530 may include a processor, an MCU, etc. In some embodiments, the processor may consist of one or more processors.

[0097] refer to Figure 5 As shown, the detection device 500 may further include an internal communication bus 550 and a communication port 540. The internal communication bus 550 enables data communication between components of the detection device 500. The communication port 540 enables data communication between the detection device 500 and external devices. In some embodiments, the detection device 500 can send and receive information and data from a network via the communication port 540. The results processed by the processor are transmitted to the user equipment via the communication port 540 and displayed on the user interface.

[0098] The above-described detection method can be implemented as a computer program, stored in memory 520, and loaded into controller 530 for execution to implement the detection method of this application.

[0099] This application also proposes a thermal printer, including the detection device 500 as described above.

[0100] When the above-described detection method is implemented as a computer program, it can also be stored as an article of manufacture in a computer-readable storage medium. For example, a computer-readable storage medium may include, but is not limited to, magnetic storage devices (e.g., hard disks, floppy disks, magnetic stripes), optical discs (e.g., compact discs (CDs), digital multifunction discs (DVDs)), smart cards, and flash memory devices (e.g., electrically erasable programmable read-only memory (EPROM), cards, sticks, key drives). Furthermore, the various storage media described herein can represent one or more devices and / or other machine-readable media for storing information. The term "machine-readable medium" may include, but is not limited to, wireless channels and various other media (and / or storage media) capable of storing, containing, and / or carrying code and / or instructions and / or data.

[0101] It should be understood that the embodiments described above are merely illustrative. The embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For hardware implementation, the processor may be implemented within one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, and / or other electronic units designed to perform the functions described herein, or combinations thereof.

[0102] Some aspects of this application can be executed entirely by hardware, entirely by software (including firmware, resident software, microcode, etc.), or by a combination of hardware and software. The aforementioned hardware or software may be referred to as a "data block," "module," "engine," "unit," "component," or "system." The processor may be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DAPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), processors, controllers, microcontrollers, microprocessors, or combinations thereof. Furthermore, aspects of this application may manifest as computer products residing in one or more computer-readable media, including computer-readable program code. For example, computer-readable media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, magnetic tapes, etc.), optical discs (e.g., compressed CDs, digital multifunction DVDs, etc.), smart cards, and flash memory devices (e.g., cards, sticks, key drives, etc.).

[0103] A computer-readable medium may contain a propagated data signal containing computer program code, for example, on baseband or as part of a carrier wave. This propagated signal may take various forms, including electromagnetic, optical, and so on, or suitable combinations thereof. A computer-readable medium can be any computer-readable medium other than a computer-readable storage medium, which can be connected to an instruction execution system, apparatus, or device to enable communication, propagation, or transmission of a program for use. The program code located on the computer-readable medium can be propagated through any suitable medium, including radio, cable, fiber optic cable, radio frequency signals, or similar media, or any combination of the above media.

[0104] The basic concepts have been described above. Obviously, for those skilled in the art, the above disclosure is merely illustrative and does not constitute a limitation of this application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements, and corrections to this application. Such modifications, improvements, and corrections are suggested in this application, and therefore remain within the spirit and scope of the exemplary embodiments of this application.

[0105] Furthermore, this application uses specific terms to describe embodiments of the application. For example, "an embodiment," "one embodiment," and / or "some embodiments" refer to a particular feature, structure, or characteristic related to at least one embodiment of the application. Therefore, it should be emphasized and noted that "an embodiment," "one embodiment," or "an alternative embodiment" mentioned twice or more in different locations in this specification do not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of the application can be appropriately combined.

[0106] In some embodiments, numbers describing the quantity of components and attributes are used. It should be understood that such numbers used in the description of embodiments are modified in some examples with the terms "approximately," "approximately," or "generally." Unless otherwise stated, "approximately," "approximately," or "generally" indicates that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may be changed depending on the characteristics required by individual embodiments. In some embodiments, numerical parameters should take into account specified significant digits and employ a general method of digit reservation. Although the numerical ranges and parameters used to confirm their breadth of scope in some embodiments of this application are approximate values, in specific embodiments, such values ​​are set as precisely as feasible.

Claims

1. A method for detecting a stepper motor, characterized in that, include: Step S11: Control the stepper motor to rotate continuously, so that the winding current of the stepper motor continues to rise. Step S12: When the winding current reaches the chopping current, the motor drive circuit activates the self-protection function, causing the winding current to stop rising and begin to fall, thus obtaining the first time required for the winding current to reach the chopping current from 0A. Step S13: After the winding current decreases for a preset second time period, the winding current reaches the stopping current, and the stopping current is obtained; as well as Step S14: Determine the model of the stepper motor based on the first duration and the stopping current; Before step S11, the method further includes: step S10: pre-testing the target first duration and target stopping current of different stepper motor models to obtain the correspondence between the stepper motor model and the target first duration and target stopping current; and Step S14 includes: comparing the first duration with the target first duration, comparing the stop current with the target stop current, and determining the model of the stepper motor based on the comparison result.

2. The detection method as described in claim 1, characterized in that, Step S10 includes: Step S101: Control the stepper motor to rotate continuously, so that the winding current of the stepper motor continues to rise; Step S102: When the winding current reaches the target chopping current, the motor drive circuit activates the self-protection function, causing the winding current to stop rising and begin to fall, thereby obtaining the target first time required for the winding current to reach the target chopping current from 0A. Step S103: After the winding current decreases for a preset target second time period, the winding current reaches the target stopping current, and the target stopping current is obtained. Step S104: Repeatedly execute steps S101 to S103, recording the first range of the first duration of the target and the second range of the target stopping current; and Step S105: Establish the correspondence between the model of the stepper motor and the first range and the second range.

3. The detection method as described in claim 2, characterized in that, Step S10 further includes: measuring the first range and the second range at different power supply voltages, and establishing the correspondence between different power supply voltages.

4. The detection method as described in claim 2, characterized in that, Step S14 includes: when the first duration is within a first range and the stop current is within a second range, determining the model of the stepper motor according to the correspondence.

5. The detection method as described in claim 1, characterized in that, In step S11, the stepper motor is controlled to rotate continuously in the forward or reverse direction.

6. The detection method as described in claim 1, characterized in that, When performing step S11, the initial value of the winding current of the stepper motor is 0A.

7. The detection method as described in claim 1, characterized in that, The stopping current is greater than 0A.

8. The detection method as described in claim 7, characterized in that, Following step S13, the method further includes: Step S131: Repeat steps S11 to S13 to obtain multiple stopping currents; and Step S132: Use the average value of the multiple stop currents as the stop current of the stepper motor.

9. The detection method as described in claim 1, characterized in that, The second duration varies depending on the model of the stepper motor.

10. The detection method as described in claim 1, characterized in that, The motor drive circuit has a first control signal input terminal and a second control signal input terminal. In step S11, the controller continuously inputs a high level to the first control signal input terminal and continuously inputs a low level to the second control signal input terminal, thereby causing the stepper motor to rotate continuously and causing the winding current of the stepper motor to rise continuously.

11. The detection method as described in claim 1, characterized in that, The motor drive circuit has a current detection pin, and the detection method further includes: the controller obtains the winding current in real time through the current detection pin.

12. The detection method as described in claim 11, characterized in that, The current detection pin is connected to a resistor with a fixed resistance value. The detection method further includes: the controller obtains the voltage value on the resistor in real time and calculates the winding current in real time based on the voltage value.

13. A method for detecting a thermal printer, characterized in that, The thermal printer includes a stepper motor, and the detection method includes: detecting the model of the stepper motor using the stepper motor detection method as described in any one of claims 1 to 12, and determining the printer model of the thermal printer based on the model.

14. A stepper motor detection device, characterized in that, include: The motor drive circuit is used to drive the rotation of the stepper motor and has a self-protection function. When the winding current of the stepper motor reaches the chopping current, the motor drive circuit activates the self-protection function to stop the winding current from rising and start to fall. Memory, used to store instructions that can be executed by the controller; A controller for executing the instructions to implement the detection method as described in any one of claims 1-12.

15. A thermal printer, characterized in that, Includes the stepper motor detection device as described in claim 14.