A step motor stall detection method based on back electromotive force method and related device

CN122993519APending Publication Date: 2026-10-27GUANGDONG REAL DESIGN INTELLIGENT TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611336793.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

但现有的堵转检测方法只能适用于步进电机已经发生严重堵转的情况,无法提前识别堵转风险

Benefits of technology

[0012]根据本申请实施例的一方面,提供了一种计算机程序产品,所述计算机程序产品包括计算机程序,所述计算机程序被电子设备的处理器读取并执行,使得所述电子设备执行如上所述的基于反电动势法的步进电机堵转检测方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122993519A_ABST
    Figure CN122993519A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of motor detection, in particular to a stepping motor stall detection method based on a back electromotive force method and related devices. The method comprises the following steps: obtaining a reference voltage of a target suspended winding and a target maximum voltage; determining a stall detection value of a current period according to a difference between the reference voltage and the target maximum voltage; adding the stall detection value of the current period and a stall detection cumulative value to obtain an updated stall detection cumulative value; if the updated stall detection cumulative value is greater than a preset risk threshold value and smaller than a preset stall detection threshold value, it is determined that the stepping motor has a stall risk in the current period; and if the updated stall detection cumulative value is greater than or equal to the preset stall detection threshold value, it is determined that the stepping motor has a stall in the current period. The application can accurately know the stall risk of the stepping motor in advance, and accurately determine whether the stepping motor has a stall, so that the stall detection accuracy is good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of motor testing technology, and in particular to a method and related device for detecting stalled stepper motors based on the back electromotive force method. Background Technology

[0002] In electric fans with oscillation functions, the stepper motor is prone to stalling when it reaches a certain rotational boundary. Therefore, accurate stall detection of the stepper motor is necessary to ensure stable and efficient fan operation. Existing stall detection methods typically measure the overall voltage of the stepper motor when the fan reaches the rotational boundary and compare it to a set reference voltage to determine if stalling has occurred. However, these methods only apply to situations where the stepper motor is already severely stalled and cannot identify potential stalling risks in advance. Summary of the Invention

[0003] To address the aforementioned problems, this application provides a stepper motor stall detection method and related apparatus based on the back electromotive force method, which can solve at least one of the above-mentioned technical problems.

[0004] According to one aspect of the embodiments of this application, a method for detecting stall in a stepper motor based on the back electromotive force method is proposed, the method comprising: The stepper motor is periodically sampled using the back electromotive force method to obtain the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the current cycle. The stall detection value for the current cycle is determined based on the difference between the reference voltage and the target maximum voltage. Obtain the cumulative value of stall detection for historical periods, which is obtained by superimposing stall detection values ​​from multiple periods; The stall detection value for the current period is added to the stall detection accumulated value to obtain the updated stall detection accumulated value; If the updated stall detection cumulative value is greater than the preset risk threshold and less than the preset stall detection threshold, then it is determined that the stepper motor has a stall risk in the current cycle. If the updated stall detection cumulative value is greater than or equal to the preset stall detection threshold, it is determined that the stepper motor has stalled in the current cycle. If the updated stall detection cumulative value is less than the preset stall detection threshold, then the stall detection will proceed to the next cycle. The reference voltage and target maximum voltage of the target floating winding of the stepper motor will be obtained in the next cycle, so as to determine whether the stepper motor stalls in the next cycle based on the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle. The terminal voltage of the target suspended winding is sampled via a preset analog-to-digital conversion channel. The reference voltage and the target maximum voltage are both sampled at the same terminal voltage sampling point. The reference voltage and the target maximum voltage are sampled at different step times. The reference voltage is sampled within a reference step, which is the step time corresponding to when the target suspended winding is in a suspended state, the adjacent winding of the target suspended winding has not experienced a turn-off impact, and the terminal voltage remains stable. The target maximum voltage is sampled within a detection step, which is the step time corresponding to when the target suspended winding is in a suspended state, the adjacent winding of the target suspended winding has turned off, and the terminal voltage has been pulled down by back electromotive force.

[0005] In the above scheme, obtaining the reference voltage of the target floating winding of the stepper motor in the current cycle includes: Obtain the current stepping cycle of the stepper motor; The sampling delay of the current cycle is determined based on the current stepping cycle. The sampling delay is used to avoid the freewheeling spike generated by the stepper motor at the moment the winding is turned off. After the current cycle begins, the reference voltage of the target suspended winding is acquired after the sampling delay.

