Device zeroing method, apparatus, terminal device, and medium
By acquiring the real-time and standard operating parameters of the motor and detecting the pulse signal of the mechanical limit, the zero-return operation of the equipment is simplified and precise, solving the problem of complex zero-return operation in the existing technology, and is applicable to various drive systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN YAKO AUTOMATION TECH CO LTD
- Filing Date
- 2022-11-03
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies involve complex zero-return operations, making them unsuitable for a wide range of industrial scenarios, especially industrial sites where sensors cannot be installed.
By acquiring the motor's real-time and standard operating parameters, the pulse signal corresponding to the mechanical limit is directly detected, and the device is homed using the pulse signal, thus avoiding the need for sensors.
It simplifies the equipment's homing operation, improves homing accuracy, is applicable to various drive systems, and reduces homing complexity.
Smart Images

Figure CN116073702B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automatic control technology, and in particular to a method, apparatus, terminal device, and computer-readable storage medium for equipment returning to zero. Background Technology
[0002] Equipment homing operation means controlling the equipment to return to a predetermined origin position, and then performing subsequent task control and processing operations based on that origin position.
[0003] In related technologies, sensor signals can be used as the zero-homing point. Specifically, position sensors such as Hall switches and photodiodes are installed at the zero-homing point. When the equipment returns to this point, the sensor sends a detection signal, and when the control circuit detects this signal, it controls the equipment to stop at the corresponding position. However, this method of equipment zeroing increases the complexity of the circuit and cannot be universally applied to various industrial scenarios. Summary of the Invention
[0004] The main objective of this invention is to provide a method, apparatus, terminal device, and computer-readable storage medium for equipment zeroing, which aims to directly perform equipment zeroing based on mechanical limit switches, thereby achieving flexible and precise equipment zeroing operation.
[0005] To achieve the above objectives, the present invention provides a method for homing a device, the method comprising the following steps:
[0006] The system acquires the real-time and standard operating parameters of the motor driving the device, and detects the pulse signal corresponding to the mechanical limit switch that restricts the device's operation based on the real-time and standard operating parameters.
[0007] The device is homed based on the pulse signal.
[0008] Optionally, the real-time operating parameters include first real-time operating parameters, and the standard operating parameters include first standard operating parameters. The step of acquiring the real-time operating parameters and standard operating parameters of the motor driving the device, and detecting the pulse signal corresponding to the mechanical limit switch restricting the device's operation based on the real-time operating parameters and the standard operating parameters, includes:
[0009] The stepper motor is controlled to run in a preset direction by pulse commands triggered by the stepper driver;
[0010] The first real-time operating parameters of the stepper motor are obtained through the motor encoder, and the parameters corresponding to the pulse command are used as the first standard operating parameters.
[0011] When the first real-time operating parameter is within a preset first range and the difference between the first standard operating parameter and the first real-time operating parameter reaches a preset threshold, the rising edge of the pulse signal corresponding to the mechanical limit switch that restricts the operation of the detection device takes effect.
[0012] Optionally, when the mechanical limit is an elastic limit, after the step of detecting the rising edge of the pulse signal corresponding to the mechanical limit when the first real-time operating parameter is within a preset first range and the difference between the first standard operating parameter and the first real-time operating parameter reaches a preset threshold, the method further includes:
[0013] The stepper driver controls the stepper motor to run in the opposite direction to the preset direction, and obtains the current second real-time operating parameters and second standard operating parameters of the stepper motor.
[0014] When the difference between the second real-time operating parameter and the second standard operating parameter is a preset first reference value, a torque command is triggered by the stepper driver.
[0015] At the elastic limit, the stepper motor is unloaded based on the torque command to detect the falling edge of the pulse signal corresponding to the elastic limit.
[0016] Optionally, the step of unloading the stepper motor at the elastic limit based on the torque command includes:
[0017] According to the torque command, the motor shaft torque of the stepper motor is controlled to be reduced to a preset second reference value, and the current third real-time operating parameters of the stepper motor are obtained to unload the stepper motor at the elastic limit.
[0018] The step of detecting the pulse signal corresponding to the mechanical limit of the operating limit device includes:
[0019] When the third real-time operating parameter is within the preset second range, the falling edge of the pulse signal corresponding to the elastic limit is detected.
[0020] Optionally, the step of performing the motor homing operation based on the pulse signal includes:
[0021] The stepper motor is controlled to run at low speed in a preset direction, and during the operation, it is determined whether the rising or falling edge of the pulse signal of the mechanical limit point is detected.
[0022] If so, the stepper motor is controlled to run at low speed in the opposite direction to the preset direction, and during the operation, it is determined whether the first motor Z signal after the rising edge or the falling edge is detected;
[0023] If the first motor Z signal is detected, the stepper motor is controlled to stop running in order to complete the device's return-to-zero operation.
[0024] Optionally, the step of performing a zero-return operation on the motor based on the pulse signal includes:
[0025] The stepper motor is controlled to run at low speed in a preset direction, and during the operation, it is determined whether the rising edge of the pulse signal at the mechanical limit point is detected.
[0026] If the rising edge is detected, the stepper motor is controlled to stop running in order to complete the device return to zero operation.
[0027] Optionally, the step of performing a zero-return operation on the motor based on the pulse signal includes:
[0028] The stepper motor is controlled to run at a low speed in a preset direction, and during the operation, it is determined whether the rising edge of the pulse signal of the mechanical limit point is detected.
[0029] If the rising edge is detected, the stepper motor is controlled to run at low speed in the opposite direction to the preset direction, and the falling edge is checked again during the operation.
[0030] If the falling edge is detected, the motor is controlled to stop running to complete the equipment return-to-zero operation.
[0031] To achieve the above objectives, the present invention also provides a device for homing equipment, the device comprising:
[0032] The determination module is used to acquire the real-time operating parameters and standard operating parameters of the motor driving the device, and to detect the pulse signal corresponding to the mechanical limit switch that restricts the operation of the device based on the real-time operating parameters and the standard operating parameters.
[0033] The zero-return module is used to perform a zero-return operation on the device based on the pulse signal.
[0034] To achieve the above objectives, the present invention also provides a terminal device, the terminal device including a memory, a processor, and a device zeroing program stored in the memory and executable on the processor, wherein the device zeroing program, when executed by the processor, implements the steps of the device zeroing method as described above.
[0035] Furthermore, to achieve the above objectives, the present invention also proposes a computer-readable storage medium storing a device homing program, which, when executed by a processor, implements the steps of the device homing method described above.
[0036] To achieve the above objectives, the present invention also provides a computer program product, the computer program product comprising a computer program, which, when executed by a processor, implements the steps of the device zeroing method described above.
[0037] This invention provides a device, apparatus, terminal device, computer-readable storage medium, and computer program product for returning equipment to zero. It acquires real-time and standard operating parameters of the motor driving the equipment, and detects pulse signals corresponding to mechanical limit switches that restrict equipment operation based on the real-time and standard operating parameters; and performs a zero-return operation based on the pulse signals.
[0038] Compared to existing technologies that use sensors for zeroing, this invention directly acquires the pulse signal corresponding to the mechanical limit based on the motor's real-time and standard operating parameters, and then performs the zeroing operation based on this pulse signal. Therefore, this invention can directly perform zeroing operation on the motor based on the mechanical limit, eliminating the need for additional circuitry and simplifying the complex zeroing process. Furthermore, because this invention directly utilizes pulse signals for zeroing, it improves zeroing accuracy compared to using sensors and is universally applicable to zeroing operations in various drive systems. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the hardware operating environment involved in the embodiments of the present invention;
[0040] Figure 2 This is a flowchart illustrating an embodiment of the device zeroing method of the present invention;
[0041] Figure 3-1 This is a first schematic diagram of the device zeroing method according to an embodiment of the present invention.
[0042] Figure 3-2 This is a second schematic diagram of the device zeroing method according to an embodiment of the present invention;
[0043] Figure 4-1 This is a third schematic diagram of the device zeroing method according to an embodiment of the present invention;
[0044] Figure 4-2 This is a fourth schematic diagram of the device zeroing method according to an embodiment of the present invention;
[0045] Figure 5-1 This is a fifth schematic diagram of the device zeroing method according to an embodiment of the present invention;
[0046] Figure 5-2 This is a sixth schematic diagram of the device zeroing method according to an embodiment of the present invention;
[0047] Figure 6 This is a functional module diagram of an embodiment of the zero-return device of the present invention.
[0048] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0049] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0050] like Figure 1 As shown, Figure 1 This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiments of the present invention.
[0051] The terminal device in this embodiment of the invention can be a driver that drives a motor, or it can be a smartphone, industrial control computer, server, or network device. The terminal device in this embodiment can be used for precise zeroing of the device.
[0052] like Figure 1 As shown, the terminal device may 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 enable communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be high-speed RAM or non-volatile memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0053] Those skilled in the art will understand that Figure 1 The device structure shown does not constitute a limitation on the device for returning to zero. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0054] like Figure 1 As shown, the memory 1005, as a computer storage medium, may include an operation module, a network communication module, a user interface module, and a device homing program. The operation module is a program that manages and controls the device's hardware and software resources, supporting the operation of the device homing program and other software or programs. Figure 1In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the server; and the processor 1001 can be used to call the device homing program stored in the memory 1005 and perform the following operations:
[0055] The system acquires the real-time and standard operating parameters of the motor driving the device, and detects the pulse signal corresponding to the mechanical limit switch that restricts the device's operation based on the real-time and standard operating parameters.
[0056] The device is homed based on the pulse signal.
[0057] Furthermore, the real-time operating parameters include first real-time operating parameters, and the standard operating parameters include: first standard operating parameters. The processor 1001 can be used to call the device zero-return program stored in the memory 1005 and perform the following operations:
[0058] The stepper motor is controlled to run in a preset direction by pulse commands triggered by the stepper driver;
[0059] The first real-time operating parameters of the stepper motor are obtained through the motor encoder, and the parameters corresponding to the pulse command are used as the first standard operating parameters.
[0060] When the first real-time operating parameter is within a preset first range and the difference between the first standard operating parameter and the first real-time operating parameter reaches a preset threshold, the rising edge of the pulse signal corresponding to the mechanical limit switch that restricts the operation of the detection device takes effect.
[0061] Furthermore, when the mechanical limit is an elastic limit, after the step of detecting the rising edge of the pulse signal corresponding to the mechanical limit when the first real-time operating parameter is within a preset first range and the difference between the first standard operating parameter and the first real-time operating parameter reaches a preset threshold, the processor 1001 can be used to call the device homing program stored in the memory 1005 and perform the following operations:
[0062] The stepper motor is controlled to run in the opposite direction to the preset direction by the stepper driver, and the current second real-time operating parameters and second standard operating parameters of the stepper motor are obtained.
[0063] When the difference between the second real-time operating parameter and the second standard operating parameter is a preset first reference value, a torque command is triggered by the stepper driver.
[0064] At the elastic limit, the stepper motor is unloaded based on the torque command, and the falling edge of the pulse signal corresponding to the elastic limit is detected to take effect.
[0065] Furthermore, the processor 1001 can be used to call the device homing program stored in the memory 1005 and perform the following operations:
[0066] According to the torque command, the motor shaft torque of the stepper motor is controlled to be reduced to a preset second reference value, so as to unload the stepper motor at the elastic limit and obtain the current third real-time operating parameters of the stepper motor.
[0067] The processor 1001 can be used to call the device homing program stored in the memory 1005 and perform the following operations:
[0068] When the third real-time operating parameter is within the preset second range, the falling edge of the pulse signal corresponding to the elastic limit is detected.
[0069] Furthermore, the processor 1001 can be used to call the device homing program stored in the memory 1005 and perform the following operations:
[0070] The stepper motor is controlled to run at low speed in a preset direction, and during the operation, it is determined whether the rising or falling edge of the pulse signal of the mechanical limit point is detected.
[0071] If so, the stepper motor is controlled to run at low speed in the opposite direction to the preset direction, and during the operation, it is determined whether the first motor Z signal after the rising edge or the falling edge is detected;
[0072] If the first motor Z signal is detected, the stepper motor is controlled to stop running in order to complete the device's return-to-zero operation.
[0073] Furthermore, the processor 1001 can be used to call the device homing program stored in the memory 1005 and perform the following operations:
[0074] The stepper motor is controlled to run at low speed in a preset direction, and during the operation, it is determined whether the rising edge of the pulse signal at the mechanical limit point is detected.
[0075] If the rising edge is detected, the stepper motor is controlled to stop running in order to complete the device return to zero operation.
[0076] Furthermore, the processor 1001 can be used to call the device homing program stored in the memory 1005 and perform the following operations:
[0077] The stepper motor is controlled to run at a low speed in a preset direction, and during the operation, it is determined whether the rising edge of the pulse signal of the mechanical limit point is detected.
[0078] If the rising edge is detected, the stepper motor is controlled to run at low speed in the opposite direction to the preset direction, and the falling edge is checked again during the operation.
[0079] If the falling edge is detected, the motor is controlled to stop running to complete the equipment return-to-zero operation.
[0080] Reference Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the device zeroing method of the present invention.
[0081] This invention provides an embodiment of a device return-to-zero method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0082] Stepper drive systems require zero-position calibration before operation. There are many methods for zero-position calibration. For example, installing a stop at the zero position prevents the stepper motor from returning to zero. This method is simple, but it can cause severe vibration and significant noise when the device is stopped. This method also occupies installation space, increases wiring costs, and its accuracy is affected by homing speed, mechanical errors, temperature, and dust. To make the zeroing of automated equipment more accurate and convenient, sensor signals can be used as the zero-position. Specifically, position sensors such as Hall switches and photodiodes can be installed at the zero position. When the stepper motor returns to zero, the sensor sends a detection signal, and the control circuit stops the motor when it detects this signal. However, this zeroing method increases circuit complexity and is not universally applicable to various industrial scenarios, such as industrial sites where sensors cannot be installed.
[0083] Based on the above problems, this invention proposes a device zeroing method applicable to stepper drive systems. In this invention, instead of relying on sensors, mechanical structures are used as limits, and the origin is taken from the mechanical limit after detection. Alternatively, the origin can be found by continuing to search in reverse for the motor Z signal. The motor Z signal is a single pulse signal (also called the zero-position pulse or marker pulse) emitted by the motor encoder for each revolution, which is used to determine the origin position and control the motor to stop running at that origin position, thus realizing a more flexible device zeroing operation.
[0084] Specifically, in this embodiment, the device homing method can be applied to a motor driver, which executes the method and includes the following steps:
[0085] Step S10: Obtain the real-time operating parameters and standard operating parameters of the motor driving the device, and detect the pulse signal corresponding to the mechanical limit switch that restricts the operation of the device based on the real-time operating parameters and the standard operating parameters.
[0086] It should be noted that in this embodiment, the motor may specifically be a stepper motor. Correspondingly, the real-time operating parameters are the operating parameters of the stepper motor obtained in real time using the motor encoder (such as the number of steps the motor takes in real time), while the standard operating parameters are the operating parameters corresponding to the pulse signals triggered by the stepper driver connected to the stepper motor (for example, the theoretical number of steps the stepper motor should take when the stepper driver sends a certain number of pulse signals to the stepper motor).
[0087] Based on this, after acquiring the real-time and standard operating parameters of the stepper motor, the motor driver will detect the pulse signal corresponding to the preset mechanical limit according to the acquired real-time and standard operating parameters. The mechanical limit is a component used to restrict the operation of the device. In this embodiment, the mechanical limit is not specifically limited; it can be a rigid limit or an elastic limit, etc. Furthermore, the pulse signal in this embodiment is a flag bit generated by the motor driver for the device's zero-return operation. This pulse signal includes both rising and falling edges.
[0088] Step S20: Perform a device homing operation based on the pulse signal.
[0089] After determining the pulse signal corresponding to the mechanical limit, the terminal device will perform a zero-return operation on the stepper motor according to the pulse signal, so that the motor can stop at the preset origin.
[0090] It should be noted that in this embodiment, different origins (i.e., the zero point of the equipment returning to zero) can be determined according to different types of mechanical constraints, thus realizing flexible zeroing of the equipment.
[0091] In this embodiment, after acquiring the real-time and standard operating parameters of the stepper motor, the terminal device will detect the pulse signal corresponding to the preset mechanical limit based on the acquired real-time and standard operating parameters. After acquiring the pulse signal corresponding to the mechanical limit, the terminal device will perform a zero-return operation on the stepper motor according to the pulse signal, so that the motor can stop at the preset origin.
[0092] Compared to existing technologies that use sensors for zero-return, this invention directly detects the pulse signal corresponding to the mechanical limit based on the motor's real-time and standard operating parameters, and then performs the zero-return operation based on this pulse signal. Therefore, this invention can directly perform zero-return operation on the motor based on the mechanical limit, eliminating the need for additional circuitry and simplifying the complex zero-return process. Furthermore, because this invention directly utilizes pulse signals for zero-return operation, it improves zero-return accuracy compared to using sensors and is universally applicable to zero-return operations in various drive systems.
[0093] Furthermore, based on the first embodiment of the device zeroing method of the present invention, a second embodiment of the device zeroing method of the present invention is proposed.
[0094] In this embodiment, step S10 above, "acquiring the real-time operating parameters and standard operating parameters of the motor driving the device, and detecting the pulse signal corresponding to the mechanical limit switch restricting the device's operation based on the real-time operating parameters and the standard operating parameters," may include:
[0095] Step S101: Control the stepper motor to run in a preset direction by the pulse command triggered by the stepper driver;
[0096] Step S102: Obtain the first real-time operating parameters of the stepper motor through the motor encoder, and use the parameters corresponding to the pulse command as the first standard operating parameters;
[0097] Step S103: When the first real-time operating parameter is within a preset first range and the difference between the first standard operating parameter and the first standard operating parameter reaches a preset threshold, the rising edge of the pulse signal corresponding to the mechanical limit that restricts the operation of the device is detected.
[0098] It should be noted that, in this embodiment, in order to improve the accuracy of zeroing based on mechanical limit, it is necessary to accurately detect the rising edge and falling edge of the pulse signal corresponding to the mechanical limit, and determine that the rising edge and falling edge are effective. On this basis, once the rising edge or falling edge of the pulse signal is detected, the rising edge and falling edge of the pulse signal can be used as the deceleration point or zero point (i.e., the origin) for zeroing operation.
[0099] Therefore, in this embodiment, the detection method for the rising edge of the pulse signal corresponding to the mechanical limit is as follows: A pulse instruction PulseRef (PulseRef is the variable name set by the device zeroing program executing the device zeroing method, and so on) is triggered by the stepper driver, and then the stepper motor is controlled to run in a preset direction (e.g., forward) according to PulseRef; when the stepper motor is running forward, the first real-time operating parameters of the stepper motor are obtained through the motor encoder, and the parameters corresponding to PulseRef are used as the first standard operating parameters of the stepper motor; then, it is detected whether the first real-time operating parameters of the stepper motor are within a preset first range and whether the difference between the first standard operating parameters and the first real-time operating parameters, InPosErr (InPosErr is a representation of the difference defined by the device zeroing program executing the device zeroing method; in this embodiment, other representations besides InPosErr can also be used), reaches a preset threshold Lo. LockRotor_Threshold (Similarly, LockRotor_Threshold is also a way of representing the preset threshold defined by the device zeroing procedure for executing the device zeroing method. In this embodiment, other representations besides LockRotor_Threshold can also be used). If it is detected that the first real-time operating parameter is within the preset first range and the difference InPosErr between the first standard operating parameter and the first real-time operating parameter reaches the preset threshold LockRotor_Threshold, the stepper driver stops outputting pulse signals to the stepper motor and clears the difference InPosErr to zero. At this time, the rising edge of the pulse signal corresponding to the mechanical limit is determined to be effective by LockRotorFlag (Same as above, LockRotorFlag is also a way of representing the rising edge defined by the device zeroing procedure for executing the device zeroing method), that is, the rising edge number LockRotorFlag is set to 1. In this embodiment, the preset first range and preset threshold are not specifically limited and can be flexibly set according to the actual stepper device zeroing scenario.
[0100] Further, after step S103 above, "when the first real-time operating parameter is within a preset first range and the difference between the first standard operating parameter and the first real-time operating parameter reaches a preset threshold, the rising edge of the pulse signal corresponding to the mechanical limit is detected to take effect," it may also include:
[0101] Step S104: Control the stepper motor to run in the opposite direction to the preset direction through the stepper driver, and obtain the current second real-time operating parameters and second standard operating parameters of the stepper motor;
[0102] Step S105: When the difference between the second real-time operating parameter and the second standard operating parameter is a preset first reference value, a torque command is triggered through the stepper driver.
[0103] Step S106: At the elastic limit, the stepper motor is unloaded based on the torque command to detect the falling edge of the pulse signal corresponding to the elastic limit.
[0104] It should be noted that, in this embodiment, in order to adapt the present invention to scenarios where the mechanical limit is an elastic limit (such as a spring, elastic baffle, etc.), it is necessary to further determine the falling edge of the pulse signal corresponding to the elastic limit.
[0105] Specifically, the detection method for the rising edge of the pulse signal corresponding to the elastic limit is as follows: after the rising edge LockRotorFlag takes effect, a pulse command is triggered by the stepper driver to control the stepper motor to run in the opposite direction (i.e., reverse direction) to the preset direction, and to obtain the real-time operating parameters (i.e., the second real-time operating parameters) and standard operating parameters (i.e., the second standard operating parameters) during the operation of the stepper motor; then, it is detected whether the difference InPosErr between the second real-time operating parameters and the second standard operating parameters corresponding to the stepper motor decreases to a preset first reference value (in this embodiment, the preset first reference value can be specifically 0). If the above difference InPosErr is detected, the stepper motor will be activated. When sErr decreases to 0, it means that the real-time operating parameters of the stepper motor are the same as the standard operating parameters. The device controlled by the stepper motor is at the critical point of the elastic limit, that is, the device is in contact with the elastic limit and the magnitude of the reaction force generated by the elastic limit is just not restricting the operation of the device. At this time, the stepper driver will stop outputting pulse signals to the stepper motor and trigger the torque command TorRef (same as above, TorRef is also a way of representing the above torque command defined by the device zeroing procedure for executing the device zeroing method). Using this torque command TorRef, the device is controlled to unload force at the elastic limit to determine the falling edge of the pulse signal in the elastic limit scenario.
[0106] Furthermore, in step S106 above, "relieves force from the stepper motor based on the torque command" may include:
[0107] Step a: Control the motor shaft torque of the stepper motor to a preset second reference value according to the torque command, and obtain the current third real-time operating parameters of the stepper motor to unload the stepper motor at the elastic limit.
[0108] In step S10 above, "detecting the pulse signal corresponding to the mechanical limit switch restricting the operation of the device" can include "
[0109] Step S107: When the third real-time operating parameter is within the preset second range, the falling edge signal of the pulse signal corresponding to the elastic limit is detected to take effect.
[0110] It should be noted that, in this embodiment, in order to be applicable to scenarios where the mechanical limit is an elastic limit, it is necessary to determine the falling edge corresponding to the pulse signal in the elastic limit scenario, so that when the falling edge is detected, the position of the falling edge is taken as the zero point of the device, and the device returns to zero.
[0111] Specifically, for example, the motor driver can control the motor shaft torque of the stepper motor to drop to a preset second reference value (the preset second reference value in this embodiment can specifically be 0) according to the torque command, so as to realize the unloading of the motor at the elastic limit.
[0112] Furthermore, when the motor shaft torque of the stepper motor drops to a preset second reference value, the current real-time operating parameters of the stepper motor (i.e., the third real-time operating parameters) are obtained through the motor encoder. After a delay of DelayCnt (as above, DelayCnt is a representation of the delay defined by the device zeroing procedure for executing the device zeroing method), it is detected whether the third real-time operating parameters are within a preset second range. When the third real-time operating parameters are detected to be within the preset second range, it is determined that the falling edge of the pulse signal corresponding to the elastic limit is effective, that is, the falling edge LockRotorFlag signal is set to 0. In this embodiment, the preset second range is not specifically limited and can be flexibly set according to the actual stepper device zeroing scenario.
[0113] It is understood that in this embodiment, the definition method of each parameter (such as rising edge, falling edge, delay, etc.) of the device zeroing procedure for executing the device zeroing method is not specifically limited. In addition to the definition method in this embodiment, other methods can also be used for definition.
[0114] In this embodiment, if the first real-time operating parameter corresponding to the stepper motor is detected to be within a preset first range and the difference between the first standard operating parameter and the first real-time operating parameter reaches a preset threshold, the rising edge of the pulse signal corresponding to the mechanical limit is detected. After the rising edge is detected, the terminal device controls the difference between the second real-time operating parameter and the second standard operating parameter corresponding to the stepper motor to decrease to 0, and controls the motor shaft torque of the stepper motor to decrease to 0 according to the torque command triggered by the motor driver. Then, the current third real-time operating parameter of the stepper motor is obtained through the motor encoder, and when the third real-time operating parameter is within a preset second range, the falling edge of the pulse signal corresponding to the elastic limit is detected.
[0115] Therefore, the present invention can accurately detect the rising and falling edges of the pulse signal corresponding to the mechanical limit, so as to realize the precise zero return of the motor by using the rising and falling edges, and can be applied to the zero return system of various equipment, which reduces the complexity of the zero return operation, improves the zero return accuracy of the system, and also improves the user experience.
[0116] Furthermore, based on the first and second embodiments of the device zeroing method of the present invention, a third embodiment of the device zeroing method of the present invention is proposed.
[0117] In this embodiment, step S20 above, "performing a motor return-to-zero operation based on the pulse signal," may include:
[0118] Step S201: Control the stepper motor to run at a low speed in a preset direction, and determine whether the rising edge or falling edge of the pulse signal of the mechanical limit point is detected during the operation.
[0119] Step S202: If yes, control the stepper motor to run at low speed in the opposite direction to the preset direction, and determine whether the first motor Z signal after the rising edge or the falling edge is detected during the operation.
[0120] In step S203, if the first motor Z signal is detected, the stepper motor is controlled to stop running to complete the device return-to-zero operation.
[0121] It should be noted that, in this embodiment, after the rising or falling edge of the pulse signal corresponding to the mechanical limit takes effect, the device can be homed based on the rising or falling edge.
[0122] Specifically, for example, such as Figure 3-1 As shown, the motor Z signal is taken as the origin (i.e., zero point), and the rising edge of the mechanical limit is taken as the deceleration point. In this scenario, when the terminal device controls the stepper motor to run at a low speed in a preset direction (forward), it decelerates and stops when the deceleration point is detected, and then runs at a low speed in the opposite direction. During the reverse low-speed running, it determines whether the first motor Z signal after the rising edge is detected. If the first motor Z signal is detected, the operation stops.
[0123] Or, such as Figure 3-2 As shown, the motor Z-signal is taken as the origin, and the falling edge of the mechanical limit is taken as the deceleration point. In this scenario, when the terminal device controls the stepper motor to run at low speed in the opposite direction (reverse), it decelerates and stops when the deceleration point is detected, and then runs at low speed in the forward direction. During the forward low-speed running, it determines whether the first motor Z-signal after the falling edge is detected. If the first motor Z-signal is detected, the operation stops. It is worth noting that in this embodiment, forward and reverse are artificially defined directions, referring to... Figure 3-1 and Figure 3-2 Running to the right is considered forward running, and running away from the right is considered reverse running.
[0124] Furthermore, in step S20 above, "performing a motor return-to-zero operation based on the pulse signal" may include:
[0125] Step S204: Control the stepper motor to run at a low speed in a preset direction, and determine whether the rising edge of the pulse signal of the mechanical limit point is detected during the operation.
[0126] In step S205, if the rising edge is detected, the stepper motor is controlled to stop running to complete the device return to zero operation.
[0127] It should be noted that in this embodiment, in order to adapt to industrial scenarios where the mechanical limit is a rigid limit, the rising edge of the mechanical limit is directly used as the origin, and no deceleration point is set in this scenario.
[0128] Specifically, for example, such as Figure 4-1 As shown, when the rising edge of the mechanical limit is taken as the origin, the terminal device controls the stepper motor to run at low speed in a preset direction (forward). When the rising edge of the mechanical limit is detected, i.e., the origin, the operation stops.
[0129] Or, such as Figure 4-2 As shown, when the falling edge of the mechanical limit is taken as the origin, the terminal device controls the stepper motor to run at low speed in the opposite direction (reverse direction) to the preset direction, and stops running when it detects the rising edge of the mechanical limit, i.e. the origin.
[0130] Furthermore, in step S20, "performing a motor return-to-zero operation based on the pulse signal" may include:
[0131] Step S206: Control the stepper motor to run at low speed in a preset direction, and determine whether the rising edge of the pulse signal of the mechanical limit point is detected during the operation.
[0132] Step S207: If the rising edge is detected, control the stepper motor to run at low speed in the opposite direction to the preset direction, and determine again whether the falling edge is detected during the operation;
[0133] In step S208, if the falling edge is detected, the motor is controlled to stop running to complete the device return-to-zero operation.
[0134] It should be noted that, in this embodiment, in order to adapt to industrial scenarios where the mechanical limit is an elastic limit, the rising edge of the mechanical limit is taken as the deceleration point, and correspondingly, the falling edge of the mechanical limit is taken as the origin.
[0135] Specifically, for example, such as Figure 5-1As shown, when the terminal device controls the stepper motor to run at a low speed in a preset direction (forward), it decelerates and stops when it detects the rising edge of the mechanical limit, i.e., the deceleration point, and then runs at a low speed in the reverse direction. During the reverse low-speed running process, it determines whether the falling edge of the mechanical limit is detected. If the falling edge is detected, it stops running.
[0136] Or, such as Figure 5-2 As shown, when the terminal device controls the stepper motor to run at low speed (reverse) in the opposite direction to the preset direction, it decelerates and stops when it detects the rising edge of the mechanical limit, i.e. the deceleration point, and then runs at low speed in the forward direction. During the forward low speed operation, it determines whether the falling edge of the mechanical limit is detected. If the falling edge is detected, it stops running.
[0137] This embodiment provides a zeroing method for devices in rigid limit, elastic limit, and other limit scenarios. Therefore, this invention can be applied to various zeroing systems, which reduces the complexity of zeroing operation, improves the accuracy of system zeroing, and enhances user experience.
[0138] Furthermore, embodiments of the present invention also propose a device for homing to zero, referring to... Figure 6 The equipment homing device includes:
[0139] The determining module 10 is used to acquire the real-time operating parameters and standard operating parameters of the motor driving the device, and to detect the pulse signal corresponding to the mechanical limit switch that restricts the operation of the device based on the real-time operating parameters and the standard operating parameters;
[0140] The zero-return module 20 is used to perform a motor zero-return operation based on the pulse signal.
[0141] Furthermore, the real-time operating parameters include first real-time operating parameters, the standard operating parameters include first standard operating parameters, and the determining module 10 includes:
[0142] The control unit is used to control the stepper motor to run in a preset direction via pulse commands triggered by the stepper driver;
[0143] The first parameter acquisition unit is used to acquire the first real-time operating parameters of the stepper motor through the motor encoder, and to use the parameters corresponding to the pulse command as the first standard operating parameters.
[0144] The rising edge activation unit is used to detect the rising edge of the pulse signal corresponding to the mechanical limit switch that restricts the operation of the device when the first real-time operating parameter is within a preset first range and the difference between the first standard operating parameter and the first real-time operating parameter reaches a preset threshold.
[0145] Furthermore, when the mechanical limit is an elastic limit, the determining module 10 further includes:
[0146] The second parameter acquisition unit is used to control the stepper motor to run in the opposite direction to the preset direction through the stepper driver, and to acquire the current second real-time operating parameters and second standard operating parameters of the stepper motor.
[0147] A torque command triggering unit is used to trigger a torque command through the stepper driver when the difference between the second real-time operating parameter and the second standard operating parameter is a preset first reference value;
[0148] The unloading unit is used to unload the stepper motor at the elastic limit position based on the torque command, so as to detect the falling edge of the pulse signal corresponding to the elastic limit position.
[0149] Furthermore, the force-relieving unit includes:
[0150] The control subunit is used to control the motor shaft torque of the stepper motor to decrease to a preset second reference value according to the torque command, and to obtain the current third real-time operating parameters of the stepper motor so as to unload the stepper motor at the elastic limit.
[0151] The determining module 10 includes:
[0152] The falling edge activation unit is used to detect the falling edge activation of the pulse signal corresponding to the elastic limit when the third real-time operating parameter is within a preset second range.
[0153] Furthermore, the zero-return module 20 includes:
[0154] The first judgment unit is used to control the stepper motor to run at low speed in a preset direction, and to determine whether the rising edge or falling edge of the pulse signal of the mechanical limit point is detected during the operation.
[0155] The second judgment unit is used to control the stepper motor to run at low speed in a direction opposite to the preset direction, and to determine during the operation whether the first motor Z signal after the rising edge or the falling edge is detected.
[0156] The first zero-return unit is used to control the stepper motor to stop running in order to complete the zero-return operation of the equipment.
[0157] Furthermore, the zero-return module 20 includes:
[0158] The third judgment unit is used to control the stepper motor to run at low speed in a preset direction, and to determine whether the rising edge of the pulse signal of the mechanical limit point is detected during the operation.
[0159] The second zero-return unit is used to control the stepper motor to stop running in order to complete the zero-return operation of the equipment.
[0160] Furthermore, the zero-return module 20 includes:
[0161] The fourth judgment unit is used to control the stepper motor to run at a low speed in a preset direction, and to determine whether the rising edge of the pulse signal of the mechanical limit point is detected during the operation.
[0162] The fifth judgment unit is used to control the stepper motor to run at low speed in a direction opposite to the preset direction, and to judge again during the operation whether the falling edge is detected;
[0163] The third zeroing unit is used to control the motor to stop running in order to complete the zeroing operation of the line equipment.
[0164] The extended content of the specific implementation of the equipment zeroing system of the present invention is basically the same as the various embodiments of the equipment zeroing method described above, and will not be repeated here.
[0165] Furthermore, embodiments of the present invention also propose a computer-readable storage medium storing a device homing program, wherein when the device homing program is executed by a processor, it implements the steps of the device homing method described below.
[0166] The various embodiments of the zero-return device and computer-readable storage medium of the present invention can be referred to the various embodiments of the zero-return method of the present invention, and will not be repeated here.
[0167] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0168] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0169] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which can be a motor driver, or a smartphone, industrial control computer, server, and network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0170] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for homing equipment, characterized in that, The device zeroing method includes: The system acquires real-time and standard operating parameters of the motor driving the device, and detects the pulse signal corresponding to the mechanical limit switch restricting the device's operation based on the real-time and standard operating parameters. The real-time operating parameters include a first real-time operating parameter, and the standard operating parameters include a first standard operating parameter. Specifically, the system includes: controlling the stepper motor to run in a preset direction via a pulse command triggered by a stepper driver; acquiring the first real-time operating parameters of the stepper motor through a motor encoder, and using the parameters corresponding to the pulse command as the first standard operating parameters; and detecting the rising edge of the pulse signal corresponding to the mechanical limit switch restricting the device's operation when the first real-time operating parameters are within a preset first range and the difference between the first standard operating parameters and the first real-time operating parameters reaches a preset threshold. If the mechanical limit is an elastic limit, then the stepper motor is controlled to run in the opposite direction to the preset direction by the stepper driver, and the current second real-time operating parameters and second standard operating parameters of the stepper motor are obtained; when the difference between the second real-time operating parameters and the second standard operating parameters is a preset first reference value, a torque command is triggered by the stepper driver; at the elastic limit, the stepper motor is unloaded based on the torque command to detect the falling edge of the pulse signal corresponding to the elastic limit; The device is homed based on the pulse signal.
2. The equipment homing method as described in claim 1, characterized in that, The step of unloading the stepper motor at the elastic limit based on the torque command includes: According to the torque command, the motor shaft torque of the stepper motor is controlled to be reduced to a preset second reference value, and the current third real-time operating parameters of the stepper motor are obtained to unload the stepper motor at the elastic limit. The step of detecting the pulse signal corresponding to the mechanical limit of the operating limit device includes: When the third real-time operating parameter is within the preset second range, the falling edge of the pulse signal corresponding to the elastic limit is detected.
3. The equipment homing method as described in claim 1, characterized in that, The step of performing the device homing operation based on the pulse signal includes: Control the stepper motor to run at low speed in a preset direction, and determine whether the rising or falling edge of the pulse signal of the mechanical limit point is detected during the operation; If so, the stepper motor is controlled to run at low speed in the opposite direction to the preset direction, and during the operation, it is determined whether the first motor Z signal after the rising edge or the falling edge is detected; If the first motor Z signal is detected, the stepper motor is controlled to stop running in order to complete the device's return-to-zero operation.
4. The equipment homing method as described in claim 1, characterized in that, The step of performing the device homing operation based on the pulse signal includes: Control the stepper motor to run at low speed in a preset direction, and determine whether the rising edge of the pulse signal of the mechanical limit point is detected during the operation; If the rising edge is detected, the stepper motor is controlled to run at low speed in the opposite direction to the preset direction, and during the operation, it is determined whether the falling edge of the pulse signal is detected. If the falling edge is detected, the motor is controlled to stop running to complete the equipment return-to-zero operation.
5. A zero-return device for equipment, characterized in that, The equipment homing device includes: The determination module is used to acquire real-time operating parameters and standard operating parameters of the motor driving the device, and to detect the pulse signal corresponding to the mechanical limit that restricts the operation of the device based on the real-time operating parameters and the standard operating parameters. The real-time operating parameters include a first real-time operating parameter, and the standard operating parameters include a first standard operating parameter. Specifically, the module includes: controlling the stepper motor to run in a preset direction by a pulse command triggered by a stepper driver; acquiring the first real-time operating parameters of the stepper motor through a motor encoder, and using the parameters corresponding to the pulse command as the first standard operating parameters; and detecting the rising edge of the pulse signal corresponding to the mechanical limit that restricts the operation of the device when the first real-time operating parameters are within a preset first range and the difference between the first standard operating parameters and the first real-time operating parameters reaches a preset threshold. The determination module is further configured to, if the mechanical limit is an elastic limit, control the stepper motor to run in the opposite direction to the preset direction via the stepper driver, and acquire the current second real-time operating parameters and second standard operating parameters of the stepper motor; when the difference between the second real-time operating parameters and the second standard operating parameters is a preset first reference value, trigger a torque command via the stepper driver; at the elastic limit, unload the stepper motor based on the torque command to detect the falling edge of the pulse signal corresponding to the elastic limit; The zero-return module is used to perform a zero-return operation on the device based on the pulse signal.
6. A terminal device, characterized in that, The terminal device includes a memory, a processor, and a device zeroing program stored in the memory and executable on the processor. When the device zeroing program is executed by the processor, it implements the steps of the device zeroing method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a device homing program, which, when executed by a processor, implements the steps of the device homing method as described in any one of claims 1 to 4.