Method for controlling a servo motor and actuator
By controlling the servo motor through multi-stage current input logic, the mechanical rotation amount and theoretical rotation amount are obtained, and the phase-finding rotation deviation is calculated. This solves the problem of phase-finding failure of the servo motor under hard limit, and realizes high-precision servo motor control and safe operation of the actuator.
Patent Information
- Application Number
- CN202511212747.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-08-28
AI Technical Summary
Existing servo motors cannot accurately control the stator winding current during startup and operation, causing the actuator to run away or stall, especially failing to find the phase under hard limit conditions.
The servo motor is controlled by multi-stage current input logic. By acquiring multiple mechanical rotation quantities and theoretical rotation quantities, the phase-finding rotation deviation is calculated, and the target current input logic is determined to avoid hard limit blocking, thereby improving phase-finding accuracy and efficiency.
It improves the control precision of servo motors, avoids actuator runaway or stalling, ensures safe operation, and is suitable for various mechanical stroke-limited application scenarios.
Smart Images

Figure CN120729095B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor control technology, and in particular to a control method and actuator for a servo motor. Background Technology
[0002] Currently, the main drive device in actuators such as electric cylinders and grippers is the servo motor, which typically uses Hall effect sensors for micro-phase finding. However, when an ABZ incremental encoder is used for the servo motor encoder, it cannot detect the absolute position of the motor rotor upon power-up. It can only use the initial mechanical angular position as a starting point and cannot determine the corresponding electrical angle (i.e., current / voltage phase) for correct control. This results in the inability to correctly control the stator winding current during startup and operation, and the inability to generate an effective magnetic field to drive the servo motor. Consequently, situations such as runaway or stalling may occur when the actuator is controlled. Furthermore, electric cylinders and grippers are limited by their mechanical travel. In practical applications, during phase finding, the motor rotor may stop at the positive or negative hard limit when the electric cylinder pushes the load or the gripper clamps the load. In such cases, using Hall effect sensors for micro-phase finding may fail due to the obstruction of the hard limit structure. Therefore, how to perform phase finding for servo motors is a problem that urgently needs to be solved. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide a control method and actuator for a servo motor to alleviate the above-mentioned technical problems.
[0004] In a first aspect, embodiments of the present invention provide a control method for a servo motor. The control method includes: after the servo motor is powered on, controlling the servo motor using a first current input logic to make the rotor rotate from the powered-on position until the rotor stops rotating, and obtaining a first mechanical rotation amount of the rotor; wherein the first current input logic includes maintaining the stator of the servo motor at a first electrical angle; controlling the servo motor using a second current input logic to make the rotor move in a target phase-finding direction until the rotor stops rotating, and obtaining a second mechanical rotation amount of the rotor; wherein the second current input logic includes changing the stator from the first electrical angle to the second electrical angle; determining a phase-finding rotation deviation based on the first mechanical rotation amount, the second mechanical rotation amount, and the theoretical mechanical rotation amount in the second current input logic; obtaining a target mechanical rotation amount; determining a target current input logic based on the target mechanical rotation amount and the phase-finding rotation deviation; and controlling the servo motor using the target current input logic.
[0005] Optionally, the control method further includes: controlling the servo motor with a third current input logic until the rotor stops rotating, and obtaining the third mechanical rotation amount of the rotor; wherein the third current input logic includes changing the stator from a first electrical angle to a third electrical angle; controlling the servo motor with a fourth current input logic until the rotor stops rotating, and obtaining the fourth mechanical rotation amount of the rotor; wherein the fourth current input logic includes changing the stator from a first electrical angle to a fourth electrical angle, and the electrical angle differences between the third electrical angle and the fourth electrical angle relative to the first electrical angle are opposites; and determining the target phase-finding direction based on the third mechanical rotation amount and the fourth mechanical rotation amount.
[0006] Optionally, the target phase-finding direction is determined based on the third mechanical rotation amount and the fourth mechanical rotation amount, including: determining whether the third mechanical rotation amount and the fourth mechanical rotation amount are the same; if not, the direction of stator electrical angle change corresponding to the larger value of the third mechanical rotation amount and the fourth mechanical rotation amount is taken as the target phase-finding direction.
[0007] Optionally, the control method further includes: if the third mechanical rotation amount and the fourth mechanical rotation amount are the same, then adjust the third electrical angle and the fourth electrical angle, and re-control the servo motor using the third current input logic and the fourth current input logic respectively, until the adjusted third mechanical rotation amount and the fourth mechanical rotation amount are different.
[0008] Optionally, the control method further includes: calculating the absolute value of the angle difference between the adjusted third electrical angle / fourth electrical angle and the first electrical angle; when the absolute value of the angle difference reaches the preset electrical angle threshold, if the adjusted third mechanical rotation amount and the fourth mechanical rotation amount are still the same, then the preset phase-finding direction is taken as the target phase-finding direction.
[0009] Optionally, the phase-finding rotation deviation is determined based on the first mechanical rotation amount, the second mechanical rotation amount, and the theoretical mechanical rotation amount in the second current input logic, including: calculating the rotation difference between the second mechanical rotation amount and the theoretical mechanical rotation amount; if the rotation difference is not greater than a preset threshold, then the first mechanical rotation amount is used as the phase-finding rotation deviation.
[0010] Optionally, determining the phase-finding rotation deviation based on the first mechanical rotation amount, the second mechanical rotation amount, and the theoretical mechanical rotation amount in the second current input logic includes: if the rotation difference is greater than a preset threshold, determining the target electrical angle corresponding to the second mechanical rotation amount based on the preset mapping information of the rotation amount and electrical angle and the second mechanical rotation amount; determining the phase-finding rotation deviation based on the target electrical angle, the first electrical angle, and the first mechanical rotation amount; wherein, the target electrical angle is the theoretical electrical angle of the stator corresponding to the rotor being in the first mechanical position, and the first mechanical position is the mechanical position of the rotor when it rotates from the powered position by the first mechanical rotation amount.
[0011] Optionally, the phase-finding rotation deviation is determined based on the target electrical angle, the first electrical angle, and the first mechanical rotation amount, including: determining the electrical angle difference between the target electrical angle and the first electrical angle based on the target electrical angle and the first electrical angle; determining the proportional mechanical rotation amount corresponding to the electrical angle difference based on the electrical angle difference; and determining the phase-finding rotation deviation based on the first mechanical rotation amount and the proportional mechanical rotation amount.
[0012] Secondly, embodiments of the present invention also provide an actuator, including a servo motor and a controller; wherein the controller is used to control the servo motor using the control method of the first aspect.
[0013] Thirdly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the control method described in the first aspect.
[0014] The embodiments of the present invention bring the following beneficial effects:
[0015] This invention provides a control method and actuator for a servo motor. After the servo motor is powered on, a first current input logic is used to control the servo motor, causing the rotor to rotate from the powered-on position until it stops rotating, at which point a first mechanical rotation amount of the rotor is obtained. The first current input logic includes maintaining the stator of the servo motor at a first electrical angle. Then, a second current input logic is used to control the servo motor, causing the rotor to move in the target phase-finding direction until it stops rotating, at which point a second mechanical rotation amount of the rotor is obtained. The second current input logic includes changing the stator from the first electrical angle to the second electrical angle. Next, a phase-finding rotation deviation is determined based on the first mechanical rotation amount, the second mechanical rotation amount, and the theoretical mechanical rotation amount in the second current input logic. Finally, a target mechanical rotation amount is obtained, and a target current input logic is determined based on the target mechanical rotation amount and the phase-finding rotation deviation, and the servo motor is controlled using the target current input logic. The above control method first controls the servo motor according to the first current input logic to determine the first mechanical rotation amount, then controls the servo motor according to the second current input logic to make the rotor move in the target phase-finding direction and determine the second mechanical rotation amount. Finally, the phase-finding rotation deviation is determined according to the first mechanical rotation amount, the second mechanical rotation amount, and the theoretical mechanical rotation amount in the second current input logic, and the servo motor is controlled according to the phase-finding rotation deviation. This avoids the situation where the actuator runs away or stalls due to the hard limit block of the actuator causing the phase-finding to fail, thereby improving the control accuracy of the servo motor and ensuring the safe operation of the actuator.
[0016] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained through the structures particularly pointed out in the description and the drawings.
[0017] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0019] Figure 1 A flowchart of a servo motor control method provided in an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] To facilitate understanding of this embodiment, the embodiments of the present invention will be described in detail below.
[0022] This invention provides a control method for a servo motor, applied to an actuator. In practical applications, actuators typically have a limited mechanical stroke, i.e., the extreme mechanical positions have hard limits. In addition, the actuator also includes a controller and an incremental encoder. The specific structure of the actuator can be referred to the prior art, and this invention will not be described in detail here.
[0023] Specifically, such as Figure 1 As shown, the servo motor control method provided in this embodiment of the invention includes the following steps:
[0024] Step S102: After the servo motor is powered on, the first current input logic is used to control the servo motor so that the rotor starts to rotate from the powered-on position until the rotor stops rotating, and the first mechanical rotation amount of the rotor is obtained.
[0025] In practical applications, a servo motor consists of a stator (also called a motor stator) and a rotor (also called a motor rotor). When the servo motor is powered on, the controller first uses the first current input logic to control the servo motor. This first current input logic involves maintaining the stator of the servo motor at a first electrical angle θ, meaning that the magnetic field angle of the stator remains unchanged and is always maintained at the first electrical angle θ. The rotor, under the attraction of the fixed stator magnetic field, starts rotating from the powered-on position and rotates towards the target position. The powered-on position of the rotor is unknown, and the target position is the position where the stator magnetic field and the rotor magnetic field are in the same direction. It should be noted that the first electrical angle θ is generally 0° or 90°, and can be set according to the actual situation.
[0026] The first current input logic is a DC current with a slowly increasing linear current amplitude and a constant current phase angle. This not only keeps the stator at the first electrical angle θ, but also allows the first current (i.e., the current when the first current input logic controls the servo motor) to increase gradually, reducing oscillations. When the rotor stops rotating, the first current input logic continues to control the servo motor until the first current reaches the first target current. The first target current is generally the maximum value (rated current) of the first current in the first current input logic or twice the maximum value, to balance the load on the actuator. The specific value of the first target current can be set according to the actual situation, which will not be described in detail in this embodiment of the invention.
[0027] Furthermore, when the rotor stops rotating and the first current reaches the first target current, the rotor may have reached the target position or may be blocked by a hard limit switch, i.e., it may be in the hard limit switch position. For example, if the hard limit switch is between the rotor's energized position and the target position, the rotor cannot rotate to the target position and is blocked by the hard limit switch; when the rotor stops rotating, it is in the hard limit switch position. If the hard limit switch is not between the rotor's energized position and the target position, or if the actuator does not have a hard limit switch, the rotor is in the target position when it stops rotating. Therefore, when the rotor stops rotating and the first current reaches the first target current, the controller also acquires the first mechanical rotation amount P1 corresponding to the rotor's rotation from the energized position to the position where it stops rotating.
[0028] In step S104, the second current input logic is used to control the servo motor, causing the rotor to move in the target phase-finding direction until the rotor stops rotating, and then the second mechanical rotation amount of the rotor is obtained.
[0029] After determining the first mechanical rotation amount P1 based on the first current input logic control of the servo motor, the controller then uses the second current input logic to control the servo motor, so that the rotor moves in the target phase-finding direction under the control of the second current input logic. When the rotor stops rotating, the controller obtains the second mechanical rotation amount P2 corresponding to the rotor in the second current input logic. This improves the phase-finding efficiency and phase-finding effect of the servo motor through the target phase-finding direction, thereby improving the control accuracy of the servo motor.
[0030] In this circuit, the second current input logic is a multi-phase alternating current with constant voltage amplitude and frequency. During this process, the stator of the servo motor changes from a first electrical angle θ to a second electrical angle γ, which is typically 360°. Meanwhile, the first electrical angle θ is 0°, thus completing one cycle. The specific values of the first electrical angle θ and the second electrical angle γ can be adaptively adjusted according to actual conditions, and the first electrical angle θ and the second electrical angle γ do not necessarily constitute a complete 360° electrical angle cycle.
[0031] Step S106: Determine the phase-finding rotation deviation based on the first mechanical rotation amount, the second mechanical rotation amount, and the theoretical mechanical rotation amount in the second current input logic.
[0032] Specifically, the rotational difference between the second mechanical rotation and the theoretical mechanical rotation is calculated. If the rotational difference is not greater than a preset threshold, the first mechanical rotation is taken as the phase-finding rotational deviation. The controller also pre-stores preset mapping information (i.e., correspondence) between rotation and electrical angle. When the stator is controlled to change from the first electrical angle θ to the second electrical angle γ using the second current input logic, the controller can determine the theoretical mechanical rotation corresponding to the second current input logic based on the first electrical angle θ, the second electrical angle γ, and the preset mapping information.
[0033] After determining the theoretical mechanical rotation amount, the controller can calculate the rotation difference between the second mechanical rotation amount P2 and the theoretical mechanical rotation amount. That is, it calculates the rotation difference between the actual mechanical rotation amount of the rotor (i.e., the second mechanical rotation amount P2) and the corresponding theoretical mechanical rotation amount during the process of the stator changing from the first electrical angle θ to the second electrical angle γ, and determines whether the rotation difference is not greater than the preset threshold. If so, it is determined that the servo motor has successfully found the phase, and the first mechanical rotation amount P1 is used as the phase finding rotation deviation ΔP, that is, ΔP=P1 at this time.
[0034] Furthermore, if the rotation difference is greater than a preset threshold, the target electrical angle corresponding to the second mechanical rotation is determined based on the preset mapping information of rotation amount and electrical angle and the second mechanical rotation amount; the phase-finding rotation deviation is determined based on the target electrical angle, the first electrical angle and the first mechanical rotation amount.
[0035] Wherein, the target electrical angle is the theoretical electrical angle of the stator corresponding to the rotor being in the first mechanical position, and the first mechanical position is the mechanical position of the rotor when it rotates by a first mechanical rotation from the energized position. In practical applications, multiple reference electrical angles are sequentially selected between the first electrical angle θ and the second electrical angle γ, and the corresponding reference mechanical rotation between each reference electrical angle and the second electrical angle γ is obtained; the reference rotation difference between each reference mechanical rotation and the second mechanical rotation P2 is calculated, and the first reference electrical angle that satisfies the reference rotation difference not being greater than a preset threshold is taken as the target electrical angle.
[0036] Specifically, when the rotation difference is greater than a preset threshold, it indicates that the actuator has a hard limit. At this time, multiple reference electrical angles are selected sequentially between the first electrical angle θ and the second electrical angle γ. These reference electrical angles can be selected in ascending order or in descending order. Taking the ascending order as an example, for instance, multiple reference electrical angles such as θ+Δθ, θ+2Δθ, and θ+3Δθ are selected sequentially. Then, for each reference electrical angle, the reference mechanical rotation amount corresponding to each reference electrical angle and the second electrical angle γ is calculated according to the preset mapping information. Here, the reference mechanical rotation amount can be understood as the rotation amount corresponding to each reference electrical angle and the second electrical angle γ. The reference rotation difference between each reference mechanical rotation amount and the second mechanical rotation amount P2 is also calculated. At this time, according to the selection order of the reference electrical angles, it is determined whether the reference rotation difference corresponding to each reference electrical angle is not greater than the preset threshold, until the first reference rotation difference not greater than the preset threshold is determined according to the selection order. The reference electrical angle corresponding to this reference rotation difference is then taken as the target electrical angle.
[0037] After determining the target electrical angle from multiple reference electrical angles, the controller determines the phase-finding rotation deviation based on the target electrical angle, the first electrical angle, and the first mechanical rotation amount. Specifically, this includes: determining the electrical angle difference between the target electrical angle and the first electrical angle based on the target electrical angle and the first electrical angle; determining the proportional mechanical rotation amount corresponding to the electrical angle difference based on the electrical angle difference; and determining the phase-finding rotation deviation based on the first mechanical rotation amount and the proportional mechanical rotation amount.
[0038] Specifically, the controller first calculates the electrical angle difference between the target electrical angle and the first electrical angle θ, and determines the proportional mechanical rotation amount corresponding to the electrical angle difference based on the preset mapping information; then, it determines the phase-finding rotation deviation ΔP based on the first mechanical rotation amount P1 and the proportional mechanical rotation amount, i.e., ΔP = P1 + proportional mechanical rotation amount.
[0039] It should be noted that the aforementioned phase-finding rotation deviation △P can be understood as the deviation between the rotor's energized position (i.e., the starting point / 0 point position of the incremental encoder) and the theoretically corresponding position of the first electrical angle θ. Considering that the theoretically corresponding position of the first electrical angle θ may not exist due to hard limit blocking, i.e., the rotor cannot reach the theoretically corresponding position of the first electrical angle θ, in this embodiment of the invention, the phase-finding of the servo motor is not to determine the theoretically corresponding position of the first electrical angle θ, but to determine the phase-finding rotation deviation △P, and to control the servo motor according to the phase-finding rotation deviation △P. This avoids the situation where the actuator runs away or stalls due to the hard limit blocking of the actuator, thereby improving the control accuracy of the servo motor.
[0040] Specifically, if the phase-finding rotation deviation ΔP cannot be determined based on the first mechanical rotation amount, the second mechanical rotation amount, and the theoretical mechanical rotation amount in the second current input logic, for example, if the theoretical electrical angle corresponding to the hard limit position is 359°, controlling the rotor to rotate to the 360° electrical angle position may not produce a displacement that can be detected by the incremental encoder, making subsequent steps impossible. In this case, an electrical angle farther from the first electrical angle θ can be selected as the second electrical angle γ. For example, when the first electrical angle θ is 0°, the second electrical angle γ can be changed from 180° to 360° of the same cycle, or even the electrical angle of the next cycle, such as 360° of the next cycle, to avoid phase-finding failure due to hard limit obstruction, thereby ensuring the correct phase-finding of the servo motor, improving the control accuracy of the servo motor, and thus ensuring the safe operation of the actuator, enriching the application scenarios of the actuator, such as applications with gravity shafts or large loads.
[0041] Step S108: Obtain the target mechanical rotation amount, determine the target current input logic based on the target mechanical rotation amount and the phase-finding rotation deviation, and use the target current input logic to control the servo motor.
[0042] Specifically, after determining the phase-finding rotation deviation ΔP, in the subsequent control process of the servo motor, when the controller obtains the target mechanical rotation amount, if it is necessary to control the rotor to move to the target mechanical rotation amount X, the controller can calculate the rotation amount X-ΔP relative to the first electrical angle θ position based on the target mechanical rotation amount X and the phase-finding rotation deviation ΔP. Correspondingly, the electrical angle that needs to be changed relative to the first electrical angle θ can be determined, which can also determine the target current input logic. At this time, the controller uses the target current input logic to control the servo motor, realizing the rotor rotation to the target mechanical rotation amount X, thereby improving the control accuracy and control efficiency of the servo motor, and thus ensuring the safe operation of the actuator.
[0043] In summary, the servo motor control method provided in this embodiment of the invention first controls the servo motor according to the first current input logic to determine the first mechanical rotation amount, then controls the servo motor according to the second current input logic to make the rotor move in the target phase-finding direction and determine the second mechanical rotation amount, and finally determines the phase-finding rotation deviation according to the first mechanical rotation amount, the second mechanical rotation amount, and the theoretical mechanical rotation amount in the second current input logic, and controls the servo motor according to the phase-finding rotation deviation. This avoids the situation where the actuator runs away or stalls due to the hard limit block of the actuator causing the phase-finding to fail, thereby improving the control accuracy of the servo motor and ensuring the safe operation of the actuator.
[0044] In one embodiment, the control method further includes the following steps: ① using a third current input logic to control the servo motor until the rotor stops rotating, and obtaining the third mechanical rotation amount of the rotor; wherein, the third current input logic includes changing the stator from a first electrical angle to a third electrical angle; ② using a fourth current input logic to control the servo motor until the rotor stops rotating, and obtaining the fourth mechanical rotation amount of the rotor; wherein, the fourth current input logic includes changing the stator from a first electrical angle to a fourth electrical angle, and the electrical angle differences between the third electrical angle and the fourth electrical angle relative to the first electrical angle are opposites; ③ determining the target phase-finding direction based on the third mechanical rotation amount and the fourth mechanical rotation amount.
[0045] Specifically, to determine the target phase-finding direction, the controller also uses third and fourth current input logic to control the servo motor. The order of the third and fourth current input logic can be set according to the actual situation. The process of determining the target phase-finding direction is as follows:
[0046] ① First, the servo motor is controlled by the third current input logic to change the stator from the first electrical angle θ to the third electrical angle. Here, the third electrical angle is represented by θ-β, that is, the difference between the first electrical angle and the third electrical angle is β, until the rotor stops rotating and the third current (that is, the current when the servo motor is controlled by the third current input logic) reaches the corresponding third target current. The mechanical rotation amount of the rotor corresponding to the change of the stator from the first electrical angle θ to the third electrical angle θ-β is obtained, that is, the third mechanical rotation amount P3.
[0047] ②Then, the fourth current input logic is used to control the servo motor so that the stator changes from the first electrical angle θ to the fourth electrical angle. Here, the fourth electrical angle is represented by θ + β, that is, the difference between the first electrical angle θ and the fourth electrical angle is also β, until the rotor stops rotating and the fourth current (that is, the current when the fourth current input logic controls the servo motor) reaches the corresponding fourth target current, and the mechanical rotation amount of the rotor corresponding to the change of the stator from the first electrical angle θ to the fourth electrical angle θ + β is obtained, that is, the fourth mechanical rotation amount P4.
[0048] It should be noted that the electrical angle differences between the third electrical angle θ-β and the fourth electrical angle θ+β relative to the first electrical angle θ are opposites. The absolute value of the electrical angle difference β ranges from 0 to a preset electrical angle threshold, generally starting from 90°, but can be set according to actual conditions. Furthermore, both the third and fourth current input logics are multi-phase AC currents with constant voltage amplitude and frequency, used to adjust the stator from the first electrical angle θ to the third electrical angle θ-β and the fourth electrical angle θ+β, respectively.
[0049] ③ Determine the target phase-finding direction based on the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4.
[0050] Specifically, when the servo motor is controlled using the third current input logic, the stator's magnetic field angle changes from the first electrical angle θ to the third electrical angle θ-β. Similarly, when the servo motor is controlled using the fourth current input logic, the stator's magnetic field angle changes from the first electrical angle θ to the fourth electrical angle θ+β. The controller obtains the third mechanical rotation P3 corresponding to the third current input logic and the fourth mechanical rotation P4 corresponding to the fourth current input logic, and determines the target phase-finding direction of the servo motor based on the third mechanical rotation P3 and the fourth mechanical rotation P4. Here, the target phase-finding direction can also be understood as the effective phase-finding direction. By determining the target phase-finding direction, the phase-finding accuracy and efficiency of the servo motor are improved, thereby improving the control accuracy and control efficiency of the servo motor.
[0051] In one method of determining the target phase-finding direction, the control method includes: determining whether the third mechanical rotation amount and the fourth mechanical rotation amount are the same; if not, then taking the stator electrical angle change direction corresponding to the larger value of the third mechanical rotation amount and the fourth mechanical rotation amount as the target phase-finding direction.
[0052] Specifically, after the controller acquires the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4, it first determines whether the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are the same. If they are different, it determines the larger value of the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4, and takes the stator electrical angle change direction corresponding to the larger value as the target phase-finding direction. For example, if the larger value is the third mechanical rotation amount P3, the target phase-finding direction is the direction of stator change from the first electrical angle θ to the third electrical angle θ-β; or, if the larger value is the fourth mechanical rotation amount P4, the target phase-finding direction is the direction of stator change from the first electrical angle θ to the fourth electrical angle θ+β.
[0053] Preferably, in some embodiments, the larger of the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 can be understood as the larger of the two when the difference between them is greater than a certain threshold. Conversely, when the difference between them is not greater than the threshold, they are considered to be the same or equal, but this is not a limitation.
[0054] In another method for determining the target phase-finding direction, the control method further includes: if the third mechanical rotation amount and the fourth mechanical rotation amount are the same, then adjust the third electrical angle and the fourth electrical angle, and re-control the servo motor using the third current input logic and the fourth current input logic respectively, until the adjusted third mechanical rotation amount and the fourth mechanical rotation amount are different.
[0055] In practical applications, assuming the rotor stops rotating at a hard-limit position under the first current input logic, the corresponding magnetic field angle is set to α, where α is an unknown value. When the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are different, there is only one scenario: the actuator has a hard limit, and θ - β < α < θ + β. When the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are the same, there are two scenarios: one is that the actuator has a hard limit, and θ - β ≥ α, or α ≥ θ + β; the other is that the actuator does not have a hard limit. Therefore, when the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are different, the target phase-finding direction can be determined based on the larger value; when the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are the same, it is necessary to further determine whether the actuator has a hard limit.
[0056] Specifically, when the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are the same, the controller adjusts the third electrical angle and the fourth electrical angle respectively, such as adjusting β to adjust the third electrical angle and the fourth electrical angle. After each adjustment, the third current input logic and the fourth current input logic are used to control the servo motor again, and it is determined whether the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are the same after each adjustment, until the adjusted third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are different.
[0057] When the adjusted third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are different, it indicates that the actuator has a hard limit. At this time, the stator electrical angle change direction corresponding to the larger value of the adjusted third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 is taken as the target phase finding direction. The specific process of determining the target phase finding direction can be referred to the aforementioned embodiment. The embodiments of the present invention will not be described in detail here.
[0058] Furthermore, the method also includes: when β is adjusted to the maximum value (i.e., the preset electrical angle threshold), if the third mechanical rotation amount P3 and the fourth mechanical rotation amount P4 are still the same, then the stator electrical angle change direction corresponding to the third current input logic or the stator electrical angle change direction corresponding to the fourth current input logic is taken as the target phase-finding direction.
[0059] Specifically, the absolute value of the angle difference between the adjusted third electrical angle (or fourth electrical angle) and the first electrical angle is calculated. When the absolute value of the angle difference reaches a preset electrical angle threshold, if the adjusted third mechanical rotation P3 and fourth mechanical rotation P4 are still the same, then the preset phase-finding direction is taken as the target phase-finding direction. The preset phase-finding direction is either the angle change direction of the stator in the third current input logic or the angle change direction of the stator in the fourth current input logic; that is, the target phase-finding direction is either one of the two angle change directions.
[0060] Therefore, this embodiment of the invention determines the target phase-finding direction by adjusting β, which facilitates accurate phase-finding near the hard limit with a short stroke. This avoids phase-finding failure due to hard limit obstruction, thereby preventing actuator runaway or stalling and ensuring safe operation of the actuator. Furthermore, in the control process of the servo motor, there is no need to rely on a high-resolution encoder, reducing phase-finding costs and improving phase-finding efficiency, thus improving the control efficiency of the servo motor.
[0061] It should be noted that, in the process of determining the target phase-finding direction, in addition to using the third and fourth current input logics mentioned above to control the servo motor to determine the target phase-finding direction, other methods can also be used to determine the target phase-finding direction, including but not limited to: presetting the target phase-finding direction in the controller in advance, or having the operator specify the target phase-finding direction according to the actual situation, etc. The specific settings can be made according to the actual situation.
[0062] Furthermore, embodiments of the present invention also provide an actuator, including a servo motor and a controller; wherein the controller is used to control the servo motor using the methods described above. In practical applications, the types of actuators include, but are not limited to, electric cylinders and electric grippers, etc., and can be specifically configured according to actual conditions.
[0063] The actuator provided in this embodiment of the invention has the same technical features as the servo motor control method provided in the above embodiments, so it can also solve the same technical problems and achieve the same technical effects.
[0064] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above-described servo motor control method.
[0065] The computer program product of the servo motor control method and actuator provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0066] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the actuator described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0067] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0068] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0069] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0070] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A control method for a servo motor, characterized in that, The control method includes: After the servo motor is powered on, the servo motor is controlled by a first current input logic to make the rotor start to rotate from the powered-on position until the rotor stops rotating, and then the first mechanical rotation amount of the rotor is obtained; wherein, the first current input logic includes maintaining the stator of the servo motor at a first electrical angle; The servo motor is controlled by a second current input logic, causing the rotor to move in the target phase-finding direction until the rotor stops rotating, at which point the second mechanical rotation amount of the rotor is obtained; wherein, the second current input logic includes changing the stator from the first electrical angle to the second electrical angle; The phase-finding rotation deviation is determined based on the first mechanical rotation amount, the second mechanical rotation amount, and the theoretical mechanical rotation amount in the second current input logic; wherein, the rotation difference between the second mechanical rotation amount and the theoretical mechanical rotation amount is calculated; if the rotation difference is not greater than a preset threshold, the first mechanical rotation amount is used as the phase-finding rotation deviation; if the rotation difference is greater than the preset threshold, a target electrical angle corresponding to the second mechanical rotation amount is determined based on the preset mapping information of rotation amount and electrical angle and the second mechanical rotation amount; the phase-finding rotation deviation is determined based on the target electrical angle, the first electrical angle, and the first mechanical rotation amount. The target mechanical rotation amount is obtained, and the target current input logic is determined based on the target mechanical rotation amount and the phase-finding rotation deviation. The target current input logic is then used to control the servo motor.
2. The control method according to claim 1, characterized in that, The control method further includes: The servo motor is controlled using a third current input logic until the rotor stops rotating, at which point the third mechanical rotation amount of the rotor is obtained; wherein, the third current input logic includes changing the stator from the first electrical angle to the third electrical angle; The servo motor is controlled by a fourth current input logic until the rotor stops rotating, at which point the fourth mechanical rotation amount of the rotor is obtained; wherein, the fourth current input logic includes changing the stator from the first electrical angle to the fourth electrical angle, and the electrical angle difference between the third electrical angle and the fourth electrical angle relative to the first electrical angle is an opposite number; The target phase-finding direction is determined based on the third mechanical rotation amount and the fourth mechanical rotation amount.
3. The control method according to claim 2, characterized in that, Determining the target phase-finding direction based on the third mechanical rotation amount and the fourth mechanical rotation amount includes: Determine whether the third mechanical rotation amount and the fourth mechanical rotation amount are the same; If not, the direction of the stator electrical angle change corresponding to the larger of the third mechanical rotation amount and the fourth mechanical rotation amount shall be taken as the target phase-finding direction.
4. The control method according to claim 3, characterized in that, The control method further includes: If the third mechanical rotation amount and the fourth mechanical rotation amount are the same, then the third electrical angle and the fourth electrical angle are adjusted, and the servo motor is controlled again using the third current input logic and the fourth current input logic respectively, until the adjusted third mechanical rotation amount and the fourth mechanical rotation amount are different.
5. The control method according to claim 4, characterized in that, The control method further includes: Calculate the absolute value of the angle difference between the adjusted third electrical angle and the fourth electrical angle and the first electrical angle; When the absolute value of the angle difference reaches the preset electrical angle threshold, if the adjusted third mechanical rotation amount and the fourth mechanical rotation amount are still the same, then the preset phase-finding direction is taken as the target phase-finding direction.
6. The control method according to claim 1, characterized in that, The target electrical angle is the theoretical electrical angle of the stator when the rotor is in the first mechanical position, and the first mechanical position is the mechanical position when the rotor rotates by the first mechanical rotation amount from the powered position.
7. The control method according to claim 1, characterized in that, Determining the phase-finding rotation deviation based on the target electrical angle, the first electrical angle, and the first mechanical rotation amount includes: Based on the target electrical angle and the first electrical angle, determine the electrical angle difference between the target electrical angle and the first electrical angle; Based on the electrical angle difference, determine the proportional mechanical rotation amount corresponding to the electrical angle difference; The phase-finding rotation deviation is determined based on the first mechanical rotation amount and the proportional mechanical rotation amount.
8. An actuator, characterized in that, It includes a servo motor and a controller; wherein the controller is used to control the servo motor using the control method described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, performs the steps of the control method according to any one of claims 1-7.
Citation Information
Patent Citations
Jiggling phase searching method for three-phase AC servo motor
CN101604955A
Motor phase searching method, device and equipment based on Hall signal and storage medium
CN116388617A