[0006] In the above scheme, determining the sampling delay of the current period based on the current step period includes: The product of the current stepping period and the preset scaling factor is determined as the sampling delay of the current period; The preset proportional coefficient is determined based on the duration of the freewheeling current in the winding of the stepper motor.

[0007] In the above scheme, the target maximum voltage of the target floating winding in the current cycle is obtained through the following steps: Within the current period, the moment when the sampling delay is reached is determined as the observation start time; The end time of the current period is determined as the end time of the observation; The observation time window for observing the maximum voltage of the target is obtained based on the observation start time and the observation end time; Within the observation time window, the target maximum voltage of the target suspended winding for the current period is obtained; the target maximum voltage is the maximum voltage value within the observation time window.

[0008] In the above scheme, determining the stall detection value for the current cycle based on the difference between the reference voltage and the target maximum voltage includes: If the difference between the reference voltage and the target maximum voltage is less than or equal to the first preset threshold, it is determined that the stepper motor has a high risk of stalling, and the stall detection value of the current cycle is determined to be the first target value. If the difference between the reference voltage and the target maximum voltage is greater than the first preset threshold and less than or equal to the second preset threshold, then the stepper motor is determined to have a moderate risk of stalling, and the stall detection value for the current cycle is determined to be the second target value. If the difference between the reference voltage and the target maximum voltage is greater than the second preset threshold and less than or equal to the third preset threshold, then the stepper motor is determined to have a slight risk of stalling, and the stall detection value for the current cycle is determined to be the third target value. If the difference between the reference voltage and the target maximum voltage is greater than the third preset threshold, it is determined that the stepper motor does not have a stall risk, and the updated stall detection cumulative value is cleared to zero, or the stall detection value of the current cycle is determined to be the fourth target value. Wherein, the first target value is greater than the second target value, the second target value is greater than the third target value, the third target value is greater than the fourth target value, and the fourth target value is a negative value.

[0009] In the above scheme, determining whether the stepper motor will stall in the next cycle based on the reference voltage and target maximum voltage of the target floating winding of the stepper motor includes: The stall detection value for the next cycle is determined based on the difference between the reference voltage of the target floating winding for the next cycle and the target maximum voltage of the target floating winding for the next cycle. Add the stall detection value of the next cycle to the updated cumulative stall detection value of the historical cycles to obtain the updated cumulative stall detection value for the next round. If the cumulative value of stall detection after the next update is greater than the preset stall detection threshold, it is determined that the stepper motor has stalled in the next cycle.

[0010] According to one aspect of the embodiments of this application, a stepper motor stall detection device based on the back electromotive force method is provided, the device comprising: The acquisition unit is used to periodically acquire voltage from the stepper motor using the back electromotive force method, thereby obtaining the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the current cycle. The first determining unit is used to determine the stall detection value for the current cycle based on the difference between the reference voltage and the target maximum voltage. The acquisition unit is used to acquire the cumulative value of stall detection for historical periods, wherein the cumulative value of stall detection is obtained by superimposing the stall detection values ​​of multiple periods; The update unit is used to add the current stall detection value to the stall detection accumulated value to obtain the updated stall detection accumulated value. The first determination unit is used to determine that the stepper motor has a stall risk in the current cycle if the updated stall detection cumulative value is greater than a preset risk threshold and less than a preset stall detection threshold. The second determination unit is used to determine that the stepper motor has stalled in the current cycle if the updated stall detection cumulative value is greater than or equal to the preset stall detection threshold. The detection unit is used to enter the next cycle of stall detection if the updated stall detection cumulative value is less than the preset stall detection threshold, and to obtain the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle, so as to determine whether the stepper motor stalls in the next cycle based on the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle. The terminal voltage of the target suspended winding is sampled via a preset analog-to-digital conversion channel. The reference voltage and the target maximum voltage are both sampled at the same terminal voltage sampling point. The reference voltage and the target maximum voltage are sampled at different step times. The reference voltage is sampled within a reference step, which is the step time corresponding to when the target suspended winding is in a suspended state, the adjacent winding of the target suspended winding has not experienced a turn-off impact, and the terminal voltage remains stable. The target maximum voltage is sampled within a detection step, which is the step time corresponding to when the target suspended winding is in a suspended state, the adjacent winding of the target suspended winding has turned off, and the terminal voltage has been pulled down by back electromotive force.

