Control parameter correction method of motor, computer program product and motor controller
By acquiring and correcting the speed signal, rotor position signal and current phase sequence of the hub motor, automatic correction is achieved under the reverse rotation of the rotary line, solving the cumbersome hardware debugging in the prior art, and improving the motor control system Accuracy and security.
Patent Information
- Application Number
- CN202411264996.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-01-14
AI Technical Summary
The prior art is usually solved by hardware changes and debugging when the rotational transformation wire of the hub motor is reversed. The process is cumbersome and time-consuming, and there is a lack of fast software logic adjustment methods to achieve the normal operation of the motor control system.
By obtaining the speed signal, rotor position signal and current phase sequence, automatically correcting based on the signal direction, correcting the rotor position and current phase sequence, controlling the rotor at the zero position of the motor, and correcting the initial rotation angle according to the zero position angle of the motor, realizing software control automatic calibration to avoid disassembly and re-proofing of the rotary transformer.
It realizes automatic correction of the motor control system when the rotational transformation line is reversed, reduces workload, improves the accuracy and safety of the motor control system, avoids potential mechanical damage and safety risks, and does not require hardware changes.
Smart Images

Figure CN119315901A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor control technology, and in particular to a motor control parameter correction method, a computer program product, and a motor controller. Background Art
[0002] The hub motor is a distributed motor, with four motors corresponding to each wheel. The position of the motor is analyzed by a rotary transformer, which in turn determines the motor speed. The rotary transformer has six wires, corresponding to the positive and negative sin signal, the positive and negative cos signal, and the positive and negative excitation signal. Once the positive and negative wires corresponding to the rotary transformer are connected in reverse, although it will not cause the motor to be completely unable to rotate, it will cause the motor to rotate in the opposite direction and even affect the torque response, which will have an adverse effect on the torque response accuracy of the motor system, the power, economy, and comfort of the vehicle.
[0003] In the related art, the above problems are mainly solved by hardware modification and debugging, but this method is time-consuming and labor-intensive, and involves the disassembly and calibration of the motor resolver, which is a cumbersome process. Therefore, there is an urgent need for a method that can quickly solve the problem by adjusting the software logic to perform calibration. The software calibration method does not require the disassembly and calibration of the resolver, which can greatly reduce the workload of calibration. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a method for correcting the control parameters of a motor, a computer program product, and a motor controller, so as to achieve the technical effect of automatically correcting and restoring the normal operation of a motor control system when the resolver line is connected in reverse.
[0005] A first aspect of an embodiment of the present application provides a method for calibrating control parameters of a motor, wherein the motor is connected to a rotary transformer; the control parameters include a rotor position, a current phase sequence, and a rotary transformer initial angle, and the method includes:
[0006] When the resolver line of the resolver is connected in reverse, the operating parameters of the motor are obtained; the operating parameters include a speed signal, a rotor position signal, and a current phase sequence;
[0007] Correcting the rotor position based on a signal direction of the speed signal and a signal direction of the rotor position signal;
[0008] When the current phase sequence does not conform to a preset phase sequence, correcting the current phase sequence to the preset phase sequence;
[0009] The rotor is controlled to be located at a motor zero position, and the resolver initial angle is corrected according to a motor zero position angle corresponding to the motor zero position.
[0010] In the above implementation process, when the resolver line is connected reversely, automatic correction is achieved through software control, and the normal operation of the motor control system can be restored without disassembling the resolver or recalibrating the resolver.
[0011] Further, the signal direction of the speed signal includes a positive direction for driving the wheels forward and a negative direction for driving the wheels backward; the signal direction of the rotor position signal includes a positive direction for the angle corresponding to the rotor position signal to increase and a negative direction for the angle corresponding to the rotor position signal to decrease; the correction of the rotor position based on the signal direction of the speed signal and the signal direction of the rotor position signal includes:
[0012] When the signal direction of the speed signal is inconsistent with the signal direction of the rotor position signal, the rotor position is corrected according to a preset angle threshold and the rotor position signal.
[0013] In the above implementation process, when the speed signal and the rotor position signal have inconsistent signal directions, it means that the motor is at risk of abnormal operation or failure. Timely detection and correction of this inconsistency can prevent the motor from continuing to run in the wrong direction, thereby avoiding potential safety hazards and mechanical damage.
[0014] Further, the correcting the rotor position based on the signal direction of the speed signal and the signal direction of the rotor position signal includes:
[0015] Acquire a first speed signal and a first rotor position signal of a first motor, and a second speed signal and a second rotor position signal of a second motor; the first motor and the second motor are installed in opposite directions;
[0016] When the signal direction of the first speed signal matches the preset signal direction, the rotor position of the second motor is corrected based on the first rotor position signal.
[0017] In the above implementation process, when the left motor and the right motor of the hub motor are connected reversely and their speed signals are in opposite directions, by correcting the position of one of the motor rotors, it can be ensured that the speed signals output by the left and right motors are both positive.
[0018] Furthermore, the operating parameter also includes a voltage signal; and when the current phase sequence does not conform to the preset phase sequence, before correcting the current phase sequence to the preset phase sequence, it also includes:
[0019] determining a second current control signal based on the voltage signal;
[0020] Acquire the current phase sequence output by the motor under the second current control signal;
[0021] Determine whether the current phase sequence conforms to the preset phase sequence.
[0022] In the above implementation process, the motor system may be affected by various factors, such as load changes, temperature changes, etc., which may cause the current phase sequence to shift. By measuring and judging the current phase sequence in real time, these shifts can be discovered and corrected in time.
[0023] Further, the current phase sequence includes sequence information of three phases; and the correcting the current phase sequence to the preset phase sequence includes:
[0024] Comparing the current phase sequence with the preset phase sequence to determine a first phase and a second phase to be corrected;
[0025] The phase values of the first phase and the second phase are interchanged.
[0026] In the above implementation process, by directly comparing the current current phase sequence with the preset phase sequence, the phase that needs to be corrected can be quickly located. Once the first phase and the second phase that need to be corrected are determined, the phase sequence can be corrected by exchanging their phase values.
[0027] Further, the operating parameter also includes a voltage signal; the controlling the rotor to be located at the motor zero position, and correcting the resolver initial angle according to the motor zero position angle corresponding to the motor zero position, includes:
[0028] Based on the voltage signal, determining a first current control signal;
[0029] Sending the first current control signal to the motor so that the motor controls the rotor to be located at the motor zero position, and obtaining the motor zero position angle corresponding to the motor zero position;
[0030] The motor zero angle is determined as the resolver initial angle.
[0031] In the above implementation process, by determining the motor zero angle as the resolver initial angle, the angle measurement error caused by the change in rotation direction can be eliminated, thereby improving the accuracy of the motor control system.
[0032] Further, after the resolver initial angle is corrected according to the motor zero position angle corresponding to the motor zero position, the method further includes:
[0033] The corrected resolver initial angle is stored in a preset memory.
[0034] In the above implementation process, the corrected resolver initial angle is stored in the memory to achieve persistent storage of this information. This means that even if the motor control system is powered off or restarted, the corrected resolver initial angle will not be lost, and the system can directly read and use this value at the next startup without the need to re-calibrate.
[0035] A second aspect of an embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, any method described in the first aspect is implemented.
[0036] A third aspect of an embodiment of the present application provides a motor controller, which uses any method described in the first aspect to calibrate motor control parameters.
[0037] A fourth aspect of an embodiment of the present application provides a vehicle, comprising the motor controller provided in the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A schematic diagram of a flow chart of a method for calibrating control parameters of a motor provided in an embodiment of the present application;
[0040] Figure 2 A schematic diagram of a correct phase sequence output provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of a digital signal of a rotor position provided in an embodiment of the present application;
[0042] Figure 4 A schematic diagram of a flow chart of another method for calibrating control parameters of a motor provided in an embodiment of the present application;
[0043] Figure 5 An overall flow chart of an embodiment of the present application is provided. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0045] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0046] When the positive and negative wires corresponding to the resolver are connected in reverse, the motor rotation direction will change. After the motor rotation direction changes, the motor control system cannot continue to operate normally. In related technologies, this problem is often solved by hardware changes and debugging, but this method is time-consuming and labor-intensive, and involves the disassembly and calibration of the motor resolver, which is a cumbersome process. Therefore, a method that can quickly solve the problem by adjusting the software logic for calibration is urgently needed, and the software calibration method does not require the disassembly and calibration of the resolver.
[0047] In view of any of the above problems, the present application provides a method for calibrating control parameters of a motor, referring to Figure 1 , Figure 1 A schematic flow chart of a method for calibrating control parameters of a motor provided in an embodiment of the present application.
[0048] In this embodiment, the motor is connected to a rotary transformer; the control parameters include rotor position, current phase sequence and rotary transformer initial angle, and the method includes:
[0049] Step S10: when the resolver line of the resolver is connected in reverse, obtaining the operating parameters of the motor; the operating parameters include a speed signal, a rotor position signal, and a current phase sequence;
[0050] It should be noted that the execution subject of this embodiment may be a motor controller. The motor may be a permanent magnet synchronous motor. The speed signal and the rotor position signal may be obtained through an inverter.
[0051] The resolver is usually installed inside or near the motor to detect parameters such as the motor's rotor position or speed. The connection methods between the resolver and the motor include but are not limited to the following:
[0052] ① Mechanical connection: The rotor part of the resolver (or the mechanical structure connected to it) is installed on the shaft of the motor and rotates with the rotor of the motor;
[0053] ②Electrical connection: The stator and stator circuit part of the rotary transformer are electrically connected to the control system or other related circuits of the motor.
[0054] Reverse connection of resolver lines can refer to phase or sequence errors in the connection process of the output or input lines of the resolver, or it can refer to the reverse connection of the positive and negative lines corresponding to the resolver lines. Reverse connection of the positive and negative lines corresponding to the resolver lines means that the positive and negative polarity or reference point lines of the resolver are incorrect during the connection process, such as the reverse connection of the positive and negative lines of sin.
[0055] It should be understood that incorrect wiring of the resolver will cause the control system to receive an erroneous angle signal. The logic or algorithm in the control system cannot correctly process the erroneous signal, thereby issuing an erroneous rotation control instruction, and the motor rotation direction is changed. After the motor rotation direction is changed, it is necessary to obtain the real-time operating parameters of the motor to correct the motor rotor position, current phase sequence, and resolver initial angle to ensure the normal operation of the motor.
[0056] Step S20: Correcting the rotor position based on the signal direction of the speed signal and the signal direction of the rotor position signal;
[0057] As an example, the speed signal direction: determines whether the motor is accelerating, decelerating, or maintaining a constant speed, and the direction of wheel rotation (clockwise or counterclockwise).
[0058] Rotor position signal direction: Determines the direction of rotation of the rotor relative to a reference point (such as the initial position).
[0059] The direction of the speed signal is compared to the direction of the rotor position signal. If the two directions are consistent, it means that the motor is running in the expected direction; if the directions are inconsistent, there may be a control error or mechanical failure. At this time, measures need to be taken to correct the rotor position.
[0060] Step S30: When the current phase sequence does not conform to the preset phase sequence, correct the current phase sequence to the preset phase sequence;
[0061] It is understandable that the three-phase current of the motor must flow in a specific order to ensure that the motor can rotate normally. If it is detected that the current phase sequence does not match the preset phase sequence (the preset phase sequence is uvw for example in this embodiment), the phase sequence output of the power supply needs to be adjusted to ensure that the current flows in the correct order. Figure 2 As shown, Figure 2 A schematic diagram of a correct phase sequence output provided by an embodiment of the present application shows that when the current flows in the correct order, the phase sequence of the three-phase current will be output in the phase sequence of uvw.
[0062] Optionally, if the output of the reverse phase sequence wvu appears, although the reverse phase sequence can also be output, it will cause excessive torque deviation. At this time, it is necessary to swap the phase sequence of any two phases to complete the correction. The phase sequence can be corrected manually or automatically. This embodiment does not limit the correction method, and manual correction or automatic correction can be selected according to actual needs.
[0063] Manual correction: The connectors outside the three-phase line of the hub motor can be directly replaced to complete the correction.
[0064] Automatic correction: Built-in connector realizes correction by changing the two-phase input of the program.
[0065] Step S40: Control the rotor to be located at the motor zero position, and correct the resolver initial angle according to the motor zero position angle corresponding to the motor zero position.
[0066] Specifically, after the rotation direction is changed, the initial angle of the motor's resolver needs to be recalibrated. Currently, the motor's rotor is often controlled to stop at the motor's zero position by applying current, and then the zero position angle measured by the resolver is read. The measured zero position angle is the re-determined initial angle of the resolver.
[0067] It should be noted that when the resolver line is connected in reverse, the rotor position in the motor needs to be corrected first, and then the current phase sequence is determined based on the completion of the rotor position correction. If the current phase sequence at this time does not meet the preset phase sequence, it is corrected to the preset phase sequence. After the rotor position and current phase sequence are corrected to the normal state, the resolver initial angle is finally corrected.
[0068] In this embodiment, if the resolver line is connected in reverse, first, the rotor position is corrected by comparing the signal direction of the speed signal and the signal direction of the rotor position signal; second, when it is found that the current phase sequence does not meet the preset phase sequence, the current phase sequence is corrected to the preset phase sequence; finally, the motor rotor is controlled to the motor zero position, and the initial angle of the resolver is corrected according to the motor zero position angle corresponding to the motor zero position. The above method enables the system to achieve automatic correction through software control without changing the hardware structure, and restore the normal operation of the motor system.
[0069] On the basis of any of the above embodiments, the signal direction of the speed signal includes a positive direction for driving the wheels forward and a negative direction for driving the wheels backward; the signal direction of the rotor position signal includes a positive direction for the angle corresponding to the rotor position signal to be increasing and a negative direction for the angle corresponding to the rotor position signal to be decreasing; step S20 includes:
[0070] When the signal direction of the speed signal is inconsistent with the signal direction of the rotor position signal, the rotor position is corrected according to a preset angle threshold and the rotor position signal.
[0071] It should be noted that this embodiment provides a method for correcting the rotor position when the rotation speed signal and the rotor position signal of a certain motor are in inconsistent directions.
[0072] In the specific implementation, the definition is based on the front of the vehicle, and the direction in which the wheels travel forward is the positive direction of the vehicle; the speed at which the motor drives the wheels forward is defined as the positive direction, and the motor speed corresponding to the positive direction is positive; similarly, the motor speed corresponding to the negative direction is negative.
[0073] The electrical signal (usually an analog signal) output by the resolver needs to be converted into a digital signal and transmitted to the control system through an appropriate interface or bus. Specifically, the rotor position signal is analyzed by the resolver, and the AD value (i.e., analog-to-digital conversion value) of the corresponding position of 0-360 degrees output by the resolver is 0-4095. The position change that increases in the order of 0 to 4095 is defined as the positive direction, and the position change that decreases in the order of 4095 to 0 is defined as the negative direction.
[0074] The signal direction of the speed signal is inconsistent with the signal direction of the rotor position signal (for example, the speed signal reflects the trend of driving the wheels forward, the speed signal is positive, and the rotor position signal reflects the trend of the AD value decreasing from 4095 to 0 in sequence. At this time, the rotor rotates counterclockwise, driving the wheels backward, and the rotor position signal is negative). This means that although the motor is rotating, the changing trend of its speed is somewhat asynchronous or opposite to the changing trend of the rotor position, and the motor rotor position stored in the control program needs to be corrected.
[0075] The preset angle threshold value may be 4095. If the rotor position is pos1 (the absolute value of pos1 is any value between 0 and 4095), when the signal direction of the speed signal is inconsistent with the signal direction of the rotor position signal, the rotor position is corrected to 4095-pos1 to ensure that the signal direction of the speed signal is consistent with the signal direction of the rotor position signal.
[0076] like Figure 3 As shown, Figure 3 A schematic diagram of a digital signal of a rotor position provided in an embodiment of the present application. Figure 3 It consists of four triangles of different heights, and the heights of these triangles actually simulate the change of the AD value output by the resolver with the rotor position (0-360 degrees). When the rotor rotates from 0 degrees to 360 degrees, the AD value output by the resolver increases from 0 to 4095. 4095 can be regarded as the AD value of the rotor when it is at 360 degrees (or close to 360 degrees), and the height of the triangle in the second half of 4095 gradually decreases, simulating the decrease of the AD value during the rotation of the rotor.
[0077] In this embodiment, when the signal direction of the speed signal is inconsistent with the signal direction of the rotor position signal, this usually means that the motor may be in an unexpected operating state. For example, if the speed signal indicates that the motor is rotating forward (i.e., driving the wheels forward), but the rotor position signal shows that the rotor is moving backward (i.e., the angle is decreasing), then this is likely an abnormal situation and needs to be corrected. By timely detecting and correcting abnormal situations, the system can prevent the motor from continuing to operate in an incorrect state.
[0078] Based on any of the above embodiments, step S20 includes:
[0079] Acquire a first speed signal and a first rotor position signal of a first motor, and a second speed signal and a second rotor position signal of a second motor; the first motor and the second motor are installed in opposite directions;
[0080] When the signal direction of the first speed signal matches the preset signal direction, the rotor position of the second motor is corrected based on the first rotor position signal.
[0081] It should be noted that this embodiment is for the entire wheel hub motor, and provides a method for correcting the rotor position when the output rotation speeds of the left and right motors or the front and rear motors of the wheel hub motor are in opposite directions.
[0082] If the left and right motors are swapped, the rotation speeds of the left and right motors will be opposite, affecting the initial angle of the resolver. The problem of affecting the initial angle of the resolver can be solved by correcting the rotor position. In the specific implementation, the initial angle of the resolver is corrected only after the rotor position is corrected.
[0083] The first motor and the second motor installed in opposite directions can be the left motor and the right motor of the wheel hub motor, or the front motor and the rear motor of the wheel hub motor. This embodiment is described by taking the first motor as the left motor and the second motor as the right motor as an example.
[0084] The preset signal direction may be a positive direction or a negative direction. This embodiment is described by taking the preset signal direction as the positive direction.
[0085] Specifically, the position change of the resolver output that increases in the order of 0 to 4095 is defined as positive, and the position change that decreases in the order of 4095 to 0 is defined as negative. If the position of the positive speed is pos2, then 4095-pos2 is the negative speed. For example, the speeds of the left motor and the right motor are opposite. In order to ensure that their output speeds are both positive, the position of the left motor rotor is defined as pos3, and the position of the right motor rotor is corrected to 4095-pos3.
[0086] In this embodiment, after the left and right motors are swapped, the normal operation of the motor control system can be restored by recalibrating the position of the rotor of the right motor without disassembling and calibrating the rotary transformer.
[0087] Based on any of the above embodiments, the operating parameters also include a voltage signal; before step S30, the following is also included: Figure 4 Steps S21 to S23 shown:
[0088] Step S21: determining a second current control signal based on the voltage signal;
[0089] It is understandable that the voltage signal may be a bus voltage signal, and the voltage signal may be obtained through an inverter. A suitable current control signal is calculated based on the voltage signal, so as to control the specific behavior of the motor by adjusting the current.
[0090] Step S22: obtaining the current phase sequence output by the motor under the second current control signal;
[0091] Specifically, after the second current control signal is applied, the current output by the motor is monitored in real time, and the phase sequence information of the current is obtained.
[0092] Step S23: determining whether the current phase sequence conforms to the preset phase sequence.
[0093] It should be understood that in a motor control system, a desired current phase sequence is usually preset, and this phase sequence is determined according to the design requirements and control objectives of the motor. This embodiment is illustrated by taking the preset phase sequence as uvw. The actual current phase sequence obtained is compared with the preset phase sequence to determine whether they are consistent. If the phase sequence is consistent, it means that the control signal and current output of the motor are correct, and the motor can operate as expected. If the phase sequence is inconsistent, it is necessary to adjust the current control signal or check the wiring of the motor itself to ensure the normal operation of the motor.
[0094] In this embodiment, the current control signal is determined based on the voltage signal, and then the current phase sequence of the motor output under the current control signal is obtained, and finally it is determined whether the current phase sequence meets the preset phase sequence. The wrong current phase sequence may cause motor damage or system failure. By checking the current phase sequence, these potential safety hazards can be discovered and prevented in advance, improving overall safety.
[0095] Based on any of the above embodiments, the current phase sequence includes sequence information of three phases; and the correcting the current phase sequence to the preset phase sequence includes:
[0096] Comparing the current phase sequence with the preset phase sequence to determine a first phase and a second phase to be corrected;
[0097] The phase values of the first phase and the second phase are interchanged.
[0098] It should be noted that the current phase sequence refers to the order in which the current flows between the phases in a multi-phase motor (such as a three-phase motor). For a three-phase motor, there are three phases (i.e., u phase, v phase, and w phase), and their current phase sequence determines the direction of rotation of the motor. For example, in the normal forward rotation, the current may flow in the order of uvw; in the reverse rotation, it may flow in the order of wvu, at which time, the w phase and the u phase need to be adjusted. Specifically, the current or phase signal of the first phase is exchanged with the current or phase signal of the second phase. This exchange can be achieved by changing the motor wiring, adjusting the control signal, or modifying the control algorithm. As an example, by adjusting the motor wiring or the control signal, the current originally flowing to the w phase is changed to flow to the u phase, and the current originally flowing to the u phase is changed to flow to the w phase, thereby realizing the exchange of phase values. The corrected current phase sequence will be consistent with the preset phase sequence, i.e., uvw.
[0099] In this embodiment, the current phase sequence is corrected to ensure that after the rotation direction of the motor is changed, the motor controller can control the motor operation according to the normal three-phase current phase sequence.
[0100] On the basis of any of the above embodiments, the operating parameter further includes a voltage signal; the controlling the rotor to be located at a motor zero position, and correcting the resolver initial angle according to a motor zero position angle corresponding to the motor zero position, includes:
[0101] Based on the voltage signal, determining a first current control signal;
[0102] Sending the first current control signal to the motor so that the motor controls the rotor to be located at the motor zero position, and obtaining the motor zero position angle corresponding to the motor zero position;
[0103] The motor zero angle is determined as the resolver initial angle.
[0104] Optionally, the voltage signal may be a bus voltage signal, and the voltage signal may be obtained through an inverter.
[0105] The motor zero position refers to the starting position of the rotor when the motor is running, that is, the initial state when the motor is exerting force.
[0106] In the specific implementation, the corresponding current control signal is calculated based on the voltage signal and sent to the motor. This signal will drive the motor to control the rotor to gradually move to the predetermined zero position. When the rotor reaches the zero position, the zero angle measured by the resolver is read. The zero angle is the corrected resolver initial angle.
[0107] In this embodiment, when the motor rotation direction changes, the relative position of the rotor will also change. This means that the motor zero position originally corresponding to the resolver initial angle may no longer be accurate. Correcting the resolver initial angle can eliminate the position deviation caused by the change in rotation direction, thereby improving the accuracy of the motor position control.
[0108] On the basis of any of the above embodiments, after correcting the resolver initial angle according to the motor zero position angle corresponding to the motor zero position, the method further includes:
[0109] The corrected resolver initial angle is stored in a preset memory.
[0110] It should be noted that the preset memory may be EEPROM (Electrically Erasable Programmable Read-Only Memory).
[0111] Optionally, the corrected resolver initial angle may be written into a program, or may be written into eep and then read by a new program to determine the corrected resolver initial angle to be used.
[0112] like Figure 5 As shown, Figure 5 A schematic diagram of an overall process provided for an embodiment of the present application. In the case where the resolver line is connected in reverse, first, obtain the operating parameters of the current hub motor, such as the rotor position, current phase sequence, and resolver initial angle. Based on the acquired operating parameters, determine the signal direction of the rotational speed and the motor position (i.e., the motor rotor position). If the signal directions of the two are inconsistent, the motor position (i.e., the motor rotor position) needs to be corrected. Next, determine whether the current phase sequence of the motor is correct. If not, it needs to be corrected. Then, recalibrate the resolver initial angle, and write the calibrated resolver initial angle into the program so that the control system can accurately read and interpret the position information of the motor. Finally, based on all the above modifications, generate a new control program and burn it into the controller. The controller controls the motor according to the new correct program.
[0113] In this embodiment, after the rotation direction of the motor is changed, the corrected resolver initial angle is stored in a preset memory to ensure that the resolver initial angle value stored in the built-in program of the motor controller is consistent with the actual resolver initial angle value of the motor, thereby improving the accuracy of the motor position control.
[0114] Based on the method described in any of the above embodiments, the present application also provides a computer program product, which includes one or more computer programs or instructions. The computer program or instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. When the computer program is executed by a processor, the method described in any of the above embodiments is implemented.
[0115] Based on the method described in any of the above embodiments, the present application also provides a motor controller, which uses the method described in any of the above embodiments to calibrate motor control parameters.
[0116] Based on the method described in any of the above embodiments, the present application also provides a vehicle, which includes the motor controller described in any of the above embodiments.
[0117] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0118] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0119] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0120] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0122] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" 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 also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for calibrating control parameters of a motor, characterized in that: The motor is connected to a rotary transformer; the control parameters include rotor position, current phase sequence and rotary transformer initial angle, and the method includes: When the resolver line of the resolver is connected in reverse, the operating parameters of the motor are obtained; the operating parameters include a speed signal, a rotor position signal, and a current phase sequence; Correcting the rotor position based on a signal direction of the speed signal and a signal direction of the rotor position signal; When the current phase sequence does not conform to a preset phase sequence, correcting the current phase sequence to the preset phase sequence; The rotor is controlled to be located at a motor zero position, and the resolver initial angle is corrected according to a motor zero position angle corresponding to the motor zero position.
2. The method according to claim 1, characterized in that The signal direction of the speed signal includes a positive direction for driving the wheels forward and a negative direction for driving the wheels backward; the signal direction of the rotor position signal includes a positive direction for the angle corresponding to the rotor position signal to be increasing and a negative direction for the angle corresponding to the rotor position signal to be decreasing; the correction of the rotor position based on the signal direction of the speed signal and the signal direction of the rotor position signal includes: When the signal direction of the speed signal is inconsistent with the signal direction of the rotor position signal, the rotor position is corrected according to a preset angle threshold and the rotor position signal.
3. The method according to claim 1, characterized in that The correcting the rotor position based on the signal direction of the speed signal and the signal direction of the rotor position signal comprises: Acquire a first speed signal and a first rotor position signal of a first motor, and a second speed signal and a second rotor position signal of a second motor; the first motor and the second motor are installed in opposite directions; When the signal direction of the first speed signal matches the preset signal direction, the rotor position of the second motor is corrected based on the first rotor position signal.
4. The method according to claim 1, characterized in that The operating parameter also includes a voltage signal; when the current phase sequence does not conform to the preset phase sequence, correcting the current phase sequence to the preset phase sequence also includes: determining a second current control signal based on the voltage signal; Acquire the current phase sequence output by the motor under the second current control signal; Determine whether the current phase sequence conforms to the preset phase sequence.
5. The method according to claim 1, characterized in that The current phase sequence includes sequence information of three phases; and the correcting the current phase sequence to the preset phase sequence includes: Comparing the current phase sequence with the preset phase sequence to determine a first phase and a second phase to be corrected; The phase values of the first phase and the second phase are interchanged.
6. The method according to claim 1, characterized in that The operating parameters also include a voltage signal; the controlling the rotor to be located at the motor zero position, and correcting the resolver initial angle according to the motor zero position angle corresponding to the motor zero position, includes: Based on the voltage signal, determining a first current control signal; Sending the first current control signal to the motor so that the motor controls the rotor to be located at the motor zero position, and obtaining the motor zero position angle corresponding to the motor zero position; The motor zero angle is determined as the resolver initial angle.
7. The method according to claim 1, characterized in that After the resolver initial angle is corrected according to the motor zero position angle corresponding to the motor zero position, the method further includes: The corrected resolver initial angle is stored in a preset memory.
8. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
9. A motor controller, characterized in that: The motor controller uses any method described in claims 1-7 to calibrate motor control parameters.
10. A vehicle, characterized in that: The vehicle includes the motor controller of claim 9.