Servo system and initial angle identification method, device, motor controller and medium
By determining the first angle and angle difference of the motor in the servo system and calculating the initial angle, the problem of errors in the motor initial angle identification method in the prior art is solved, and high-precision motor initial angle identification and more accurate motor control are achieved.
Patent Information
- Application Number
- CN202111388963.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-11-22
AI Technical Summary
In the prior art, there are errors in the initial angle identification method of motors, resulting in inconsistent identification results, affecting the accuracy of motor control.
By determining the first angle of the servo system motor and controlling the motor rotation according to the given current command, the angle difference between the actual electrical angle and the given electrical angle is recorded, the initial angle is calculated, and the identification accuracy is improved.
High-precision motor initial angle recognition is achieved, reducing the recognition result error caused by encoder error and motor extreme error, and improving the accuracy of motor control.
Smart Images

Figure CN114123871B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of motor control technology, and in particular to a servo system and an initial angle identification method, device, motor controller and medium thereof. Background Art
[0002] When the motor in the servo system is started, the specific position of the motor rotor must be confirmed based on the motor initial angle. Therefore, accurate identification of the motor initial angle plays an important role in the performance of motor control.
[0003] The motor initial angle identification method in the related art mainly controls the motor rotation by giving a current in a certain direction, and takes the electrical angle corresponding to the position when the motor stops rotating as the motor initial angle. The defects of the related art are: there is a certain error in the distance between each pair of poles in the motor, which will lead to inconsistent identification results for each pair of poles, and the linearity of the motor encoder itself will also lead to a certain error in the identification result, thereby affecting the accuracy of the motor initial angle identification result. Summary of the invention
[0004] The present invention aims to solve one of the technical problems in the related art to at least a certain extent. To this end, the first object of the present invention is to provide an initial angle identification method for a servo system, by which the initial angle of a motor in the servo system can be identified with high precision.
[0005] A second object of the present invention is to provide a computer-readable storage medium.
[0006] The third objective of the present invention is to provide a motor controller.
[0007] A fourth object of the present invention is to provide a servo system.
[0008] A fifth objective of the present invention is to provide an initial angle identification device for a servo system.
[0009] To achieve the above-mentioned purpose, an embodiment of the first aspect of the present invention proposes a method for identifying the initial angle of a servo system, the method comprising: determining a first angle of a motor of the servo system; obtaining a first current given instruction, and controlling the motor to rotate in a first direction according to a preset angular frequency based on the first current given instruction; in the process of the motor rotating in the first direction, determining a first angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the first current given instruction; and determining the initial angle of the motor based on the first angle and the first angle difference.
[0010] According to the initial angle identification method of the servo system of the embodiment of the present invention, firstly, a first angle of a motor of the servo system is determined, and then a first current given instruction is obtained, and the motor is controlled to rotate in a first direction according to a preset angular frequency according to the first current given instruction, and in the process of the motor rotating in the first direction, a first angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the first current given instruction is determined, and the initial angle of the motor is determined according to the first angle and the first angle difference, so that the initial angle of the motor in the servo system can be identified with high precision.
[0011] In addition, the initial angle identification method of the servo system according to the above embodiment of the present invention may also have the following additional technical features:
[0012] According to one embodiment of the present invention, determining the initial angle of the motor according to the first angle and the first angle difference includes: calculating an average value of the first angle difference, and determining the initial angle of the motor according to the average value of the first angle difference and the first angle.
[0013] According to one embodiment of the present invention, before determining the initial angle of the motor based on the first angle and the first angle difference, the method also includes: obtaining a second current given instruction, and controlling the motor to rotate in a second direction at a preset angular frequency according to the second current given instruction, wherein the first direction is opposite to the second direction; in the process of the motor rotating in the second direction, determining a second angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the second current given instruction, so as to determine the initial angle of the motor based on the second angle difference, the first angle and the first angle difference.
[0014] According to one embodiment of the present invention, the initial angle of the motor is determined based on the second angle difference, the first angle and the first angle difference, including: calculating the average value of the first angle difference, calculating the average value of the second angle difference, and determining the initial angle of the motor based on the average value of the first angle difference, the average value of the second angle difference and the first angle.
[0015] According to one embodiment of the present invention, the motor rotates at least one circle in the first direction according to a preset angular frequency, and the motor rotates at least one circle in the second direction according to the preset angular frequency.
[0016] According to an embodiment of the present invention, the preset angular frequency is less than or equal to a given angular frequency threshold.
[0017] According to one embodiment of the present invention, the first given current instruction and the second given current instruction both include a d-axis given current and a q-axis given current, wherein the q-axis given current is zero.
[0018] According to one embodiment of the present invention, determining the first angle of a motor of a servo system includes: obtaining a current given instruction of a fixed angle, controlling the motor to rotate according to the current given instruction of the fixed angle, and when the motor stops rotating, using the fixed angle as the first angle.
[0019] According to one embodiment of the present invention, the current amplitude of the fixed-angle current setting instruction is the rated operating current of the motor.
[0020] To achieve the above-mentioned purpose, the second aspect of the present invention proposes a computer-readable storage medium on which an initial angle identification program of a servo system is stored. When the initial angle identification program of the servo system is executed by a processor, the initial angle identification method of the servo system proposed in the first aspect of the present invention is implemented.
[0021] According to the computer readable storage medium of the embodiment of the present invention, when the computer program stored thereon is executed by a processor, the initial angle of the motor in the servo system can be identified with high precision by implementing the aforementioned initial angle identification method of the servo system.
[0022] To achieve the above-mentioned purpose, an embodiment of the third aspect of the present invention proposes a motor controller, including a memory, a processor, and an initial angle identification program of a servo system stored in the memory and executable on the processor. When the processor executes the initial angle identification program of the servo system, the initial angle identification method of the servo system proposed in the embodiment of the first aspect is implemented.
[0023] According to the motor controller of the embodiment of the present invention, when the computer program stored thereon is executed by the processor, the initial angle of the motor in the servo system can be identified with high precision by implementing the aforementioned initial angle identification method of the servo system.
[0024] To achieve the above objectives, a fourth embodiment of the present invention proposes a servo system, including a motor and a motor controller. The motor controller executes the steps of the initial angle identification method of the servo system proposed in the first embodiment when identifying the initial angle of the motor.
[0025] According to the servo system of the embodiment of the present invention, the motor controller that executes the steps of the initial angle identification method of the servo system proposed in the first aspect of the embodiment can identify the initial angle of the motor in the servo system with high precision.
[0026] To achieve the above-mentioned purpose, the fifth aspect of the present invention proposes an initial angle identification device for a servo system, including: a determination module, used to determine a first angle of a motor of the servo system; an acquisition module, used to acquire a first current given instruction; a control module, used to control the motor to rotate in a first direction according to a preset angular frequency according to the first current given instruction, and in the process of the motor rotating in the first direction, determine a first angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the first current given instruction, and determine the initial angle of the motor according to the first angle and the first angle difference.
[0027] According to the initial angle identification device of the servo system of the embodiment of the present invention, the first angle of the motor of the servo system is determined by a determination module, and the first current given instruction is obtained by an acquisition module, and the motor is controlled to rotate in a first direction according to a preset angular frequency according to the first current given instruction by a control module, and in the process of the motor rotating in the first direction, the first angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the first current given instruction is determined, and the initial angle of the motor is determined according to the first angle and the first angle difference, so that the initial angle of the motor in the servo system can be identified with high precision. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A schematic diagram of the motor d-axis angle and encoder feedback angle according to an embodiment of the present invention;
[0029] Figure 2 is a schematic diagram of encoder error according to an embodiment of the present invention;
[0030] Figure 3 is a flow chart of a method for identifying an initial angle of a servo system according to an embodiment of the present invention;
[0031] Figure 4 is a flow chart of a method for identifying an initial angle of a servo system according to another embodiment of the present invention;
[0032] Figure 5 is a flow chart of a method for identifying an initial angle of a servo system according to another embodiment of the present invention;
[0033] Figure 6 is a flow chart of a method for identifying an initial angle of a servo system according to another embodiment of the present invention;
[0034] Figure 7 is a block diagram of a motor controller according to an embodiment of the present invention;
[0035] Figure 8 FIG. 4 is a block diagram of an initial angle recognition device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0037] When the motor in the servo system is started, the specific position of the motor rotor must be confirmed based on the motor initial angle. Therefore, accurate identification of the motor initial angle plays an important role in the performance of motor control.
[0038] The motor initial angle identification method in the related art mainly controls the motor rotation by giving a current in a certain direction, and uses the electrical angle corresponding to the position when the motor stops rotating as the motor's initial angle. The defects of the related art are: there is a certain error in the distance between each pair of poles in the motor, which will lead to inconsistent identification results for each pair of poles, and the linearity of the motor encoder itself will also lead to certain errors in the identification results, thereby affecting the accuracy of the motor initial angle identification results. For example, in accordance with Figure 1 The solid line shown is linear. When the d-axis angle of the motor is given, ideally, the Figure 2 The solid line shows the encoder feedback angle, but due to the linearity of the motor encoder itself, the encoder feedback angle is actually Figure 1 As shown by the dotted line, and from Figure 2 It can be clearly seen that there is a certain error between the encoder feedback angle and the ideal encoder feedback angle, which will affect the accuracy of the motor initial angle identification result. Based on this, the present invention provides an initial angle identification method that can identify the motor initial angle with high accuracy.
[0039] Figure 3 FIG. 1 is a flow chart of an initial angle recognition method according to an embodiment of the present invention. Figure 3 As shown, the initial angle recognition method may include the following steps:
[0040] In step S1 , a first angle of a motor of a servo system is determined.
[0041] That is to say, when identifying the initial angle of the motor in the servo system, the initial angle of the motor, i.e., the first angle, can be preliminarily determined first. Specifically, a current given instruction corresponding to a certain fixed angle can be given to make the motor in the servo system rotate under the action of the current given instruction until the motor stops rotating, i.e., the rotor position of the motor no longer changes, and the fixed angle is marked as the first angle of the motor. Optionally, the current amplitude of the aforementioned current given instruction can be set to the rated working current of the motor.
[0042] In step S2, a first current setting instruction is obtained, and the motor is controlled to rotate in a first direction at a preset angular frequency according to the first current setting instruction.
[0043] It should be noted that the first direction can be the forward direction of the motor or the reverse direction of the motor, and there is no specific limitation here. Optionally, when the motor is controlled to rotate along the first direction at a preset angular frequency according to the first current given instruction, it is necessary to make the preset angular frequency not greater than the given angular frequency threshold, so that by limiting the angular frequency, the rotation speed of the motor is limited to the set threshold range, so as to ensure the accuracy of the actual electrical angle of the motor obtained, thereby improving the accuracy of the initial angle of the motor obtained.
[0044] In step S3, when the motor rotates in a first direction, a first angle difference between an actual electrical angle of the motor and an electrical angle corresponding to a first current given instruction is obtained.
[0045] Specifically, the motor can be controlled to rotate n times in the first direction at a preset angular frequency according to the first current given instruction, where n≥1. During the rotation of the motor, the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the first current given instruction are recorded, and then the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the first current given instruction are calculated, and the electrical angle difference between the electrical angle converted from the position feedback and the electrical angle corresponding to the first current given instruction is marked as the first angle difference.
[0046] In step S4, an initial angle of the motor is determined according to the first angle and the first angle difference.
[0047] Specifically, the initial angle of the motor is obtained by superimposing the first angle and the first angle difference.
[0048] According to the initial angle identification method of this embodiment, after determining the first angle of the motor, the motor is also controlled to rotate at a preset angular frequency, and during the rotation, the angle difference between the actual electrical angle of the motor and the given electrical angle is recorded, and the initial angle of the motor is calculated based on the first angle and the angle difference. This can reduce the identification result error caused by the encoder error and the error between each pair of poles of the motor, so that the initial angle of the motor in the servo system can be accurately obtained.
[0049] Figure 4 FIG. 4 is a flow chart of an initial angle recognition method according to another embodiment of the present invention. Figure 4 As shown, the initial angle recognition method may include the following steps:
[0050] In step S1 , a first angle of a motor of a servo system is determined.
[0051] That is to say, when identifying the initial angle of the motor in the servo system, the initial angle of the motor, i.e., the first angle, can be preliminarily determined first. Specifically, a current given instruction corresponding to a certain fixed angle can be given to make the motor in the servo system rotate under the action of the current given instruction until the motor stops rotating, i.e., the rotor position of the motor no longer changes, and the fixed angle is marked as the first angle of the motor. Optionally, the current amplitude of the aforementioned current given instruction can be set to the rated working current of the motor.
[0052] In step S2, a first current setting instruction is obtained, and the motor is controlled to rotate in a first direction at a preset angular frequency according to the first current setting instruction.
[0053] It should be noted that the first direction can be the forward direction of the motor or the reverse direction of the motor, and there is no specific limitation here. Optionally, when the motor is controlled to rotate along the first direction at a preset angular frequency according to the first current given instruction, it is necessary to make the preset angular frequency not greater than the given angular frequency threshold, so that by limiting the angular frequency, the rotation speed of the motor is limited to the set threshold range, so as to ensure the accuracy of the actual electrical angle of the motor obtained, thereby improving the accuracy of the initial angle of the motor obtained.
[0054] In step S3, when the motor rotates in a first direction, a first angle difference between an actual electrical angle of the motor and an electrical angle corresponding to a first current given instruction is obtained.
[0055] Specifically, the motor can be controlled to rotate n times in the first direction at a preset angular frequency according to the first current given instruction, where n≥1. During the rotation of the motor, the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the first current given instruction are recorded, and then the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the first current given instruction are calculated, and the electrical angle difference between the electrical angle converted from the position feedback and the electrical angle corresponding to the first current given instruction is marked as the first angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the first current given instruction.
[0056] In step S5, an average value of the first angle differences is calculated.
[0057] Specifically, when the number of revolutions of the motor is n=1, the first angle differences of multiple points within one revolution of the motor are averaged to obtain the average value of the first angle difference; when the number of revolutions of the motor is n>1, the first angle differences of each point within n revolutions of the motor are averaged to obtain the average value of the first angle difference. That is, the first angle differences corresponding to all position points during the rotation of the motor are averaged to obtain the average value of the first angle difference.
[0058] It should be noted that the number of motor rotations may be less than one circle, but the recognition result of the motor initial angle in this case will be slightly less accurate than when the motor rotates more than or equal to 1, but it still has a certain accuracy. The specific number of rotations can be determined according to actual needs and is not limited here.
[0059] In step S6, an initial angle of the motor is determined according to the average value of the first angle difference and the first angle.
[0060] Specifically, the initial angle of the motor is obtained by superimposing the average value of the first angle difference and the first angle.
[0061] According to the initial angle identification method of this embodiment, after determining the first angle of the motor, the motor is also controlled to rotate at a preset angular frequency, and during the rotation, the angle difference between the actual electrical angle of the motor and the given electrical angle is recorded, and the angle difference is averaged, and the initial angle of the motor is calculated based on the first angle and the average value of the angle difference. This can reduce the identification result error caused by the encoder error and the error between each pair of poles of the motor, so that the initial angle of the motor in the servo system can be accurately obtained.
[0062] Figure 5 FIG. 4 is a flow chart of an initial angle recognition method according to another embodiment of the present invention. Figure 5 As shown, the initial angle recognition method may include the following steps:
[0063] In step S1 , a first angle of a motor of a servo system is determined.
[0064] That is to say, when identifying the initial angle of the motor in the servo system, the initial angle of the motor, i.e., the first angle, can be preliminarily determined first. Specifically, a current given instruction corresponding to a certain fixed angle can be given to make the motor in the servo system rotate under the action of the current given instruction until the motor stops rotating, i.e., the rotor position of the motor no longer changes, and the fixed angle is marked as the first angle of the motor. Optionally, the current amplitude of the aforementioned current given instruction can be set to the rated working current of the motor.
[0065] In step S2, a first current setting instruction is obtained, and the motor is controlled to rotate in a first direction at a preset angular frequency according to the first current setting instruction.
[0066] It should be noted that the first direction can be the forward direction of the motor or the reverse direction of the motor, and there is no specific limitation here. Optionally, when the motor is controlled to rotate along the first direction at a preset angular frequency according to the first current given instruction, it is necessary to make the preset angular frequency not greater than the given angular frequency threshold, so that by limiting the angular frequency, the rotation speed of the motor is limited to the set threshold range, so as to ensure the accuracy of the actual electrical angle of the motor obtained, thereby improving the accuracy of the initial angle of the motor obtained.
[0067] In step S3, when the motor rotates in a first direction, a first angle difference between an actual electrical angle of the motor and an electrical angle corresponding to a first current given instruction is obtained.
[0068] Specifically, the motor can be controlled to rotate n times in the first direction at a preset angular frequency according to the first current given instruction, where n≥1. During the rotation of the motor, the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the first current given instruction are recorded, and then the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the first current given instruction are calculated, and the electrical angle difference between the electrical angle converted from the position feedback and the electrical angle corresponding to the first current given instruction is marked as the first angle difference.
[0069] In step S7, a second current setting instruction is obtained, and the motor is controlled to rotate in a second direction at a preset angular frequency according to the second current setting instruction.
[0070] It should be noted that the second direction is the opposite direction to the first direction. For example, when the first direction is the forward direction of the motor, the corresponding second direction is the reverse direction of the motor; for another example, when the first direction is the reverse direction of the motor, the corresponding second direction is the forward direction of the motor. Optionally, when the motor is controlled to rotate in the second direction at a preset angular frequency according to the second current given instruction, it is necessary to make the preset angular frequency not greater than a given angular frequency threshold, so that by limiting the angular frequency, the rotation speed of the motor is limited within the set threshold range to ensure the accuracy of the actual electrical angle of the motor, thereby improving the accuracy of the initial angle of the motor.
[0071] In step S8, when the motor rotates in the second direction, a second angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the second current given instruction is obtained.
[0072] Specifically, the motor can be controlled to rotate m turns along the second direction at a preset angular frequency according to the second current given instruction, where m≥1. During the rotation of the motor, the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the second current given instruction are recorded, and then the electrical angle difference between the electrical angle converted from the position feedback and the electrical angle corresponding to the second current given instruction is calculated according to the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the second current given instruction, and the electrical angle difference is marked as the second angle difference.
[0073] In step S9, an initial angle of the motor is determined according to the first angle difference, the second angle difference and the first angle.
[0074] Specifically, the first angle difference and the second angle difference are averaged, and then the average value and the first angle are superimposed to obtain the initial angle of the motor.
[0075] According to the initial angle identification method of this embodiment, after determining the first angle of the motor, the first angle difference and the second angle difference obtained when the motor rotates in the forward direction and the reverse direction are averaged, and the initial angle of the motor is determined based on the average value of the first angle difference and the second angle difference. This can not only reduce the identification result error caused by the encoder error and the error between each pair of poles of the motor, but also offset the initial angle calculation error caused by friction, effectively solving the problem of a certain error in the identification result of the motor's initial angle when the torque generated by the current controlling the motor's rotation is less than the friction of the motor's rotation, thereby greatly improving the accuracy of the motor's initial angle identification result.
[0076] Figure 6 FIG. 4 is a flow chart of an initial angle recognition method according to another embodiment of the present invention. Figure 6 As shown, the initial angle recognition method may include the following steps:
[0077] In step S1 , a first angle of a motor of a servo system is determined.
[0078] That is to say, when identifying the initial angle of the motor in the servo system, the initial angle of the motor, i.e., the first angle, can be preliminarily determined. Specifically, a current given instruction of a certain fixed angle can be given to make the motor in the servo system rotate under the action of the current given instruction until the motor stops rotating, i.e., the rotor position of the motor no longer changes, and the fixed angle is marked as the first angle of the motor. Optionally, the current amplitude of the aforementioned current given instruction can be set to the rated working current of the motor.
[0079] In step S2, a first current setting instruction is obtained, and the motor is controlled to rotate in a first direction at a preset angular frequency according to the first current setting instruction.
[0080] It should be noted that the first direction can be the forward direction of the motor or the reverse direction of the motor, and there is no specific limitation here. Optionally, when the motor is controlled to rotate along the first direction at a preset angular frequency according to the first current given instruction, it is necessary to make the preset angular frequency not greater than the given angular frequency threshold, so that by limiting the angular frequency, the rotation speed of the motor is limited to the set threshold range, so as to ensure the accuracy of the actual electrical angle of the motor obtained, thereby improving the accuracy of the initial angle of the motor obtained.
[0081] In step S3, when the motor rotates in a first direction, a first angle difference between an actual electrical angle of the motor and an electrical angle corresponding to a first current given instruction is obtained.
[0082] Specifically, the motor can be controlled to rotate n times in the first direction at a preset angular frequency according to the first current given instruction, where n≥1. During the rotation of the motor, the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the first current given instruction are recorded, and then the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the first current given instruction are calculated, and the electrical angle difference between the electrical angle converted from the position feedback and the electrical angle corresponding to the first current given instruction is marked as the first angle difference.
[0083] In step S7, a second current setting instruction is obtained, and the motor is controlled to rotate in a second direction at a preset angular frequency according to the second current setting instruction.
[0084] It should be noted that the second direction is the opposite direction to the first direction. For example, when the first direction is the forward direction of the motor, the corresponding second direction is the reverse direction of the motor; for another example, when the first direction is the reverse direction of the motor, the corresponding second direction is the forward direction of the motor. Optionally, when the motor is controlled to rotate in the second direction at a preset angular frequency according to the second current given instruction, it is necessary to make the preset angular frequency not greater than a given angular frequency threshold, so that by limiting the angular frequency, the rotation speed of the motor is limited within the set threshold range to ensure the accuracy of the actual electrical angle of the motor, thereby improving the accuracy of the initial angle of the motor.
[0085] In step S8, when the motor rotates in the second direction, a second angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the second current given instruction is obtained.
[0086] Specifically, the motor can be controlled to rotate m turns along the second direction at a preset angular frequency according to the second current given instruction, where m≥1. During the rotation of the motor, the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the second current given instruction are recorded, and then the electrical angle difference between the electrical angle converted from the position feedback and the electrical angle corresponding to the second current given instruction is calculated according to the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the second current given instruction, and the electrical angle difference is marked as the second angle difference.
[0087] In step S10 , an average value of the first angle difference and an average value of the second angle difference are calculated.
[0088] Specifically, the motor is controlled to rotate n times in the first direction according to the first current given instruction, where n≥1, and the electrical angle converted from the position feedback during the rotation of the motor is recorded, and the electrical angle corresponding to the first current given instruction is recorded, and the electrical angle converted from the position feedback is obtained, and the electrical angle difference corresponding to the first current instruction is obtained, and the electrical angle difference is marked as the first angle difference, and the average value of the first angle difference is calculated, and the average value of the calculated first angle difference is used as the final first angle difference. That is, the first angle difference corresponding to all position points during the rotation of the motor in the positive direction is averaged, and the average value of the first angle difference is obtained.
[0089] The motor is controlled to rotate m times in the second direction at a preset angular frequency according to the second current given instruction, wherein m≥1; the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the second current instruction are recorded, and then the electrical angle converted from the position feedback and the electrical angle difference corresponding to the second current instruction are obtained, and the electrical angle difference is marked as the second angle difference, and the average value of the second angle difference is calculated, and the average value of the calculated second angle difference is used as the final second angle difference. That is, the second angle difference corresponding to all position points during the rotation of the motor in the reverse direction is averaged, and then the average value of the second angle difference is obtained.
[0090] The preset angular frequency is not greater than the given angular frequency threshold; the first current given instruction and the second current given instruction both include: a d-axis given current and a q-axis given current, and the q-axis given current is zero. That is, the motor runs in the current loop, and the q-axis given current of the current loop is zero.
[0091] In step S11 , an initial angle of the motor is determined according to the first angle, the average value of the first angle difference, and the average value of the second angle difference.
[0092] Specifically, the average value of the first angle difference and the average value of the second angle difference are averaged, and then the initial angle of the motor is calculated based on the average value and the first angle.
[0093] According to the initial angle identification method of this embodiment, after determining the first angle of the motor, the first angle difference and the second angle difference obtained when the motor is rotated in the forward direction and the reverse direction are averaged, and the initial angle of the motor is confirmed based on the average value of the first angle difference and the second angle difference. This can not only reduce the identification result error caused by the encoder error and the error between each pair of poles of the motor, but also offset the initial angle calculation error caused by friction, effectively solving the problem that when the torque generated by the current controlling the rotation of the motor is less than the friction of the motor, resulting in a certain error in the identification result of the motor's initial angle, thereby greatly improving the accuracy of the motor's initial angle identification result.
[0094] Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, on which an initial angle recognition program is stored. When the initial angle recognition program is executed by a processor, the above-mentioned initial angle recognition method is implemented.
[0095] According to the computer-readable storage medium provided by an embodiment of the present invention, when the computer program stored on the computer-readable storage medium is executed by a processor, the error of the initial angle identification result of the motor caused by the encoder's own error and the error between each pair of poles of the motor can be reduced, the friction force during the rotation of the motor can be offset, and the error of the initial angle identification result of the motor caused by the friction force when the torque generated by the current controlling the rotation of the motor is less than the friction force of the motor rotation can be reduced, thereby achieving the purpose of improving the accuracy of the initial angle identification result of the motor.
[0096] Figure 7 is a block diagram of a motor controller according to an embodiment of the present invention, referring to Figure 7 As shown, the motor controller 100 includes: a processor 101, a memory 102, and an initial angle recognition program 103 stored in the memory 102 and executable on the processor 101. When the processor 101 executes the initial angle recognition program 103, the above-mentioned initial angle recognition method can be implemented.
[0097] The motor controller provided according to the embodiment of the present invention can reduce the error in the initial angle identification result of the motor caused by the encoder's own error and the error between each pair of poles of the motor, offset the friction during the rotation of the motor, and thereby reduce the error in the initial angle identification result of the motor caused by the friction when the torque generated by the current controlling the rotation of the motor is less than the friction of the motor rotation, thereby achieving the purpose of improving the accuracy of the initial angle identification result of the motor.
[0098] Furthermore, an embodiment of the present invention provides a servo system, which includes a motor and a motor controller. The motor controller identifies the initial angle of the motor in the servo system by executing the steps of the above-mentioned initial angle identification method.
[0099] The servo system provided according to the embodiment of the present invention can reduce the error in the initial angle identification result of the motor caused by the encoder's own error and the error between each pair of poles of the motor, and can offset the friction during the rotation of the motor, thereby reducing the error in the initial angle identification result of the motor caused by the friction when the torque generated by the current controlling the rotation of the motor is less than the friction of the motor rotation, thereby achieving the purpose of improving the accuracy of the initial angle identification result of the motor.
[0100] Figure 8 is a block diagram of an initial angle recognition device according to an embodiment of the present invention, referring to Figure 8 As shown, the initial angle recognition device 200 may include: a determination module 201 , an acquisition module 202 and a control module 203 .
[0101] Among them, the determination module 201 is used to determine the first angle of the motor of the servo system; the acquisition module 202 is used to obtain the first current given instruction; the control module 203 is used to control the motor to rotate along the first direction at a preset angular frequency according to the first current given instruction, and in the process of the motor rotating along the first direction, determine the first angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the first current given instruction, and determine the initial angle of the motor according to the first angle and the first angle difference.
[0102] According to an embodiment of the present invention, the control module 203 is specifically configured to: calculate an average value of the first angle difference, and determine an initial angle of the motor according to the average value of the first angle difference and the first angle.
[0103] According to one embodiment of the present invention, the acquisition module 20 is also used to: acquire a second current given instruction; the control module 203 is also used to: control the motor to rotate in a second direction at a preset angular frequency according to the second current given instruction, and during the rotation of the motor in the second direction, determine the second angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the second current given instruction, so as to determine the initial angle of the motor according to the second angle difference, the first angle and the first angle difference, wherein the first direction and the second direction are opposite.
[0104] According to one embodiment of the present invention, the control module 203 is specifically used to: calculate the average value of the first angle difference, calculate the average value of the second angle difference, and determine the initial angle of the motor according to the average value of the first angle difference, the average value of the second angle difference and the first angle.
[0105] According to an embodiment of the present invention, the motor rotates at least one revolution in the first direction at a preset angular frequency, and the motor rotates at least one revolution in the second direction at a preset angular frequency.
[0106] According to an embodiment of the present invention, the preset angular frequency is not greater than a given angular frequency threshold.
[0107] According to one embodiment of the present invention, the first given current instruction and the second given current instruction both include: a q-axis given current and a d-axis given current, and the q-axis given current is zero.
[0108] According to an embodiment of the present invention, the determination module 201 is specifically used to: obtain a current given instruction of a fixed angle, control the rotation of the motor according to the current given instruction of the fixed angle, and use the fixed angle as the first angle when the motor stops rotating.
[0109] According to one embodiment of the present invention, the current amplitude of the fixed-angle current setting instruction is the rated operating current of the motor.
[0110] It should be noted that, for the description of the initial angle recognition device in this application, please refer to the description of the initial angle recognition method in this application, and the details will not be repeated here.
[0111] The initial angle identification device of the servo system provided according to the embodiment of the present invention can reduce the error of the initial angle identification result of the motor caused by the error of the encoder itself and the error between each pair of poles of the motor, as well as the error of the initial angle identification result of the motor caused by the friction force when the torque generated by the current controlling the rotation of the motor is less than the friction force of the motor rotation, thereby achieving the purpose of improving the accuracy of the initial angle identification result of the motor.
[0112] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0113] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0114] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0115] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0116] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0117] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A method for identifying an initial angle of a servo system, characterized in that: include: determining a first angle of a motor of the servo system; Obtaining a first current given instruction, and controlling the motor to rotate in a first direction at a preset angular frequency according to the first current given instruction; During the process of the motor rotating in the first direction, determining a first angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the first current given instruction, wherein the motor rotates n times in the first direction at a preset angular frequency, n≥1, and during the rotation of the motor, recording the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the first current given instruction, and calculating the first angle difference according to the difference between the two; Obtaining a second current given instruction, and controlling the motor to rotate in a second direction according to the preset angular frequency according to the second current given instruction, wherein the first direction is opposite to the second direction; During the process of the motor rotating in the second direction, determining a second angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the second current given instruction, wherein the motor rotates m turns in the second direction at a preset angular frequency, m≥1, and during the rotation of the motor, recording the electrical angle converted from the position feedback during the rotation of the motor and the electrical angle corresponding to the second current given instruction, and calculating the second angle difference according to the difference between the two, so as to determine the initial angle of the motor according to the second angle difference, the first angle and the first angle difference; An initial angle of the motor is determined according to the first angle and the first angle difference.
2. The method according to claim 1, characterized in that Determining an initial angle of the motor according to the first angle and the first angle difference includes: An average value of the first angle difference is calculated, and an initial angle of the motor is determined according to the average value of the first angle difference and the first angle.
3. The method according to claim 1, characterized in that Determining an initial angle of the motor according to the second angle difference, the first angle, and the first angle difference includes: An average value of the first angle difference is calculated, and an average value of the second angle difference is calculated, and an initial angle of the motor is determined according to the average value of the first angle difference, the average value of the second angle difference and the first angle.
4. The method according to claim 1, characterized in that: The motor rotates at least one circle in a first direction according to the preset angular frequency, and the motor rotates at least one circle in a second direction according to the preset angular frequency.
5. The method according to claim 1, characterized in that The preset angular frequency is less than or equal to a given angular frequency threshold.
6. The method according to claim 1, characterized in that The first given current instruction and the second given current instruction both include a d-axis given current and a q-axis given current, wherein the q-axis given current is zero.
7. The method according to any one of claims 1 to 6, characterized in that Determining a first angle of a motor of the servo system includes: A current given instruction of a fixed angle is obtained, and the motor is controlled to rotate according to the current given instruction of the fixed angle, and when the motor stops rotating, the fixed angle is used as the first angle.
8. The method according to claim 7, characterized in that The current amplitude of the fixed-angle current setting instruction is the rated operating current of the motor.
9. A computer-readable storage medium, characterized in that: An initial angle identification program of a servo system is stored thereon, and when the initial angle identification program of the servo system is executed by a processor, an initial angle identification method of a servo system according to any one of claims 1-8 is implemented.
10. A motor controller, characterized in that: The invention comprises a memory, a processor and an initial angle identification program of a servo system which is stored in the memory and can be run on the processor. When the processor executes the initial angle identification program of the servo system, the initial angle identification method of the servo system according to any one of claims 1 to 8 is implemented.
11. A servo system, characterized in that: The invention comprises a motor and a motor controller, wherein the motor controller performs the steps of the initial angle identification method of the servo system according to any one of claims 1 to 8 when identifying the initial angle of the motor.
12. An initial angle identification device for a servo system, the device executing the initial angle identification method for a servo system according to any one of claims 1 to 8, characterized in that: include: A determination module, used to determine a first angle of a motor of the servo system; An acquisition module, used for acquiring a first current given instruction; A control module is used to control the motor to rotate in a first direction at a preset angular frequency according to the first current given instruction, and during the process of the motor rotating in the first direction, determine a first angle difference between the actual electrical angle of the motor and the electrical angle corresponding to the first current given instruction, and determine the initial angle of the motor according to the first angle and the first angle difference.
Citation Information
Patent Citations
Motor static initial angle positioning method and device and motor equipment
CN110829929A
Initial angle correction method and initial angle correction device of motor rotor, and electric automobile
CN111146979A