[0011] According to one aspect of the embodiments of this application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the stepper motor stall detection method based on the back EMF method as described above.

[0012] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program, the computer program being read and executed by a processor of an electronic device, causing the electronic device to perform the stepper motor stall detection method based on the back EMF method as described above.

[0013] The beneficial effects of this application are as follows: This application uses the back electromotive force method to periodically collect voltage data from a stepper motor. Within the current cycle, it obtains the reference voltage of the target floating winding and the target maximum voltage of the target floating winding of the stepper motor. The difference between the reference voltage and the target maximum voltage is used to determine the stall detection value for the current cycle. By adding this value to the accumulated stall detection value from previous cycles, the updated stall detection value for the current cycle is obtained. This value is used to determine whether the stepper motor has a stall risk or has stalled in the current cycle. It can accurately predict the stall risk of the stepper motor in advance and accurately determine whether the stepper motor has stalled. If no stall has occurred, the stall detection continues in the next cycle, and this process is repeated continuously. Attached Figure Description

[0014] Figure 1 This is a system architecture diagram of the stepper motor stall detection method based on back EMF provided in the embodiments of this application; Figure 2 A schematic flowchart of the stepper motor stall detection method based on the back electromotive force method provided in the embodiments of this application; Figure 3 A waveform diagram of the back electromotive force provided in an embodiment of this application; Figure 4 A block diagram of a stepper motor stall detection device based on the back electromotive force method provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation

[0015] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0016] It should be noted that while some processes described in the specification, claims, and accompanying drawings include multiple steps appearing in a specific order, it should be clearly understood that these steps may not be performed in the order they appear herein, or may be performed in parallel. The step numbers are merely used to distinguish different steps and do not themselves represent any execution order. Furthermore, descriptions such as "first," "second," or "objective" in this document are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. "Multiple" in this document refers to at least two.

[0017] It is worth noting that in the specific embodiments of this application, voltage data, inductance, resistance, and other related data are involved. When the above embodiments of this application are applied to specific products or technologies, permission or consent from the target object is required, and the collection, use, and processing of related data must comply with relevant laws, regulations, and standards. For example, when an embodiment of this application needs to obtain voltage data, inductance, resistance, and other related data of a node, separate permission or consent from the target object can be obtained through pop-up windows or redirection to a confirmation page. After obtaining the separate permission or consent from the target object, the voltage data, inductance, resistance, and other related data used to enable the embodiment of this application to operate normally can then be obtained.

[0018] Please see Figure 1 , Figure 1 This is a system architecture diagram of the stepper motor stall detection method based on the back EMF method provided in this application embodiment. It includes a terminal 140, an Internet connection 130, a gateway 120, a server 110, etc.

[0019] Terminal 140 can take various forms, including desktop computers, laptops, PDAs (personal digital assistants), mobile phones, vehicle terminals, and dedicated terminals. Furthermore, it can be a single device or a collection of multiple devices. For example, multiple desktop computers can be interconnected via a local area network, sharing a single monitor to work collaboratively, forming a single terminal 140. Terminal 140 can communicate with the Internet 130 via wired or wireless means to exchange data.

[0020] Server 110 refers to a computer system capable of providing certain services to terminal 140. Compared to ordinary terminal 140, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines). Server 110 can also communicate with the Internet 130 via wired or wireless means to exchange data.

[0021] Gateway 120, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal 140 to server 110 are forwarded to the corresponding server 110 via gateway 120. Messages sent from server 110 to terminal 140 are also forwarded to the corresponding terminal 140 via gateway 120.

