Limit position test method, device and equipment of stepper motor and medium
By receiving encoder pulse feedback during the self-generated pulse process of the stepper motor, the limit type can be determined, thus solving the limit problem of the stepper motor during power-on initialization and improving the application reliability of the motor.
Patent Information
- Application Number
- CN202210090876.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-24
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-01-24
AI Technical Summary
When a stepper motor is powered on and undergoes phase initialization, structural interference can cause it to fail to return to zero correctly, leading to a "runaway" phenomenon and resulting in low application reliability.
By controlling the stepper motor's stepper driver to generate spontaneous pulses, receiving encoder pulse feedback, determining the encoder pulse feedback number, and judging the limit type, including forward and reverse limits, the speed loop control is prevented from going out of control due to limit.
This improves the reliability of stepper motor applications, avoids the "runaway" phenomenon caused by limit switches, and ensures the normal operation of stepper motors.
Smart Images

Figure CN114527382B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of motor controllers, in particular to a step motor limit position testing method, device, equipment and medium. BACKGROUND
[0002] The current step motor is prone to incorrect zero return when phase initialization is performed at power-on due to structural interference, which may cause the closed-loop step motor to be limited in position. The step motor that is limited in position may not work normally due to the "flywheel" phenomenon, resulting in low reliability of step motor application technology. SUMMARY
[0003] The main purpose of the present application is to provide a step motor limit position testing method, device, equipment and medium, aiming at solving the technical problem of low reliability of current step motor application.
[0004] To achieve the above-mentioned purpose, the step motor limit position testing method provided by the embodiments of the present application comprises:
[0005] The step driver of the step motor to be tested is controlled to generate self-generated pulses, which include forward self-generated pulses and / or reverse self-generated pulses;
[0006] The current encoder pulse feedback of the step motor to be tested during the self-generated pulse process is received, and the encoder pulse feedback number corresponding to the current encoder pulse feedback is determined;
[0007] Whether the step motor to be tested is limited in position is determined based on the encoder pulse feedback number, and the limit position includes forward limit position and / or reverse limit position.
[0008] Preferably, the step of determining whether the step motor to be tested is limited in position based on the encoder pulse feedback number comprises:
[0009] The encoder pulse feedback number is compared with a preset self-generated pulse threshold value;
[0010] If the total number of encoder pulse feedbacks is less than the preset self-generated pulse threshold value, the first phase deviation time of the step motor to be tested during the self-generated pulse process is obtained, and the first phase deviation time is the time difference between the reception of the current encoder pulse feedback and the reception of the next encoder pulse feedback;
[0011] Whether the step motor to be tested is limited in position is determined according to the first phase deviation time.
[0012] Preferably, after the step of comparing the encoder pulse feedback number with the preset self-generated pulse threshold value, the step further comprises:
[0013] if the total number of the encoder pulse feedbacks is equal to the preset spontaneous pulse threshold, determining whether the driver of the step motor to be tested completes the output of the spontaneous pulse;
[0014] if the driver completes the output of the spontaneous pulse, determining that the step motor to be tested is not limited.
[0015] Preferably, after the step of determining whether the driver of the step motor to be tested completes the output of the spontaneous pulse, the method further comprises:
[0016] if the driver does not complete the output of the spontaneous pulse, performing the step of acquiring the first phase overrun time of the step motor to be tested during the spontaneous pulse until determining whether the step motor to be tested is limited.
[0017] Preferably, the step of determining whether the step motor to be tested is limited according to the first phase overrun time comprises:
[0018] comparing the first phase overrun time with a preset time threshold;
[0019] if the first phase overrun time is greater than the preset time threshold, determining that the step motor to be tested is limited.
[0020] Preferably, the step of determining that the step motor to be tested is limited comprises:
[0021] if the spontaneous pulse is a forward spontaneous pulse, determining that the step motor to be tested is forward limited;
[0022] if the spontaneous pulse is a reverse spontaneous pulse, determining that the step motor to be tested is reverse limited.
[0023] Preferably, after the step of determining that the step motor to be tested is limited, the method further comprises:
[0024] if the step motor to be tested is forward limited, controlling the step driver to perform a reverse spontaneous pulse to make the step motor to be tested rotate in reverse, and performing the step of receiving the current encoder pulse feedback of the step motor to be tested during the spontaneous pulse until determining whether the step motor to be tested is reverse limited;
[0025] if the step motor to be tested is reverse limited, controlling the step driver to perform a forward spontaneous pulse to make the step motor to be tested rotate in forward, and performing the step of receiving the current encoder pulse feedback of the step motor to be tested during the spontaneous pulse until determining whether the step motor to be tested is forward limited.
[0026] To achieve the above object, the application further provides a step motor limit position testing device, which comprises:
[0027] a control module, configured to control a step driver of a step motor to be tested to generate a self-generating pulse, wherein the self-generating pulse comprises a forward self-generating pulse and / or a reverse self-generating pulse;
[0028] a receiving module, configured to receive current encoder pulse feedback of the step motor to be tested during the self-generating pulse, and determine an encoder pulse feedback number corresponding to the current encoder pulse feedback;
[0029] a determining module, configured to determine whether the step motor to be tested is limited in position based on the encoder pulse feedback number, wherein the limit in position comprises a forward limit in position and / or a reverse limit in position.
[0030] Further, to achieve the above object, the application further provides a step motor limit position testing device, which comprises a memory, a processor and a step motor limit position testing program stored in the memory and executable on the processor, and the step motor limit position testing program implements the steps of the step motor limit position testing method when executed by the processor.
[0031] Further, to achieve the above object, the application further provides a medium, which is a computer readable storage medium, and the computer readable storage medium stores a step motor limit position testing program, and the step motor limit position testing program implements the steps of the step motor limit position testing method when executed by a processor.
[0032] Further, to achieve the above object, the application further provides a computer program product, which comprises a computer program, and the computer program implements the steps of the step motor limit position testing method when executed by a processor.
[0033] The embodiment of the application provides a kind of step motor limit test method, device, equipment and medium, control the step motor of the step drive of to be tested to carry out spontaneous pulse, the spontaneous pulse includes positive spontaneous pulse and / or reverse spontaneous pulse;Receive the current encoder pulse feedback of the step motor to be tested in the spontaneous pulse process, and determine the encoder pulse feedback number corresponding to current encoder pulse feedback;Determine whether the step motor to be tested is limited based on the encoder pulse feedback number, and the limit includes positive limit and / or reverse limit.The application can be in the spontaneous pulse process of the step motor to be tested, according to the encoder pulse feedback number corresponding to the current encoder pulse feedback received accurately determine whether the step motor to be tested is limited, and when being limited, is positive limit or reverse limit, by determining the limit condition of the step motor to be tested, it is convenient to control the operation of step motor after testing according to limit condition, avoid the step motor in power-on and carry out phase lock, because being limited, lead to the speed ring control out of control caused by "fly car" phenomenon and cannot work normally, can improve the application reliability of step motor. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 For the structure schematic diagram of hardware running environment related to the step motor limit test method embodiment scheme of the application;
[0035] Figure 2 For the flowchart of the first embodiment of the step motor limit test method of the application;
[0036] Figure 3 For the flowchart of the second embodiment of the step motor limit test method of the application;
[0037] Figure 4 For the function module schematic diagram of the preferred embodiment of the step motor limit test device of the application.
[0038] The implementation of the object of the application, functional characteristics and advantages will be further described with reference to the drawings. DETAILED DESCRIPTION
[0039] It should be understood that the specific embodiments described herein are only used to explain the application, and are not used to limit the application.
[0040] The step motor limit position test method, device, equipment and medium provided by the embodiment of the application, the step motor to be tested is controlled to generate self-generated pulses by a step driver, the self-generated pulses include forward self-generated pulses and / or reverse self-generated pulses; current encoder pulse feedback of the step motor to be tested during the self-generated pulses is received, and the number of encoder pulse feedback corresponding to the current encoder pulse feedback is determined; whether the step motor to be tested is limited is determined based on the number of encoder pulse feedback, and the limit position includes forward limit position and / or reverse limit position. The embodiment of the application can accurately determine whether the step motor to be tested is limited and whether the limit position is forward limit position or reverse limit position according to the number of encoder pulse feedback corresponding to the current encoder pulse feedback during the self-generated pulses of the step motor to be tested, and the limit position of the step motor to be tested is determined, so that the step motor after testing can be controlled to operate according to the limit position, the phenomenon of "flying car" caused by the speed loop control out of control due to the fact that the step motor cannot accurately lock the initial phase when the phase is locked after power-on is avoided, and the application reliability of the step motor can be improved.
[0041] As Figure 1 shown, Figure 1 is a schematic diagram of a limit position test device of a step motor in a hardware running environment according to an embodiment of the application.
[0042] In the subsequent description, suffixes such as "module", "component" or "unit" used to represent elements are only for the convenience of the description of the application, and have no specific meaning. Therefore, "module", "component" or "unit" can be mixedly used.
[0043] The limit position test device of the step motor according to the embodiment of the application can be a PC, a tablet computer, a portable computer or other mobile terminal equipment.
[0044] As Figure 1 shown, the limit position test device of the step motor can include a processor 1001 such as a CPU, a network interface 1004, a user interface 1003, a memory 1005 and a communication bus 1002. The communication bus 1002 is used to realize the connection and communication between the components. The user interface 1003 can include a display screen (Display) and an input unit such as a keyboard (Keyboard). The optional user interface 1003 can also include a standard wired interface and a wireless interface. The network interface 1004 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory) such as a magnetic disk memory. The memory 1005 can also be a storage device independent of the aforementioned processor 1001.
[0045] Those skilled in the art can understand that Figure 1 The structure of the limit position testing device of the stepper motor shown in the figure is not a limitation of the limit position testing device of the stepper motor, and can include more or fewer components than the figure, or combine certain components, or different component arrangements.
[0046] As shown in Figure 1 The memory 1005 as a storage medium can include an operating system, a network communication module, a user interface module, and a limit position testing program of a stepper motor.
[0047] In the device shown in Figure 1 In the device shown in the figure, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the limit position testing program of the stepper motor stored in the memory 1005 and perform the following operations:
[0048] Control the step driver of the stepper motor to be tested to generate a spontaneous pulse, the spontaneous pulse including a forward spontaneous pulse and / or a reverse spontaneous pulse;
[0049] Receive the current encoder pulse feedback of the stepper motor to be tested during the spontaneous pulse process, and determine the encoder pulse feedback number corresponding to the current encoder pulse feedback;
[0050] Determine whether the stepper motor to be tested is limited based on the encoder pulse feedback number, the limit including forward limit and / or reverse limit.
[0051] Further, the step of determining whether the stepper motor to be tested is limited based on the encoder pulse feedback number includes:
[0052] Compare the encoder pulse feedback number with a preset spontaneous pulse threshold;
[0053] If the total number of encoder pulse feedbacks is less than the preset spontaneous pulse threshold, obtain a first phase difference time of the stepper motor to be tested during the spontaneous pulse process, the first phase difference time being the time difference between receiving the current encoder pulse feedback and receiving the next encoder pulse feedback;
[0054] Determine whether the stepper motor to be tested is limited according to the first phase difference time.
[0055] Further, after the step of comparing the encoder pulse feedback number with the preset spontaneous pulse threshold, the processor 1001 can be used to call the limit position testing program of the stepper motor stored in the memory 1005 and perform the following operations:
[0056] determining whether the driver of the stepper motor to be tested completes the output of the spontaneous pulse if the total number of the encoder pulse feedbacks is equal to the preset spontaneous pulse threshold value;
[0057] determining that the stepper motor to be tested is not limited if the driver completes the output of the spontaneous pulse.
[0058] Further, after the step of determining whether the driver of the stepper motor to be tested completes the output of the spontaneous pulse, the processor 1001 can be configured to invoke the limit test program of the stepper motor stored in the memory 1005 and perform the following operations:
[0059] if the driver does not complete the output of the spontaneous pulse, performing the step of obtaining the first phase overrun time of the stepper motor to be tested during the spontaneous pulse until determining whether the stepper motor to be tested is limited.
[0060] Further, the step of determining whether the stepper motor to be tested is limited according to the first phase overrun time comprises:
[0061] comparing the first phase overrun time with a preset time threshold value;
[0062] if the first phase overrun time is greater than the preset time threshold value, determining that the stepper motor to be tested is limited.
[0063] Further, the step of determining that the stepper motor to be tested is limited comprises:
[0064] if the spontaneous pulse is a forward spontaneous pulse, determining that the stepper motor to be tested is forward limited;
[0065] if the spontaneous pulse is a reverse spontaneous pulse, determining that the stepper motor to be tested is reverse limited.
[0066] Further, after the step of determining that the stepper motor to be tested is limited, the processor 1001 can be configured to invoke the limit test program of the stepper motor stored in the memory 1005 and perform the following operations:
[0067] if the stepper motor to be tested is forward limited, controlling the stepper driver to perform a reverse spontaneous pulse to make the stepper motor to be tested rotate in reverse, and performing the step of receiving the current encoder pulse feedback of the stepper motor to be tested during the spontaneous pulse until determining whether the stepper motor to be tested is reverse limited;
[0068] If the to-be-tested stepper motor is reversely limited, the step-by-step driver is controlled to perform a positive self-pulse to make the to-be-tested stepper motor rotate in a positive direction, and the step of receiving current encoder pulse feedback of the to-be-tested stepper motor during the self-pulse is performed until it is determined whether the to-be-tested stepper motor is positively limited.
[0069] For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to convey the scope of the present disclosure to those skilled in the art.
[0070] For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to convey the scope of the present disclosure to those skilled in the art.
[0071] With reference to Figure 2 , Figure 2 A flowchart of a step-by-step motor limit testing method provided by the first embodiment of the present application. In this embodiment, the step-by-step motor limit testing method comprises the following steps:
[0072] Step S10, control the step-by-step driver of the to-be-tested stepper motor to perform a self-pulse, the self-pulse including a positive self-pulse and / or a reverse self-pulse;
[0073] It can be understood that the current stepper motor is easy to be unable to correctly zero due to structural interference when it is powered on for phase initialization, thereby causing the closed-loop stepper motor to be limited. The stepper motor that is limited may not work normally due to the "runaway" phenomenon, resulting in low application reliability of the stepper motor. To solve the above problems, the present embodiment provides a step-by-step motor limit testing method, which can be applied to a step-by-step motor limit testing system. By executing the step-by-step motor limit testing method through the step-by-step motor limit testing system, it can be accurately determined whether the to-be-tested stepper motor is limited and whether it is positively or reversely limited according to the encoder pulse feedback number corresponding to the current encoder pulse feedback received during the self-pulse of the to-be-tested stepper motor. By determining the limit condition of the to-be-tested stepper motor, it is convenient to control the operation of the tested stepper motor according to the limit condition, thereby avoiding the "runaway" phenomenon caused by the speed loop control out of control due to the inability to accurately lock the initial phase when the stepper motor is powered on for phase locking, and improving the application reliability of the stepper motor. At the same time, for the convenience of description, the step-by-step motor limit testing system is referred to as the system hereinafter.
[0074] It can be understood that for each step motor, in order to avoid the phenomenon of "flying car" caused by being limited when the step motor is powered on to lock the phase, each step motor can be tested as a step motor to be tested before use. The step motor can be tested for limiting, and the step motor can be used according to the limiting condition obtained by testing, so that the step motor can work normally, and the application reliability of the step motor is improved.
[0075] Specifically, for each step motor to be tested, the system locks the motor of the step motor to be tested, sets the total number of self-generated pulses after completing the motor locking, converts the total number of self-generated pulses into a preset self-generated pulse threshold according to the running subdivision and the number of encoder lines of the step motor corresponding to the step motor to be tested, controls the step motor to be tested to generate self-generated pulses and gives enable, and stops self-generated pulses when the number of self-generated pulses of the step motor reaches the set total number of self-generated pulses. The initial direction of the self-generated pulse can be forward or reverse, that is, the step motor to be tested can be controlled to rotate forward by controlling the step motor to generate forward self-generated pulses, or the step motor to be tested can be controlled to rotate reverse by controlling the step motor to generate reverse self-generated pulses. In order to subsequently receive the current encoder pulse feedback of the step motor to be tested during the self-generated pulse process, and determine the pulse feedback number corresponding to the current pulse feedback.
[0076] Step S20, receiving the current encoder pulse feedback of the step motor to be tested during the self-generated pulse process, and determining the encoder pulse feedback number corresponding to the current encoder pulse feedback;
[0077] After controlling the step motor to be tested to generate self-generated pulses, the system receives the current position of the step motor to be tested through the encoder feedback, receives the current encoder pulse feedback sent by the encoder, and determines the encoder pulse feedback number of the step motor to be tested according to the number of received current encoder pulse feedback. Specifically, counting starts when the first encoder pulse feedback is received, and each time an encoder pulse feedback is received, the counting is accumulated to obtain the encoder pulse feedback number corresponding to the encoder pulse feedback. In order to subsequently determine whether the step motor to be tested is limited based on the encoder pulse feedback number, it can be determined whether the step motor to be tested is limited, and if it is limited, it can be determined whether it is one-way limited or two-way limited, so as to control the operation of the tested step motor according to the limiting condition, avoid the phenomenon of "flying car" caused by being limited when the step motor is powered on to lock the phase, and improve the application reliability of the step motor.
[0078] Step S30, determining whether the step motor to be tested is limited based on the encoder pulse feedback number, the limiting including forward limiting and / or reverse limiting.
[0079] After determining the encoder pulse feedback number corresponding to the current encoder pulse feedback, it is determined whether the to-be-tested stepping motor is limited by determining whether the encoder pulse feedback number reaches a preset spontaneous pulse threshold. Specifically, if the encoder pulse feedback number reaches the preset spontaneous pulse threshold and the driver of the to-be-tested stepping motor has completed the output of the spontaneous pulse, it is determined that the to-be-tested stepping motor is not limited, that the to-be-tested stepping motor has no collision, and that a certain number of pulses of the reverse spontaneous pulse are determined to re-find a suitable position. After a certain number of pulses of the reverse spontaneous pulse, the to-be-tested stepping motor is released and re-locked, and the number needs to be less than the total number of spontaneous pulses. If the encoder pulse feedback number does not reach the preset spontaneous pulse threshold, or the number of spontaneous pulses of the driver of the to-be-tested stepping motor reaches the total number of spontaneous pulses but the driver of the to-be-tested stepping motor has not completed the output of the spontaneous pulse, it is further determined whether the to-be-tested stepping motor is limited according to the first phase difference time of the to-be-tested stepping motor in the spontaneous pulse process. If the result of the current determination is that the to-be-tested stepping motor is limited, it is determined whether the limit is forward or reverse according to the direction of the spontaneous pulse. The first phase difference time is the time difference between receiving the current encoder pulse feedback and receiving the next encoder pulse feedback, and the first phase difference time can be multiple, for example, timing starts after receiving the first encoder pulse feedback, and ends when the second encoder pulse feedback is received. If the second encoder pulse feedback is not received, the timing is always on; timing starts again after the second encoder pulse feedback is received, and ends when the third encoder pulse feedback is received. If the third encoder pulse feedback is not received, the timing is always on. In this way, the process is repeated until the encoder pulse feedback number reaches the preset spontaneous pulse threshold. It should be noted that if the to-be-tested stepping motor is determined to be limited according to the first phase difference time of the to-be-tested stepping motor in the spontaneous pulse process, it is determined that the to-be-tested stepping motor is currently unidirectionally limited, and the stepping driver is further controlled to perform reverse spontaneous pulse to make the to-be-tested stepping motor rotate in the reverse direction. For example, if the current limit is forward, the stepping driver is controlled to perform reverse spontaneous pulse to make the to-be-tested stepping motor rotate in the reverse direction. If the current limit is reverse, the stepping driver is controlled to perform forward spontaneous pulse to make the to-be-tested stepping motor rotate in the forward direction. Further, the phase difference time of the to-be-tested stepping motor in the reverse direction spontaneous pulse process is determined to determine whether the to-be-tested stepping motor is limited in the reverse direction, i.e., whether the to-be-tested stepping motor is unidirectionally limited or bidirectionally limited. The to-be-tested stepping motor is controlled to operate according to the limit condition after testing, so as to avoid the phenomenon that the stepping motor cannot be accurately locked in the initial phase when the stepping motor is powered on and phase-locked due to being limited, which causes the speed ring control to lose control and causes the phenomenon of "flying car" and cannot work normally, and the application reliability of the stepping motor can be improved.
[0080] It can be understood that in the embodiment, the position of the phase change causing the to-be-tested stepper motor to be limited can also be accurately determined according to the number of encoder pulse feedbacks when the to-be-tested stepper motor is limited, so as to troubleshoot the to-be-tested stepper motor according to the position of the phase change, so that the to-be-tested stepper motor can work normally. When the position of the phase change causing the to-be-tested stepper motor to be limited is determined according to the number of encoder pulse feedbacks, the position of the phase change can be determined by combining the number of encoder pulse feedbacks with the running track corresponding to each pulse.
[0081] The embodiment provides a method for testing the limit of a stepper motor. A stepper driver of a to-be-tested stepper motor is controlled to generate a self-generating pulse, which includes a forward self-generating pulse and / or a reverse self-generating pulse. A current encoder pulse feedback during the self-generating pulse is received, and a number of encoder pulse feedbacks corresponding to the current encoder pulse feedback is determined. Whether the to-be-tested stepper motor is limited is determined based on the number of encoder pulse feedbacks. The limit includes forward limit and / or reverse limit. In the self-generating pulse of the to-be-tested stepper motor, the number of encoder pulse feedbacks corresponding to the current encoder pulse feedback received can be used to accurately determine whether the to-be-tested stepper motor is limited, and whether the limit is forward limit or reverse limit. By determining the limit of the to-be-tested stepper motor, the to-be-tested stepper motor can be controlled to operate according to the limit after testing, so that the stepper motor can work normally, and the application reliability of the stepper motor can be improved.
[0082] Further, with reference to Figure 3 , based on the first embodiment of the method for testing the limit of a stepper motor, a second embodiment of the method for testing the limit of a stepper motor is provided. In the second embodiment, the step of determining whether the to-be-tested stepper motor is limited based on the number of encoder pulse feedbacks includes:
[0083] Step S31, comparing the number of encoder pulse feedbacks with a preset self-generating pulse threshold value;
[0084] Step S32, if the total number of encoder pulse feedbacks is less than the preset self-generating pulse threshold value, a first phase difference time of the to-be-tested stepper motor during the self-generating pulse is obtained. The first phase difference time is a time difference between the current encoder pulse feedback and the next encoder pulse feedback.
[0085] Step S33, determining whether the to-be-tested stepper motor is limited according to the first phase difference time.
[0086] After determining the encoder pulse feedback number corresponding to the current encoder pulse feedback, the system compares the determined encoder pulse feedback number with the preset spontaneous pulse threshold, so as to determine the size relationship between the encoder pulse feedback number and the preset spontaneous pulse threshold. If it is determined after comparison that the encoder pulse feedback number is less than the preset spontaneous pulse threshold, the time length value obtained by starting timing when the current encoder pulse feedback is received is taken as the first phase difference time of the to-be-tested stepping motor in the spontaneous pulse process, and the first phase difference time is cleared and timing is restarted when the next encoder pulse feedback is received. Further, whether the to-be-tested stepping motor is limited is determined by comparing the first phase difference time with the preset time threshold, wherein the preset time threshold is a time value set according to actual test requirements. The to-be-tested stepping motor after test is controlled to operate according to the limiting condition, so as to avoid the phenomenon that the stepping motor cannot work normally due to the fact that the stepping motor cannot accurately lock the initial phase when the stepping motor is powered on to lock the phase because the stepping motor is limited, and the speed ring control is out of control, and the application reliability of the stepping motor can be improved.
[0087] Further, the step of comparing the encoder pulse feedback number with the preset spontaneous pulse threshold further comprises:
[0088] Step S34, if the total number of encoder pulse feedbacks is equal to the preset spontaneous pulse threshold, it is determined whether the driver of the to-be-tested stepping motor completes the output of the spontaneous pulse;
[0089] Step S35, if the driver completes the output of the spontaneous pulse, it is determined that the to-be-tested stepping motor is not limited.
[0090] In comparison between the determined encoder pulse feedback number and the preset spontaneous pulse threshold value, i.e., the pulse threshold value converted by the running subdivision of the stepper driver and the encoder line number, if the determined encoder pulse feedback number is equal to the preset spontaneous pulse threshold value, it indicates that the number of spontaneous pulses has met the pulse requirement, and then the spontaneous pulse giving can be prohibited. However, due to the delay between the spontaneous pulse received by the driver and the output of the spontaneous pulse, the spontaneous pulse has been given and completed, but actually the output of the spontaneous pulse may not be completed, i.e., there may be a situation that the pulse signal has been received, but the corresponding action has not been executed. Therefore, it is necessary to further determine whether the driver of the tested stepper motor completes the output of the spontaneous pulse, which can be determined by detecting the running track or running action of the tested stepper motor, if the running track or running action of the tested stepper motor is consistent with the preset running track or preset running action, it is determined that the driver completes the output of the spontaneous pulse, and if the running track or running action of the tested stepper motor is not consistent with the preset running track or preset running action, it is determined that the driver of the tested stepper motor does not complete the output of the spontaneous pulse. If it is determined that the driver completes the output of the spontaneous pulse, it indicates that the number of encoder pulse feedback reaches the pulse threshold value and the driver of the tested stepper motor has completed the output of the spontaneous pulse (i.e., the number of spontaneous pulses has reached the total number of spontaneous pulses), and the phase fixation (i.e., the limiting) will not occur again, i.e., the tested stepper motor completes the output of the spontaneous pulse without phase fixation, and then it is determined that the tested stepper motor is not limited, it is determined that the tested stepper motor has no collision and releases the tested stepper motor after a certain number of reverse spontaneous pulses, and then the tested stepper motor is locked again, and then the limiting test of the tested stepper motor is ended.
[0091] Further, after the step of determining whether the driver of the tested stepper motor completes the output of the spontaneous pulse, the step further comprises:
[0092] In step S36, if the driver does not complete the output of the spontaneous pulse, the step of acquiring the first phase difference time of the tested stepper motor during the spontaneous pulse is executed until it is determined whether the tested stepper motor is limited.
[0093] After determining whether the driver of the step motor to be tested completes the output of the self-generated pulse, if it is determined that the driver does not complete the output of the self-generated pulse, for example, the running track or running action of the step motor to be tested is inconsistent with the preset running track or preset running action, the time length value obtained by starting timing when the current pulse feedback is received is taken as the first phase excess time of the step motor to be tested in the self-generated pulse process. And further, by comparing the first phase excess time with the preset time threshold, it is determined whether the step motor to be tested is limited. If the first phase excess time is greater than the preset time threshold and the next pulse feedback is still not received, it is determined that the step motor to be tested is limited at the position corresponding to the pulse. Understandably, after determining that the step motor to be tested is limited in a single direction, the step driver needs to be controlled to perform reverse self-generated pulse to make the step motor to be tested rotate reversely to determine whether the step motor to be tested is limited when rotating reversely.
[0094] And if the next encoder pulse feedback is received before or when the first excess time reaches the preset time threshold, it is determined that the current phase is not fixed, that is, the step motor to be tested is not limited at the position corresponding to the current encoder pulse. The time length value obtained by starting timing when the next encoder pulse feedback is received is taken as the next first phase excess time of the step motor to be tested in the self-generated pulse process. And further, by comparing the next first phase excess time with the preset time threshold, it is determined whether the step motor to be tested is limited. This facilitates the control of the running of the tested step motor according to the limiting condition, avoids the "runaway" phenomenon caused by the speed loop control out of control due to the inability to accurately lock the initial phase when the step motor is powered on to lock the phase, and can improve the application reliability of the step motor.
[0095] Further, the step of determining whether the step motor to be tested is limited according to the first phase excess time comprises:
[0096] Step S331, comparing the first phase excess time with a preset time threshold;
[0097] Step S332, if the first phase excess time is greater than the preset time threshold, it is determined that the step motor to be tested is limited.
[0098] After the first phase overrun time of the to-be-tested stepping motor in the self-generating pulse process is acquired, the first phase overrun time is compared with the preset time threshold, which can be specifically a numerical value comparison between the first phase overrun time and the preset time threshold, so as to determine the size relationship between the first phase overrun time and the preset time threshold. Further, if it is determined through comparison that the first phase overrun time is greater than the preset time threshold, it means that the next pulse feedback is not received after the current pulse feedback is received and the preset time threshold is exceeded, which indicates that the phase of the to-be-tested stepping motor is fixed, and then it is determined that the to-be-tested stepping motor is limited.
[0099] Further, the step of determining that the to-be-tested stepping motor is limited includes:
[0100] Step A, if the self-generating pulse is a forward self-generating pulse, it is determined that the to-be-tested stepping motor is forward limited;
[0101] Step B, if the self-generating pulse is a reverse self-generating pulse, it is determined that the to-be-tested stepping motor is reverse limited.
[0102] After it is determined that the first phase overrun time is greater than the preset time threshold, if the rotation direction of the to-be-tested stepping motor is forward, it is determined that the to-be-tested stepping motor is forward limited; and if the current rotation direction of the to-be-tested stepping motor is reverse, it is determined that the to-be-tested stepping motor is reverse limited.
[0103] The embodiment can accurately determine whether the to-be-tested stepping motor is limited and whether it is forward limited or reverse limited according to the current encoder pulse feedback corresponding to the encoder pulse feedback received in the self-generating pulse process of the to-be-tested stepping motor. By determining the limiting condition of the to-be-tested stepping motor, the operation of the tested stepping motor can be controlled according to the limiting condition, so as to avoid the "runaway" phenomenon caused by the speed loop control out of control due to the inability to accurately lock the initial phase when the stepping motor is powered on to lock the phase, and the stepping motor cannot work normally, and the application reliability of the stepping motor can be improved.
[0104] Further, after the step of determining that the to-be-tested stepping motor is limited, the method further includes:
[0105] Step C, if the to-be-tested stepping motor is forward limited, the stepping driver is controlled to perform a reverse self-generating pulse to make the to-be-tested stepping motor rotate in reverse, and the step of receiving the current encoder pulse feedback of the to-be-tested stepping motor in the self-generating pulse process is executed, until it is determined whether the to-be-tested stepping motor is reverse limited;
[0106] Step D, if the stepper motor under test is reverse limited, then control the stepper driver to positive self-initiate pulse the stepper motor under test to rotate in the positive direction and perform the step of receiving the current encoder pulse feedback of the stepper motor under test during the self-initiate pulse until it is determined whether the stepper motor under test is positive limited.
[0107] After determining that the to-be-tested stepper motor is limited, it is determined that the to-be-tested stepper motor is at least unidirectionally limited. After the to-be-tested stepper motor is unidirectionally limited, the embodiment can further determine whether the to-be-tested stepper motor is bidirectionally limited. Specifically, if the to-be-tested stepper motor is positively limited, the actual positive spontaneous pulse number is saved, the motor commutation of the to-be-tested stepper motor is enabled, and the reverse spontaneous pulse is given to enable the stepper driver to perform reverse spontaneous pulse compensation for a certain number of pulses. Further, it is determined whether the reverse spontaneous pulse compensation is completed, and if not, the compensation is waited until it is completed. If it is completed, the judgment of whether the to-be-tested stepper motor is limited is enabled, and the encoder pulse feedback number corresponding to the current encoder pulse feedback is determined. Since the pulse compensation is performed, the preset spontaneous pulse threshold also needs to be updated. The new preset spontaneous pulse threshold is the sum of the original preset spontaneous pulse threshold and the feedback pulse number converted from the running subdivision of the compensation spontaneous pulse number and the encoder line number. Further, whether the encoder pulse feedback number reaches the new preset spontaneous pulse threshold is determined to determine whether the to-be-tested stepper motor is reversely limited. Specifically, if the spontaneous pulse number of the driver has reached the sum of the total spontaneous pulse number and the compensation spontaneous pulse number, the spontaneous pulse reverse given is prohibited, and it is determined whether the driver of the to-be-tested stepper motor has completed the output of the reverse spontaneous pulse. If the driver of the to-be-tested stepper motor has completed the output of the reverse spontaneous pulse, it is determined that the to-be-tested stepper motor is not reversely limited, that the to-be-tested stepper motor is not collided, and that the to-be-tested stepper motor is released after a certain number of pulses in the reverse direction of the spontaneous pulse, wherein the number is less than the new total number of spontaneous pulses. If the encoder pulse feedback number does not reach the new preset spontaneous pulse threshold, or the spontaneous pulse number is equal to the new total number of spontaneous pulses but the driver of the to-be-tested stepper motor has not completed the output of the reverse spontaneous pulse, it is further determined whether the to-be-tested stepper motor is reversely limited according to the phase difference time of the to-be-tested stepper motor in the reverse spontaneous pulse process. The specific content is referred to the above step of determining whether the to-be-tested stepper motor is limited according to the first phase difference time of the to-be-tested stepper motor in the spontaneous pulse process, which is not repeated here. The phase difference time is the time difference between receiving the current encoder pulse feedback and receiving the next encoder pulse feedback, and the phase difference time can be multiple, for example, the timing starts after receiving the first encoder pulse feedback, and ends when the second encoder pulse feedback is received. If the second encoder pulse feedback is not received, the timing is always performed; after receiving the second encoder pulse feedback, the timing is restarted, and ends when the third encoder pulse feedback is received. If the third encoder pulse feedback is not received, the timing is always performed, and so on, until the encoder pulse feedback number reaches the new preset spontaneous pulse threshold.If it is determined that the stepping motor to be tested is reverse limited, the stepping motor to be tested is reversed, the actual reverse spontaneous pulse number is saved, a certain number of reverse spontaneous pulses are sent to re-search for a suitable position, and the stepping motor to be tested is released and re-locked after the certain number of reverse spontaneous pulses, wherein the number is less than the difference between the actual forward spontaneous pulse number and the actual reverse spontaneous pulse number.
[0108] If the stepping motor to be tested is reverse limited, the actual reverse spontaneous pulse number is saved, the motor commutation of the stepping motor to be tested is controlled by the stepping driver, and the stepping motor to be tested is enabled to rotate forward by the spontaneous pulse and compensated by a certain number of pulses. Further, it is determined whether the forward spontaneous pulse compensation is completed, and if not, the compensation is waited until it is completed. If the compensation is completed, the determination of whether the stepping motor to be tested is limited is enabled, and the encoder pulse feedback number corresponding to the current encoder pulse feedback is determined. Since the pulse compensation is performed, the preset spontaneous pulse threshold value also needs to be updated. The new preset spontaneous pulse threshold value is the sum of the original preset spontaneous pulse threshold value and the feedback pulse number converted from the running subdivision of the driver and the encoder line number of the compensated spontaneous pulse number. Further, whether the stepping motor to be tested is forward limited is determined by determining whether the encoder pulse feedback number reaches the new preset spontaneous pulse threshold value. Specifically, if the spontaneous pulse number of the driver has reached the sum of the total spontaneous pulse number and the compensated spontaneous pulse number, the spontaneous pulse forward setting is prohibited, and it is determined whether the driver of the stepping motor to be tested has completed the output of the forward spontaneous pulse. If the driver of the stepping motor to be tested has completed the output of the forward spontaneous pulse, it is determined that the stepping motor to be tested is not forward limited, it is determined that the stepping motor to be tested has no collision, and the stepping motor to be tested is released after a certain number of pulses of the reverse spontaneous pulse, and then the machine is relocked, wherein the number needs to be less than the new total spontaneous pulse number. If the pulse feedback number does not reach the new preset spontaneous pulse threshold value, or the spontaneous pulse number is equal to the new total spontaneous pulse number but the driver of the stepping motor to be tested has not completed the output of the forward spontaneous pulse, it is further determined whether the stepping motor to be tested is forward limited according to the phase difference time of the stepping motor to be tested in the forward spontaneous pulse process. The specific content is referred to the above-mentioned step of determining whether the stepping motor to be tested is limited according to the first phase difference time of the stepping motor to be tested in the spontaneous pulse process, which is not repeated here. The phase difference time is the time difference between receiving the current encoder pulse feedback and receiving the next encoder pulse feedback, and the phase difference time can be multiple, for example, timing starts after receiving the first encoder pulse feedback, and ends when the second encoder pulse feedback is received. If the second encoder pulse feedback is not received, the timing is always on; timing starts again after receiving the second encoder pulse feedback, and ends when the third encoder pulse feedback is received. If the third encoder pulse feedback is not received, the timing is always on. In this way, the encoder pulse feedback number reaches the new preset spontaneous pulse threshold value.If it is determined that the to-be-tested stepping motor is forward limited, the actual forward spontaneous pulse quantity is saved after the motor commutation is performed on the to-be-tested stepping motor, a certain number of reverse spontaneous pulses are sent to re-search for a suitable position, and the to-be-tested stepping motor is released and re-locked after the certain number of reverse spontaneous pulses.
[0109] The embodiment can further determine whether the to-be-tested stepping motor is bidirectionally limited after determining that the to-be-tested stepping motor is unidirectionally limited, so as to control the operation of the tested stepping motor according to the limiting condition, avoid the "runaway" phenomenon caused by the fact that the stepping motor cannot accurately lock the initial phase when the phase is locked after power-on due to being limited, and cannot work normally, and improve the application reliability of the stepping motor.
[0110] Further, the application further provides a limiting test device for a stepping motor.
[0111] Reference Figure 4 , Figure 4 FIG. 1 is a schematic diagram of function modules of a first embodiment of the limiting test device for a stepping motor.
[0112] The limiting test device for a stepping motor comprises:
[0113] A control module 10 is configured to control a stepping driver of a to-be-tested stepping motor to perform spontaneous pulses, wherein the spontaneous pulses comprise forward spontaneous pulses and / or reverse spontaneous pulses.
[0114] A receiving module 20 is configured to receive current encoder pulse feedback of the to-be-tested stepping motor during the spontaneous pulses, and determine an encoder pulse feedback number corresponding to the current encoder pulse feedback.
[0115] A determining module 30 is configured to determine whether the to-be-tested stepping motor is limited based on the encoder pulse feedback number, wherein the limiting comprises forward limiting and / or reverse limiting.
[0116] In addition, the application further provides a medium, preferably a computer readable storage medium, having a limiting test program for a stepping motor stored thereon, wherein the limiting test program for the stepping motor, when executed by a processor, implements the steps of each embodiment of the limiting test method for the stepping motor.
[0117] In addition, the application further provides a computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the steps of each embodiment of the limiting test method for the stepping motor.
[0118] In the embodiments of the step motor limit position test device, the computer readable storage medium and the computer program product, all the technical features of the embodiments of the step motor limit position test method are contained, and the description and explanation are basically the same as those of the embodiments of the step motor limit position test method, and will not be repeated here.
[0119] It should be noted that in this paper, the term "include", "contain" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the sentence "includes a" does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0120] The above application embodiment serial number is only for description, not representing the pros and cons of the embodiment.
[0121] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment method can be realized by software and necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a plurality of instructions for making a terminal device (which can be a fixed terminal, such as Internet of Things intelligent device, including smart air conditioner, smart lamp, smart power supply, smart router and other smart home; or mobile terminal, including smart phone, wearable networked AR / VR device, smart speaker, autonomous vehicle and many other networked devices) execute the method described in each embodiment of the present application.
[0122] The above is only the preferred embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for testing the limit of a stepper motor, characterized in that, The limit position test method of the stepping motor comprises: controlling a stepping driver of a stepping motor to be tested to generate a self-generating pulse, wherein the self-generating pulse comprises a forward self-generating pulse and / or a reverse self-generating pulse; receiving current encoder pulse feedback of the stepping motor to be tested during the self-generating pulse, and determining an encoder pulse feedback number corresponding to the current encoder pulse feedback; determining whether the stepping motor to be tested is limited based on the encoder pulse feedback number, wherein the limit position comprises a forward limit position and / or a reverse limit position, and the determination comprises: comparing the encoder pulse feedback number with a preset self-generating pulse threshold value; if the total number of the encoder pulse feedback is less than the preset self-generating pulse threshold value, obtaining a first phase difference time of the stepping motor to be tested during the self-generating pulse, wherein the first phase difference time is a time difference between the current encoder pulse feedback and a next encoder pulse feedback; determining whether the stepping motor to be tested is limited according to the first phase difference time, wherein the determination comprises: comparing the first phase difference time with a preset time threshold value; if the first phase difference time is greater than the preset time threshold value, determining that the stepping motor to be tested is limited; if the total number of the encoder pulse feedback is equal to the preset self-generating pulse threshold value, determining whether the stepping motor to be tested is limited according to whether the driver of the stepping motor to be tested completes the output of the self-generating pulse, and the determination comprises: if a running track or a running action of the stepping motor to be tested is consistent with a preset running track or a preset running action, determining that the driver of the stepping motor to be tested completes the output of the self-generating pulse, and determining that the stepping motor to be tested is not limited.
2. The method of claim 1, wherein the step motor is a stepper motor. After the step of determining whether the driver of the stepping motor to be tested completes the output of the self-generating pulse, the method further comprises: if the driver does not complete the output of the self-generating pulse, executing the step of obtaining the first phase difference time of the stepping motor to be tested during the self-generating pulse until determining whether the stepping motor to be tested is limited.
3. The method of claim 1, wherein the step motor is a stepper motor. The step of determining that the stepping motor to be tested is limited comprises: if the self-generating pulse is a forward self-generating pulse, determining that the stepping motor to be tested is forward limited; if the self-generating pulse is a reverse self-generating pulse, determining that the stepping motor to be tested is reverse limited.
4. The method of claim 1, wherein the step of testing the limit of the stepper motor is performed by a microprocessor. After the step of determining that the stepping motor to be tested is limited, the method further comprises: if the stepping motor to be tested is forward limited, controlling the stepping driver to generate a reverse self-generating pulse to make the stepping motor to be tested rotate in a reverse direction, and executing the step of receiving the current encoder pulse feedback of the stepping motor to be tested during the self-generating pulse until determining whether the stepping motor to be tested is reverse limited; if the stepping motor to be tested is reverse limited, controlling the stepping driver to generate a forward self-generating pulse to make the stepping motor to be tested rotate in a forward direction, and executing the step of receiving the current encoder pulse feedback of the stepping motor to be tested during the self-generating pulse until determining whether the stepping motor to be tested is forward limited.
5. A position limit testing device for a stepper motor, characterized by, The step motor limit position testing device comprises: a control module configured to control a step driver of a step motor to be tested to generate a self-generating pulse, wherein the self-generating pulse comprises a forward self-generating pulse and / or a reverse self-generating pulse; a receiving module configured to receive a current encoder pulse feedback of the step motor to be tested during the self-generating pulse and determine a number of encoder pulse feedbacks corresponding to the current encoder pulse feedback; a determining module configured to determine whether the step motor to be tested is limited based on the number of encoder pulse feedbacks, wherein the limitation comprises forward limitation and / or reverse limitation, and wherein the determining comprises: comparing the number of encoder pulse feedbacks with a preset self-generating pulse threshold value; if the total number of encoder pulse feedbacks is less than the preset self-generating pulse threshold value, obtaining a first phase difference time of the step motor to be tested during the self-generating pulse, wherein the first phase difference time is a time difference between a time when the current encoder pulse feedback is received and a time when a next encoder pulse feedback is received; determining whether the step motor to be tested is limited based on the first phase difference time, wherein the determining comprises comparing the first phase difference time with a preset time threshold value; if the first phase difference time is greater than the preset time threshold value, determining that the step motor to be tested is limited; if the total number of encoder pulse feedbacks is equal to the preset self-generating pulse threshold value, determining whether the step motor to be tested is limited based on whether a driver of the step motor to be tested completes output of the self-generating pulse, wherein the determining comprises: if a running track or a running action of the step motor to be tested is consistent with a preset running track or a preset running action, determining that the driver of the step motor to be tested completes output of the self-generating pulse, and determining that the step motor to be tested is not limited.
6. A position limit testing device for a stepper motor, characterized by, The step motor limit position testing device comprises a memory, a processor, and a step motor limit position testing program stored in the memory and executable on the processor, and the step motor limit position testing program, when executed by the processor, implements the steps of the step motor limit position testing method according to any one of claims 1-4.
7. A medium, the medium being a computer-readable storage medium, characterized in that, The computer readable storage medium stores a step motor limit position testing program, and the step motor limit position testing program, when executed by a processor, implements the steps of the step motor limit position testing method according to any one of claims 1-4.
Citation Information
Patent Citations
Cradle head control method and device
CN106341649A
Controller for drive of pulse motor
JP1987123991A