A method and system for detecting a stall of a stepper motor
By obtaining the voltage data of the non-energized coil of the stepper motor and comparing it with historical data, and using the difference parameters and quantified values to accumulate and judge stall, the problem of high false judgment rate in the existing technology is solved, and more reliable stall detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONG KONG HESHENG ZHIXIN CO LTD
- Filing Date
- 2026-03-17
- Publication Date
- 2026-06-09
AI Technical Summary
Existing methods for detecting stalled stepper motors suffer from high false alarm rates, poor reliability, and an inability to detect and implement timely protective measures, leading to motor damage and equipment failure.
By acquiring the voltage data of the non-energized second phase coil when the first phase coil of the stepper motor is energized, the difference parameters between the voltage data and historical data are used to determine whether a stall has occurred. This includes the preset parameter range of the difference parameters and the accumulation of quantized values to determine whether the stepper motor has stalled.
This improves the reliability of stepper motor stall detection, reduces false alarms, and ensures timely detection and protective measures are taken when stall occurs, thus preventing motor damage and equipment failure.
Smart Images

Figure CN122172006A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor control technology, and in particular to a method and system for detecting stall in a stepper motor. Background Technology
[0002] Stepper motors, as actuators that convert electrical pulse signals into angular or linear displacement, are used in the oscillation mechanisms, damper adjustments, and guide vane controls of products such as heaters and fans due to their precise positioning and reliable control. This enables precise positioning of the air delivery angle, smooth switching between hot and cold air modes, and uniform and adjustable airflow direction. However, during actual operation, stepper motors are prone to stalling due to various factors such as abnormal load, mechanical jamming, and abnormal control signals. If a stepper motor stalls and is not detected and protected with shutdown and alarm mechanisms in a timely manner, it can lead to overheating and burnout of the motor coils, damage to the motor's mechanical structure, and potentially cause the entire equipment to malfunction, resulting in economic losses.
[0003] Currently, there are various technical solutions for stepper motor stall detection. Among them, the most commonly used is the current-based stall detection solution, which determines whether the motor is stalled by detecting changes in the current in the stepper motor coil. Another solution is the rotor state detection solution, which uses sensors to sample the angle or pulse information of the motor rotor, calculates the rotor speed, and compares this speed information with the commutation state of the motor coil to determine the motor's operating status and whether stall has occurred.
[0004] However, the above-mentioned technical solutions are prone to misjudgment and have poor detection reliability. Summary of the Invention
[0005] This invention provides a method and system for detecting stepper motor stall, thereby improving the reliability of the stepper motor stall detection method.
[0006] According to one aspect of the present invention, a method for detecting stepper motor stall is provided. The method for detecting stepper motor stall according to an embodiment of the present invention includes: When the first phase coil of the stepper motor is energized, the voltage data of the second phase coil, which is not energized, is obtained; Based on the difference parameters between the voltage data obtained at the current moment and the historical data, it is determined whether the stepper motor is stalled; wherein, the historical data is obtained based on at least one voltage data obtained before the current moment.
[0007] Optionally, based on the difference between the current voltage data and historical data, determine whether the stepper motor is stalled, including: Based on the difference parameters between the voltage data obtained at the current moment and the historical data, the preset parameter range to which the difference parameter belongs is determined, and based on the correlation between the preset parameter range and the quantized value, the quantized value corresponding to the difference parameter is determined; wherein, the preset parameter range includes at least two, and different preset parameter ranges correspond to different quantized values; The quantized value is added to the historical accumulated value to obtain the updated accumulated value; the historical accumulated value is obtained by adding the quantized values of the difference parameters corresponding to the voltage data before the current time. If the updated cumulative value exceeds the preset cumulative value threshold, it is determined that the stepper motor is stalled.
[0008] Optionally, when the difference parameter is greater than or equal to the preset difference parameter threshold, the quantized value is positive; when the difference parameter is less than the preset difference parameter threshold, the quantized value is negative.
[0009] Optionally, each difference parameter in at least two preset parameter ranges is greater than or equal to a preset difference parameter threshold; the at least two preset parameter ranges include a first preset parameter range and a second preset parameter range; The minimum value of the second preset parameter range is greater than the maximum value of the first preset parameter range; The quantization value corresponding to the second preset parameter range is greater than the quantization value of the first preset parameter range.
[0010] Optionally, the quantified value can be summed with the historical accumulated value to obtain an updated accumulated value, including: Determine if the quantized value is positive. If it is, add the quantized value to the historical accumulated value to obtain the updated accumulated value, and use the updated accumulated value as the historical accumulated value at the next sampling time. If not, determine whether the updated accumulated value obtained by adding the quantized value and the historical accumulated value is non-negative. If it is, keep the updated accumulated value unchanged and use the updated accumulated value as the historical accumulated value at the next sampling time. If not, use the historical accumulated value as the updated accumulated value and use the updated accumulated value as the historical accumulated value at the next sampling time.
[0011] Optionally, based on the difference between the current voltage data and historical data, determine whether the stepper motor is stalled, including: Historical data is determined based on the voltage data acquired before the current moment; The difference parameters are determined based on the voltage data obtained at the current moment and historical data; Determine whether the stepper motor is stalled based on the difference parameters.
[0012] Optionally, the difference parameter includes at least one of the absolute value, ratio, variance, and standard deviation of the difference between the voltage data acquired at the current time and the historical data.
[0013] According to another aspect of the present invention, a stepper motor stall detection system is provided. The stepper motor stall detection system applying the stepper motor stall detection method of any embodiment of the present invention includes: a control module and a sampling module. The sampling module is used to sample the voltage of the non-energized second phase coil of the stepper motor when the first phase coil of the stepper motor is energized, and transmit the voltage sampling signal to the control module; The control module is used to acquire the voltage data of the non-energized second-phase coil based on the voltage sampling signal; The control module is also used to determine whether the stepper motor is stalled based on the difference parameters between the voltage data obtained at the current moment and the historical data; wherein, the historical data includes at least one voltage data obtained before the current moment.
[0014] Optionally, the sampling module includes: Voltage sampling unit and first clamping protection unit; The input terminal of the voltage sampling unit is connected to the non-energized second phase coil of the stepper motor, and the output terminal of the voltage sampling unit is connected to the input terminal of the control module. It is used to collect the voltage of the coil when the coil is not energized and generate a voltage sampling signal to the input terminal of the control module. The first end of the first clamping protection unit is connected between the output end of the voltage sampling unit and the input end of the control module, and is used to limit the voltage of the voltage sampling signal output by the voltage sampling unit to a first voltage threshold; wherein the first voltage threshold is greater than or equal to the safe negative voltage threshold of the control module.
[0015] Optionally, the sampling module may also include: a signal amplification unit and a second clamping protection unit; The input terminal of the signal amplification unit is connected to the output terminal of the voltage sampling unit, and the output terminal of the signal amplification unit is connected to the input terminal of the control module; the signal amplification unit is used to amplify the voltage sampling signal and output it to the input terminal of the control module. The first end of the first clamping protection unit is connected between the output end of the signal amplification unit and the input end of the control module, and is used to limit the voltage of the voltage sampling signal output by the signal amplification unit to a first voltage threshold. The first end of the second clamping protection unit is connected between the output end of the voltage sampling unit and the input end of the signal amplification unit, and the second end of the second clamping protection unit is grounded; it is used to limit the voltage of the voltage sampling signal output by the voltage sampling unit to a second voltage threshold; wherein the second voltage threshold is greater than or equal to the safe negative voltage threshold of the signal amplification unit.
[0016] The technical solution of this invention involves acquiring voltage data of the non-energized second-phase coil when the first-phase coil of the stepper motor is energized; and determining whether the stepper motor is stalled based on the difference between the current voltage data and historical data. Since the voltage of the non-energized second-phase coil is stable during normal stepper motor rotation, the fluctuation between the current voltage data and historical data is small, resulting in a small difference parameter. When the stepper motor stalls, the voltage change of the non-energized second-phase coil is significant. When the difference parameter is too large, it can be determined that the stepper motor is stalled. Compared to traditional rotor state detection methods, there is no need to add additional sensors to detect rotor angle and pulse information; only the voltage of the non-energized second-phase coil needs to be collected to determine whether a stall has occurred. Furthermore, the voltage change of the non-energized second-phase coil is significant when the stepper motor stalls, preventing missed detection due to inconspicuous phenomena. In summary, the stepper motor stall detection method of this invention is simple and reliable.
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A flowchart of a stepper motor stall detection method provided in an embodiment of the present invention; Figure 2 A wiring diagram of a stepper motor provided in an embodiment of the present invention; Figure 3 A flowchart of another stepper motor stall detection method provided in an embodiment of the present invention; Figure 4 A flowchart of another stepper motor stall detection method provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of a stepper motor stall detection system provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of another stepper motor stall detection system provided in an embodiment of the present invention; Figure 7This is a schematic diagram of another stepper motor stall detection system provided in an embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0021] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0022] Figure 1 This is a flowchart illustrating a stepper motor stall detection method provided by an embodiment of the present invention. The stepper motor in this embodiment can be used to precisely control the speed and direction of a fan. This embodiment is applicable to fields where stepper motors are used as actuators, and where there is a risk of stalling and requirements for operational safety and reliability are present. The method in this embodiment can be executed by a control module, and the system can be implemented in hardware and / or software. Figure 1 As shown, the stepper motor stall detection method of this invention includes: S110. When the first phase coil of the stepper motor is energized, acquire the voltage data of the second phase coil, which is not energized.
[0023] In this embodiment, the stepper motor is a servo motor that can convert input electrical pulse signals into angular or linear displacement. The electrical pulse signals can be provided by a power supply. The stepper motor can include at least two coils. When an electrical pulse signal is input to the first phase coil of the stepper motor, current flows through it after it is energized, generating a magnetic field to drive the rotor to rotate. The second phase coil of the stepper motor is not energized, and no current flows through it. The second phase coil cuts the rotating magnetic field when the rotor rotates, inducing a reverse electromotive force. The voltage data of the second phase coil of the stepper motor can be obtained through the reverse electromotive force. The voltage data can be the data corresponding to the voltage value output after conversion by an analog-to-digital converter. The second phase coil is any coil of the stepper motor that is not energized.
[0024] Figure 2 This is a wiring diagram of a stepper motor provided in an embodiment of the present invention, exemplarily shown below. Figure 2 As shown, a stepper motor can be a five-wire, four-phase stepper motor. The stepper motor includes four independent coils A, B, C, and D. Terminal 1 is the first terminal of coil A, terminal 2 is the first terminal of coil D, terminal 4 is the first terminal of coil B, terminal 5 is the first terminal of coil C, and a common terminal 3. The second terminals of all four independent coils are connected to the common terminal 3. The first phase coil is energized, and the second phase coil is de-energized. For example, if the first phase coil is coil D, then when coil D is energized, the voltage data of any one of the phase coils A, B, or C can be obtained.
[0025] Table 1 is an excitation sequence table for forward rotation of a stepper motor provided in an embodiment of the present invention. (Reference) Figure 2According to Table 1, the stepper motor can be driven in a four-phase, eight-beat configuration. The common terminal 3 is connected to the positive terminal of the power supply. The first terminals of coils A, B, C, and D are all connected to the negative terminal of the power supply. The power supply energizes coils A, B, C, and D in a fixed sequence. For example, during forward rotation, in the first beat, coil A is energized from terminal 1 and common terminal 3; in the second beat, coil A is energized from terminal 1 and common terminal 3, and coil B is energized from terminal 4 and common terminal 3. The energizing sequence of the stepper motor coils from the first to the eighth beat is: A-AB-B-BC-C-CD-D-DA. Taking coil D as the first phase coil as an example, when coil D is energized, after the seventh beat, the voltage of the non-energized second phase coil is sampled. Optionally, voltage sampling can be performed on the adjacent non-energized coil B of the energized coil D. The strong magnetic coupling between adjacent coils and the rotor magnetic field results in a larger and more stable induced reverse electromotive force signal, thus improving the reliability of the acquired voltage data. The energizing sequence of the stepper motor coils can be executed periodically according to a fixed number of steps. After the 7th step (energizing coil D) in each cycle, voltage sampling is performed on the second non-energized phase coil B.
[0026] Optionally, during reverse rotation, the energizing sequence of the stepper motor coils from the 8th to the 1st step can be: A-AD-D-DC-C-CB-B-BA. Taking the first phase coil as coil D as an example, when coil D is energized, after the 6th step is completed, the voltage of the non-energized second phase coil B is sampled to obtain the voltage data of the non-energized second phase coil B. Optionally, the voltage sampling of the non-energized second-phase coil can be determined after a certain number of steps are completed, based on the connection method between the sampling module and the stepper motor's coil windings. For example, when the stepper motor is rotating forward, the sampling module is connected to the first end of coil A, and after the 5th step of each cycle (coil C is energized), voltage sampling is performed on coil A; the sampling module is connected to the first end of coil B, and after the 7th step of each cycle (coil D is energized), voltage sampling is performed on coil B; the sampling module is connected to the first end of coil C, and after the 1st step of each cycle (coil A is energized), voltage sampling is performed on coil C; the sampling module is connected to the first end of coil D, and after the 3rd step of each cycle (coil B is energized), voltage sampling is performed on coil D.
[0027] When the stepper motor is in reverse rotation, the sampling module is connected to the first end of coil A. After the 4th beat in each round (coil C is energized), the voltage of coil A is sampled. The sampling module is connected to the first end of coil B. After the 6th beat in each round (coil D is energized), the voltage of coil B is sampled. The sampling module is connected to the first end of coil C. After the 8th beat in each round (coil A is energized), the voltage of coil C is sampled. The sampling module is connected to the first end of coil D. After the 2nd beat in each round (coil B is energized), the voltage of coil D is sampled.
[0028] It should be noted that this embodiment only uses a four-phase eight-step stepper motor as an example to explain the stepper motor stall detection method of this embodiment. It is also applicable to other stepper motors containing at least two coils. This embodiment of the invention does not impose any specific limitations on this.
[0029] S120. Based on the difference parameters between the voltage data obtained at the current moment and the historical data, determine whether the stepper motor is stalled.
[0030] The historical data is obtained based on at least one voltage data point acquired before the current moment.
[0031] In this embodiment, the voltage data acquired at the current moment can be the voltage data obtained at the current sampling moment when the voltage of the non-energized second-phase coil is sampled during the current round of execution. Historical data can be a voltage data obtained before the current sampling moment, or the average of voltage data obtained from multiple sampling rounds before the current sampling moment. The magnitude of the difference parameter can reflect whether the voltage data of the non-energized second-phase coil of the stepper motor fluctuates significantly in each round.
[0032] Specifically, when a stepper motor is working normally, the current flowing through each coil gradually builds up, and the magnetic field within the coil changes steadily. When the stepper motor stalls or suddenly jams, the rotor cannot rotate normally. At the moment of commutation, the back electromotive force generated by the rotor motion decreases, and the magnetic energy in the non-energized second-phase coil cannot be consumed through normal rotation. At the moment the energized first-phase coil is de-energized or commutated, energy is released, i.e. Significant changes have occurred, among which, For inductance, The rate of change of current causes an increase in the voltage of the unenergized second-phase coil. By acquiring the voltage data of the unenergized second-phase coil in each cycle, and based on the difference between the current voltage data and historical data, it is determined whether there is a large voltage fluctuation in the unenergized second-phase coil. If the difference parameter is small, the stepper motor runs smoothly; if the difference parameter is large, it can be determined that the stepper motor is stalled.
[0033] According to the technical solution of this invention, when the first phase coil of the stepper motor is energized, the voltage data of the non-energized second phase coil is acquired; based on the difference parameter between the voltage data acquired at the current moment and the historical data, it is determined whether the stepper motor is stalled. Since the voltage of the non-energized second phase coil is stable when the stepper motor is rotating normally, the fluctuation between the voltage data acquired at the current moment and the historical data of the non-energized second phase coil is small, and the difference parameter is small. When the stepper motor stalls, the voltage change of the non-energized second phase coil is obvious. When the difference parameter is too large, it can be determined that the stepper motor is stalled. Compared with traditional rotor state detection schemes, there is no need to add additional sensors to detect rotor angle and pulse information; only the voltage of the non-energized second phase coil needs to be collected to determine whether a stall has occurred. Furthermore, when the stepper motor stalls, the voltage change of the non-energized second phase coil is obvious, preventing missed detection due to inconspicuous phenomena. In summary, the stepper motor stall detection method of this invention is simple and reliable.
[0034] Optionally, S120 determines whether the stepper motor is stalled based on the difference parameters between the voltage data obtained at the current moment and the historical data, including: Historical data is determined based on the voltage data acquired before the current moment.
[0035] For example, it could be the average of the voltage data obtained 20 times prior to the current sampling time. If the number of sampling times is less than 20, it could be the average of the voltage data obtained from all sampling rounds prior to the current sampling time.
[0036] The difference parameters are determined based on the voltage data obtained at the current moment and historical data.
[0037] The difference parameter can be calculated mathematically from the voltage data obtained at the current moment and historical data to reflect the voltage fluctuation of the non-energized second phase coil of the stepper motor.
[0038] Optionally, the difference parameter includes at least one of the absolute value, ratio, variance, and standard deviation of the difference between the voltage data acquired at the current time and the historical data.
[0039] For example, taking the variance of the voltage data obtained at the current moment and the historical data as an example to calculate the difference parameter, the voltage data obtained at the current moment is 3007, and the historical data can be the average value of the voltage data obtained from the previous 20 samplings, which is 2900. Then the difference parameter is... The numerical values listed in this embodiment are only for explaining the calculation process of the difference parameters and are not intended to be specific limitations of the embodiments of the present invention.
[0040] Determine whether the stepper motor is stalled based on the difference parameters.
[0041] Among them, the fluctuation between the voltage data obtained at the current moment and the historical data is small, and the difference parameter is small. The fluctuation between the voltage data obtained at the current moment and the historical data is large, and the difference parameter is too large. When the difference parameter is too large, it can be determined that the stepper motor is stalled.
[0042] For example, a preset difference parameter threshold can be used to determine whether the difference parameter is too large. This threshold can be a boundary value obtained through experience or experimentation, used to determine whether the voltage of the non-energized second-phase coil of the stepper motor exhibits significant fluctuations. When the fluctuation between the current voltage data and historical data is small, the difference parameter is less than the threshold, and the stepper motor does not stall. When the fluctuation between the current voltage data and historical data is large, the difference parameter is greater than or equal to the threshold, and the stepper motor stalls.
[0043] Figure 3 A flowchart of another stepper motor stall detection method provided in an embodiment of the present invention is shown below. Figure 3 As shown, the stepper motor stall detection method of this embodiment may include the following steps: S210. When the first phase coil of the stepper motor is energized, acquire the voltage data of the second phase coil, which is not energized.
[0044] S220. Based on the difference parameters between the voltage data obtained at the current moment and the historical data, determine the preset parameter range to which the difference parameters belong, and based on the correlation between the preset parameter range and the quantized value, determine the quantized value corresponding to the difference parameters.
[0045] The preset parameter range includes at least two, with different preset parameter ranges corresponding to different quantization values.
[0046] In this embodiment, the preset parameter range can be a parameter interval pre-set according to the magnitude of the difference parameters, and the quantized value can be the specific value after quantizing the parameter interval.
[0047] Specifically, there are at least two preset parameter ranges, and there is a one-to-one correspondence between these at least two preset parameter ranges and at least two quantized values. The quantized values can be used to evaluate the fluctuation degree of the difference parameter between the voltage data acquired at the current moment and historical data. The larger the difference parameter, the larger the quantized value, and the greater the voltage fluctuation degree of the non-energized second phase coil of the stepper motor.
[0048] Optionally, when the difference parameter is greater than or equal to the preset difference parameter threshold, the quantized value is positive; when the difference parameter is less than the preset difference parameter threshold, the quantized value is negative.
[0049] The relationship between preset parameter ranges and quantized values includes at least two sets of mapping relationships between preset parameter ranges and quantized values. For example, the preset parameter ranges include parameter ranges that are greater than or equal to preset difference parameter thresholds and parameter ranges that are less than preset difference parameter thresholds. When the preset parameter range is greater than or equal to the preset difference parameter threshold, the corresponding quantized value is a positive number, such as 1. When the preset parameter range is less than the preset difference parameter threshold, the corresponding quantized value is a negative number, such as -1.
[0050] For example, the preset difference parameter threshold is 100, and the preset parameter range is divided into... and , The corresponding quantization value is 1. The corresponding quantization value is -1. When the difference parameter calculated based on the voltage data obtained at the current moment and the historical data is greater than or equal to 100, the corresponding quantization value is 1; when the difference parameter calculated based on the voltage data obtained at the current moment and the historical data is less than 100, the corresponding quantization value is -1. The values listed in this embodiment are not intended to be specific limitations of the embodiments of the present invention.
[0051] Optionally, each difference parameter in at least two preset parameter ranges is greater than or equal to a preset difference parameter threshold; the at least two preset parameter ranges include a first preset parameter range and a second preset parameter range; the minimum value of the second preset parameter range is greater than the maximum value of the first preset parameter range; and the quantized value corresponding to the second preset parameter range is greater than the quantized value of the first preset parameter range.
[0052] When the preset parameter range is a parameter range that is greater than or equal to the preset difference parameter threshold, it may include at least two preset parameter ranges corresponding to at least two positive quantized values.
[0053] Specifically, the preset parameter range includes a first preset parameter range and a second preset parameter range. The parameter value range of the second preset parameter range is larger than the parameter value range of the second preset parameter range. When the difference parameter belongs to the first preset parameter range, the corresponding quantized value is smaller than the corresponding quantized value when the difference parameter belongs to the second preset parameter range.
[0054] For example, when the preset parameter range is divided into At that time, The parameter range is divided into [100, 200), [200, 300), [300, 400), etc., with [100, 200) corresponding to a quantization value of 1, [200, 300) to a quantization value of 2, and [300, 400) to a quantization value of 3. By refining the preset parameter range into multiple values when the difference parameter is greater than or equal to a preset difference parameter threshold, and by setting quantization values corresponding to these multiple preset parameter ranges, the situation of large voltage fluctuations in the non-energized second-phase coil of the stepper motor can be further refined, allowing for a more accurate determination of the voltage fluctuation level of the non-energized second-phase coil of the stepper motor.
[0055] Table 2 is a table showing the relationship between voltage data, difference parameters, and quantized values of a stepper motor provided in an embodiment of the present invention. As shown in Table 2, taking a preset difference parameter of 100 as an example, the table shows the voltage data, difference parameters, and quantized values corresponding to the difference parameters obtained during the stepper motor stall detection process. S230. The quantized value is added to the historical accumulated value to obtain the updated accumulated value. The historical accumulated value is obtained by adding the quantized values of the difference parameters corresponding to the voltage data before the current time.
[0056] In this embodiment, the historical accumulated value can be the accumulated value of the quantized value corresponding to the difference parameter obtained in each round of sampling before the current sampling time, and the updated accumulated value can be the sum of the difference parameter at the current sampling time and the historical accumulated value.
[0057] For example, the initial value of the historical accumulated value can be 0. When voltage sampling of the non-energized second phase coil of the stepper motor begins, the voltage data N1 at the current sampling time can be obtained in the first round. The first round only has one voltage data, and the difference parameter is not calculated for it. The second round obtains the voltage data N2 at the current sampling time, and the historical data H3 is the voltage data N1 from the first round. The second round calculates the difference parameter. for Determine the difference parameters The preset parameter range and corresponding quantization value Q2 are defined, and Q2 is added to the historical accumulated value with an initial value of 0, updating the accumulated value S2 to S2 = Q2 + 0. In the third round, the voltage data N3 at the current sampling time can be obtained. The historical data is the average of the voltage data from the first and second rounds, and the historical data H3 is... The third round of calculation of difference parameters for Determine the difference parameters The preset parameter range and the corresponding quantization value Q3 are determined, and the quantization value Q3 is added to the historical accumulated value S2, and the accumulated value S3 is updated to S3=Q3+S2.
[0058] S240. If the updated cumulative value exceeds the preset cumulative value threshold, it is determined that the stepper motor has stalled.
[0059] In this embodiment, the preset accumulated value threshold can be the value of the updated accumulated value when the voltage of the non-energized second phase coil of the stepper motor fluctuates significantly and can be determined as a stalled rotor.
[0060] For example, the preset accumulated value threshold can be set according to the actual situation such as the load stability of the stepper motor. For instance, if the preset accumulated value threshold is 50, then when the updated accumulated value exceeds 50, it can be determined that the stepper motor is stalled. By setting a preset accumulated value threshold, it is possible to prevent misjudgment of the stepper motor's working state due to large differences in parameters from a single sampling during normal rotation, thereby improving the reliability of the stepper motor stall detection method.
[0061] Optionally, S230, the quantized value is added to the historical accumulated value to obtain an updated accumulated value, including: Determine if the quantized value is positive. If it is, add the quantized value to the historical accumulated value to obtain the updated accumulated value, and use the updated accumulated value as the historical accumulated value at the next sampling time.
[0062] Both the historical cumulative value and the updated cumulative value are non-negative. When the quantified value is positive, it can be directly added to the historical cumulative data to obtain the updated cumulative value.
[0063] If not, determine whether the updated accumulated value obtained by adding the quantized value and the historical accumulated value is non-negative. If it is, keep the updated accumulated value unchanged and use the updated accumulated value as the historical accumulated value at the next sampling time. If not, use the historical accumulated value as the updated accumulated value and use the updated accumulated value as the historical accumulated value at the next sampling time.
[0064] When the quantized value is negative, after adding the quantized value to the historical accumulated value, it is necessary to determine in advance that the updated accumulated value is non-negative before using the sum of the quantized value and the historical accumulated value as the updated accumulated value; otherwise, the quantized value at the current moment is discarded.
[0065] For example, when the historical accumulated value is 0, the difference parameter at the current sampling moment is less than the preset difference parameter threshold, and the corresponding quantized value is negative. The quantized value at this sampling moment is not added to the historical accumulated value; instead, the historical accumulated value is used as the updated accumulated value. This avoids the situation where, when the stepper motor is running smoothly, the quantized value corresponding to the voltage data of the non-energized second phase coil of the stepper motor is added to the historical accumulated value, resulting in a negative updated accumulated value. Consequently, the historical accumulated value at the next sampling moment will also be negative, and the updated accumulated value at the next sampling moment will not accurately reflect the degree of voltage data fluctuation of the non-energized second phase coil of the stepper motor. This would lead to errors in determining whether the stepper motor is stalled, affecting the accuracy of the stepper motor stall detection method.
[0066] Figure 4 A flowchart of another stepper motor stall detection method provided by an embodiment of the present invention is shown below. Figure 4 As shown, the stepper motor stall detection method of this embodiment may include the following steps: S301. When the first phase coil of the stepper motor is energized, acquire the voltage data of the second phase coil, which is not energized.
[0067] Optionally, before acquiring the voltage data of the second phase coil of the stepper motor that is not energized, after driving the stepper motor to commutate, it is determined whether the coil connected to the sampling module is the sampling phase. If it is, then S302 is executed; otherwise, the stepper motor is driven to commutate.
[0068] S302. Based on the difference parameters between the voltage data obtained at the current moment and the historical data, determine the preset parameter range to which the difference parameters belong, and based on the correlation between the preset parameter range and the quantized value, determine the quantized value corresponding to the difference parameters.
[0069] S303. Determine if the quantized value is positive. If yes, execute S304; otherwise, execute S305.
[0070] S304. The quantized value is added to the historical accumulated value to obtain the updated accumulated value, and the updated accumulated value is used as the historical accumulated value at the next sampling time.
[0071] S305. Determine whether the updated accumulated value obtained by adding the quantized value and the historical accumulated value is non-negative. If yes, execute S306; otherwise, execute S307.
[0072] S306. Keep the updated accumulated value unchanged, and use the updated accumulated value as the historical accumulated value at the next sampling time.
[0073] S307. Use the historical accumulated value as the updated accumulated value, and use the updated accumulated value as the historical accumulated value at the next sampling time.
[0074] S308. Determine if the updated cumulative value exceeds the preset cumulative value threshold. If yes, execute S309; otherwise, return to S301.
[0075] S309. Determine if the stepper motor is stalled.
[0076] The stepper motor stall detection method of this embodiment has the beneficial effects of the stepper motor stall detection method in any of the above embodiments.
[0077] Figure 5 This is a schematic diagram of a stepper motor stall detection system provided in an embodiment of the present invention, as shown below. Figure 5 As shown, the stepper motor stall detection system of this embodiment applies the stepper motor stall detection method of any embodiment of this invention. The stepper motor stall detection system of this embodiment includes: a control module 10 and a sampling module 20. The sampling module 20 is used to sample the voltage of the non-energized second phase coil of the stepper motor when the first phase coil of the stepper motor is energized, and transmit the voltage sampling signal to the control module 10; the control module 10 is used to obtain the voltage data of the non-energized second phase coil according to the voltage sampling signal; the control module 10 is also used to determine whether the stepper motor is stalled based on the difference parameters between the voltage data obtained at the current moment and the historical data; wherein, the historical data includes at least one voltage data obtained before the current moment.
[0078] In this embodiment of the invention, the sampling module 20 can be a hardware circuit module with voltage sampling function, and the control module 10 can be a microcontroller, etc. The microcontroller of the control module 10 can include an analog-to-digital converter, which filters the voltage sampling signal sent by the sampling module 20 and converts it into corresponding voltage data. The voltage sampling signal can be an analog signal, and the voltage data can be a digital signal. The control module 10 and the sampling module 20 are used to execute the stepper motor stall detection method provided in any embodiment of the present invention. Therefore, the stepper motor stall detection system composed of the control module 10 and the sampling module 20 has the same beneficial effects as the stepper motor stall detection method provided in any embodiment of the present invention, and will not be described again here.
[0079] Figure 6 This is a schematic diagram of another stepper motor stall detection system provided in an embodiment of the present invention, as shown below. Figure 6 As shown, in some embodiments, the sampling module 20 includes: Voltage sampling unit 21 and first clamping protection unit 22; The input terminal of the voltage sampling unit 21 is connected to the non-energized second phase coil of the stepper motor, and the output terminal of the voltage sampling unit 21 is connected to the input terminal of the control module 10. It is used to collect the voltage of the coil when the coil is not energized and generate a voltage sampling signal to the input terminal of the control module 10. The first terminal of the first clamping protection unit 22 is connected between the output terminal of the voltage sampling unit 21 and the input terminal of the control module 10. It is used to limit the voltage of the voltage sampling signal output by the voltage sampling unit 21 to a first voltage threshold. The first voltage threshold is greater than or equal to the safety negative voltage threshold of the control module 10.
[0080] The voltage sampling unit 21 may include a first sampling resistor R1 and a second sampling resistor R2. The first end of the first sampling resistor R1 is the input terminal of the sampling module 20. The first end of the first sampling resistor R1 is connected to any coil of the stepper motor. The second end of the first sampling resistor R1 is connected to the first end of the second sampling resistor R2, and the second end of the second sampling resistor R2 is grounded. In this embodiment, taking the first end of the first sampling resistor R1 connected to coil B of the stepper motor as an example, when the first phase coil of the stepper motor is coil D, that is, when coil D is energized, the first sampling resistor R1 and the second sampling resistor R2 connected in series can generate a voltage divider on the voltage of the second phase coil of the stepper motor, that is, voltage sampling can be performed on coil B. The second end of the first sampling resistor R1 is the output terminal of the sampling module 20, and the sampling module 20 outputs a voltage sampling signal.
[0081] The first clamping protection unit 22 may include a first clamping diode D1. The cathode of the first clamping diode D1 is the input terminal of the first clamping protection unit 22, the cathode of the first clamping diode D1 is connected to the output terminal of the sampling module 20, and the anode of the first clamping diode D1 is grounded. The safe negative voltage threshold of the control module 10 can be the minimum negative voltage threshold that the input port pin of the control module 10 can withstand. If the first voltage threshold is greater than or equal to the minimum negative voltage threshold that the control module 10 can withstand, the control module 10 will burn out if the voltage value input to the control module 10 is less than the first voltage threshold. When the first phase coil of the stepper motor is energized and commutates or the magnetic field changes abruptly, the voltage of the non-energized second phase coil may become negative. When a negative voltage occurs, the first clamping diode D1 can clamp the voltage at the input terminal of the control module 10 above the first voltage threshold to prevent the negative voltage from damaging the control module 10.
[0082] Optionally, the stepper motor stall detection system also includes a driver chip. The input terminal of the driver chip is connected to the output terminal of the control module 10, the power supply terminal of the driver chip is connected to the common terminal 3 of the stepper motor coil, the first output terminal A1 of the driver chip is connected to the first terminal 1 of the stepper motor coil A, the second output terminal B1 of the driver chip is connected to the first terminal 4 of the stepper motor coil B, the third output terminal C1 of the driver chip is connected to the first terminal 5 of the stepper motor coil C, and the fourth output terminal D1 of the driver chip is connected to the first terminal 2 of the stepper motor coil D. The driver chip is used to output commutation drive signals according to a fixed timing sequence based on the output signal of the control module 10.
[0083] Figure 7 This is a schematic diagram of another stepper motor stall detection system provided in an embodiment of the present invention, as shown below. Figure 7 As shown, in some embodiments, the sampling module 20 further includes: a signal amplification unit 23 and a second clamping protection unit 24; The input terminal of the signal amplification unit 23 is connected to the output terminal of the voltage sampling unit 21, and the output terminal of the signal amplification unit 23 is connected to the input terminal of the control module 10. The signal amplification unit 23 is used to amplify the voltage sampling signal and output it to the input terminal of the control module 10. The first terminal of the first clamping protection unit 22 is connected between the output terminal of the signal amplification unit 23 and the input terminal of the control module 10, and is used to limit the voltage of the voltage sampling signal output by the signal amplification unit 23 to above a first voltage threshold. The first terminal of the second clamping protection unit 24 is connected between the output terminal of the voltage sampling unit 21 and the input terminal of the signal amplification unit 23, and the second terminal of the second clamping protection unit 24 is grounded, and is used to limit the voltage of the voltage sampling signal output by the voltage sampling unit 21 to above a second voltage threshold. The second voltage threshold is greater than or equal to the safety negative voltage threshold of the signal amplification unit 23.
[0084] The signal amplification unit 23 includes an operational amplifier U, a first resistor R3, a second resistor R5, and a third resistor R4. The non-inverting input of the operational amplifier U is connected to the output of the voltage sampling unit 21, and the inverting input of the operational amplifier U is connected to the first terminal of the first resistor R3, with the second terminal of the first resistor R3 grounded. The output of the operational amplifier U is connected to the first terminal of the second resistor R5, which is the output of the signal amplification unit 23. The second terminal of the second resistor R5 is also connected to the input of the control module 10. The second terminal of the second resistor R5 is connected to the first terminal of the third resistor R4, which is connected to the inverting input of the operational amplifier U. The signal amplification unit 23 amplifies the voltage sampling signal and outputs it to the input of the control module 10.
[0085] The third resistor R4 serves as a feedback resistor, enabling the operational amplifier unit 23 to form negative feedback and ensuring that the operational amplifier U operates in the linear region. The second clamping protection unit 24 may include a second clamping diode D2. The cathode of the second clamping diode D2 is the input terminal of the second clamping protection unit 24, and the cathode of the second clamping diode D2 is connected to the output terminal of the voltage sampling unit 21. The anode of the second clamping diode D2 is grounded. The safe negative voltage threshold of the signal amplification unit can be the critical value of the lowest negative voltage that the input pin of the operational amplifier U can withstand. If the second voltage threshold is greater than or equal to the critical value of the lowest negative voltage that the input pin of the operational amplifier U can withstand, a voltage value less than the second voltage threshold will cause the non-inverting input port of the operational amplifier U to be broken down and burned. When the first phase coil of the stepper motor is energized and commutates or the magnetic field changes abruptly, the voltage of the non-energized second phase coil may become negative. When a negative voltage occurs, the second clamping diode D2 can clamp the voltage at the non-inverting input terminal of the operational amplifier U above the second voltage threshold, preventing the negative voltage from damaging the input port of the operational amplifier U.
[0086] Specifically, the voltage sampling unit 21 can collect the voltage signal of the non-energized second-phase coil of the stepper motor, and the signal amplification unit 23 amplifies the voltage sampling signal output by the voltage sampling unit 21 and outputs it to the control module 10. By designing the signal amplification unit 23, the small voltage sampling signal can be amplified, so that the control module 10 can determine whether the stepper motor is stalled based on the voltage data of the non-energized second-phase coil of the stepper motor, thereby improving the accuracy of the stepper motor stall detection method. The first clamping protection unit 22 is connected between the output terminal of the signal amplification unit 23 and the input terminal of the control module 10 to prevent negative voltage from burning out the control module 10; the second clamping protection unit 24 is connected between the output terminal of the voltage sampling unit 21 and the non-inverting input terminal of the operational amplifier U of the signal amplification unit 23 to prevent negative voltage from burning out the operational amplifier U, thereby improving the reliability of the stepper motor stall detection system.
[0087] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0088] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for detecting stall in a stepper motor, characterized in that, include: When the first phase coil of the stepper motor is energized, the voltage data of the second phase coil, which is not energized, is acquired; Based on the difference parameter between the voltage data obtained at the current moment and the historical data, it is determined whether the stepper motor is stalled; wherein, the historical data is obtained based on at least one voltage data obtained before the current moment.
2. The stepper motor stall detection method according to claim 1, characterized in that, The stepper motor stalling is determined based on the difference parameter between the voltage data obtained at the current moment and the historical data, including: Based on the difference parameter between the voltage data obtained at the current moment and the historical data, the preset parameter range to which the difference parameter belongs is determined, and based on the correlation between the preset parameter range and the quantized value, the quantized value corresponding to the difference parameter is determined; wherein, the preset parameter range includes at least two, and different preset parameter ranges correspond to different quantized values; The quantized value is added to the historical accumulated value to obtain the updated accumulated value; wherein, the historical accumulated value is obtained by adding the quantized values of the difference parameters corresponding to the voltage data before the current time. If the updated accumulated value exceeds a preset accumulated value threshold, it is determined that the stepper motor has stalled.
3. The stepper motor stall detection method according to claim 2, characterized in that, When the difference parameter is greater than or equal to a preset difference parameter threshold, the quantized value is a positive number; When the difference parameter is less than the preset difference parameter threshold, the quantization value is negative.
4. The stepper motor stall detection method according to claim 3, characterized in that, Each difference parameter in at least two of the preset parameter ranges is greater than or equal to the preset difference parameter threshold; the at least two preset parameter ranges include a first preset parameter range and a second preset parameter range; The minimum value of the second preset parameter range is greater than the maximum value of the first preset parameter range; The quantization value corresponding to the second preset parameter range is greater than the quantization value of the first preset parameter range.
5. The stepper motor stall detection method according to claim 2, characterized in that, The step of adding the quantized value to the historical accumulated value to obtain the updated accumulated value includes: Determine whether the quantized value is positive. If so, add the quantized value to the historical accumulated value to obtain an updated accumulated value, and use the updated accumulated value as the historical accumulated value at the next sampling time. If not, determine whether the updated accumulated value obtained by adding the quantized value and the historical accumulated value is non-negative. If yes, keep the updated accumulated value unchanged and use the updated accumulated value as the historical accumulated value at the next sampling time. If not, use the historical accumulated value as the updated accumulated value and use the updated accumulated value as the historical accumulated value at the next sampling time.
6. The stepper motor stall detection method according to any one of claims 1-5, characterized in that, The stepper motor stalling is determined based on the difference parameter between the voltage data obtained at the current moment and the historical data, including: The historical data is determined based on the voltage data obtained before the current moment; The difference parameter is determined based on the voltage data obtained at the current moment and the historical data; The stepper motor is determined to be stalled based on the difference parameters.
7. The stepper motor stall detection method according to claim 6, characterized in that, The difference parameter includes at least one of the absolute value, ratio, variance, and standard deviation of the difference between the voltage data obtained at the current time and the historical data.
8. A stepper motor stall detection system, characterized in that, include: Control module and sampling module; The sampling module is used to sample the voltage of the non-energized second phase coil of the stepper motor when the first phase coil of the stepper motor is energized, and transmit the voltage sampling signal to the control module. The control module is used to acquire the voltage data of the non-energized second-phase coil based on the voltage sampling signal; The control module is also used to determine whether the stepper motor is stalled based on the difference parameters between the voltage data obtained at the current time and the historical data; wherein, the historical data includes at least one voltage data obtained before the current time.
9. The stepper motor stall detection system according to claim 8, characterized in that, The sampling module includes: Voltage sampling unit and first clamping protection unit; The input terminal of the voltage sampling unit is connected to the non-energized second phase coil of the stepper motor, and the output terminal of the voltage sampling unit is connected to the input terminal of the control module. It is used to collect the voltage of the coil when the coil is not energized and generate the voltage sampling signal to the input terminal of the control module. The first end of the first clamping protection unit is connected between the output end of the voltage sampling unit and the input end of the control module, and is used to limit the voltage of the voltage sampling signal output by the voltage sampling unit to a first voltage threshold; wherein the first voltage threshold is greater than or equal to the safety negative voltage threshold of the control module.
10. The stepper motor stall detection system according to claim 9, characterized in that, The sampling module further includes: a signal amplification unit and a second clamping protection unit; The input terminal of the signal amplification unit is connected to the output terminal of the voltage sampling unit, and the output terminal of the signal amplification unit is connected to the input terminal of the control module; the signal amplification unit is used to amplify the voltage sampling signal and output it to the input terminal of the control module. The first end of the first clamping protection unit is connected between the output end of the signal amplification unit and the input end of the control module, and is used to limit the voltage of the voltage sampling signal output by the signal amplification unit to a first voltage threshold. The first end of the second clamping protection unit is connected between the output end of the voltage sampling unit and the input end of the signal amplification unit, and the second end of the second clamping protection unit is grounded; it is used to limit the voltage of the voltage sampling signal output by the voltage sampling unit to a second voltage threshold; wherein the second voltage threshold is greater than or equal to the safe negative voltage threshold of the signal amplification unit.