[0022] The following provides a detailed description of the specific implementation methods of the embodiments of this application: Please see Figure 2 , Figure 2 This is a flowchart illustrating the stepper motor stall detection method based on the back EMF method provided in this application embodiment. The stepper motor stall detection method based on the back EMF method can be implemented by server 110 and / or terminal 140. Figure 2 The stepper motor stall detection method shown includes: Step 210: Periodically collect voltage data from the stepper motor using the back electromotive force method to obtain the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the current cycle. Step 220: Determine the stall detection value for the current cycle based on the difference between the reference voltage and the target maximum voltage; Step 230: Obtain the cumulative value of stall detection for historical periods, wherein the cumulative value of stall detection is obtained by superimposing the stall detection values ​​for multiple periods; Step 240: Add the current stall detection value to the stall detection accumulated value to obtain the updated stall detection accumulated value; Step 250: If the updated stall detection cumulative value is greater than the preset risk threshold and less than the preset stall detection threshold, then it is determined that the stepper motor has a stall risk in the current cycle. Step 260: If the updated stall detection cumulative value is greater than or equal to the preset stall detection threshold, it is determined that the stepper motor has stalled in the current cycle. Step 270: If the updated stall detection cumulative value is less than the preset stall detection threshold, then proceed to the stall detection of the next cycle, obtain the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle, and determine whether the stepper motor stalls in the next cycle based on the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle.

[0023] First, BEMF (Back Electromotive Force) is a key phenomenon generated when a stepper motor is running. When a stepper motor rotates, the windings cut the magnetic field, generating an induced voltage. The direction of this voltage is opposite to the external voltage that drives the motor to rotate, hence the name "back" electromotive force.

[0024] This application can be applied to the stall detection scenario of electric fans. The stepper motor of the electric fan adopts a four-phase drive, with each of the four phases corresponding to a different winding. The drive mode includes four-phase eight-step and four-phase four-step modes. In this application, the winding in the energized state is called the conducting winding, and the winding in the de-energized state is called the floating winding. It should be noted that under different stepping conditions, there can be one or two conducting windings, and correspondingly, there can be two or three floating windings. This application achieves stall detection by collecting the terminal voltage of the floating winding, and selects one of the one or more floating windings as the target floating winding. In this embodiment, one floating winding is preferably selected as the target floating winding.

[0025] In the detection step of the target suspended winding, the target suspended winding is in a suspended state, and when the winding adjacent to the target suspended winding is turned off, a back electromotive force is induced in the target suspended winding. Simultaneously, the target suspended winding will switch from a suspended state to a conducting state in subsequent steps. Thus, each round of stall detection only requires voltage acquisition from one target suspended winding, achieving stall detection without increasing hardware costs.

[0026] Furthermore, the voltage waveform obtained through BEMF is as follows: Figure 3 As shown in the figure, a distinct V-shaped trough is evident, representing a standard BEMF waveform. Therefore, the target maximum voltage of the target floating winding of the stepper motor can be obtained from this figure. This voltage is then subtracted from the reference voltage to obtain the stall detection value for the current cycle.

[0027] Further, determining the stall detection value for the current cycle based on the difference between the reference voltage and the target maximum voltage includes: If the difference between the reference voltage and the target maximum voltage is less than or equal to the first preset threshold, it is determined that the stepper motor has a high risk of stalling, and the stall detection value of the current cycle is determined to be the first target value. If the difference between the reference voltage and the target maximum voltage is greater than the first preset threshold and less than or equal to the second preset threshold, then the stepper motor is determined to have a moderate risk of stalling, and the stall detection value for the current cycle is determined to be the second target value. If the difference between the reference voltage and the target maximum voltage is greater than the second preset threshold and less than or equal to the third preset threshold, then the stepper motor is determined to have a slight risk of stalling, and the stall detection value for the current cycle is determined to be the third target value. If the difference between the reference voltage and the target maximum voltage is greater than the third preset threshold, it is determined that the stepper motor does not have a stall risk, and the updated stall detection cumulative value is cleared to zero, or the stall detection value of the current cycle is determined to be the fourth target value. Wherein, the first target value is greater than the second target value, the second target value is greater than the third target value, the third target value is greater than the fourth target value, and the fourth target value is a negative value.

[0028] Specifically, the first preset threshold can be set to 4, the second preset threshold can be set to 8, and the third preset threshold can be set to 16. The larger the difference between the reference voltage and the target maximum voltage, the less likely stalling will occur. The first target value can be set to 6, the second target value can be set to 3, the third target value can be set to 1, and the fourth target value can be set to -5. In some embodiments, if the difference between the reference voltage and the target maximum voltage is greater than the third preset threshold, the updated stall detection accumulation value can be cleared to zero, and it is not necessary to obtain the fourth target value.

