Motor electrical angle zero calibration method and device and storage medium
By dynamically adjusting the electrical angle increment and judging the motor parameter status, the electrical angle offset zeroing is automatically completed, which solves the problem of abnormal motor operation during encoder installation and improves debugging efficiency and compensation accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MORNSUN GUANGZHOU SCI & TECH
- Filing Date
- 2023-03-20
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, there is an electrical angle offset during encoder installation, which leads to abnormal motor operation and makes the debugging process complex and inefficient.
By determining the current loop control parameters based on the motor line resistance and motor line inductance, the electrical angle increment is dynamically adjusted. The motor parameter status is judged by combining the real-time electrical angle and the optimal electrical angle increment, and the electrical angle offset value is automatically determined to achieve zeroing of the electrical angle offset.
Automatic zeroing of electrical angle offset was achieved, which improved debugging efficiency, reduced the workload of debugging personnel, and improved the accuracy of offset compensation.
Smart Images

Figure CN116365944B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic technology, and specifically to a method, apparatus, and storage medium for zeroing the electrical angle of a motor. Background Technology
[0002] With the rapid development of power electronics technology and the continuous upgrading of the manufacturing industry, a huge market has been created for the development of the servo industry. The high-precision control of servo products benefits from the accurate position feedback of the encoder. When there is a deviation between the electrical angle corresponding to the encoder feedback information and the actual electrical angle of the motor, the motor may experience abnormal output, stalling, or even runaway, endangering personal safety.
[0003] Currently, servo motor manufacturers usually calibrate the encoder at the factory when the motor leaves the factory. However, if the encoder is damaged and the commissioning personnel do not calibrate it after replacing the encoder, or if the zeroing work is not done properly when the motor leaves the factory, there will be a certain offset in the electrical angle, and the motor will run abnormally.
[0004] Normally, when an electrical angle offset occurs, the most direct way is to disassemble and reassemble the encoder for zeroing. However, some encoders are difficult to disassemble and reassemble, and even after zeroing, non-professionals may still have some electrical angle deviation. Another method is to fix the motor rotor at zero point, slowly rotate the motor until the encoder is triggered at zero position, and record the deviation of the pulse for compensation.
[0005] However, the above two methods are relatively complex and require debugging personnel to spend a lot of time and effort to zero the encoder position, which reduces debugging efficiency. Summary of the Invention
[0006] The purpose of this invention is to provide a motor electrical angle zeroing device and storage medium to solve the problem of abnormal motor operation caused by offset during encoder installation, thereby reducing the workload of debugging personnel and improving debugging efficiency.
[0007] To solve the above-mentioned technical problems, the present invention proposes the following technical solution:
[0008] In a first aspect, embodiments of the present invention provide a method for zeroing the electrical angle of a motor, comprising the following steps:
[0009] Based on the motor line resistance and motor line inductance, determine the current loop control parameters, and set the servo system according to the current loop control parameters;
[0010] Based on the set electrical angle increment, the motor is controlled to perform stepping motion according to the electrical angle increment, and the real-time electrical angle of the motor is obtained; wherein, the electrical angle increment is dynamically set according to the feedback data of the motor;
[0011] The electrical angle increment is determined to be the optimal electrical angle increment. Based on the real-time electrical angle and the optimal electrical angle increment, the setting status of the motor parameters is determined.
[0012] Once the setting status is confirmed to be correct, the electrical angle offset value is determined based on the real-time electrical angle and the optimal electrical angle increment.
[0013] Furthermore, the electrical angle increment is dynamically set based on feedback data from the motor, including:
[0014] The motor speed is determined based on the motor rotor position in the feedback data;
[0015] Based on the motor speed, the increment ratio coefficient of the electrical angle increment is dynamically adjusted to update the electrical angle increment until the electrical angle increment no longer changes, at which point the electrical angle increment is the optimal electrical angle increment.
[0016] Furthermore, the formula for determining the incremental ratio coefficient is as follows:
[0017]
[0018] in, The scaling factor is N, where N is the single trigger increment angle, X is the PWM counting interval, and f is the scaling factor. pwm Where Pn is the PWM frequency and Pn is the number of pole pairs of the motor.
[0019] Furthermore, the step of dynamically adjusting the incremental ratio coefficient of the electrical angle increment based on the motor speed includes:
[0020] If the change in motor speed within a preset period is greater than the fluctuation threshold, the PWM counting interval is reduced.
[0021] If the change in motor speed within a preset period is less than or equal to a fluctuation threshold, the single trigger increment angle is adjusted according to the motor speed.
[0022] Furthermore, adjusting the single-trigger increment angle according to the motor speed includes:
[0023] If the motor speed is determined to be greater than the preset expected speed range, the single trigger increment angle is reduced.
[0024] Determine that the motor speed is within the desired speed range, and keep the single trigger increment angle unchanged;
[0025] If the motor speed is determined to be lower than the expected speed range, the single trigger increment angle is increased.
[0026] Furthermore, determining the setting status of motor parameters based on the real-time electrical angle and the optimal electrical angle increment includes:
[0027] An electrical angle feedback curve is generated based on the real-time electrical angle.
[0028] Based on the optimal electrical angle increment, generate the desired electrical angle curve;
[0029] The setting status of motor parameters is determined based on the electrical angle feedback curve and the electrical angle expectation curve.
[0030] Furthermore, the determination of the setting status of motor parameters specifically includes:
[0031] If the electrical angle feedback curve and the electrical angle expectation curve meet the state judgment conditions, the setting state is determined to be correct.
[0032] If the electrical angle feedback curve and the electrical angle expectation curve do not meet the state judgment conditions, the setting state is determined to be abnormal.
[0033] Furthermore, the state determination conditions include:
[0034] The increasing direction of the real-time electrical angle in the electrical angle feedback curve is consistent with the increasing direction of the expected electrical angle in the electrical angle expectation curve.
[0035] The number of real-time peaks in the electrical angle feedback curve is equal to the number of expected peaks in the electrical angle expectation curve within the same time period.
[0036] Secondly, embodiments of the present invention also provide a motor electrical angle zeroing device, the motor electrical angle zeroing device comprising:
[0037] The control parameter setting unit is used to determine the current loop control parameters based on the motor line resistance and motor line inductance, and to set the servo system according to the current loop control parameters;
[0038] A stepping motion unit is used to control the motor to perform stepping motion according to the set electrical angle increment, and to acquire the real-time electrical angle of the motor; wherein the electrical angle increment is dynamically set according to the feedback data of the motor.
[0039] The status judgment unit is used to determine that the electrical angle increment has reached the optimal electrical angle increment, and to determine the setting status of the motor parameters based on the real-time electrical angle and the optimal electrical angle increment.
[0040] The bias value determination unit is used to determine that the setting state is correct and to determine the electrical angle bias value based on the real-time electrical angle and the optimal electrical angle increment.
[0041] Thirdly, embodiments of the present invention also provide a computer storage medium storing a computer program, which, when executed by a processor, implements the steps of the motor electrical angle zeroing method described in the first aspect.
[0042] The beneficial effects of this invention are as follows:
[0043] This invention first determines the state of the motor parameters, and then, under the correct motor parameter environment, determines the electrical angle offset value based on the real-time electrical angle. This enables automatic zeroing of the electrical angle offset, effectively improving troubleshooting and saving significant debugging time. Furthermore, it offers high offset compensation accuracy and has strong application value. This invention is applicable to all motors that use encoder feedback position analysis to obtain electrical angle information, and is not limited by encoder type, demonstrating strong compatibility. Attached Figure Description
[0044] Figure 1 This is the basic structure of the servo control system in the application scenario of this invention.
[0045] Figure 2 This is a flowchart illustrating the steps of the motor electrical angle zeroing method according to an embodiment of the present invention.
[0046] Figure 3 This is a schematic diagram illustrating the principle of electrical angle dragging in an embodiment of the present invention.
[0047] Figure 4 This is a flowchart illustrating the principle of the self-incrementing electrical angle module according to an embodiment of the present invention.
[0048] Figure 5 This is a schematic diagram illustrating the correct relationship between the desired electrical angle curve and the electrical angle feedback curve in an embodiment of the present invention.
[0049] Figure 6 This is a schematic diagram illustrating the relationship between the desired electrical angle curve and the electrical angle feedback curve in an embodiment of the present invention when the rotation direction is incorrect.
[0050] Figure 7 This is a schematic diagram illustrating the relationship between the desired electrical angle curve and the electrical angle feedback curve in an embodiment of the present invention when the number of pole pairs is incorrectly set.
[0051] Figure 8 This is the basic procedure for diagnosing motor parameters.
[0052] Figure 9 This is the basic procedure for zeroing the electrical angle bias.
[0053] Figure 10 This is a schematic diagram showing the location of the offset angle acquisition point in the electrical angle feedback curve corresponding to the peak of the electrical angle expectation curve.
[0054] Figure 11 The overall implementation flowchart.
[0055] Figure 12 This is a flowchart illustrating the overall implementation of the algorithm.
[0056] Figure 13 This is a block diagram of the motor electrical angle zeroing device according to an embodiment of the present invention. Detailed Implementation
[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0058] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.
[0059] Figure 1 The basic system structure of the application of the present invention is shown in the embodiment. The host computer includes, but is not limited to, a PC, for real-time detection of motor feedback waveforms and modification of control parameters; the driver is a self-built driver, and the two are connected by a communication cable for data interaction; the encoder is any type that the driver can parse position information from, including, but not limited to, absolute encoders and incremental encoders; the servo motor is a type that the driver supports in controlling, including, but not limited to, three-phase permanent magnet synchronous motors.
[0060] refer to Figure 2 This invention provides a method for zeroing the electrical angle of a motor, comprising the following steps:
[0061] S100. Determine the current loop control parameters based on the motor line resistance and motor line inductance, and set the servo system according to the current loop control parameters.
[0062] In this embodiment, by connecting the servo motor to be debugged and loading the motor line resistance and inductance, the current loop control parameters can be calculated based on these two parameters. Here, robust current loop control parameters are preferred. Using the current loop control parameters for closed-loop current control ensures smooth motor operation and uniform output, avoiding the excessive current, motor stalling, and uneven output that might occur with directly applying a control voltage. This embodiment uses a PI series structure, and the engineering tuning method is recommended. The calculation formula for the current loop control parameters is as follows; the detailed calculation process is not explained here.
[0063]
[0064] Where Kcp and Kci are the proportional and integral parameters of the PI controller selected for the current, respectively, Ls is the motor line inductance, Rs is the motor line resistance, and Tpwm is the single current calculation control cycle.
[0065] S200. According to the set electrical angle increment, control the motor to perform stepping motion according to the electrical angle increment, and obtain the real-time electrical angle of the motor; wherein, the electrical angle increment is dynamically set according to the feedback data of the motor.
[0066] In this embodiment, under the action of the current controller, the motor will perform stepping motion according to the initially set electrical angle increment. The initial electrical angle increment set by the user must at least ensure that the motor can rotate. Simultaneously, the servo motor operates in current closed-loop mode. In this mode, the current loop control parameters are adjusted to a stable control value, and then the encoder self-recognition mode is entered via a given mode command. The given mode command can be provided through various means such as a panel, bus, or serial port, preferably via host computer communication. In self-recognition mode, the vector control will obtain the real-time electrical angle of the stepping motion from the self-incremental electrical angle module.
[0067] S300. Determine that the electrical angle increment is the optimal electrical angle increment, and judge the setting status of the motor parameters based on the real-time electrical angle and the optimal electrical angle increment.
[0068] S400. Determine that the setting status is correct, and determine the electrical angle offset value based on the real-time electrical angle and the optimal electrical angle increment.
[0069] In this embodiment, after obtaining the electrical angle bias value, compensation can be performed on the servo side based on the electrical angle bias value. After detecting that the motor is running normally, the electrical angle bias value is solidified into the storage chip, which means that the bias zeroing process has been completed.
[0070] In one embodiment, the electrical angle increment in step S200 is dynamically set based on feedback data from the motor, including:
[0071] S201. Determine the motor speed based on the motor rotor position in the feedback data;
[0072] S202. Based on the motor speed, dynamically adjust the increment ratio coefficient of the electrical angle increment, and then update the electrical angle increment until the electrical angle increment no longer changes, then the electrical angle increment is the optimal electrical angle increment.
[0073] In one embodiment, the formula for determining the incremental scaling factor is:
[0074]
[0075] in, The scaling factor is N, where N is the increment angle per trigger, and X is the PWM counting interval. f pwm Pn is the PWM frequency and Pn is the number of pole pairs of the motor. To ensure the smooth rotation of the motor, it is necessary to ensure as much as possible that: (1) the motor is unloaded and (2) the drive speed setting does not exceed 500 rpm.
[0076] In one embodiment, dynamically adjusting the increment ratio of the electrical angle increment based on the motor speed includes:
[0077] If the change in motor speed within a preset period is greater than the fluctuation threshold, the PWM counting interval is reduced.
[0078] If the change in motor speed within a preset period is less than or equal to a fluctuation threshold, the single trigger increment angle is adjusted according to the motor speed.
[0079] In one embodiment, adjusting the single-trigger increment angle according to the motor speed includes:
[0080] If the motor speed is determined to be greater than the preset expected speed range, the single trigger increment angle is reduced.
[0081] Determine that the motor speed is within the desired speed range, and keep the single trigger increment angle unchanged;
[0082] If the motor speed is determined to be lower than the expected speed range, the single trigger increment angle is increased.
[0083] This can be achieved by constructing a self-incrementing electric angle module, such as... Figure 4 As shown, the incremental electrical angle module filters the motor speed feedback from the encoder and compares the filtered result with a predetermined motor speed range, i.e., a fluctuation threshold. The incremental electrical angle module first outputs step angles according to the user-set electrical angle increments, while simultaneously detecting the magnitude of fluctuations in the filtered motor speed. When the motor speed fluctuations are large, the X parameter value is decreased. After the speed stabilizes, it checks whether the motor speed has reached the desired speed range. If it is below the desired speed range, the N parameter is increased; otherwise, the N parameter is decreased.
[0084] In one embodiment, determining the setting state of the motor parameters based on the real-time electrical angle and the optimal electrical angle increment includes:
[0085] An electrical angle feedback curve is generated based on the real-time electrical angle.
[0086] Based on the optimal electrical angle increment, generate the desired electrical angle curve;
[0087] The setting status of motor parameters is determined based on the electrical angle feedback curve and the electrical angle expectation curve.
[0088] In this embodiment, the host computer can simultaneously monitor the expected electrical angle curve calculated by the encoder and the actual electrical angle feedback curve. Under normal circumstances, both curves exhibit a "right-angled triangle" trend in the same direction, and the number of "right-angled triangles" is the same within the same time period. Figure 5 As shown, where, Figure 5 The dashed line in the figure represents the desired electrical angle curve, and the solid line represents the electrical angle feedback curve.
[0089] If the following occurs Figure 6 If the "right-angled triangle" pattern shown is reversed, it indicates that the positive direction of motor rotation defined internally by the driver is opposite to the positive direction of rotation defined by the encoder. In this case, it is necessary to change the positive direction of motor rotation defined internally by the driver or to reverse the phase sequence of the motor connected to the driver. Figure 6 The dashed line in the figure represents the desired electrical angle curve, and the solid line represents the electrical angle feedback curve.
[0090] If the following occurs Figure 7 If the number of right-angled triangles is different within the same time period, it indicates that the number of motor pole pairs defined by the driver is inconsistent with the actual number of motor pole pairs. Figure 7 The dashed line in the diagram represents the desired electrical angle curve, and the solid line represents the electrical angle feedback curve. Figure 7 For example, since the electrical angle calculated by the encoder is related to the number of motor pole pairs defined by the driver, when the defined number of motor pole pairs is less than the actual number of motor pole pairs, the number of electrical angle cycles required to make the motor rotate one revolution by dragging the electrical angle will be greater than the number of electrical angles formed by the encoder rotating one revolution. Therefore, the number of motor pole pairs defined in the driver needs to be increased. The same applies when the number of motor pole pairs defined by the driver is greater than the actual number of motor pole pairs.
[0091] In one embodiment, determining the setting status of motor parameters specifically includes:
[0092] If the electrical angle feedback curve and the electrical angle expectation curve meet the state judgment conditions, the setting state is determined to be correct.
[0093] If the electrical angle feedback curve and the electrical angle expectation curve do not meet the state judgment conditions, the setting state is determined to be abnormal.
[0094] In one embodiment, the state determination conditions include:
[0095] The increasing direction of the real-time electrical angle in the electrical angle feedback curve is consistent with the increasing direction of the expected electrical angle in the electrical angle expectation curve.
[0096] The number of real-time peaks in the electrical angle feedback curve is equal to the number of expected peaks in the electrical angle expectation curve within the same time period.
[0097] Figure 8 This demonstrates the basic process for motor parameter diagnosis. Once the motor speed meets the predetermined range, motor parameter diagnosis is enabled. The desired electrical angle curve and the electrical angle feedback curve are sent to the host computer for status judgment. By observing the trend direction of both curves and whether the number of peaks or overflows of the two curves within the same time period are consistent, it can be determined whether the motor parameter settings are correct. If all status judgment conditions are not met, it indicates that the motor parameter settings are abnormal, and an error will be reported. When checking the status judgment conditions, first determine whether the increasing direction of the real-time electrical angle in the electrical angle feedback curve is consistent with the increasing direction of the desired electrical angle in the electrical angle desired curve. After the trend judgment is completed, extract the number of real-time peaks in the electrical angle feedback curve and the number of desired peaks in the electrical angle desired curve within the same time period and determine whether they are consistent. When the trends are inconsistent, it indicates that the motor rotation direction is incorrect and reverse processing is required; when the number of peaks is inconsistent, it indicates that the number of motor pole pairs is incorrectly set and the settings need to be rechecked.
[0098] After completing the basic encoder installation and testing process and confirming that the electrical angle feedback curve and the desired electrical angle curve are basically consistent, the encoder zeroing process can begin. Figure 3 It can be seen that the current real-time electrical angle is actually the position of the D-axis. To ensure that the motor can have maximum torque, the electrical angle resolved by the encoder should lead the D-axis by 90 degrees, which is the position corresponding to the Q-axis. Therefore, it can be deduced that when the real-time electrical angle is 270 degrees, the encoder angle should be exactly 0 degrees, and the actual difference is the encoder installation offset.
[0099] Figure 9 The basic process of zeroing the electrical angle offset is illustrated. After the motor parameters are verified and found to be correct, the electrical angle offset is performed. In one embodiment, the electrical angle offset is obtained by recording the real-time electrical angle corresponding to the peak of the encoder's desired electrical angle curve, thus obtaining the offset angle acquisition point angle value. ,like Figure 10 As shown. Among them, Figure 10 The dashed line represents the desired electrical angle curve, and the solid line represents the electrical angle feedback curve. After repeating this step multiple times, the average angle value at the offset angle acquisition point is finally calculated.
[0100] At this time, the electrical angle offset value of the encoder It can be calculated as:
[0101] ;
[0102] Correctly corresponding encoder resolution electrical angle Compared with actual electrical angle The corrective relationship is as follows:
[0103] ;
[0104] In another embodiment, the electrical angle bias is obtained by recording the expected electrical angle on the expected electrical angle curve corresponding to the peak of the electrical angle feedback curve, thus obtaining the angle value at the bias angle acquisition point. After completion, the average of the angle values obtained from multiple offset angle acquisition points is used to calculate the electrical angle offset value. The calculation formula is:
[0105] ;
[0106] Correctly corresponding encoder resolution electrical angle Compared with actual electrical angle The corrective relationship is as follows:
[0107] .
[0108] Figure 12 The overall algorithm diagram is shown. The current controller, including but not limited to a PI controller, receives the feedback current from the motor, performs closed-loop calculations, and generates a control voltage. The control voltage is vector-modulated to generate a PWM wave that acts on the inverter module, driving the motor to perform a predetermined motion. The incremental module deduces appropriate stepping parameters based on the speed feedback from the motor to ensure smooth motor operation and generates an electrical angle increment that acts on the vector modulation module for position calculation. After the motor runs smoothly at the predetermined speed, the motor parameter diagnosis module combines the encoder's analysis of the electrical angle position and the incremental stepping curve to infer whether the motor parameter settings are reasonable. After receiving the motor parameter matching signal, the electrical angle offset calculation module combines the encoder's analysis of the electrical angle position and the incremental stepping curve to infer the magnitude of the electrical angle offset and outputs and stores it.
[0109] refer to Figure 13 The present invention also provides a motor electrical angle zeroing device, which includes:
[0110] The control parameter setting unit is used to determine the current loop control parameters based on the motor line resistance and motor line inductance, and to set the servo system according to the current loop control parameters;
[0111] A stepping motion unit is used to control the motor to perform stepping motion according to the set electrical angle increment, and to acquire the real-time electrical angle of the motor; wherein the electrical angle increment is dynamically set according to the feedback data of the motor.
[0112] The status judgment unit is used to determine that the electrical angle increment has reached the optimal electrical angle increment, and to determine the setting status of the motor parameters based on the real-time electrical angle and the optimal electrical angle increment.
[0113] The bias value determination unit is used to determine that the setting state is correct and to determine the electrical angle bias value based on the real-time electrical angle and the optimal electrical angle increment.
[0114] Furthermore, the electrical angle increment in the stepper motion unit is dynamically set based on feedback data from the motor, including:
[0115] The motor speed is determined based on the motor rotor position in the feedback data;
[0116] Based on the motor speed, the increment ratio coefficient of the electrical angle increment is dynamically adjusted to update the electrical angle increment until the electrical angle increment no longer changes, at which point the electrical angle increment is the optimal electrical angle increment.
[0117] Furthermore, the formula for determining the incremental ratio coefficient is as follows:
[0118]
[0119] in, The scaling factor is N, where N is the single trigger increment angle, X is the PWM counting interval, and f is the scaling factor. pwm Where Pn is the PWM frequency and Pn is the number of pole pairs of the motor.
[0120] Furthermore, the step of dynamically adjusting the incremental ratio coefficient of the electrical angle increment based on the motor speed includes:
[0121] If the change in motor speed within a preset period is greater than the fluctuation threshold, the PWM counting interval is reduced.
[0122] If the change in motor speed within a preset period is less than or equal to a fluctuation threshold, the single trigger increment angle is adjusted according to the motor speed.
[0123] Furthermore, adjusting the single-trigger increment angle according to the motor speed includes:
[0124] If the motor speed is determined to be greater than the preset expected speed range, the single trigger increment angle is reduced.
[0125] Determine that the motor speed is within the desired speed range, and keep the single trigger increment angle unchanged;
[0126] If the motor speed is determined to be lower than the expected speed range, the single trigger increment angle is increased.
[0127] Furthermore, determining the setting status of motor parameters based on the real-time electrical angle and the optimal electrical angle increment includes:
[0128] An electrical angle feedback curve is generated based on the real-time electrical angle.
[0129] Based on the optimal electrical angle increment, generate the desired electrical angle curve;
[0130] The setting status of motor parameters is determined based on the electrical angle feedback curve and the electrical angle expectation curve.
[0131] Furthermore, the determination of the setting status of motor parameters specifically includes:
[0132] If the electrical angle feedback curve and the electrical angle expectation curve meet the state judgment conditions, the setting state is determined to be correct.
[0133] If the electrical angle feedback curve and the electrical angle expectation curve do not meet the state judgment conditions, the setting state is determined to be abnormal.
[0134] Furthermore, the state determination conditions include:
[0135] The increasing direction of the real-time electrical angle in the electrical angle feedback curve is consistent with the increasing direction of the expected electrical angle in the electrical angle expectation curve.
[0136] The number of real-time peaks in the electrical angle feedback curve is equal to the number of expected peaks in the electrical angle expectation curve within the same time period.
[0137] Furthermore, embodiments of the present invention also provide a computer storage medium storing a computer program, which, when executed by a processor, implements the steps of the motor electrical angle zeroing method as described in the first aspect.
[0138] It should be noted that for details not disclosed in the computer storage medium of this embodiment of the invention, please refer to the details disclosed in the motor electrical angle zeroing method of this embodiment of the invention, which will not be repeated here.
[0139] As can be seen from the above, this invention first determines the state of the motor parameters, and then, under the correct motor parameter environment, determines the electrical angle offset value based on the real-time electrical angle. This enables automatic zeroing of the electrical angle offset, effectively improving troubleshooting and saving significant debugging time. Furthermore, it boasts high offset compensation accuracy and strong application value. Moreover, this invention is applicable to all motors that use encoder feedback position analysis to obtain electrical angle information, and the encoder type is not limited, demonstrating strong compatibility.
[0140] The above description of the embodiments is only as an example of the present invention and is not intended to limit the scope of the present invention. Therefore, any modifications or equivalent substitutions made without departing from the principle of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for zeroing the electrical angle of a motor, characterized in that, Includes the following steps: Based on the motor line resistance and motor line inductance, determine the current loop control parameters, and set the servo system according to the current loop control parameters; Based on the set electrical angle increment, the motor is controlled to perform stepping motion according to the electrical angle increment, and the real-time electrical angle of the motor is obtained; wherein, the electrical angle increment is dynamically set according to the feedback data of the motor; The electrical angle increment is determined to be the optimal electrical angle increment. Based on the real-time electrical angle and the optimal electrical angle increment, the setting status of the motor parameters is determined. Once the setting status is confirmed to be correct, the electrical angle offset value is determined based on the real-time electrical angle and the optimal electrical angle increment.
2. The method for zeroing the electrical angle of a motor according to claim 1, characterized in that: The electrical angle increment is dynamically set based on feedback data from the motor, including: The motor speed is determined based on the motor rotor position in the feedback data; Based on the motor speed, the increment ratio coefficient of the electrical angle increment is dynamically adjusted to update the electrical angle increment until the electrical angle increment no longer changes, at which point the electrical angle increment is the optimal electrical angle increment.
3. The method for zeroing the electrical angle of a motor according to claim 2, characterized in that: The formula for determining the incremental ratio coefficient is: in, Where N is the incremental scaling factor, N is the single trigger increment angle, and X is the PWM counting interval. f pwm Where Pn is the PWM frequency and Pn is the number of pole pairs of the motor.
4. The method for zeroing the electrical angle of a motor according to claim 3, characterized in that: The method of dynamically adjusting the incremental ratio coefficient of the electrical angle increment based on the motor speed includes: If the change in motor speed within a preset period is greater than the fluctuation threshold, the PWM counting interval is reduced. If the change in motor speed within a preset period is less than or equal to a fluctuation threshold, the single trigger increment angle is adjusted according to the motor speed.
5. The method for zeroing the electrical angle of a motor according to claim 4, characterized in that: The adjustment of the single trigger increment angle based on the motor speed includes: If the motor speed is determined to be greater than the preset expected speed range, the single trigger increment angle is reduced. Determine that the motor speed is within the desired speed range, and keep the single trigger increment angle unchanged; If the motor speed is determined to be lower than the expected speed range, the single trigger increment angle is increased.
6. The method for zeroing the electrical angle of a motor according to claim 1, characterized in that: The method of determining the setting status of motor parameters based on the real-time electrical angle and the optimal electrical angle increment includes: An electrical angle feedback curve is generated based on the real-time electrical angle. Based on the optimal electrical angle increment, generate the desired electrical angle curve; The setting status of motor parameters is determined based on the electrical angle feedback curve and the electrical angle expectation curve.
7. The method for zeroing the electrical angle of a motor according to claim 6, characterized in that: The determination of the setting status of motor parameters specifically includes: If the electrical angle feedback curve and the electrical angle expectation curve meet the state judgment conditions, the setting state is determined to be correct. If the electrical angle feedback curve and the electrical angle expectation curve do not meet the state judgment conditions, the setting state is determined to be abnormal.
8. The method for zeroing the electrical angle of a motor according to claim 7, characterized in that: The state determination conditions include: The increasing direction of the real-time electrical angle in the electrical angle feedback curve is consistent with the increasing direction of the expected electrical angle in the electrical angle expectation curve. The number of real-time peaks in the electrical angle feedback curve is equal to the number of expected peaks in the electrical angle expectation curve within the same time period.
9. A motor electrical angle zeroing device, characterized in that, The motor electrical angle zeroing device includes: The control parameter setting unit is used to determine the current loop control parameters based on the motor line resistance and motor line inductance, and to set the servo system according to the current loop control parameters; A stepping motion unit is used to control the motor to perform stepping motion according to the set electrical angle increment, and to acquire the real-time electrical angle of the motor; wherein the electrical angle increment is dynamically set according to the feedback data of the motor. The status judgment unit is used to determine that the electrical angle increment has reached the optimal electrical angle increment, and to determine the setting status of the motor parameters based on the real-time electrical angle and the optimal electrical angle increment. The bias value determination unit is used to determine that the setting state is correct and to determine the electrical angle bias value based on the real-time electrical angle and the optimal electrical angle increment.
10. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, implements the steps of the motor electrical angle zeroing method as described in any one of claims 1 to 8.