Method, device and electronic device for finding origin
By detecting the torque and stopping time of the motor, replacing physical switches and sensors, the automatic return to the origin operation of the motor is achieved, solving the problems of high usage cost, low accuracy and complex operation in the existing technology, and improving the efficiency of the motor and accuracy.
Patent Information
- Application Number
- CN202410775575.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-06-17
AI Technical Summary
In the prior art, the motor's return to the origin operation depends on external switches or sensors, resulting in high cost of use, limited use occasions, low-precision feedback affects accuracy, and complex operation, requiring high professionalism of the operator.
By detecting the actual torque of the motor and the duration of the stoppage, the physical switch and sensor are replaced as the trigger source for the origin regression operation.
It reduces the cost of use, expands the use occasion, improves the accuracy and accuracy of the motor back to the origin, simplifies the operation process, and reduces the professional requirements for operators.
Smart Images

Figure CN118748529B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motor technology, and in particular to a method and device for finding an origin, and electronic equipment. Background Art
[0002] The origin of the motor is the starting point of the motor operation; the motor itself does not have a fixed origin, and the origin of the motor is set manually. The motor is usually composed of two parts: the motor (rotor, stator) and the encoder. The motor can form a complete motor system with the controller. The motor encoder is usually divided into relative encoder and absolute encoder. The disadvantage of the relative encoder is that after the motor is powered off, the current position of the motor will not be recorded. Therefore, every time the motor is restarted, the motor needs to return to the origin, that is, return to the starting point of the motor. The absolute encoder will record the current position of the motor after the motor is powered off. Therefore, after the motor is restarted, the motor does not need to return to the origin. However, the price of relative encoders is usually cheaper, while the price of absolute encoders is much more expensive than relative encoders due to their more complex internal structure. Due to cost factors, most motor encoders on the market use relative encoders.
[0003] In the prior art, an actual physical switch is usually used as a trigger condition to allow the motor to perform the action of returning to the origin, that is, a switch and a sensor are connected at the origin position, and when the sensor detects that the motor triggers the switch, the motor is caused to perform the action of returning to the origin, that is, the motor performs the operation of clearing the position to make the motor find the origin position. However, the inventors have found that the prior art has the following disadvantages: 1. An external switch or various types of sensors are required as a trigger source for performing the origin return operation, which will increase the user's usage cost. 2. Under some special conditions of use, it is not allowed to connect these switches and sensors, so the use occasions are limited. 3. Low-precision switches and sensors have delays or false alarms in the feedback signals of the origin position, which will affect the search for the origin position and prevent the motor from returning to the origin at the correct position. 4. In the prior art, if an obstacle blocks the motor during operation, the motor will enter a fault state or an alarm state, requiring the operator to re-operate the state machine to continue normal operation. The matching relationship between different switches and modes in the prior art is complex, and the operator is required to be familiar with the operating states of different modes. Therefore, the prior art still has the problems of complex operation and high professional requirements for operators. Summary of the invention
[0004] The embodiments of the present invention provide a method, device and electronic device for finding the origin, which are used to replace the actual physical switches and sensors with the actual torque of the motor and the duration of the stall as the trigger source of the origin return operation, so as to solve the problems existing in the prior art such as high cost of use, limited application occasions, low-precision switches and sensors that make it impossible for the motor to return to the origin at the correct position, and complex operation and high professional requirements for the operator.
[0005] The specific technical solutions are as follows:
[0006] In a first aspect, an embodiment of the present invention provides a method for finding an origin, the method comprising:
[0007] Receiving an origin search request; wherein the origin search method in the origin search request is a stalled-rotor origin search method;
[0008] According to the origin search method in the origin search request, the motor starts to run;
[0009] During the movement of the motor, detecting whether the motor is stalled;
[0010] When it is detected that the motor is stalled, the value of the current encoder of the motor is obtained; the current position value of the motor is calculated according to the value of the current encoder of the motor; it is determined whether the current position value of the motor is the same as the position value of the set calibration point; if they are the same, the motor is caused to perform a position clearing operation; if they are different, the motor is caused to move toward the position of the calibration point; when the motor moves to the calibration point, the motor is caused to perform a position clearing operation.
[0011] Optionally, the step of detecting whether the motor is stalled during the movement of the motor includes:
[0012] During the movement of the motor, the torque value of the motor is acquired in real time, and the torque value of the motor is compared with a preset stall detection torque value;
[0013] When the torque value of the motor is greater than the stall detection torque value, recording a duration during which the torque value of the motor is greater than the stall detection torque value;
[0014] It is determined whether the duration for which the torque value of the motor is greater than the stall detection torque value reaches a preset stall monitoring duration; if so, it is determined that the motor is stalled.
[0015] Optionally, before the step of determining whether the current position value of the motor is the same as the position value of the set calibration point, the method further includes:
[0016] A calibration point is set for the motor.
[0017] Optionally, the step of setting a calibration point for the motor includes:
[0018] Receive the position value of the calibration point input by the user;
[0019] A calibration point is set for the motor according to the received position value of the calibration point.
[0020] Optionally, the step of setting a calibration point for the motor includes:
[0021] When receiving an instruction to set a calibration point; continuously obtaining the value of the encoder of the motor according to a preset number of times; wherein the instruction to set the calibration point is an instruction issued after the user drags the motor to the calibration point;
[0022] Performing smoothing and filtering calculation on the acquired value to obtain the position value of the motor;
[0023] The position value of the motor is confirmed as the position value of the calibration point.
[0024] Optionally, the step of setting a calibration point for the motor includes:
[0025] When the motor is stalled, the encoder value of the motor is continuously obtained according to a preset number of times, and the obtained value is smoothed and filtered to obtain the position value of the motor;
[0026] The position value of the motor is confirmed as the position value of the calibration point.
[0027] In a second aspect, an embodiment of the present invention provides a device for finding an origin, the device comprising:
[0028] A receiving module, used for receiving an origin search request; wherein the origin search mode in the origin search request is a stalled-rotor origin search mode;
[0029] An operation module, used for starting the motor to run according to the origin search method in the origin search request;
[0030] A detection module, used for detecting whether the motor is stalled during the movement of the motor;
[0031] The judgment module is used to obtain the value of the current encoder of the motor when it is detected that the motor is blocked; calculate the current position value of the motor according to the value of the current encoder of the motor; judge whether the current position value of the motor is the same as the position value of the set calibration point; if they are the same, the motor is caused to perform a position clearing operation; if they are different, the motor is caused to move to the position of the calibration point; when the motor moves to the calibration point, the motor is caused to perform a position clearing operation.
[0032] Optionally, the detection module is specifically used to:
[0033] During the movement of the motor, the torque value of the motor is acquired in real time, and the torque value of the motor is compared with a preset stall detection torque value;
[0034] When the torque value of the motor is greater than the stall detection torque value, recording a duration during which the torque value of the motor is greater than the stall detection torque value;
[0035] It is determined whether the duration for which the torque value of the motor is greater than the stall detection torque value reaches a preset stall monitoring duration; if so, it is determined that the motor is stalled.
[0036] Optionally, the device further includes:
[0037] The calibration point setting module is used to set the calibration point for the motor.
[0038] Optionally, the module for setting calibration points is specifically used for:
[0039] Receive the position value of the calibration point input by the user;
[0040] A calibration point is set for the motor according to the received position value of the calibration point.
[0041] Optionally, the module for setting calibration points is specifically used for:
[0042] When receiving an instruction to set a calibration point; continuously obtaining the value of the encoder of the motor according to a preset number of times; wherein the instruction to set the calibration point is an instruction issued after the user drags the motor to the calibration point;
[0043] Performing smoothing and filtering calculation on the acquired value to obtain the position value of the motor;
[0044] The position value of the motor is confirmed as the position value of the calibration point.
[0045] Optionally, the module for setting calibration points is specifically used for:
[0046] When the motor is stalled, the encoder value of the motor is continuously obtained according to a preset number of times, and the obtained value is smoothed and filtered to obtain the position value of the motor;
[0047] The position value of the motor is confirmed as the position value of the calibration point.
[0048] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0049] The memory is used to store computer programs;
[0050] The processor is used to implement the method steps of finding the origin described in the first aspect when executing the program stored in the memory.
[0051] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps for finding the origin described in the first aspect are implemented.
[0052] The method provided in the embodiment of the present invention can replace the actual physical switches and sensors with the actual torque of the motor and the duration of the stall as the trigger source for the origin return operation, so as to solve the problems existing in the prior art such as high cost of use, limited application occasions, low-precision switches and sensors that make it impossible for the motor to return to the origin at the correct position, and complex operation and high professional requirements for the operator.
[0053] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.
[0054] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0056] Figure 1 A schematic flow chart of a method for finding an origin provided by an embodiment of the present invention;
[0057] Figure 2 Another schematic flow chart of a method for finding an origin provided by an embodiment of the present invention;
[0058] Figure 3 for Figure 2 A schematic diagram of the method of finding the origin of the motor operation in the shown method;
[0059] Figure 4 for Figure 1 Another schematic diagram of the motor running to find the origin in the method shown;
[0060] Figure 5 for Figure 1 In the method shown, when the direction of the motor's return to the origin is forward motion, the time curve of the motor using stalled rotor to find the origin;
[0061] Figure 6 for Figure 1 In the method shown, when the direction of the motor's return to the origin is reverse motion, the time curve of the motor using stalled rotor to find the origin;
[0062] Figure 7 Another schematic flow chart of a method for finding an origin provided by an embodiment of the present invention;
[0063] Figure 8 A schematic diagram of a structure of a device for finding the origin of a motor provided by an embodiment of the present invention;
[0064] Fig. 9 A schematic diagram of the internal structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0065] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0066] Figure 1 A flow chart of a method for finding an origin provided by an embodiment of the present invention is shown. The method provided by an embodiment of the present invention is applied to a motor controller. In the embodiment of the present invention, the motor is in a closed-loop control state, and the encoder of the motor is a single-turn encoder, such as Figure 1 As shown, the method includes:
[0067] S101: receiving an origin search request; wherein the origin search method in the origin search request is a stalled rotor origin search method;
[0068] The motor has multiple origin-seeking methods. The user needs to set the origin-seeking method for the motor first so that the motor can perform the origin-seeking operation according to the set origin-seeking method.
[0069] S102: according to the origin search method in the origin search request, the motor starts to run;
[0070] In a specific embodiment, after the user sets the motor's origin search mode to the stall-triggered origin search mode, the user can also set a return direction for the motor, that is, set a running direction for the motor. The user can set a running direction of the motor to forward motion, and set the running direction opposite to the forward motion to reverse motion.
[0071] S103: During the movement of the motor, detecting whether the motor is stalled;
[0072] Specifically, during the movement of the motor, the step of detecting whether the motor is stalled may include:
[0073] During the movement of the motor, the torque value of the motor is obtained in real time, and the torque value of the motor is compared with the preset stall detection torque value; wherein the stall detection torque value is set by the user according to actual needs;
[0074] When the torque value of the motor is greater than the stall detection torque value, the duration of the motor torque value being greater than the stall detection torque value is recorded;
[0075] It is determined whether the duration for which the torque value of the motor is greater than the stall detection torque value reaches a preset stall monitoring duration. If so, it is determined that the motor is stalled.
[0076] S104: when it is detected that the motor is stalled, the value of the current encoder of the motor is obtained; the current position value of the motor is calculated according to the value of the current encoder of the motor; it is determined whether the current position value of the motor is the same as the position value of the set calibration point; if they are the same, step S105 is executed; if they are different, step S106 is executed;
[0077] S105: enabling the motor to perform a position clearing operation;
[0078] S106: The motor is moved toward the calibration point; when the motor moves to the calibration point, the motor is reset to zero.
[0079] Specifically, the encoder value can be obtained in real time during the process of the motor moving to the calibration point; the current position value of the motor is calculated in real time according to the obtained encoder value; and it is determined whether the current position value of the motor is the same as the position value of the set calibration point; when the current position value of the motor is the same as the position value of the set calibration point, the motor is stopped; and the motor is reset to zero. The motor resets to zero means that the motor returns to the origin.
[0080] In the embodiment of the present invention, the calibration point is a point set by the user for causing the motor to perform a return to origin operation, that is, in the process of finding the origin, when the motor runs to the calibration point, the motor will perform a return to origin operation.
[0081] In practical applications, before the step of determining whether the current position value of the motor is the same as the position value of the set calibration point, a step of setting a calibration point for the motor is also included.
[0082] In the method provided in the embodiment of the present invention, the calibration point can be set for the motor in the following three ways:
[0083] Method 1:
[0084] Receive the position value of the calibration point input by the user;
[0085] The calibration point is set for the motor according to the received position value of the calibration point.
[0086] Method 2:
[0087] When receiving the instruction to set the calibration point; continuously obtaining the value of the motor encoder according to the preset number of times; wherein the instruction to set the calibration point is the instruction issued after the user drags the motor to the calibration point;
[0088] Perform smoothing and filtering calculation on the acquired value to obtain the position value of the motor;
[0089] Confirm the position value of the motor as the position value of the calibration point.
[0090] Method 3:
[0091] When the motor is stalled, the encoder value of the motor is continuously obtained according to a preset number of times, and the obtained value is smoothed and filtered to obtain the position value of the motor;
[0092] Confirm the position value of the motor as the position value of the calibration point.
[0093] For the above-mentioned method 2 and method 3, the position value of the motor is calculated by smoothing filtering, which can make the obtained motor position value more accurate.
[0094] See also Figure 1 It can be seen that Figure 1 The method shown is for the user to set a calibration point for the motor. When the motor is stalled, the motor is driven back to the origin at the calibration point set by the user. Figure 1 The method shown is applicable to scenarios where the obstacle is rigid and not easily deformed or where the obstacle is not easily displaced, and is also applicable to scenarios where the obstacle is rigid and is easily deformed or where the obstacle is easily displaced.
[0095] like Figure 2 As shown, in a scenario where the obstacle is rigid and not easily deformed or the obstacle is not easily displaced, the embodiment of the present invention further provides another method for finding the origin by using the motor's stalled rotor, and the specific steps are as follows:
[0096] S201: receiving an origin search request; wherein the origin search method in the origin search request is a stalled-rotor origin search method;
[0097] S202: according to the origin search method in the origin search request, the motor starts to run;
[0098] S203: During the movement of the motor, detecting whether the motor is stalled;
[0099] S204: When the motor is stalled, the motor is caused to perform a position clearing operation.
[0100] Figure 2 The method shown is to directly perform the position reset operation at the position where the motor is stalled, that is, to perform the return to origin operation. It is applicable to the scene where the obstacle is rigid and not easy to deform or the obstacle is not easy to shift position, but it is not suitable for the scene where the obstacle is rigid and easy to deform or the obstacle is easy to shift position. This is because for the scene where the obstacle is rigid and easy to deform or the obstacle is easy to shift position, when the obstacle triggers the motor stall multiple times and deformation or position shift occurs, the use Figure 2 The method shown will result in an offset in the position where the homing operation is performed. For example, see Figure 3 , Figure 3 They are listed in Figure 2 In the method shown, the motor's homing direction is a scenario when it moves forward and a scenario when it moves reverse.
[0101] Point A is the initial setting of the motor's origin position. After multiple attempts to find the motor's origin by stalling the motor, the obstacle is deformed or shifted, so that it is no longer possible to apply enough torque to the motor at point A to trigger the motor stall. Instead, it is only possible to apply enough torque to the motor at point B to trigger the motor stall, thereby performing the return to origin operation. This causes the origin position to shift to point B. As a result, the position of the motor's origin search by stalling the motor is inconsistent with the initial search for the origin position, and the origin position is shifted.
[0102] in addition Figure 2 The method shown also requires that when the motor is used multiple times to find the origin, the stall detection torque value set each time must be the same, otherwise the origin position will also be offset because Figure 2 In the method shown, it is necessary to determine whether the motor is stalled based on the relationship between the actual torque value of the motor and the stall detection torque value. If the stall detection torque value is set differently, the position where the motor is detected to be stalled will change, resulting in an origin position offset.
[0103] See also Figure 4 , Figure 4 They are listed in Figure 1 In the method shown, the motor's homing direction is a scenario when it moves forward and a scenario when it moves reverse. Figure 1 The method shown is to use the preset calibration point H_set point ( Figure 1The method shown in the figure determines the final operation of returning to the origin, that is, the operation of returning to the origin is performed at H_set. Although after multiple motor stalls to find the motor origin, the obstacle is deformed or shifted, causing the position where the motor stalls to move from point A to point B, the position of H_set is fixed, and if the position of H_set does not shift, it will not cause Figure 1 The method shown here shows that the position of the motor origin is offset. The same logic applies whether the motor is homing in the forward or reverse direction.
[0104] Figure 5 for Figure 1 In the method shown, when the direction of the motor's return to the origin is forward motion, the time curve of the motor using stalled rotor to find the origin; Figure 5 As shown, Figure 1 The method shown starts controlling the motor to perform forward motion at time T1. When the motor is detected to be stalled at time T2, the motor stops at point A. After the motor waits for a while at point A, the motor is controlled to perform reverse motion at time T3. When the motor runs to point H_set, the motor returns to the origin at point H_set.
[0105] Figure 6 They are Figure 1 In the method shown, when the direction of the motor's return to the origin is reverse motion, the time curve of the motor using stalled rotor to find the origin; Figure 1 The method shown starts controlling the motor to perform reverse motion at time T1. When the motor is detected to be stalled at time T2, the motor stops at point A. After the motor waits for a while at point A, the motor is controlled to perform forward motion at time T3. When the motor runs to point H_set, the motor returns to the origin at point H_set.
[0106] because Figure 1 The method shown is to perform the return to origin operation at the calibration point H_set point, instead of Figure 2 The method shown in the figure performs the homing operation directly at the position where the stall occurs, so that Figure 1 When the method shown is used to find the origin multiple times when the motor is stalled, even if the stall detection torque value set each time is different, there will be no deviation in the origin position. In addition, in practical applications, in order to ensure that the position of H_set is fixed, after each return to the origin operation, the method provided by the embodiment of the present invention will automatically re-mark the position coordinates of the H_set point.
[0107] Depend on Figure 1It can be seen from the illustrated embodiment that the method provided in the embodiment of the present invention can replace the actual physical switches and sensors with the actual torque of the motor and the duration of the stall as the trigger source for the origin return operation, so as to solve the problems existing in the prior art such as high cost of use, limited application occasions, low-precision switches and sensors that make it impossible for the motor to return to the origin at the correct position, and complex operation and high professional requirements for the operator.
[0108] The following is a practical example to further illustrate the method provided by the embodiment of the present invention in more detail.
[0109] In this embodiment, the motor is in a closed-loop control state, and the motor encoder adopts a single-turn encoder, such as Figure 7 As shown, the method includes:
[0110] S701: receiving an origin search request; wherein the origin search mode in the origin search request is a stalled-rotor origin search mode;
[0111] S702: according to the origin search method in the origin search request, the motor starts to run;
[0112] S703: During the movement of the motor, the torque value of the motor is obtained in real time, and the torque value of the motor is compared with a preset stall detection torque value;
[0113] Among them, the stall detection torque value is set by the user according to actual needs.
[0114] S704: When the torque value of the motor is greater than the stall detection torque value, record the duration of the motor torque value being greater than the stall detection torque value;
[0115] S705: Determine whether the duration of the motor torque value being greater than the stall detection torque value reaches a preset stall monitoring duration. If yes, determine that the motor is stalled; and execute step S706; if no, continue to execute step S705;
[0116] S706: Obtain the value of the current encoder of the motor; calculate the current position value of the motor according to the value of the current encoder of the motor; determine whether the current position value of the motor is the same as the position value of the set calibration point; if they are the same, execute step S707; if they are different, execute step S708;
[0117] S707: Enable the motor to perform a position reset operation;
[0118] S708: Make the motor move toward the calibration point; when the motor moves to the calibration point, make the motor perform a position clearing operation.
[0119] Depend on Figure 7It can be seen from the illustrated embodiment that the method provided in the embodiment of the present invention can replace the actual physical switches and sensors with the actual torque of the motor and the duration of the stall as the trigger source for the origin return operation, so as to solve the problems existing in the prior art such as high cost of use, limited application occasions, low-precision switches and sensors that make it impossible for the motor to return to the origin at the correct position, and complex operation and high professional requirements for the operator.
[0120] and Figure 1 Corresponding to the embodiment shown in FIG. 1 , the embodiment of the present invention further provides a device for finding the origin. Figure 8 As shown, the device includes: a receiving module 801, an operating module 802, a detection module 803, and a judgment module 804, wherein:
[0121] The receiving module 801 is used to receive an origin search request; wherein the origin search method in the origin search request is a stalled-rotor origin search method;
[0122] The operation module 802 is used to start the motor to run according to the origin search method in the origin search request;
[0123] The detection module 803 is used to detect whether the motor is stalled during the movement of the motor;
[0124] The judgment module 804 is used to obtain the value of the current encoder of the motor when it is detected that the motor is blocked; calculate the current position value of the motor according to the value of the current encoder of the motor; judge whether the current position value of the motor is the same as the position value of the set calibration point; if they are the same, the motor is caused to perform a position clearing operation; if they are different, the motor is caused to move to the position of the calibration point; when the motor moves to the calibration point, the motor is caused to perform a position clearing operation.
[0125] Optionally, the detection module 803 is specifically used for:
[0126] During the movement of the motor, the torque value of the motor is obtained in real time, and the torque value of the motor is compared with the preset stall detection torque value;
[0127] When the torque value of the motor is greater than the stall detection torque value, the duration of the motor torque value being greater than the stall detection torque value is recorded;
[0128] It is determined whether the duration for which the torque value of the motor is greater than the stall detection torque value reaches a preset stall monitoring duration. If so, it is determined that the motor is stalled.
[0129] Optionally, the device further includes:
[0130] The calibration point setting module is used to set the calibration point for the motor.
[0131] Optionally, set a calibration point module, specifically for:
[0132] Receive the position value of the calibration point input by the user;
[0133] The calibration point is set for the motor according to the received position value of the calibration point.
[0134] Optionally, set a calibration point module, specifically for:
[0135] When receiving the instruction to set the calibration point; continuously obtaining the value of the motor encoder according to the preset number of times; wherein the instruction to set the calibration point is the instruction issued after the user drags the motor to the calibration point;
[0136] Perform smoothing and filtering calculation on the acquired value to obtain the position value of the motor;
[0137] Confirm the position value of the motor as the position value of the calibration point.
[0138] Optionally, set a calibration point module, specifically for:
[0139] When the motor is stalled, the encoder value of the motor is continuously obtained according to a preset number of times, and the obtained value is smoothed and filtered to obtain the position value of the motor;
[0140] Confirm the position value of the motor as the position value of the calibration point.
[0141] The device provided in the embodiment of the present invention can use the actual torque of the motor and the duration of the stall to replace the actual physical switches and sensors as the trigger source for the origin return operation, so as to solve the problems existing in the prior art such as high cost of use, limited application occasions, low-precision switches and sensors that make it impossible for the motor to return to the origin at the correct position, and complex operation and high professional requirements for the operator.
[0142] and Figure 1 Corresponding to the embodiment shown, the embodiment of the present invention further provides an electronic device, see Fig. 9 , including a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904;
[0143] Memory 903, used for storing computer programs;
[0144] The processor 901 is used to implement any of the origin-finding method steps described in the above embodiments when executing the program stored in the memory.
[0145] The electronic device provided in the embodiment of the present invention can use the actual torque size of the motor and the duration of the stall to replace the actual physical switches and sensors as the trigger source for the origin return operation, so as to solve the problems existing in the prior art such as high cost of use, limited usage occasions, low-precision switches and sensors that make it impossible for the motor to return to the origin at the correct position, and complex operation and high professional requirements for the operator.
[0146] and Figure 1 Corresponding to the embodiment shown, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any of the method steps for finding the origin described in the above embodiments is implemented.
[0147] The storage medium provided in the embodiment of the present invention can use the actual torque of the motor and the duration of the stall to replace the actual physical switches and sensors as the trigger source for the origin return operation, so as to solve the problems existing in the prior art such as high cost of use, limited usage occasions, low-precision switches and sensors that make it impossible for the motor to return to the origin at the correct position, and complex operation and high professional requirements for operators.
[0148] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0149] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0150] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0151] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0152] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for finding an origin, characterized in that: Applied to a motor controller, the method comprises: Receiving an origin search request; wherein the origin search method in the origin search request is a stalled-rotor origin search method; According to the origin search method in the origin search request, the motor starts to run; During the movement of the motor, detecting whether the motor is stalled; When it is detected that the motor is blocked, the value of the current encoder of the motor is obtained; the current position value of the motor is calculated according to the value of the current encoder of the motor; it is determined whether the current position value of the motor is the same as the position value of the set calibration point; if they are the same, the motor is caused to perform a position clearing operation; if they are different, the motor is caused to move to the position of the calibration point; when the motor moves to the calibration point, the motor is caused to perform a position clearing operation; Before the step of determining whether the current position value of the motor is the same as the position value of the set calibration point, the method further includes: Setting a calibration point for the motor; The step of setting a calibration point for the motor comprises: When receiving an instruction to set a calibration point; continuously obtaining the value of the encoder of the motor according to a preset number of times; wherein the instruction to set the calibration point is an instruction issued after the user drags the motor to the calibration point; Performing smoothing and filtering calculation on the acquired value to obtain the position value of the motor; Confirming the position value of the motor as the position value of the calibration point; Or the step of setting a calibration point for the motor includes: When the motor is stalled, the encoder value of the motor is continuously obtained according to a preset number of times, and the obtained value is smoothed and filtered to obtain the position value of the motor; The position value of the motor is confirmed as the position value of the calibration point.
2. The method according to claim 1, characterized in that: The step of detecting whether the motor is stalled during the movement of the motor comprises: During the movement of the motor, the torque value of the motor is acquired in real time, and the torque value of the motor is compared with a preset stall detection torque value; When the torque value of the motor is greater than the stall detection torque value, recording a duration during which the torque value of the motor is greater than the stall detection torque value; It is determined whether the duration for which the torque value of the motor is greater than the stall detection torque value reaches a preset stall monitoring duration; if so, it is determined that the motor is stalled.
3. A device for finding an origin, characterized in that: The device comprises: A receiving module, used for receiving an origin search request; wherein the origin search mode in the origin search request is a stalled-rotor origin search mode; An operation module, used for starting the motor to run according to the origin search method in the origin search request; A detection module, used for detecting whether the motor is stalled during the movement of the motor; A judgment module is used to obtain the value of the current encoder of the motor when it is detected that the motor is blocked; calculate the current position value of the motor according to the value of the current encoder of the motor; judge whether the current position value of the motor is the same as the position value of the set calibration point; if they are the same, make the motor perform a position clearing operation; if they are different, make the motor move to the position of the calibration point; when the motor moves to the calibration point, make the motor perform a position clearing operation; Before the step of determining whether the current position value of the motor is the same as the position value of the set calibration point, the method further includes: Setting a calibration point for the motor; The step of setting a calibration point for the motor comprises: When receiving an instruction to set a calibration point; continuously obtaining the value of the encoder of the motor according to a preset number of times; wherein the instruction to set the calibration point is an instruction issued after the user drags the motor to the calibration point; Performing smoothing and filtering calculation on the acquired value to obtain the position value of the motor; Confirming the position value of the motor as the position value of the calibration point; Or the step of setting a calibration point for the motor includes: When the motor is stalled, the encoder value of the motor is continuously obtained according to a preset number of times, and the obtained value is smoothed and filtered to obtain the position value of the motor; The position value of the motor is confirmed as the position value of the calibration point.
4. The device according to claim 3, characterized in that The detection module is specifically used for: During the movement of the motor, the torque value of the motor is acquired in real time, and the torque value of the motor is compared with a preset stall detection torque value; When the torque value of the motor is greater than the stall detection torque value, recording a duration during which the torque value of the motor is greater than the stall detection torque value; It is determined whether the duration for which the torque value of the motor is greater than the stall detection torque value reaches a preset stall monitoring duration; if so, it is determined that the motor is stalled.
5. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method steps described in any one of claims 1-2 when executing the program stored in the memory.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1-2 are implemented.
Citation Information
Patent Citations
Servo motor zero returning method and system based on PLC, storage medium and PLC
CN117477991A