[0029] Furthermore, the preset risk threshold can be set to 65, and the preset stall detection threshold can be set to 80. When the accumulated stall detection value reaches 65, it indicates that the stepper motor is at risk of stalling. A stall risk warning message can be sent to the user's terminal device, such as a computer or mobile phone, to prevent stalling from occurring in a timely manner. Of course, reaching a stall detection value of 65 does not necessarily require immediate shutdown. Stall detection can continue for the next cycle. When the accumulated stall detection value reaches 80, it indicates that stalling has occurred, and immediate shutdown is required.

[0030] Furthermore, the preset reference multiple can be a value such as 3, 4, or 5, which is determined according to the rotor speed of the stepper motor. For example, if the rotor speed of the stepper motor is 1000 rpm, the preset reference multiple can be set to 3. The faster the rotor speed of the stepper motor, the smaller the preset reference multiple should be.

[0031] Furthermore, this application uses the back electromotive force method to periodically collect voltage data from the stepper motor. Within the current cycle, it acquires the reference voltage of the target floating winding and the target maximum voltage of the target floating winding of the stepper motor. The difference between the reference voltage and the target maximum voltage is used to determine the stall detection value for the current cycle. This value is then added to the accumulated stall detection value from previous cycles to obtain the updated stall detection value for the current cycle. This allows for the determination of whether the stepper motor faces stall risk or has stalled in the current cycle. This approach can accurately predict the stall risk of the stepper motor in advance and accurately determine whether stall has occurred. If no stall has occurred, the stall detection continues in the next cycle, and this cycle is repeated continuously, resulting in good stall detection accuracy.

[0032] Please see Figure 4 , Figure 4 This is a schematic diagram of a stepper motor stall detection device based on the back EMF method provided in an embodiment of this application. This device is applied to computer equipment and may include: The acquisition unit 401 is used to periodically acquire voltage from the stepper motor using the back electromotive force method, thereby obtaining the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the current cycle. The first determining unit 402 is used to determine the stall detection value of the current cycle based on the difference between the reference voltage and the target maximum voltage. The acquisition unit 403 is used to acquire the cumulative value of stall detection in historical cycles, wherein the cumulative value of stall detection is obtained by superimposing the stall detection values ​​of multiple cycles; The update unit 404 is used to add the current stall detection value to the stall detection accumulated value to obtain the updated stall detection accumulated value. The first determination unit 405 is used to determine that the stepper motor has a stall risk in the current cycle if the updated stall detection cumulative value is greater than a preset risk threshold and less than a preset stall detection threshold. The second determination unit 406 is used to determine that the stepper motor has stalled in the current cycle if the updated stall detection cumulative value is greater than or equal to the preset stall detection threshold. The detection unit 407 is used to enter the next cycle of stall detection if the updated stall detection cumulative value is less than the preset stall detection threshold, and to obtain the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle, so as to determine whether the stepper motor stalls in the next cycle based on the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle.

[0033] Reference Figure 5 , Figure 5 To implement the structural block diagram of a portion of the terminal 140 in this application embodiment, the terminal 140 includes: a radio frequency (RF) circuit 710, a memory 715, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a wireless fidelity (WiFi) module 770, a processor 780, and a power supply 790, among other components. Those skilled in the art will understand that... Figure 5 The terminal 140 structure shown does not constitute a limitation on a mobile phone or computer, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0034] The RF circuit 710 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 780; in addition, it transmits uplink data to the base station.

[0035] The memory 715 can be used to store software programs and modules. The processor 780 executes various terminal functions and stepper motor stall detection processing based on the back EMF method by running the software programs and modules stored in the memory 715.

[0036] The input unit 730 can be used to receive input numeric or character information, and to generate key signal inputs related to the terminal's settings and function control. Specifically, the input unit 730 may include a touch panel 731 and other input devices 732.

[0037] The display unit 740 can be used to display input or provided information, as well as various menus of the terminal. The display unit 740 may include a display panel 741.

[0038] Audio circuitry 760, speaker 761, and microphone 762 provide an audio interface.

[0039] In this embodiment, the processor 780 included in the terminal 140 can execute the stepper motor stall detection method based on the back EMF method in the previous embodiment.

