Stepping motor stalling detection method, device and equipment and storage medium
By initializing the maximum stroke when the stepper motor is powered on and performing blocking and rotation point detection movement, the problems of sudden current current and false blocking and rotation misjudgment in the prior art are solved, and a higher detection accuracy is achieved.
Patent Information
- Application Number
- CN202310958720.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-31
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art has problems such as sudden current changes and false blocking and misjudgment in detecting stepper motor blockage, resulting in low detection accuracy.
By initializing the maximum stroke when the stepper motor is powered on, the stepper motor is controlled to drive the actuator to perform blocking and rotation point detection movement. If the blocking and rotation point cannot be crossed several times in a row, the reverse movement will be moved to the first hard stop position to obtain the reverse Itinerary, determine whether there is a blockage based on the maximum stroke and the reverse stroke.
There is no need for current surge, which avoids damage to the control circuit, reduces the possibility of false blocking and misjudgment, and improves the accuracy of motor blocking and rotation detection.
Smart Images

Figure CN119482290A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of detection technology, and in particular to a stepping motor stall detection method, device, equipment and storage medium. Background Art
[0002] When the stepper motor is running, the existing technology determines whether the motor is stalled by whether the current feedback from the motor changes suddenly. However, when the current changes suddenly and remains at a very large current value, it will cause harm to the circuit system. If the current sudden change method is not adopted, there is a possibility of false stall misjudgment, resulting in low accuracy of current stall detection. Summary of the invention
[0003] The embodiments of the present invention provide a stepper motor stall detection method, device, equipment and storage medium to solve the problems of current sudden change hazards and false stall misjudgment when detecting stepper motor stall in the prior art.
[0004] An embodiment of the present invention provides a stepper motor stall detection method, comprising:
[0005] When the stepper motor is powered on, the maximum stroke is initialized and the maximum stroke is stored;
[0006] Controlling the stepper motor to drive the actuator to perform stall point detection movement;
[0007] If the stall point cannot be crossed after several consecutive stall point detection movements, the stepper motor is controlled to drive the actuator to move in the reverse direction to the first hard stop position to obtain a reverse stroke;
[0008] Determining whether the stepping motor is blocked according to the maximum stroke and the reverse stroke;
[0009] If the stepper motor is blocked, the stepper motor is controlled to stop moving and an error message is reported to the controller.
[0010] Optionally, controlling the stepper motor to drive the actuator to perform a stall point detection movement includes:
[0011] Controlling the stepper motor to drive the actuator to move forward;
[0012] If the stepper motor cannot pass the stall point, the stepper motor is controlled to retract in the reverse direction to a preset angle or the stepper motor is controlled to drive the actuator to retract a preset distance;
[0013] The stepper motor is controlled again to drive the actuator to perform forward motion.
[0014] Optionally, controlling the stepper motor to drive the actuator to perform a stall point detection movement includes:
[0015] If the stepper motor drives the actuator to pass the stall point, the stepper motor is controlled to drive the actuator to continue to move forward to the second hard stop position.
[0016] Optionally, judging whether the stepper motor is stalled according to the maximum stroke and the reverse stroke includes:
[0017] Calculating the difference between the maximum stroke and the reverse stroke;
[0018] Calculating a ratio between the difference and the maximum stroke;
[0019] comparing the ratio with a preset correction value;
[0020] If the ratio is less than the preset correction value, it is determined that the stepper motor is not stalled;
[0021] If the ratio is greater than or equal to the preset correction value, it is determined that the stepper motor is stalled.
[0022] Optionally, when the stepper motor is powered on, initializing the maximum stroke, and storing the maximum stroke includes:
[0023] When the stepper motor is powered on, the self-learning function is executed to make the actuator blade touch the first hard stop and the second hard stop;
[0024] Obtaining the travel between the first hard stop and the second hard stop as the maximum travel;
[0025] The maximum stroke is recorded and stored.
[0026] Optionally, the maximum stroke and reverse stroke of the stepper motor are represented by the number of steps of the stepper motor.
[0027] An embodiment of the present invention provides a stepper motor stall detection device, comprising:
[0028] An initialization module, used to initialize the maximum stroke and store the maximum stroke when the stepper motor is powered on;
[0029] A rotation control module, used for controlling the stepper motor to drive the actuator to perform a stall point detection movement;
[0030] An acquisition module, used for controlling the stepper motor to drive the actuator to move in the reverse direction to a first hard stop position to acquire a reverse stroke if the stall point detection movement fails to cross the stall point for several consecutive times;
[0031] A judging module, used for judging whether the stepping motor is stalled according to the maximum stroke and the reverse stroke;
[0032] The stall processing module is used to control the stepper motor to stop moving if the stepper motor is stalled, and report error information to the controller.
[0033] Optionally, the judging module includes:
[0034] A difference calculation unit, used for calculating the difference between the maximum stroke and the reverse stroke;
[0035] a ratio calculation unit, used for calculating the ratio between the difference and the maximum stroke;
[0036] a comparing unit, configured to compare the ratio with a preset correction value;
[0037] The determination unit is used to determine that the stepper motor is not stalled if the ratio is less than the preset correction value; and to determine that the stepper motor is stalled if the ratio is greater than or equal to the preset correction value.
[0038] An embodiment of the present invention provides a terminal device, including a memory, a controller, and a computer program stored in the memory and executable on the controller, wherein the controller implements the above-mentioned stepper motor stall detection method when executing the computer program.
[0039] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the stepper motor stall detection method as described in any one of the above items is implemented.
[0040] The above-mentioned stepper motor stall detection method, device, equipment and storage medium initialize the maximum stroke when the stepper motor is powered on and store the maximum stroke; control the stepper motor to drive the actuator to move forward to the stall point; if the stall point cannot be crossed for several consecutive times, control the stepper motor to drive the actuator to move in the reverse direction to the first hard stop position to obtain the reverse stroke; determine whether the stepper motor is stalled according to the maximum stroke and reverse stroke; if the stepper motor is stalled, control the stepper motor to stop moving and report error information to the controller. It is not dependent on current and does not require the stepper motor to have a sudden change in current when stalling, which effectively avoids damage to the control circuit, reduces the possibility of false stall misjudgment, and improves the accuracy of motor stall detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0042] Figure 1 is a flow chart of a stepper motor stall detection method in one embodiment of the present invention;
[0043] Figure 2 Schematic diagram of hard stop and stall point provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] The stepper motor stall detection method provided in the embodiment of the present invention redesigns the stall identification and control strategy. When the stepper motor is powered on, the maximum stroke is initialized, and the stepper motor is controlled to drive the actuator to move forward to the stall point; if the stall point cannot be crossed for several consecutive times, the stepper motor is controlled to drive the actuator to move in the reverse direction to the first hard stop to obtain the reverse stroke; whether the stepper motor is stalled is determined based on the maximum stroke and the reverse stroke; if the stepper motor is stalled, the stepper motor is controlled to stop moving and an error message is reported to the controller. When the stepper motor is stalled, the current does not surge, which avoids damage to the control circuit, effectively reduces the possibility of false stall misjudgment, and improves the accuracy of motor stall detection. This method is applicable to the field of interior motor component control in the automotive industry, including but not limited to the control of electric air-conditioning outlet blades of passenger cars and commercial vehicles.
[0046] In one embodiment, if Figure 1 As shown, a stepper motor stall detection method is provided, the method comprising the following steps:
[0047] S101: when the stepper motor is powered on, initializing the maximum stroke and storing the maximum stroke;
[0048] S102: Control the stepper motor to drive the actuator to perform a stall point detection movement;
[0049] S103: If the stall point cannot be crossed after several consecutive stall point detection movements, the stepping motor is controlled to drive the actuator to move in the reverse direction to the first hard stop position to obtain a reverse stroke;
[0050] S104: determining whether the stepping motor is stalled according to the maximum stroke and the reverse stroke;
[0051] S105: If the stepper motor is blocked, the stepper motor is controlled to stop moving, and an error message is reported to the controller.
[0052] The maximum stroke is the stroke between the first hard stop and the second hard stop, which is represented by the number of steps of the stepping motor.
[0053] As an example, in step S101, the maximum stroke is initialized when the stepper motor is powered on for the first time, and the maximum stroke L is recorded and stored.
[0054] The blocking point is a foreign object blocking point, that is, the blades of the actuator cannot pass through when encountering the foreign object.
[0055] As an example, in step S102, the stepper motor drives the actuator to move forward, and if the blade encounters a foreign object stall point, the blade attempts to pass the stall point. If the attempt fails, the stepper motor retreats and tries to pass the stall point again.
[0056] The reverse stroke H is the stroke from the stall point to the first hard stop, which is represented by the number of steps of the stepping motor.
[0057] As an example, in step S103, in this embodiment, the stepper motor drives the actuator to try to cross the stall point several times. If all attempts fail, the stepper motor is controlled to drive the actuator to move in the reverse direction to the first hard stop position, and the number of steps of the stepper motor is obtained to obtain the reverse stroke. This embodiment can effectively eliminate the situation of false stall faults by executing several attempts to cross the stall point.
[0058] When the stepper motor cannot pass the stall point, the stall point may be the second hard stop on the other side. The maximum stroke and reverse stroke can reflect whether the stall point that cannot be passed is a real stall.
[0059] As an example, in step S104, this embodiment determines the real stall through the relationship between the maximum stroke and the reverse stroke. If the relationship between the maximum stroke and the reverse stroke meets the preset condition, it is considered that the stepper motor cannot pass the stall point, and the real stall occurs at the stall point, not the second hard stop on the other side.
[0060] As an example, in step S105, if it is determined through step S104 that the stepper motor is stalled, the stepper motor is controlled to sleep and stop moving immediately to avoid the stepper motor repeatedly trying to hit the stall point and causing irreversible damage to the parts mechanism, protect the control circuit from being affected, and report error information to the controller.
[0061] In the stepper motor stall detection method provided in this embodiment, the previous stall identification and control strategy is changed. The stepper motor is controlled to drive the actuator to move forward to the stall point several times. If the stall point cannot be crossed, the stepper motor is controlled to drive the actuator to move reversely to the first hard stop to obtain the reverse stroke; whether the stepper motor is stalled is determined according to the maximum stroke and the reverse stroke; and when the stepper motor is stalled, the stepper motor is controlled to stop moving and an error message is reported to the controller. No current surge is required, which avoids damage to the control circuit, effectively reduces the possibility of false stall misjudgment, and improves the accuracy of motor stall detection.
[0062] In one embodiment, step S101, i.e., initializing the maximum stroke and storing the maximum stroke when the stepper motor is powered on, includes:
[0063] In step S1011, when the stepper motor is powered on, a self-learning function is executed to make the actuator blade touch the first hard stop and the second hard stop;
[0064] In step S1012, the travel between the first hard stop and the second hard stop is obtained as the initialization maximum travel;
[0065] In step S1013, the maximum stroke is recorded and stored.
[0066] The stepper motor includes hard stops on both sides, namely the first hard stop and the second hard stop. The hard stop refers to the use of a mechanical travel switch in conjunction with a travel block to limit the position. The blade of the actuator will stop moving when it reaches the hard stop. The stepper motor performs a stall point detection between the first hard stop and the second hard stop.
[0067] For ease of understanding, Figure 2 Schematic diagram of the hard stop and stall point provided for this embodiment.
[0068] As an example, in step S1011, when the stepper motor is powered on for the first time, a self-learning function is performed to make the actuator blade move forward from the first hard stop position to the second hard stop position.
[0069] The maximum stroke is the stroke between the first hard stop and the second hard stop, which is represented by the number of steps of the stepping motor.
[0070] As an example, in step S1012 and step S1013, after the stepper motor drives the actuator to complete the movement from the first hard stop to the second hard stop, the number of steps of the stepper motor is recorded as the maximum stroke, and the maximum stroke is recorded and stored.
[0071] In one embodiment, step S102, i.e. controlling the stepper motor to drive the actuator to perform stall point detection, includes:
[0072] Step S1021, controlling the stepper motor to drive the actuator to move forward;
[0073] Step S1022: If the stepper motor cannot pass the stall point, control the stepper motor to reversely retreat to a preset angle or control the stepper motor to drive the actuator to retreat to a preset distance;
[0074] Step S1023, controlling the stepper motor again to drive the actuator to perform forward motion.
[0075] This embodiment controls the stepper motor to drive the actuator to move forward to the stall point. When the stall point is encountered, the blade of the actuator attempts to cross the stall point. If the stall point cannot be crossed, the blade moves forward again after retreating a preset angle or a preset distance to try to cross the stall point. By retreating and then moving forward to try to cross the stall point, the probability of crossing the stall point can be increased and the possibility of false stall misjudgment can be reduced. Optionally, when the stepper motor drives the actuator to move forward three times and fails to cross the stall point, the false stall fault can be eliminated.
[0076] In one embodiment, step S102, i.e., controlling the stepper motor to drive the actuator to perform stall point detection, further includes:
[0077] Step S1024: If the stepper motor drives the actuator to pass the stall point, the stepper motor is controlled to drive the actuator to continue to move forward to the second hard stop.
[0078] In the stall point detection, if the blade of the actuator passes the stall point at any time, it means that the stepper motor is normal and the actuator continues to move forward to the second hard stop.
[0079] In one embodiment, step S104, i.e., determining whether the stepping motor is stalled according to the maximum stroke and the reverse stroke, includes:
[0080] Step S1041, calculating the difference between the maximum stroke and the reverse stroke;
[0081] Step S1042, calculating the ratio between the difference and the maximum stroke;
[0082] Step S1043, comparing the ratio with a preset correction value;
[0083] Step S1044, if the ratio is less than the preset correction value, it is determined that the stepper motor is not stalled;
[0084] Step S1045: If the ratio is greater than or equal to the correction value, it is determined that the stepper motor is stalled.
[0085] Wherein, the maximum stroke and reverse stroke of the stepper motor are represented by the number of steps of the stepper motor.
[0086] As an example, in steps S1041 and S1042 , the present embodiment calculates the difference (LH) between the maximum stroke L and the reverse stroke H, and then calculates the ratio between the difference (LH) and the maximum stroke L.
[0087] The preset correction value is a criterion for determining whether a real stall occurs, so as to eliminate the influence of the hard stop on the other side (ie, the second hard stop).
[0088] As an example, the correction value is preferably 5%. This embodiment compares the ratio (LH) / L with the above correction value. When (LH) / L<5%, the stepper motor is not stalled, and the stall point is the hard stop on the other side, that is, the second hard stop; when (LH) / L≥5%, it means that the stepper electronics is actually stalled at the stall point. This embodiment takes 5% as the correction value, which can effectively filter out false stalls caused by tolerance. The preset correction value can be adaptively adjusted according to actual debugging and is not unique.
[0089] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0090] In one embodiment, a terminal device is provided, including a memory, a controller, and a computer program stored in the memory and executable on the controller. When the controller executes the computer program, the stepper motor stall detection method in the above embodiment is implemented, for example Figure 1 S101-S105 shown are not described here again to avoid repetition.
[0091] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the stepper motor stall detection method in the above embodiment is implemented, for example Figure 1 S101-S105 shown are not described here in detail to avoid repetition.
[0092] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0093] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0094] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A stepper motor stall detection method, characterized in that: include: When the stepper motor is powered on, the maximum stroke is initialized and the maximum stroke is stored; Controlling the stepper motor to drive the actuator to perform stall point detection movement; If the stall point cannot be crossed after several consecutive stall point detection movements, the stepper motor is controlled to drive the actuator to move in the reverse direction to the first hard stop position to obtain a reverse stroke; Determining whether the stepper motor is stalled according to the maximum stroke and the reverse stroke; If the stepper motor is blocked, the stepper motor is controlled to stop moving and an error message is reported to the controller.
2. The stepper motor stall detection method according to claim 1, characterized in that: The stepping motor is controlled to drive the actuator to perform a stall point detection movement, including: Controlling the stepper motor to drive the actuator to move forward; If the stepper motor cannot pass the stall point, the stepper motor is controlled to retract in the reverse direction to a preset angle or the stepper motor is controlled to drive the actuator to retract a preset distance; The stepper motor is controlled again to drive the actuator to perform forward motion.
3. The stepper motor stall detection method according to claim 2, characterized in that: The stepping motor is controlled to drive the actuator to perform a stall point detection movement, and further includes: If the stepper motor drives the actuator to pass the stall point, the stepper motor is controlled to drive the actuator to continue to move forward to the second hard stop position.
4. The stepper motor stall detection method according to claim 1, characterized in that: The step of judging whether the stepping motor is stalled according to the maximum stroke and the reverse stroke comprises: Calculating the difference between the maximum stroke and the reverse stroke; Calculating a ratio between the difference and the maximum stroke; comparing the ratio with a preset correction value; If the ratio is less than the preset correction value, it is determined that the stepper motor is not stalled; If the ratio is greater than or equal to the preset correction value, it is determined that the stepper motor is stalled.
5. The stepper motor stall detection method according to claim 1, characterized in that: When the stepper motor is powered on, the maximum stroke is initialized and the maximum stroke is stored, which includes: When the stepper motor is powered on, the self-learning function is executed to make the actuator blade touch the first hard stop and the second hard stop; Obtaining the travel between the first hard stop and the second hard stop as the maximum travel; The maximum stroke is recorded and stored.
6. The stepper motor stall detection method according to claim 1, characterized in that: The maximum stroke and reverse stroke of the stepper motor are represented by the number of steps of the stepper motor.
7. A stepper motor stall detection device, characterized in that: The device comprises An initialization module, used to initialize the maximum stroke and store the maximum stroke when the stepper motor is powered on; A rotation control module, used for controlling the stepper motor to drive the actuator to perform a stall point detection movement; An acquisition module, used for controlling the stepper motor to drive the actuator to move in the reverse direction to a first hard stop position to acquire a reverse stroke if the stall point detection movement fails to cross the stall point for several consecutive times; A judging module, used for judging whether the stepping motor is stalled according to the maximum stroke and the reverse stroke; The stall processing module is used to control the stepper motor to stop moving if the stepper motor is stalled, and report error information to the controller.
8. The stepper motor stall detection device according to claim 7, characterized in that: The judging module comprises: A difference calculation unit, used for calculating the difference between the maximum stroke and the reverse stroke; a ratio calculation unit, used for calculating the ratio between the difference and the maximum stroke; a comparing unit, configured to compare the ratio with a preset correction value; The determination unit is used to determine that the stepper motor is not stalled if the ratio is less than the preset correction value; and to determine that the stepper motor is stalled if the ratio is greater than or equal to the preset correction value.
9. A device comprising a memory, a controller, and a computer program stored in the memory and executable on the controller, characterized in that: When the controller executes the computer program, the stepper motor stall detection method according to any one of claims 1 to 6 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the stepper motor stall detection method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Locked-rotor control method and device of electronic transmission, electronic transmission and bicycle
CN122407782A