Offset angle determination method and device and vehicle
By controlling the motor to rotate to the target electrical angle in a permanent magnet synchronous motor and detecting the actual electrical angle, the bias angle of the angle sensor is determined, and the problem of starting time extension caused by inconsistent with the number of pole pairs of the angle sensor and the number of pole pairs of the motor is solved, and the starting time is extended. Quickly determine the bias angle and reduce motor start time.
Patent Information
- Application Number
- CN202411374291.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-07
AI Technical Summary
In permanent magnet synchronous motors, since the pole pairs of the angle sensor are inconsistent with the pole pairs of the motor, it takes a long time to determine the bias angle of the angle sensor from multiple fixed bias angles each time they are powered on. Impacts the start time of the motor.
By controlling the motor to rotate to the target electrical angle, the actual electrical angle is detected, and the difference between each fixed bias angle and the current bias angle is calculated separately. If the minimum difference is less than the preset threshold, it is used as the angle sensor Bias angle, shortens the time to determine the bias angle.
This method does not require determining each fixed bias angle and trial operation in sequence, but directly controls the motor through a fixed bias angle of the minimum difference, significantly shortens the start time of the motor, and improves the determination efficiency through repeated execution and adjustment of the electrical angle change.
Smart Images

Figure CN119276172A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor technology, and more specifically, to a method, device and vehicle for determining an offset angle in the field of motor technology. Background Art
[0002] In the control process of a permanent magnet synchronous motor (hereinafter referred to as the motor), the electrical angle of the motor is mainly detected by an angle sensor (specifically a rotating transformer), and the motor is precisely controlled according to the detected electrical angle.
[0003] In some cases, the number of pole pairs of the angle sensor may be inconsistent with the number of pole pairs of the motor due to factors such as cost, installation space, and manufacturing process. In this case, each time the motor is powered on, the bias angle of the angle sensor is a random one of multiple fixed bias angles. At this time, it takes a long time to determine the bias angle of the angle sensor after this power-on from multiple fixed bias angles, so as to determine the bias angle of the motor according to the bias angle after this power-on, and control the motor according to the bias angle of the motor. Summary of the invention
[0004] The present application provides a method, device and vehicle for determining an offset angle, which can shorten the time used for determining the offset angle of a rotation angle sensor.
[0005] In a first aspect, a method for determining an offset angle is provided, comprising:
[0006] After the motor is powered on, the motor is controlled to rotate to the target electrical angle;
[0007] The electrical angle of the controlled motor is detected by a rotation angle sensor to obtain the actual electrical angle of the motor; wherein the rotation angle sensor has a plurality of fixed offset angles;
[0008] Determine the difference between each fixed offset angle and the current offset angle respectively to obtain a plurality of difference values; wherein the current offset angle is the difference between the actual electrical angle and the target electrical angle;
[0009] If the minimum difference among the multiple differences is smaller than a preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
[0010] In an embodiment of the present application, after the motor is initialized, the motor is controlled to rotate to the target electrical angle, and the electrical angle of the controlled motor is detected by the angle sensor to obtain the actual electrical angle of the motor, and then the current offset angle between the actual electrical angle and the target electrical angle is determined, and the difference between each fixed offset angle and the current offset angle is determined to obtain multiple differences. When the minimum difference among the multiple differences is less than a preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the angle sensor after the current power-on. In this method, there is no need to determine the motor offset angle according to each fixed offset angle in turn, nor is there a need to control the motor test run according to the motor offset angle corresponding to each fixed offset angle in turn. It is only necessary to control the motor's rotor to rotate to the target electrical angle, thereby shortening the time used to determine the offset angle of the angle sensor after the motor is powered on this time.
[0011] In combination with the first aspect, in some possible implementations, the method also includes: if the minimum difference is greater than or equal to the preset threshold, determining whether the number of times the determination step is executed reaches the preset number; if it does not reach the preset number, executing the control step, the detection step and the determination step again to obtain the multiple differences again, and when the minimum difference among the multiple differences is less than the preset threshold, using the fixed offset angle corresponding to the minimum difference as the offset angle of the angle sensor after this power-on; if the preset number is reached, outputting an alarm signal; wherein the alarm information is used to indicate a fault of the motor and / or the angle sensor.
[0012] In an embodiment of the present application, the bias angle determination method provided in the embodiment of the present application can be repeatedly executed multiple times to eliminate the situation where the minimum difference is greater than or equal to a preset threshold due to possible errors, making it impossible to determine the fixed bias angle at the time of power-on.
[0013] In combination with the first aspect, in some possible implementations, before re-executing the control step, the detection step and the determination step, the method also includes: determining the electrical angle change according to the number of times the determination step is executed; wherein the electrical angle change is positively correlated or negatively correlated with the number of times the determination step is executed; and adjusting the current target electrical angle according to the electrical angle change to obtain a new target electrical angle.
[0014] In this embodiment, during repeated execution, the target electrical angle is adjusted by the electrical angle change so that the target electrical angle can be different during each execution, thereby reducing the problem of being unable to determine the bias angle of the angle sensor after power-on this time due to unreasonable target electrical angle setting.
[0015] In combination with the first aspect, in some possible implementations, the fixed bias angle corresponding to the minimum difference is used as the bias angle of the angle sensor after the current power-on, including: determining the motor bias angle of the motor according to the fixed bias angle corresponding to the minimum difference; if the motor trial operation is controlled by the motor bias angle, then the fixed bias angle corresponding to the minimum difference is used as the bias angle of the angle sensor after the current power-on.
[0016] In the embodiment of the present application, by verifying the offset angle of the determined rotation angle sensor after the current power-on through the trial operation of the motor, possible misjudgments can be reduced to reduce the situation of incorrect setting of the offset angle.
[0017] In combination with the first aspect, in some possible implementations, if the motor trial run is controlled by the motor offset angle, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the angle sensor after the current power-on, including: controlling the motor to run at a first preset speed by the motor offset angle; if the number of rotations of the motor within a first preset time period reaches a preset number of rotations, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the angle sensor after the current power-on.
[0018] In combination with the first aspect, in some possible implementations, controlling the motor to rotate to the target electrical angle includes: repeatedly controlling the motor to rotate to the target electrical angle for multiple times; or, after controlling the motor to rotate at a second preset speed for a second preset time period, controlling the motor to rotate to the target electrical angle.
[0019] In an embodiment of the present application, before executing the detection step and the determination step, the control step is executed multiple times or the motor is controlled to rotate for a certain period of time, so that the motor can reach the operating state and accurately rotate to the target electrical angle, so as to eliminate the situation where the minimum difference is greater than or equal to the preset threshold due to possible errors, making it impossible to determine the fixed offset angle at this power-on.
[0020] In combination with the first aspect, in some possible implementations, the target electrical angle is 0 electrical angle, and the difference between each of the fixed offset angles and the current offset angle is determined respectively to obtain multiple differences, including: the difference between each of the fixed offset angles and the actual electrical angle is determined respectively to obtain the multiple differences.
[0021] In the embodiment of the present application, when the target electrical angle is set to 0 electrical angle, not only can the motor be accurately controlled, but also multiple differences can be quickly determined, thereby improving the efficiency of determining the offset angle.
[0022] In a second aspect, a bias angle determination device is provided, the device comprising:
[0023] A control module, used to control the motor to rotate to a target electrical angle after the motor is powered on;
[0024] A detection module, used to detect the electrical angle of the controlled motor through a rotation angle sensor to obtain the actual electrical angle of the motor; wherein the rotation angle sensor has a plurality of fixed offset angles;
[0025] A determination module, used to respectively determine the difference between each fixed offset angle and the current offset angle to obtain a plurality of difference values; wherein the current offset angle is the difference between the actual electrical angle and the target electrical angle;
[0026] As a module, if the minimum difference among the multiple differences is less than a preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
[0027] In a third aspect, a vehicle is provided, the vehicle comprising:
[0028] A memory for storing executable program codes;
[0029] A processor is used to call and run the executable program code from the memory, so that the vehicle executes the method in any possible implementation of the first aspect above.
[0030] In a fourth aspect, a computer program product is provided, which includes: an executable program code, when the executable program code is run on a computer, the computer executes the method in any possible implementation manner of the first aspect above.
[0031] In a fifth aspect, a readable storage medium is provided, in which an executable program code is stored. When the executable program code runs on a computer, the computer executes the method in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 is a flowchart of a method for determining an offset angle provided in an embodiment of the present application;
[0033] Figure 2 is a flowchart of another method for determining an offset angle provided in an embodiment of the present application;
[0034] Figure 3 is a structural schematic diagram of a bias angle determination device provided in an embodiment of the present application;
[0035] Figure 4 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0037] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0038] In some cases, the number of pole pairs of the angle sensor installed in the motor may be inconsistent with the number of pole pairs of the motor due to factors such as cost, installation space, and manufacturing process. In such cases, each time the motor is powered on, the bias angle of the angle sensor is a random one of multiple fixed bias angles (hereinafter referred to as fixed bias angles). The fixed bias angle refers to the deviation between the electrical angle of the motor detected by the angle sensor and the actual electrical angle of the motor each time the motor is powered on.
[0039] For example, when the number of pole pairs of the motor is 5 and the number of pole pairs of the angle sensor is 4, the angle sensor has 4 fixed offset angles. Each time the motor is powered on, the offset angle of the angle sensor is a random one of the 4 fixed offset angles. At this time, it is necessary to determine the offset angle of the angle sensor after the current power-on from the 4 fixed offset angles.
[0040] In view of the above situation, the usual practice is to use each fixed offset angle to determine the offset angle of the motor (hereinafter referred to as the motor offset angle) in turn each time the motor is powered on, and control the motor trial run according to the motor offset angle. During the motor trial run, detect whether the control accuracy of the motor meets the requirements. When the control accuracy of the motor meets the requirements, determine that the fixed offset angle used is the offset angle of the angle sensor after the current power-on. Afterwards, determine the final motor offset angle based on the offset angle after the current power-on, and control the motor according to the motor offset angle. The problem with this method is that it is necessary to determine the motor offset angle according to each fixed offset angle in turn, and control the motor trial run according to the motor offset angle, which takes a long time, which may cause the motor to require a long startup time.
[0041] In order to solve the above technical problems, an embodiment of the present application provides a method for determining a bias angle. In this method, each time the motor is powered on, the motor is first controlled to rotate to a target electrical angle, and the actual electrical angle of the motor is detected by an angle sensor. Then, the difference between the actual electrical angle and the target electrical angle is determined, and the difference between the difference and each fixed bias angle is determined to obtain multiple differences. When the minimum difference among the multiple differences is less than a preset threshold, it indicates that the fixed bias angle corresponding to the minimum difference is the bias angle of the angle sensor after the current power-on. At this time, the motor bias angle can be determined based on the bias angle.
[0042] In the offset angle determination method provided in the embodiment of the present application, there is no need to determine the motor offset angle according to each fixed offset angle in turn, nor is there a need to control the motor trial operation according to the motor offset angle corresponding to each fixed offset angle in turn. It is only necessary to control the motor's rotor to rotate to the target electrical angle, thereby shortening the time used to determine the offset angle of the angle sensor after the motor is powered on, and further shortening the start-up time of the motor.
[0043] The execution subject of the offset angle determination method provided in the embodiment of the present application may be a motor controller. For example, when the motor is installed in a vehicle, the offset angle determination method provided in the embodiment of the present application may be executed by the motor controller for controlling the rotation of the motor.
[0044] See also Figure 1 , Figure 1 is a flowchart of a method for determining an offset angle provided in an embodiment of the present application. Figure 1 As shown, the method may include the following steps:
[0045] Step 101: Control the motor to rotate to a target electrical angle.
[0046] Step 102: Detect the electrical angle of the controlled motor through a rotation angle sensor to obtain the actual electrical angle of the motor.
[0047] The rotation angle sensor has multiple fixed offset angles. For example, when the number of pole pairs of the motor is 5 and the number of pole pairs of the rotation angle sensor is 4, the rotation angle sensor has 4 fixed offset angles, which are represented by A, B, C, and D. Each time the motor is powered on, the offset angle of the rotation angle sensor is a random one of A, B, C, and D.
[0048] In this embodiment, the actual electrical angle is the electrical angle actually collected by the angle sensor after the motor is controlled to rotate to the target electrical angle. The target electrical angle is a reference benchmark, and the target electrical angle can be pre-set according to actual needs. For example, the target electrical angle can be pre-set to 100 degrees. After each power-on of the motor, the motor controller can first initialize the motor. After the initialization is completed, the motor can be open-loop controlled to rotate the electrical angle of the rotor in the motor to 100 degrees. The electrical angle of the motor is the electrical angle of the rotor in the motor. After controlling the electrical angle of the rotor to rotate to 100 degrees, the motor controller can detect the electrical angle of the motor through the angle sensor to obtain the actual electrical angle.
[0049] Step 103: Determine the difference between each fixed offset angle and the current offset angle respectively to obtain a plurality of difference values.
[0050] Among them, the current bias angle is the difference between the actual electrical angle and the target electrical angle. The current bias angle corresponds to the deviation between the electrical angle collected by the angle sensor and the actual electrical angle when the motor is powered on this time.
[0051] In this embodiment, after the actual electrical angle is detected, the motor controller can first calculate the difference between the actual electrical angle and the target electrical angle, and use the difference as the current offset angle. Afterwards, for each fixed offset angle, the difference between the current offset angle and the fixed offset angle can be calculated to obtain multiple differences. For example, for the above-mentioned four fixed offset angles A, B, C, and D, the difference between A, B, C, and D and the current offset angle can be calculated respectively, so that a difference corresponding to A, B, C, and D can be obtained, a total of four differences.
[0052] It should be understood that after the motor is powered on this time, the current bias angle corresponds to the deviation between the electrical angle collected by the angle sensor when the motor is powered on this time and the actual electrical angle. Therefore, for each fixed bias angle, the smaller the difference between the current bias angle and the fixed bias angle, the closer the fixed bias angle is to the bias angle of the angle sensor after the motor is powered on this time.
[0053] Step 104: If the minimum difference among the multiple differences is smaller than the preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
[0054] Among them, the preset threshold corresponds to the control accuracy requirement of the motor. For each difference, the closer the difference is to the current offset angle, the closer the fixed offset angle corresponding to the difference is to the offset angle of the angle sensor after the current power-on. For each fixed offset angle, when the difference between the fixed offset angle and the current offset angle is less than the preset threshold, it indicates that when the motor is controlled according to the motor offset angle corresponding to the fixed offset angle, the control accuracy of the motor can meet the requirements.
[0055] In this embodiment, after obtaining multiple differences, the motor controller can first determine the smallest difference from the multiple differences, thereby obtaining the minimum difference. Afterwards, the minimum difference can be compared with a preset threshold value. If the minimum difference is less than the preset threshold value, the fixed offset angle corresponding to the minimum difference is determined as the offset angle of the angle sensor after this power-on. Afterwards, the motor offset angle can be calculated based on the fixed offset angle corresponding to the minimum difference. For example, if the minimum difference corresponds to A among A, B, C and D, the motor offset angle can be determined based on A. Specifically, the motor offset angle can be calculated and determined by the formula shown below.
[0056]
[0057] Among them, MotorOff is the motor offset angle, X is the fixed offset angle corresponding to the minimum difference, N is the number of pole pairs of the angle sensor, and M is the number of pole pairs of the motor.
[0058] In an embodiment of the present application, after the motor is initialized, the motor is controlled to rotate to the target electrical angle, and the electrical angle of the controlled motor is detected by the angle sensor to obtain the actual electrical angle of the motor, and then the current offset angle between the actual electrical angle and the target electrical angle is determined, and the difference between each fixed offset angle and the current offset angle is determined to obtain multiple differences. When the minimum difference among the multiple differences is less than a preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the angle sensor after the current power-on. In this method, there is no need to determine the motor offset angle according to each fixed offset angle in turn, nor is there a need to control the motor trial operation according to the motor offset angle corresponding to each fixed offset angle in turn. It is only necessary to control the motor's rotor to rotate to the target electrical angle, thereby shortening the time used to determine the offset angle of the angle sensor after the motor is powered on this time, and further shortening the start-up time of the motor.
[0059] Optionally, the target electrical angle is 0 electrical angle, and the difference between each fixed offset angle and the current offset angle is determined respectively to obtain multiple difference values, including:
[0060] The difference between each fixed offset angle and the actual electrical angle is determined respectively to obtain a plurality of difference values.
[0061] In one implementation, the target electrical angle may be set to 0 degrees, and during each execution of step 101, the motor controller may control the motor to rotate to 0 electrical angle. Afterwards, the actual electrical angle of the motor may be detected, and the difference between each fixed offset angle and the actual electrical angle may be calculated to obtain multiple difference values.
[0062] After controlling the motor to rotate to 0 electrical angle, it can be considered that the motor is at 0 electrical angle at this time. At this time, the actual electrical angle of the motor collected by the angle sensor is equivalent to the offset angle of the angle sensor when the motor is powered on this time. The smaller the difference between the actual electrical angle and the fixed offset angle, the closer the fixed offset angle is to the offset angle at this power-on. Furthermore, after obtaining multiple differences, if the minimum difference among the multiple differences is close to the preset threshold, it indicates that the minimum difference is close to 0, and the fixed offset angle corresponding to the minimum difference is the fixed offset angle at this power-on.
[0063] In the embodiment of the present application, when the target electrical angle is set to 0 electrical angle, not only can the motor be accurately controlled, but also multiple differences can be quickly determined, thereby improving the efficiency of determining the offset angle.
[0064] Optionally, the method may further include:
[0065] If the minimum difference is greater than or equal to a preset threshold, determining whether the number of times the determining step is performed reaches a preset number of times;
[0066] If the preset number of times is not reached, the control step, the detection step and the determination step are executed again to obtain multiple difference values again, and when the minimum difference value among the multiple difference values is less than the preset threshold value, the fixed offset angle corresponding to the minimum difference value is used as the offset angle of the rotation angle sensor after the current power-on;
[0067] If the preset number of times is reached, an alarm signal is output; wherein the alarm information is used to indicate a fault in the motor and / or the rotation angle sensor.
[0068] In one embodiment, when the minimum difference is greater than or equal to a preset threshold, steps 101 to 104 may be executed again, and the number of executions of steps 101 to 104 may be counted. When the number of executions is less than the preset number, if the minimum difference is less than the preset threshold during a certain execution, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the angle sensor after the current power-on, and the motor offset angle is determined according to the fixed offset angle corresponding to the minimum difference. When the number of executions reaches the preset number, if the minimum difference is not less than the preset threshold, it is determined that one or both of the motor and the angle sensor are faulty, and an alarm signal may be output at this time to prompt the user of the motor and / or angle sensor fault through the alarm signal.
[0069] See also Figure 2 , Figure 2 FIG. 1 is a flowchart of another method for determining an offset angle provided in an embodiment of the present application. Figure 2 As shown, the method may include the following steps:
[0070] Step 201, set the execution count to 1.
[0071] In this embodiment, after the motor is powered on and initialized, the motor controller can first set the number of executions to 0, which is the number of times step 103 is determined, that is, the number of times step 101 is controlled and the number of times step 102 is detected, that is, the number of times steps 101 to 104 are executed.
[0072] Step 202: Control the motor to rotate to a target electrical angle.
[0073] Step 203: Detect and obtain the actual electrical angle.
[0074] Step 204: Determine a plurality of difference values.
[0075] Step 205: Determine the minimum difference value from the multiple differences.
[0076] Step 206: Determine whether the minimum difference is less than a preset threshold.
[0077] In this embodiment, after the motor is powered on and initialized, the motor controller first controls the motor to rotate to the target electrical angle, and detects the electrical angle of the motor through the angle sensor to obtain the actual electrical angle of the motor. After that, the difference between the actual electrical angle and the target electrical angle can be calculated to obtain the current offset angle, and the difference between each fixed offset angle and the current offset angle can be calculated to obtain multiple differences. After that, the minimum difference can be determined from the multiple differences, and it can be determined whether the minimum difference is less than the preset threshold. When the minimum difference is less than the preset threshold, step 207 is executed, and when the minimum difference is greater than or equal to the preset threshold, step 208 is executed.
[0078] Step 207: Use the fixed offset angle corresponding to the minimum difference as the offset angle of the rotation angle sensor after the current power-on.
[0079] Step 208: Increase the number of executions by 1.
[0080] Step 209: Determine whether the execution times reaches the preset times.
[0081] In this embodiment, each time step 208 is executed, the number of executions can be increased by 1, and then step 209 is executed to determine whether the number of executions reaches the preset number. When the number of executions does not reach the preset number, step 202 can be returned to, and steps 202 to 206 can be executed again. When the number of executions reaches the preset number, step 210 can be executed to output an alarm signal. For example, when the motor is installed in a vehicle, the motor controller can output an alarm signal to the vehicle controller. After receiving the alarm signal, the vehicle controller can notify the user of the motor and / or angle sensor failure through voice or display. It should be understood that the specific output method of the alarm signal can be set according to demand, and this example does not limit this.
[0082] In the embodiment of the present application, the offset angle determination method provided in the embodiment of the present application can be repeatedly executed multiple times to eliminate the situation where the minimum difference is greater than or equal to the preset threshold value due to possible errors, making it impossible to determine the fixed offset angle at this power-on. For example, when controlling the motor to rotate to the target electrical angle, the load may be too large to cause the rotor to rotate to the target angle, which may cause the minimum difference to be greater than the preset threshold value, making it impossible to determine the offset angle of the angle sensor after this power-on. When repeated multiple times, the rotor can be controlled to rotate to the target electrical angle, thereby reducing the occurrence of this situation.
[0083] Optionally, before executing the controlling step, the detecting step and the determining step again, the method may further include:
[0084] Determine the electrical angle change according to the number of times the determining step is performed; wherein the electrical angle change is positively correlated or negatively correlated with the number of times the determining step is performed;
[0085] The current target electrical angle is adjusted according to the electrical angle change to obtain a new target electrical angle.
[0086] In one embodiment, after executing the control step for the first time and before each subsequent execution of the control step, the electrical angle change corresponding to the number of executions can be determined, and the target electrical angle can be adjusted according to the electrical angle change to obtain a new target electrical angle, and then the electrical angle of the motor can be controlled to rotate to the new target electrical angle.
[0087] Exemplarily, the electrical angle change is positively correlated with the number of executions, and the electrical angle change increases by Δ for each increase in the number of executions. After the motor completes initialization, during the first execution of the control step, the motor controller can control the motor's rotor to rotate to the initial target electrical angle ω. During the second execution of the control step, the electrical angle change is Δ, and the new target electrical angle is (ω+Δ), and the motor controller can control the motor's rotor to rotate to the new target electrical angle (ω+Δ). During the third execution of the control step, the electrical angle change is 2Δ, and the new target electrical angle is (ω+2Δ), and the motor controller can control the motor's rotor to rotate to the new target electrical angle (ω+2Δ). During the fourth execution of step 202, the electrical angle change is 3Δ, and the new target electrical angle is (ω+3Δ), and the motor controller can control the motor's rotor to rotate to the new target electrical angle (ω+3Δ). By analogy, for each increase in the number of executions, the electrical angle change increases by Δ, so that the target electrical angle increases by Δ.
[0088] The electrical angle change may also be negatively correlated with the number of executions. Each time the number of executions increases, the electrical angle change decreases by Δ, thereby reducing the target electrical angle by Δ.
[0089] In this embodiment, during repeated execution, the target electrical angle is adjusted by the electrical angle change so that the target electrical angle can be different during each execution, thereby reducing the problem of being unable to determine the bias angle of the angle sensor after power-on this time due to unreasonable target electrical angle setting.
[0090] Optionally, a fixed offset angle corresponding to the minimum difference is used as an offset angle of the rotation angle sensor after the current power-on, including:
[0091] Determining a motor offset angle of the motor according to a fixed offset angle corresponding to the minimum difference;
[0092] If the motor test run is passed by controlling the motor offset angle, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
[0093] In one embodiment, when it is determined that the minimum difference is less than a preset threshold, the motor offset angle can be first determined by the above formula, and then the motor offset angle is used to control the motor to test run for a certain period of time. During the test run, it can be determined whether the control accuracy of the motor meets the requirements. If the control accuracy of the motor meets the requirements, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the angle sensor after the current power-on. At this time, the determined motor offset angle can be kept unchanged, and the determined motor offset angle can be directly used to control the motor operation. If the control accuracy of the motor does not meet the requirements, the above steps can be performed again when the number of executions does not reach the preset number of times, and an alarm signal can be output when the number of executions reaches the preset number of times.
[0094] In the embodiment of the present application, by verifying the offset angle of the determined rotation angle sensor after the current power-on through the trial operation of the motor, possible misjudgments can be reduced to reduce the situation of incorrect setting of the offset angle.
[0095] Optionally, if the motor test run is passed by controlling the motor offset angle, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on, including:
[0096] Controlling the motor to run at a first preset speed through a motor offset angle;
[0097] If the number of rotations of the motor within the first preset time reaches the preset number of rotations, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
[0098] In one embodiment, during the process of controlling the motor test run, the motor can be controlled to rotate at a first preset speed by the motor offset angle, and the first preset speed can be a relatively low speed that will not affect the load of the motor. During the motor rotation process, the number of rotations of the motor can be timed and monitored. Before the timing time reaches the first preset time, if the number of rotations of the motor reaches the preset number of rotations, it is determined that the control accuracy of the motor meets the requirements, and the fixed offset angle corresponding to the minimum difference can be used as the offset angle of the angle sensor after the current power-on.
[0099] Optionally, controlling the motor to rotate to a target electrical angle includes:
[0100] Repeat the process of controlling the motor to rotate to the target electrical angle multiple times;
[0101] Alternatively, after the motor is controlled to rotate at a second preset speed for a second preset time period, the motor is controlled to rotate to a target electrical angle.
[0102] In one embodiment, in the process of executing the control step, the control step can be executed multiple times in succession, and the motor can be controlled to rotate multiple times, and each time the motor is controlled to rotate to the target electrical angle. For example, the number of times can be 3 times, and the target electrical angle is 0. In the process of executing the control step, the motor can be controlled to rotate continuously for 3 times, and each time the electrical angle of the motor is controlled to rotate to 0 electrical angle. Afterwards, the detection step and the determination step can be executed, and when the minimum difference among the multiple differences is less than the preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the angle sensor after the current power-on. It should be understood that the number of times and the target electrical angle can also be other values, and this embodiment does not limit this.
[0103] In another embodiment, before executing the control step, the motor can be first controlled to rotate at a second preset speed for a second preset time. The second preset speed can be a lower speed that will not affect the load of the motor, and the second preset time can be a shorter time. After controlling the motor to rotate at the second preset speed for the second preset time, the motor can be controlled to rotate to the target electrical angle. Thereafter, the detection step and the determination step can be executed, and when the minimum difference among multiple differences is less than a preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the angle sensor after this power-on.
[0104] In an embodiment of the present application, before executing the detection step and the determination step, the control step is executed multiple times or the motor is controlled to rotate for a certain period of time, so that the motor can reach the operating state and accurately rotate to the target electrical angle, so as to eliminate the situation where the minimum difference is greater than or equal to the preset threshold due to possible errors, making it impossible to determine the fixed offset angle at this power-on.
[0105] See also Figure 3 , Figure 3 is a schematic diagram of the structure of a bias angle determination device provided in an embodiment of the present application. Figure 3 As shown, the offset angle determination device 300 may include:
[0106] The control module 301 is used to control the motor to rotate to a target electrical angle after the motor is powered on;
[0107] A detection module 302 is used to detect the electrical angle of the controlled motor through a rotation angle sensor to obtain an actual electrical angle of the motor; wherein the rotation angle sensor has a plurality of fixed offset angles;
[0108] The determination module 303 is used to respectively determine the difference between each fixed offset angle and the current offset angle to obtain a plurality of difference values; wherein the current offset angle is the difference between the actual electrical angle and the target electrical angle;
[0109] As module 304, if the minimum difference among the multiple differences is less than a preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
[0110] Optionally, the device 300 also includes: an execution module, used to determine whether the number of times the determination step is executed reaches a preset number if the minimum difference is greater than or equal to the preset threshold; if it does not reach the preset number, executing the control step, the detection step and the determination step again to obtain the multiple differences again, and when the minimum difference among the multiple differences is less than the preset threshold, using the fixed offset angle corresponding to the minimum difference as the offset angle of the angle sensor after this power-on; if it reaches the preset number, outputting an alarm signal; wherein the alarm information is used to indicate a fault of the motor and / or the angle sensor.
[0111] Optionally, the execution module is also used to determine the electrical angle change according to the number of times the determination step is executed before the control step, the detection step and the determination step are executed again; wherein the electrical angle change is positively correlated or negatively correlated with the number of times the determination step is executed; and the current target electrical angle is adjusted according to the electrical angle change to obtain a new target electrical angle.
[0112] Optionally, the module is specifically used to determine the motor offset angle of the motor based on the fixed offset angle corresponding to the minimum difference; if the motor trial operation is passed by controlling the motor offset angle, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after this power-on.
[0113] Optionally, the module is specifically used to control the motor to run at a first preset speed through the motor offset angle; if the number of rotations of the motor within a first preset time period reaches a preset number of rotations, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after this power-on.
[0114] Optionally, the control module is specifically used to repeatedly control the motor to rotate to the target electrical angle; or, after controlling the motor to rotate at a second preset speed for a second preset time period, control the motor to rotate to the target electrical angle.
[0115] Optionally, the target electrical angle is 0 electrical angle, and the determination module is specifically used to respectively determine the difference between each of the fixed offset angles and the actual electrical angle to obtain the multiple differences.
[0116] See also Figure 4 , Figure 4 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application.
[0117] For example, Figure 4 As shown, the vehicle 400 includes: a memory 401 and a processor 402, wherein the memory 401 stores an executable program code 4011, and the processor 402 is used to call and execute the executable program code 4011 to perform a method for determining an offset angle.
[0118] In addition, an embodiment of the present application also protects a bias angle determination device, which may include a memory and a processor, wherein the memory stores an executable program code, and the processor is used to call and execute the executable program code to execute a bias angle determination method provided by an embodiment of the present application.
[0119] It should be understood that the device provided in this embodiment is used to execute the above-mentioned offset angle determination method, and thus can achieve the same effect as the above-mentioned implementation method.
[0120] In addition, the device provided in the embodiments of the present application may specifically be a chip, a component or a module, and the chip may include a connected processor and a memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip can execute a method for determining an offset angle provided in the above embodiments.
[0121] This embodiment also provides a readable storage medium, in which executable program code is stored. When the executable program code is run on a computer, the computer executes the above-mentioned related method steps to implement a method for determining an offset angle provided in the above embodiment.
[0122] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement a method for determining an offset angle provided in the above-mentioned embodiment.
[0123] Among them, the device, readable storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0124] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0125] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0126] The above contents are only specific implementation methods 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.
Claims
1. A method for determining an offset angle, characterized in that: The method comprises: After the motor is powered on, the motor is controlled to rotate to the target electrical angle; The electrical angle of the controlled motor is detected by a rotation angle sensor to obtain the actual electrical angle of the motor; wherein the rotation angle sensor has a plurality of fixed offset angles; Determine the difference between each fixed offset angle and the current offset angle respectively to obtain a plurality of difference values; wherein the current offset angle is the difference between the actual electrical angle and the target electrical angle; If the minimum difference among the multiple differences is smaller than a preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
2. The method according to claim 1, characterized in that The method further comprises: If the minimum difference is greater than or equal to the preset threshold, determining whether the number of times the determining step is performed reaches a preset number; If the preset number of times is not reached, the control step, the detection step and the determination step are performed again to obtain the multiple difference values again, and when the minimum difference value among the multiple difference values is less than the preset threshold value, the fixed offset angle corresponding to the minimum difference value is used as the offset angle of the rotation angle sensor after the current power-on; If the preset number of times is reached, an alarm signal is output; wherein the alarm information is used to indicate a fault in the motor and / or the rotation angle sensor.
3. The method according to claim 2, characterized in that Before executing the controlling step, the detecting step and the determining step again, the method further includes: Determine the electrical angle change according to the number of times the determining step is performed; wherein the electrical angle change is positively correlated or negatively correlated with the number of times the determining step is performed; The current target electrical angle is adjusted according to the electrical angle change to obtain a new target electrical angle.
4. The method according to claim 1, characterized in that The method of using the fixed offset angle corresponding to the minimum difference as the offset angle of the rotation angle sensor after the current power-on includes: Determining a motor offset angle of the motor according to a fixed offset angle corresponding to the minimum difference; If the motor test run is passed by controlling the motor offset angle, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
5. The method according to claim 4, characterized in that If the motor is controlled to pass the trial operation by the motor offset angle, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on, including: Controlling the motor to run at a first preset speed by using the motor offset angle; If the number of rotations of the motor within the first preset time reaches a preset number of rotations, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
6. The method according to claim 1, characterized in that The controlling the motor to rotate to a target electrical angle comprises: Repeating for multiple times controlling the motor to rotate to the target electrical angle; Alternatively, after controlling the motor to rotate at a second preset speed for a second preset time period, the motor is controlled to rotate to the target electrical angle.
7. The method according to any one of claims 1 to 6, characterized in that The target electrical angle is 0 electrical angle, and the difference between each of the fixed offset angles and the current offset angle is determined respectively to obtain a plurality of difference values, including: The difference between each of the fixed offset angles and the actual electrical angle is determined respectively to obtain the multiple difference values.
8. A device for determining an offset angle, characterized in that: The device comprises: A control module, used to control the motor to rotate to a target electrical angle after the motor is powered on; A detection module, used to detect the electrical angle of the controlled motor through a rotation angle sensor to obtain the actual electrical angle of the motor; wherein the rotation angle sensor has a plurality of fixed offset angles; A determination module, used to respectively determine the difference between each fixed offset angle and the current offset angle to obtain a plurality of difference values; wherein the current offset angle is the difference between the actual electrical angle and the target electrical angle; As a module, if the minimum difference among the multiple differences is less than a preset threshold, the fixed offset angle corresponding to the minimum difference is used as the offset angle of the rotation angle sensor after the current power-on.
9. A readable storage medium, characterized in that: The readable storage medium stores executable program codes, and when the executable program codes are executed on the offset angle determination device, the offset angle determination device is enabled to execute the method according to any one of claims 1 to 7.
10. A vehicle, characterized in that: The vehicle comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the vehicle executes the method according to any one of claims 1 to 7.