[0040] The terminal 140 in this application embodiment includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, and aircraft. This application embodiment can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0041] Figure 6This is a partial structural block diagram of a server 110 implementing an embodiment of this application. The server 110 can vary significantly due to different configurations or performance characteristics, and may include one or more central processing units (CPUs) 822 (e.g., one or more processors) and memory 832, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 842 or data 844. The memory 832 and storage media 830 can be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server 110. Furthermore, the CPU 822 may be configured to communicate with the storage media 830 and execute the series of instruction operations in the storage media 830 on the server 110.

[0042] Server 110 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input / output interfaces 858, and / or one or more operating systems 841, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0043] The central processing unit 822 in server 110 can be used to execute the stepper motor stall detection method based on the back EMF method according to the embodiments of this application.

[0044] This application also provides a computer-readable storage medium for storing program code, which is used to execute the stepper motor stall detection method based on the back EMF method in the foregoing embodiments.

[0045] This application also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to perform the aforementioned stepper motor stall detection method based on the back electromotive force method.

[0046] Furthermore, the terms “comprising” and “including”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are expressly listed, but may include other steps or units that are not expressly listed or that are inherent to such process, method, product, or apparatus.

[0047] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0048] It should be understood that in the description of the embodiments of this application, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.

[0049] In the several embodiments provided in this application, 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 through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0050] 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 the embodiments of this application, depending on actual needs.

[0051] Furthermore, the functional units in the various embodiments of this application 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.

[0052] 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 this application, 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 of the various embodiments of this application. 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.

[0053] It should also be understood that the various implementation methods provided in this application can be combined arbitrarily to achieve different technical effects.

[0054] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0055] The above is a detailed description of the embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A method for detecting stall in a stepper motor based on the back electromotive force method, characterized in that, The method includes: The stepper motor is periodically sampled using the back electromotive force method to obtain the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the current cycle. The stall detection value for the current cycle is determined based on the difference between the reference voltage and the target maximum voltage. Obtain the cumulative value of stall detection for historical periods, which is obtained by superimposing stall detection values ​​from multiple periods; The stall detection value for the current period is added to the stall detection accumulated value to obtain the updated stall detection accumulated value; If the updated stall detection cumulative value is greater than the preset risk threshold and less than the preset stall detection threshold, then it is determined that the stepper motor has a stall risk in the current cycle. If the updated stall detection cumulative value is greater than or equal to the preset stall detection threshold, it is determined that the stepper motor has stalled in the current cycle. If the updated stall detection cumulative value is less than the preset stall detection threshold, then the stall detection will proceed to the next cycle. The reference voltage and target maximum voltage of the target floating winding of the stepper motor will be obtained in the next cycle, so as to determine whether the stepper motor stalls in the next cycle based on the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle. The terminal voltage of the target suspended winding is sampled via a preset analog-to-digital conversion channel. The reference voltage and the target maximum voltage are both sampled at the same terminal voltage sampling point. The reference voltage and the target maximum voltage are sampled at different step times. The reference voltage is sampled within a reference step, which is the step time corresponding to when the target suspended winding is in a suspended state, the adjacent winding of the target suspended winding has not experienced a turn-off impact, and the terminal voltage remains stable. The target maximum voltage is sampled within a detection step, which is the step time corresponding to when the target suspended winding is in a suspended state, the adjacent winding of the target suspended winding has turned off, and the terminal voltage has been pulled down by back electromotive force.

2. The stepper motor stall detection method based on back electromotive force method according to claim 1, characterized in that, The step of obtaining the reference voltage of the target floating winding of the stepper motor in the current cycle includes: Obtain the current stepping cycle of the stepper motor; The sampling delay of the current cycle is determined based on the current stepping cycle. The sampling delay is used to avoid the freewheeling spike generated by the stepper motor at the moment the winding is turned off. After the current cycle begins, the reference voltage of the target suspended winding is acquired after the sampling delay.

3. The stepper motor stall detection method based on back electromotive force method according to claim 2, characterized in that, The step of determining the sampling delay of the current period based on the current step period includes: The product of the current stepping period and the preset scaling factor is determined as the sampling delay of the current period; The preset proportional coefficient is determined based on the duration of the freewheeling current in the winding of the stepper motor.

4. The stepper motor stall detection method based on back electromotive force method according to claim 3, characterized in that, The target maximum voltage of the target floating winding in the current cycle is obtained through the following steps: Within the current period, the moment when the sampling delay is reached is determined as the observation start time; The end time of the current period is determined as the end time of the observation; The observation time window for observing the maximum voltage of the target is obtained based on the observation start time and the observation end time; Within the observation time window, the target maximum voltage of the target suspended winding for the current period is obtained; the target maximum voltage is the maximum voltage value within the observation time window.

