A zero calibration method and device, electronic equipment and storage medium
By reading encoder position information from the servo motor and calculating electrical angle deviation, zero-position calibration is automatically completed, solving the problems of low efficiency and large error in manual calibration, improving calibration efficiency and reducing error.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-07
- Publication Date
- 2026-04-10
AI Technical Summary
Manually calibrating the zero position of a servo motor is inefficient and prone to errors.
By reading the position information from the encoder while the motor is powered on and locked, and controlling the motor to rotate at a specific angle, the electrical angle deviation value is calculated, and the zero-position calibration is automatically determined to be successful.
Automatic zero-point calibration is achieved, improving efficiency and reducing errors caused by human operation.
Smart Images

Figure CN115149868B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of servo motors, and particularly relates to a zero position calibration method and device, electronic equipment and a storage medium. BACKGROUND
[0002] Servo motor control is widely used in the field of automatic motion control. Among them, absolute encoder zero position calibration of servo motor is one of the key technologies to realize precise and efficient motion control. Therefore, how to realize zero position calibration is a very important link in servo motor control.
[0003] At present, servo motor manufacturers generally rely on manual zero position calibration of servo motors before the motors are shipped.
[0004] However, manual zero position calibration not only has low efficiency, but also is prone to errors caused by human operation. SUMMARY
[0005] Embodiments of the present application aim to provide a zero position calibration method and device, electronic equipment and a storage medium to solve the problem that manual zero position calibration not only has low efficiency, but also is prone to errors caused by human operation. The specific technical solutions are as follows:
[0006] In a first aspect, a zero position calibration method is provided, and the method comprises:
[0007] reading first position information in an encoder corresponding to the motor under the condition that the motor is powered on and locked;
[0008] in the case that the motor is a four-pole motor, controlling the motor to rotate counterclockwise by ninety degrees three times, reading corresponding position information in the encoder after each rotation to obtain second position information, third position information and fourth position information;
[0009] determining first, second and third electrical angle deviation values based on the first, second, third, fourth position information and the target resolution of the encoder corresponding to the motor;
[0010] when the first, second and third electrical angle deviation values are all less than or equal to a first threshold value, determining that the zero position calibration is successful.
[0011] In one possible implementation, the determination of the first, second and third electrical angle deviation values based on the first, second, third, fourth position information and the target resolution of the encoder corresponding to the motor comprises:
[0012] The first position information, the second position information, the third position information, the fourth position information and the target resolution corresponding to the encoder are substituted into the following formulas to obtain a first position deviation value, a second position deviation value and a third position deviation value:
[0013] M1 = abs(Mod(D2, N) - Mod(D1, N)) (1)
[0014] M2 = abs(Mod(D3, N) - Mod(D2, N)) (2)
[0015] M3 = abs(Mod(D4, N) - Mod(D3, N)) (3)
[0016] Wherein, D1 is the first position information, D2 is the second position information, D3 is the third position information, N is the resolution of the encoder, M1 is the first position deviation value, M2 is the second position deviation value, and M3 is the third position deviation value.
[0017] The first position deviation value, the second position deviation value and the third position deviation value are substituted into the following formulas to obtain the first electrical angle deviation value, the second electrical angle deviation value and the third electrical angle deviation value:
[0018]
[0019]
[0020]
[0021] Wherein, L1 is the first electrical angle deviation value, L2 is the second electrical angle deviation value, and L3 is the third electrical angle deviation value.
[0022] In one possible implementation, the method further comprises:
[0023] In the case that the motor is a two-pole motor, the motor is controlled to rotate counterclockwise once by one hundred and eighty degrees, and after rotation, the fifth position information corresponding to the encoder is read;
[0024] Based on the first position information, the fifth position information and the target resolution corresponding to the encoder, a fourth electrical angle deviation value is determined.
[0025] When the fourth electrical angle deviation value is less than or equal to a second threshold value, it is determined that the zero position calibration is successful.
[0026] In one possible implementation, the method further comprises:
[0027] The first position information, the fifth position information, and the target resolution corresponding to the encoder are substituted into the following formula to obtain a fourth position deviation value:
[0028] M4 = abs(Mod(D5, N) - Mod(D1, N)) (3)
[0029] wherein D1 is the first position information, D5 is the fifth position information, N is the resolution of the encoder, and M4 is the fourth position deviation value;
[0030] The fourth position deviation value is substituted into the following formula to obtain the fourth electrical angle deviation value:
[0031]
[0032] wherein L4 is the fourth electrical angle deviation value.
[0033] In one possible implementation, the energizing lock of the motor includes:
[0034] The control current is output from the U phase, the V phase, and the W phase of the motor, and the currents of the V phase and the W phase are each half of the current of the U phase, so as to achieve the energizing lock of the motor.
[0035] In one possible implementation, the method further includes:
[0036] During the operation of the motor, it is determined whether the motor is normally operated based on the first position information, the second position information, the third position information, and the fourth position information.
[0037] When the motor is abnormally operated, prompt information for prompting the abnormal operation is sent.
[0038] In one possible implementation, the method further includes:
[0039] The type corresponding to the encoder is determined.
[0040] According to the corresponding relationship between the type and the resolution, the resolution corresponding to the type is determined as the target resolution.
[0041] In a second aspect, a zero position calibration device is provided, and the device includes:
[0042] A reading module is configured to read first position information in an encoder corresponding to a motor in the case of energizing lock of the motor.
[0043] The first control module is configured to, in the case that the motor is a four-pole motor, control the motor to rotate counterclockwise by 90 degrees three times, read corresponding position information in the encoder after each rotation to obtain second position information, third position information and fourth position information;
[0044] The first determination module is configured to determine a first electrical angle deviation value, a second electrical angle deviation value and a third electrical angle deviation value based on the first position information, the second position information, the third position information, the fourth position information and a target resolution corresponding to the encoder.
[0045] The second determination module is configured to determine that the zero position calibration is successful when the first electrical angle deviation value, the second electrical angle deviation value and the third electrical angle deviation value are all less than or equal to a first threshold value.
[0046] In one possible implementation, the first determination module is specifically configured to:
[0047] The first position information, the second position information, the third position information, the fourth position information and the target resolution corresponding to the encoder are substituted into the following formulas to obtain a first position deviation value, a second position deviation value and a third position deviation value:
[0048] M1 = abs(Mod(D2, N) - Mod(D1, N)) (1)
[0049] M2 = abs(Mod(D3, N) - Mod(D2, N)) (2)
[0050] M3 = abs(Mod(D4, N) - Mod(D3, N)) (3)
[0051] Wherein, D1 is the first position information, D2 is the second position information, D3 is the third position information, N is the resolution of the encoder, M1 is the first position deviation value, M2 is the second position deviation value, and M3 is the third position deviation value.
[0052] The first position deviation value, the second position deviation value and the third position deviation value are substituted into the following formulas to obtain the first electrical angle deviation value, the second electrical angle deviation value and the third electrical angle deviation value:
[0053]
[0054]
[0055]
[0056] Wherein, L1 is a first electrical angle deviation value, L2 is a second electrical angle deviation value, and L3 is a third electrical angle deviation value.
[0057] In one possible implementation, the apparatus further includes:
[0058] The second control module is configured to, in the case that the motor is a two-pole motor, control the motor to rotate one time counterclockwise by one hundred and eighty degrees, and read fifth position information corresponding to the encoder after the rotation;
[0059] The third determination module is configured to determine a fourth electrical angle deviation value based on the first position information, the fifth position information, and a target resolution corresponding to the encoder.
[0060] The fourth determination module is configured to determine that the zero position calibration is successful when the fourth electrical angle deviation value is less than or equal to a second threshold value.
[0061] In one possible implementation, the third determination module is specifically configured to:
[0062] Substitute the first position information, the fifth position information, and the target resolution corresponding to the encoder into the following formula to obtain a fourth position deviation value:
[0063] M4 = abs(Mod(D5, N) - Mod(D1, N)) (3)
[0064] Wherein, D1 is the first position information, D5 is the fifth position information, N is the resolution of the encoder, and M4 is the fourth position deviation value.
[0065] Substitute the fourth position deviation value into the following formula to obtain the fourth electrical angle deviation value:
[0066]
[0067] Wherein, L4 is the fourth electrical angle deviation value.
[0068] In one possible implementation, the apparatus further includes:
[0069] The locking module is configured to control the current to flow out of the U phase, the V phase, and the W phase of the motor, and the currents of the V phase and the W phase are each half of the current of the U phase, so as to achieve energization locking of the motor.
[0070] In one possible implementation, the apparatus further includes:
[0071] The fifth determination module is configured to determine, during the operation of the motor, whether the motor is operating normally based on the first position information, the second position information, the third position information, and the fourth position information.
[0072] The sending module is configured to send prompt information for prompting the abnormal operation when the motor is abnormally operated.
[0073] In one possible implementation, the apparatus further includes:
[0074] The sixth determining module is configured to determine the type corresponding to the encoder.
[0075] The seventh determining module is configured to determine, according to the correspondence between the type and the resolution, the resolution corresponding to the type as the target resolution.
[0076] In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus.
[0077] The memory is configured to store a computer program.
[0078] The processor is configured to execute the program stored in the memory, and implement the method steps of any one of the first aspect.
[0079] In a fourth aspect, a computer readable storage medium is provided, which is characterized by storing a computer program, and the computer program is executed by a processor to implement the method steps of any one of the first aspect.
[0080] In a fifth aspect, a computer program product including instructions, which, when executed on a computer, causes the computer to perform the zero point calibration method of any one of the above aspects.
[0081] The embodiments of the present application have the following beneficial effects:
[0082] The embodiment of the application provides a zero position calibration method and device, electronic equipment and a storage medium. The application comprises the following steps: firstly, reading first position information in an encoder corresponding to a motor under the condition that the motor is powered and locked; then, under the condition that the motor is a four-pole motor, controlling the motor to rotate counterclockwise by 90 degrees three times, reading corresponding position information in the encoder after each rotation to obtain second position information, third position information and fourth position information; then, determining first, second and third electric angle deviation values based on the first, second, third and fourth position information and target resolution of the encoder; and finally, determining that zero position calibration is successful when the first, second and third electric angle deviation values are all less than or equal to a first threshold value. In this way, the motor can be automatically calibrated to zero position without manual calibration, thereby improving the efficiency of zero position calibration and reducing errors caused by manual operation.
[0083] Of course, implementing any product or method of the application does not necessarily require all the advantages described above. BRIEF DESCRIPTION OF DRAWINGS
[0084] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, for those skilled in the art, other drawings can also be obtained without creative labor.
[0085] Figure 1 A flowchart of a zero position calibration method provided by the embodiment of the application;
[0086] Figure 2 A flowchart of another zero position calibration method provided by the embodiment of the application;
[0087] Figure 3 A structural schematic diagram of a zero position calibration device provided by the embodiment of the application;
[0088] Figure 4 A structural schematic diagram of an electronic device provided by the embodiment of the application. DETAILED DESCRIPTION
[0089] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the application.
[0090] The zero position calibration method provided by the embodiment of the application will be described in detail below with reference to the specific embodiments. As shown in the following specific steps: Figure 1
[0091] S101, read first position information in the encoder corresponding to the motor under the condition that the motor is energized and locked.
[0092] The zero position calibration method provided by the embodiment of the application can be applied to a zero position calibration system, which includes control software, a driver and a motor, and the motor is provided with an encoder. The motor can be a servo motor, and the driver can be a servo driver accordingly. The communication connection between the driver and the control software can be realized through a serial communication protocol development, and the established channel can be used to complete functions such as parameter reading and writing, data acquisition and zero position calibration.
[0093] In application, the user can set motor running parameters (such as motor speed) in the control software, and when starting zero position calibration, the control software sends the motor running parameters to the driver, and after the sending is completed and verified, the control software issues an instruction to lock the motor, and the driver controls the motor to run based on the motor running parameters according to the instruction.
[0094] Further, during the zero position calibration process, the control software can send command frames in a loop to verify whether the driver maintains communication and data transmission.
[0095] In the embodiment of the application, the servo driver energizes and locks the motor according to the instruction of the lock motor instruction, so that the servo motor is locked at zero position B1. After the motor is locked, the servo driver returns a lock feedback signal, and after receiving the feedback signal, it is determined that the locking is successful, and the first position information D1 at this time is read from the encoder.
[0096] As an embodiment, the specific implementation of energizing and locking the motor includes: controlling the current to flow into the U phase of the motor and out of the V phase and the W phase, and the currents of the V phase and the W phase are each half of the current of the U phase, so as to realize energizing and locking the motor.
[0097] In this embodiment, the current parameter (that is, the value of the locking current at this time) can be input in the control software, and the motor is run in the lock shaft mode. The parameter is transmitted to the driver, and after being adjusted by the SVPWM circuit in the driver, it is transmitted to the motor, so as to realize that the locking current flows into the U phase of the motor and out of the V and W phases, and the V and W phases are each 0.5 times of the U phase. When the locking current is input, under the continuous action of the stator magnetic field, the magnetic field direction of the rotor will coincide with the nearest stator S pole, and this position is defined as the zero degree position of the rotor, also known as zero position, that is, B1.
[0098] S102, in the case that the motor is a four-pole motor, the motor is controlled to rotate counterclockwise for ninety degrees three times, and the corresponding position information of the encoder is read after each rotation to obtain second position information, third position information and fourth position information.
[0099] In the zero position calibration system, the encoder is responsible for feeding back the phase zero point of the motor. The encoder is an absolute encoder, which has the advantages of being able to directly read the absolute position information of the rotating shaft, not losing information after power failure, and no cumulative error, and has good function and accuracy in positioning. The motor is a four-pole motor, that is, the motor has four zero points.
[0100] In the embodiment of the application, the servo motor is controlled by the servo driver to rotate counterclockwise for ninety degrees, so that the servo motor is locked at zero position B2. After receiving the locking feedback signal of the motor, it is determined that the locking is successful, and the second position information D2 at this time is read from the encoder.
[0101] The servo motor is further controlled to rotate counterclockwise for ninety degrees (i.e. rotate counterclockwise for one hundred and eighty degrees relative to B1), so that the servo motor is locked at zero position B3. After receiving the locking feedback signal of the motor, it is determined that the locking is successful, and the third position information D3 at this time is read from the encoder.
[0102] Finally, the servo motor is controlled to rotate counterclockwise for ninety degrees (i.e. rotate counterclockwise for two hundred and seventy degrees relative to B1), so that the servo motor is locked at zero position B4. After receiving the locking feedback signal of the motor, it is determined that the locking is successful, and the fourth position information D4 at this time is read from the encoder. In this way, the position information corresponding to the four zero positions is obtained.
[0103] S103, based on the first position information, the second position information, the third position information, the fourth position information and the target resolution of the encoder, determining a first electrical angle deviation value, a second electrical angle deviation value and a third electrical angle deviation value.
[0104] S104, when the first electrical angle deviation value, the second electrical angle deviation value and the third electrical angle deviation value are all less than or equal to a first threshold value, it is determined that the zero position calibration is successful.
[0105] The following uniformly describes S103 and S104:
[0106] In the embodiment of the application, the user can pre-set the electrical angle allowable deviation (i.e. the first threshold value) through the interactive interface of the control software, which is used to compare with the calculated electrical angle deviation value to determine whether the zero position calibration is successful.
[0107] Specifically, after obtaining the four position information corresponding to the four zero positions (i.e., the first position information, the second position information, the third position information, and the fourth position information), the zero position calibration system can calculate three electrical angle deviation values (i.e., the first electrical angle deviation value, the second electrical angle deviation value, and the third electrical angle deviation value) based on the four position information. Then, the three deviation values are compared with the first threshold value. When all the three deviation values are less than the first threshold value, it is determined that the zero position calibration is successful. In this way, the encoder zero point and the magnetic pole zero point of the motor rotating shaft are aligned.
[0108] Further, after determining that the zero position calibration is successful, the deviation value of each encoder zero point and the magnetic pole zero point of the motor rotating shaft is calculated, and the deviation value is recorded in the control software, thereby completing the zero position calibration.
[0109] Further, when the first electrical angle deviation value is greater than the first threshold value, or the second electrical angle deviation value is greater than the first threshold value, or the third electrical angle deviation value is greater than the first threshold value, it is determined that the zero position calibration fails, and prompt information for prompting the calibration failure is sent. In this way, the user is prompted in time of the calibration failure.
[0110] In the embodiment of the present application, first, the first position information is read in the encoder corresponding to the motor under the condition that the motor is powered and locked. Then, in the case that the motor is a four-pole motor, the motor is controlled to rotate counterclockwise by ninety degrees three times, and the corresponding position information in the encoder is read after each rotation to obtain the second position information, the third position information, and the fourth position information. Then, based on the first position information, the second position information, the third position information, the fourth position information, and the target resolution of the encoder, the first electrical angle deviation value, the second electrical angle deviation value, and the third electrical angle deviation value are determined. Finally, when the first electrical angle deviation value, the second electrical angle deviation value, and the third electrical angle deviation value are all less than or equal to the first threshold value, it is determined that the zero position calibration is successful. In this way, the motor can be automatically calibrated without manual zero position calibration, thereby improving the efficiency of zero position calibration and reducing errors caused by human operation.
[0111] In another embodiment of the present application, the method further includes the following steps: during the operation of the motor, it is determined whether the motor is normally operated based on the first position information, the second position information, the third position information, and the fourth position information; and when the motor is abnormally operated, prompt information for prompting the abnormal operation is sent.
[0112] For example, when the motor is at zero position B1, the position information displayed by the encoder should be the first position information according to the data when the calibration is successful. If the position information displayed by the encoder at this time is not the first position information, it means that the motor is abnormal, otherwise it means that the motor is normal. The detection process of zero positions B2-B4 is the same as that of B1, which is not described herein. Optionally, a fault tolerance range can be set, that is, when the difference between the position information displayed by the encoder in real time and the first position information is within the preset range, it is considered that the motor is normal. When the motor is abnormal, an abnormal prompt information can be sent to prompt the user to check the abnormality in time.
[0113] In another embodiment of the present application, whether the motor is normal can be determined by the deviation value of each encoder zero point and the magnetic pole zero point of the motor shaft.
[0114] For example, when the motor is at zero position B1, the position information displayed by the encoder should be the first position information according to the data when the calibration is successful. If the position information displayed by the encoder at this time is not the first position information, it means that the motor is abnormal, otherwise it means that the motor is normal. The detection process of zero positions B2-B4 is the same as that of B1, which is not described herein.
[0115] In another embodiment of the present application, the S103 can include the following steps:
[0116] The first position information, the second position information, the third position information, the fourth position information and the target resolution corresponding to the encoder are substituted into the following formula to obtain the first position deviation value, the second position deviation value and the third position deviation value:
[0117] M1=abs(Mod(D2,N)-Mod(Dl,N)) (1)
[0118] M2=abs(Mod(D3,N)-Mod(D2,N)) (2)
[0119] M3=abs(Mod(D4,N)-Mod(D3,N)) (3)
[0120] Wherein, D1 is the first position information, D2 is the second position information, D3 is the third position information, N is the resolution of the encoder, M1 is the first position deviation value, M2 is the second position deviation value, and M3 is the third position deviation value.
[0121] The first position deviation value, the second position deviation value and the third position deviation value are substituted into the following formula to obtain the first electric angle deviation value, the second electric angle deviation value and the third electric angle deviation value:
[0122]
[0123]
[0124]
[0125] Wherein, L1 is a first electrical angle deviation value, L2 is a second electrical angle deviation value, and L3 is a third electrical angle deviation value.
[0126] In this way, the determination of the first electrical angle deviation value, the second electrical angle deviation value and the third electrical angle deviation value can be realized.
[0127] In another embodiment of the present application, as shown in the figure, Figure 2 The method further includes the following steps:
[0128] S201, in the case of the motor being a two-pole motor, the motor is controlled to rotate counterclockwise once by 180 degrees, and the corresponding fifth position information in the encoder is read after rotation.
[0129] S202, based on the first position information, the fifth position information and the target resolution corresponding to the encoder, a fourth electrical angle deviation value is determined.
[0130] S203, when the fourth electrical angle deviation value is less than or equal to a second threshold value, it is determined that the zero position calibration is successful.
[0131] In the embodiment of the present application, the motor is a two-pole motor, i.e. only two zero points. At this time, after reading the first position information, the motor is controlled to rotate counterclockwise by 180 degrees, so that the motor rotates to another zero point B5 (i.e. the motor has only two zero points B1 and B5), and the corresponding fifth position information in the encoder is read. Further, based on the first position information, the fifth position information and the target resolution corresponding to the encoder, a fourth electrical angle deviation value is determined, and when the fourth electrical angle deviation value is less than or equal to a second threshold value, it is determined that the zero position calibration is successful.
[0132] Wherein, based on the first position information, the fifth position information and the target resolution corresponding to the encoder, the specific implementation of determining the fourth electrical angle deviation value includes:
[0133] The first position information, the fifth position information and the target resolution corresponding to the encoder are substituted into the following formula to obtain the fourth position deviation value:
[0134] M4 = abs(Mod(D5, N) - Mod(D1, N)) (3)
[0135] Wherein, D1 is the first position information, D5 is the fifth position information, N is the resolution of the encoder, and M4 is the fourth position deviation value.
[0136] The fourth position deviation value is substituted into the following formula to obtain the fourth electrical angle deviation value:
[0137]
[0138] L4 is the fourth electrical angle deviation value.
[0139] In this way, zero position calibration of a two-pair-pole motor can be implemented.
[0140] In another embodiment of the present application, the method further includes the following steps:
[0141] The type corresponding to the encoder is determined, and the resolution corresponding to the type is determined as the target resolution according to the correspondence between the type and the resolution.
[0142] In the embodiment of the present application, the correspondence between different types of absolute encoders and resolutions, and the correspondence between different types of absolute encoders and communication protocols can be pre-set in the control software. For example, the different types of absolute encoders include a Tomi absolute encoder, a Nikon absolute encoder, and a Biss absolute encoder.
[0143] Therefore, the target resolution and the target communication protocol can be determined according to the type of the encoder, so that the encoder can be communicated by using the target communication protocol, and the electrical angle deviation value can be calculated based on the target resolution. In this way, the zero position calibration of the motor configured with different types of encoders can be implemented, and the adaptability of the zero position calibration system to different types of encoders can be improved.
[0144] Based on the same technical concept, an embodiment of the present application further provides a zero position calibration device, as shown in Figure 3 The device includes:
[0145] The reading module 301 is configured to read first position information in the encoder corresponding to the motor under the condition that the motor is powered and locked.
[0146] The first control module 302 is configured to control the motor to rotate counterclockwise by ninety degrees three times under the condition that the motor is a four-pair-pole motor, and read corresponding position information in the encoder after each rotation to obtain second position information, third position information, and fourth position information.
[0147] The first determination module 303 is configured to determine a first electrical angle deviation value, a second electrical angle deviation value, and a third electrical angle deviation value based on the first position information, the second position information, the third position information, the fourth position information, and a target resolution corresponding to the encoder.
[0148] The second determining module 304 is configured to determine that the zero position calibration is successful when the first electric angle deviation value, the second electric angle deviation value and the third electric angle deviation value are all less than or equal to the first threshold value.
[0149] In a possible implementation, the first determining module is specifically configured to:
[0150] The first position information, the second position information, the third position information, the fourth position information and the target resolution corresponding to the encoder are substituted into the following formulas to obtain the first position deviation value, the second position deviation value and the third position deviation value:
[0151] M1=abs(Mod(D2,N)-Mod(D1,N)) (1)
[0152] M2=abs(Mod(D3,N)-Mod(D2,N)) (2)
[0153] M3=abs(Mod(D4,N)-Mod(D3,N)) (3)
[0154] wherein D1 is the first position information, D2 is the second position information, D3 is the third position information, N is the resolution of the encoder, M1 is the first position deviation value, M2 is the second position deviation value, and M3 is the third position deviation value.
[0155] The first position deviation value, the second position deviation value and the third position deviation value are substituted into the following formulas to obtain the first electric angle deviation value, the second electric angle deviation value and the third electric angle deviation value:
[0156]
[0157]
[0158]
[0159] wherein L1 is the first electric angle deviation value, L2 is the second electric angle deviation value, and L3 is the third electric angle deviation value.
[0160] In a possible implementation, the apparatus further includes:
[0161] The second control module is configured to, in the case that the motor is a two-pole motor, control the motor to rotate counterclockwise by one hundred and eighty degrees once, and read fifth position information corresponding to the encoder after the rotation.
[0162] The third determining module is configured to determine a fourth electric angle deviation value based on the first position information, the fifth position information and the target resolution corresponding to the encoder.
[0163] a fourth determining module, configured to determine that the zero position calibration succeeds when the fourth electrical angle deviation value is less than or equal to a second threshold value.
[0164] In a possible implementation, the third determining module is specifically configured to:
[0165] substitute the first position information, the fifth position information and the target resolution corresponding to the encoder into the following formula to obtain a fourth position deviation value:
[0166] M4 = abs(Mod(D5, N) - Mod(D1, N)) (3)
[0167] wherein D1 is the first position information, D5 is the fifth position information, N is the resolution of the encoder, and M4 is the fourth position deviation value.
[0168] substitute the fourth position deviation value into the following formula to obtain the fourth electrical angle deviation value:
[0169]
[0170] wherein L4 is the fourth electrical angle deviation value.
[0171] In a possible implementation, the apparatus further includes:
[0172] a locking module, configured to control the current to flow out of the U phase, the V phase and the W phase of the motor, and the currents of the V phase and the W phase are each half of the current of the U phase, so as to achieve energization locking of the motor.
[0173] In a possible implementation, the apparatus further includes:
[0174] a fifth determining module, configured to determine whether the motor is normally running based on the first position information, the second position information, the third position information and the fourth position information during running of the motor.
[0175] a sending module, configured to send prompt information for prompting abnormal running when the motor is abnormally running.
[0176] In a possible implementation, the apparatus further includes:
[0177] a sixth determining module, configured to determine a type corresponding to the encoder.
[0178] a seventh determining module, configured to determine, according to a corresponding relationship between the type and the resolution, that a resolution corresponding to the type is the target resolution.
[0179] In this embodiment, firstly, with the motor powered on and locked, first position information is read from the encoder corresponding to the motor. Then, if the motor is a four-pole motor, the motor is controlled to rotate counterclockwise by 90 degrees three times. After each rotation, the corresponding position information in the encoder is read to obtain second, third, and fourth position information. Then, based on the first, second, third, and fourth position information and the target resolution corresponding to the encoder, first, second, and third electrical angle deviation values are determined. Finally, when the first, second, and third electrical angle deviation values are all less than or equal to a first threshold, the zero-position calibration is considered successful. This allows for automatic zero-position calibration of the motor, eliminating the need for manual zero-position calibration, thereby improving the efficiency of zero-position calibration and reducing errors caused by human operation.
[0180] Based on the same technical concept, embodiments of this application also provide an electronic device, such as... Figure 4 As shown, it includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0181] Memory 113 is used to store computer programs;
[0182] When processor 111 executes a program stored in memory 113, it performs the following steps:
[0183] When the motor is powered on and locked, the first position information is read from the encoder corresponding to the motor.
[0184] When the motor is a four-pole motor, the motor is controlled to rotate counterclockwise three times at 90 degrees. After each rotation, the corresponding position information in the encoder is read to obtain the second position information, the third position information and the fourth position information.
[0185] Based on the first position information, the second position information, the third position information, the fourth position information, and the target resolution corresponding to the encoder, the first electrical angle deviation value, the second electrical angle deviation value, and the third electrical angle deviation value are determined.
[0186] When the first electrical angle deviation value, the second electrical angle deviation value, and the third electrical angle deviation value are all less than or equal to the first threshold, the zero-position calibration is determined to be successful.
[0187] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0188] The communication interface is used for communication between the above electronic device and other devices.
[0189] The memory can include a Random Access Memory (RAM) and can also include a Non-Volatile Memory (NVM), for example, at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0190] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processing (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0191] In another embodiment provided in the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of any of the zero point calibration methods described above are implemented.
[0192] In another embodiment provided in the present application, a computer program product containing instructions is also provided, and when the computer program product is run on a computer, the computer is caused to execute any of the zero point calibration methods in the above embodiments.
[0193] In the embodiments described above, all or some of the steps can be implemented by software, hardware or firmware, or any combination thereof. When implemented by software, all or some of the steps can be implemented in the form of one or more computer programs. The computer program can be stored in any computer readable medium, and loaded into the computer for execution. The computer readable medium includes: a computer storage medium and a computer communication medium. The computer storage medium includes: volatile memory and non-volatile memory. The computer communication medium includes: computer program transmitted via any transmission medium (for example, wired network or wireless network). The computer program product of the present application can be a computer program that can be executed by one or more computers.
[0194] It should be noted that the terms "first" and "second" and the like in this text are used only to distinguish one entity or action from another, and do not necessarily require or imply any actual relationship or order between the entities or actions. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0195] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications of these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to these embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features applied herein.
Claims
1. A method of null calibration, characterized by, The method comprises: reading first position information in an encoder corresponding to the motor in the case of energizing lock of the motor; in the case of the motor being a four-pole motor, controlling the motor to rotate counterclockwise by ninety degrees three times, reading corresponding position information in the encoder after each rotation to obtain second position information, third position information and fourth position information; determining first electrical angle deviation, second electrical angle deviation and third electrical angle deviation based on the first position information, the second position information, the third position information, the fourth position information and the target resolution corresponding to the encoder; determining that the zero position calibration is successful when the first electrical angle deviation, the second electrical angle deviation and the third electrical angle deviation are all less than or equal to a first threshold value; wherein the determination of the first electrical angle deviation, the second electrical angle deviation and the third electrical angle deviation based on the first position information, the second position information, the third position information, the fourth position information and the target resolution corresponding to the encoder comprises: substituting the first position information, the second position information, the third position information, the fourth position information and the target resolution corresponding to the encoder into the following formula to obtain first position deviation, second position deviation and third position deviation: (1) (2) (3) wherein D1 is the first position information, D2 is the second position information, D3 is the third position information, N is the resolution of the encoder, M1 is the first position deviation, M2 is the second position deviation, and M3 is the third position deviation; substituting the first position deviation, the second position deviation and the third position deviation into the following formula to obtain the first electrical angle deviation, the second electrical angle deviation and the third electrical angle deviation: (4) (5) (6) wherein L1 is the first electrical angle deviation, L2 is the second electrical angle deviation, and L3 is the third electrical angle deviation.
2. The method of claim 1, wherein, The method further comprises: in the case of the motor being a two-pole motor, controlling the motor to rotate counterclockwise by one hundred and eighty degrees once, and reading corresponding fifth position information in the encoder after the rotation; determining a fourth electrical angle deviation based on the first position information, the fifth position information and the target resolution corresponding to the encoder; determining that the zero position calibration is successful when the fourth electrical angle deviation is less than or equal to a second threshold value.
3. The method of claim 2, wherein, The determination of the fourth electrical angle deviation based on the first position information, the fifth position information and the target resolution corresponding to the encoder comprises: substituting the first position information, the fifth position information and the target resolution corresponding to the encoder into the following formula to obtain a fourth position deviation: (3) wherein D1 is the first position information, D5 is the fifth position information, N is the resolution of the encoder, and M4 is the fourth position deviation; substituting the fourth position deviation into the following formula to obtain the fourth electrical angle deviation: (4) wherein L4 is the fourth electrical angle deviation.
4. The method of claim 1, wherein, The energizing lock of the motor comprises: The control current is from the U-phase, V-phase and W-phase of the motor, and the current of the V-phase and W-phase is half of the U-phase, so as to realize the energizing locking of the motor.
5. The method of claim 1, wherein, The method further comprises: During the operation of the motor, determining whether the motor is normally operated based on the first position information, the second position information, the third position information and the fourth position information; When the motor is abnormally operated, sending prompt information for prompting abnormal operation.
6. The method of claim 1, wherein, The method further comprises: Determining the type corresponding to the encoder; According to the corresponding relationship between the type and the resolution, determining the resolution corresponding to the type as the target resolution.
7. A null calibration apparatus, characterized by, The device comprises: A reading module, configured to read first position information in an encoder corresponding to a motor in the case of energizing locking of the motor; A first control module, configured to control the motor to rotate counterclockwise by 90 degrees three times in the case that the motor is a four-pole motor, and read corresponding position information in the encoder after each rotation to obtain second position information, third position information and fourth position information; A first determination module, configured to determine first, second and third electrical angle deviation values based on the first position information, the second position information, the third position information, the fourth position information and a target resolution corresponding to the encoder; A second determination module, configured to determine that zero position calibration is successful when the first, second and third electrical angle deviation values are all less than or equal to a first threshold value. The first determination module is specifically configured to: Substitute the first position information, the second position information, the third position information, the fourth position information and the target resolution corresponding to the encoder into the following formula to obtain first, second and third position deviation values: (1) (2) (3) Wherein, D1 is the first position information, D2 is the second position information, D3 is the third position information, N is the resolution of the encoder, M1 is the first position deviation value, M2 is the second position deviation value, and M3 is the third position deviation value. Substitute the first, second and third position deviation values into the following formula to obtain the first, second and third electrical angle deviation values: (4) (5) (6) Wherein, L1 is the first electrical angle deviation value, L2 is the second electrical angle deviation value, and L3 is the third electrical angle deviation value.
8. An electronic device, comprising: The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; The memory is used to store a computer program; The processor is used to execute the program stored in the memory to realize the method steps of any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method steps of any one of claims 1-6. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the method steps of any one of claims 1-6.
Citation Information
Patent Citations
Zero calibration method and device for motor incremental encoder, product and medium
CN111174819A
Permanent magnet synchronous motor rotor zero detection method
CN112671296A