5. The stepper motor stall detection method based on back electromotive force method according to claim 1, characterized in that, The stall detection value for the current cycle is determined based on the difference between the reference voltage and the target maximum voltage, including: If the difference between the reference voltage and the target maximum voltage is less than or equal to the first preset threshold, it is determined that the stepper motor has a high risk of stalling, and the stall detection value of the current cycle is determined to be the first target value. If the difference between the reference voltage and the target maximum voltage is greater than the first preset threshold and less than or equal to the second preset threshold, then the stepper motor is determined to have a moderate risk of stalling, and the stall detection value for the current cycle is determined to be the second target value. If the difference between the reference voltage and the target maximum voltage is greater than the second preset threshold and less than or equal to the third preset threshold, then the stepper motor is determined to have a slight risk of stalling, and the stall detection value for the current cycle is determined to be the third target value. If the difference between the reference voltage and the target maximum voltage is greater than the third preset threshold, it is determined that the stepper motor does not have a stall risk, and the updated stall detection cumulative value is cleared to zero, or the stall detection value of the current cycle is determined to be the fourth target value. Wherein, the first target value is greater than the second target value, the second target value is greater than the third target value, the third target value is greater than the fourth target value, and the fourth target value is a negative value.

6. The stepper motor stall detection method based on back electromotive force method according to claim 1, characterized in that, Determining whether the stepper motor will stall in the next cycle based on the reference voltage and target maximum voltage of the target suspended winding of the stepper motor, including: The stall detection value for the next cycle is determined based on the difference between the reference voltage of the target floating winding for the next cycle and the target maximum voltage of the target floating winding for the next cycle. Add the stall detection value of the next cycle to the updated cumulative stall detection value of the historical cycles to obtain the updated cumulative stall detection value for the next round. If the cumulative value of stall detection after the next update is greater than the preset stall detection threshold, it is determined that the stepper motor has stalled in the next cycle.

7. A stepper motor stall detection device based on the back electromotive force method, characterized in that, The device includes: The acquisition unit is used to periodically acquire voltage from the stepper motor using the back electromotive force method, thereby obtaining the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the current cycle. The first determining unit is used to determine the stall detection value for the current cycle based on the difference between the reference voltage and the target maximum voltage. The acquisition unit is used to acquire the cumulative value of stall detection for historical periods, wherein the cumulative value of stall detection is obtained by superimposing the stall detection values ​​of multiple periods; The update unit is used to add the current stall detection value to the stall detection accumulated value to obtain the updated stall detection accumulated value. The first determination unit is used to determine that the stepper motor has a stall risk in the current cycle if the updated stall detection cumulative value is greater than a preset risk threshold and less than a preset stall detection threshold. The second determination unit is used to determine that the stepper motor has stalled in the current cycle if the updated stall detection cumulative value is greater than or equal to the preset stall detection threshold. The detection unit is used to enter the next cycle of stall detection if the updated stall detection cumulative value is less than the preset stall detection threshold, and to obtain the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle, so as to determine whether the stepper motor stalls in the next cycle based on the reference voltage and target maximum voltage of the target floating winding of the stepper motor in the next cycle. The terminal voltage of the target suspended winding is sampled via a preset analog-to-digital conversion channel. The reference voltage and the target maximum voltage are both sampled at the same terminal voltage sampling point. The reference voltage and the target maximum voltage are sampled at different step times. The reference voltage is sampled within a reference step, which is the step time corresponding to when the target suspended winding is in a suspended state, the adjacent winding of the target suspended winding has not experienced a turn-off impact, and the terminal voltage remains stable. The target maximum voltage is sampled within a detection step, which is the step time corresponding to when the target suspended winding is in a suspended state, the adjacent winding of the target suspended winding has turned off, and the terminal voltage has been pulled down by back electromotive force.

8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the stepper motor stall detection method based on the back EMF method as described in any one of claims 1 to 6.

9. A computer program product, the computer program product comprising a computer program, characterized in that, The computer program is read and executed by the processor of the electronic device, causing the electronic device to perform the stepper motor stall detection method based on the back electromotive force method as described in any one of claims 1 to 6.