Vehicle motor initial angle calculation method, device, equipment and medium
By recording and adjusting the motor rotation angle, using a binary search algorithm to determine the initial angle of the motor, the problems of inconvenience in operation, complex algorithm and high cost when calibration of the initial angle of the motor in the prior art are solved, and simple and efficient motor initial angle calibration is achieved .
Patent Information
- Application Number
- CN202411241948.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2025-01-03
AI Technical Summary
In vehicle motor control systems, the prior art is inconvenient to use when determining the initial angle of the motor, the algorithm is complex and the cost is high, resulting in increased system complexity.
By recording the initial motor rotation angle, the motor angle range is gradually adjusted based on the deviation of the motor magnetic field angle and rotation angle, and the motor angle is determined using a binary search algorithm to simplify operation and reduce calculation complexity.
It realizes simple initial motor angle calibration, improves calculation efficiency and reduces system costs, is easy to operate and has high calculation efficiency.
Smart Images

Figure CN119254075A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automobile technology, and in particular to a method, device, equipment and computer-readable storage medium for calculating the initial angle of a vehicle motor. Background Art
[0002] In the vehicle motor control system, the motor initial angle needs to be calibrated, and the vehicle speed and position are predicted based on the calibrated value. How to calibrate the motor initial angle quickly and accurately is becoming increasingly important.
[0003] In the related technology, open-loop dragging and position identification methods are mainly used to calibrate the initial angle of the motor. Among them, the open-loop dragging method usually gives a current of a fixed angle, so that the α axis coincides with the rotor position, and the position corresponding to the resolver is the initial angle of the motor; the position identification method is more common to determine the initial angle of the motor through high-frequency injection. Its working principle is to superimpose a voltage pulse on the motor output voltage at a certain time interval, and then calculate the voltage and current at the sampling time in a two-phase stationary coordinate system or a synchronous rotating coordinate system to estimate the rotor position and speed, so as to find the initial angle of the motor.
[0004] However, the open-loop dragging method requires a forklift to lift the vehicle so that the motor drive wheel is suspended in the air to give the motor a larger rotation space, and then find the initial angle of the motor through open-loop dragging, which is inconvenient to operate; the algorithm of the position identification method is relatively complicated, and the high-frequency injection method requires a large bandwidth of the current controller, which increases the complexity of the system and increases the cost. Summary of the invention
[0005] The present application provides a method, device, equipment and computer-readable storage medium for calculating the initial angle of a vehicle motor, which can solve the technical problems existing in the prior art when calibrating the initial angle of the motor, such as inconvenient operation, complex algorithm and high cost.
[0006] In a first aspect, an embodiment of the present application provides a method for calculating an initial angle of a vehicle motor, the method comprising:
[0007] After receiving the motor start command, the initial motor rotation angle is recorded to control the motor micro-motion;
[0008] Determine the kth motor running direction based on the rotation direction of the motor along the kth magnetic field angle;
[0009] Obtaining a k-th motor resolution angle, and determining an angle deviation of the k-th motor resolution angle based on the k-th motor resolution angle and an initial motor resolution angle;
[0010] Based on the kth motor running direction and the kth motor angle range, determine the k+1th motor angle range, where k is a positive integer, and the first magnetic field angle and the first motor angle range are both calibrated values;
[0011] Determine whether the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is greater than the range threshold;
[0012] If it is greater than the range threshold, then based on the left endpoint value, the right endpoint value of the k+1th motor angle range and the angle deviation of the kth motor rotation angle, determine the k+1th magnetic field angle, add 1 to the k value, trigger the motor start command, and return to the step of recording the initial motor rotation angle and controlling the motor micro-motion after receiving the motor start command;
[0013] If it is less than or equal to the range threshold, after adjusting the motor rotor position according to the kth magnetic field angle, the target motor rotation angle is obtained, and the first difference between the target motor rotation angle and the kth magnetic field angle is calculated, and the first difference is used as the motor initial angle.
[0014] In combination with the first aspect, in one implementation, determining the kth motor running direction based on the rotation direction of the motor along the kth magnetic field angle includes:
[0015] If the motor rotates in a clockwise direction along the kth magnetic field angle, the kth motor running direction is determined to be positive;
[0016] If the rotation direction of the motor along the k-th magnetic field angle is counterclockwise, it is determined that the k-th motor running direction is negative.
[0017] In combination with the first aspect, in one implementation, the k+1th motor angle range is determined based on the kth motor running direction and the kth motor angle range, and the corresponding formula is:
[0018] If the kth motor running direction is positive,
[0019]
[0020] If the kth motor running direction is negative,
[0021]
[0022] Among them, θ l (k) is the left endpoint of the kth motor angle range, θ r (k) is the right endpoint of the kth motor angle range, θ l (k+1) is the left endpoint of the k+1th motor angle range, θ r (k+1) is the right endpoint value of the k+1th motor angle range.
[0023] In combination with the first aspect, in one implementation, the k+1th magnetic field angle is determined based on the left endpoint value, the right endpoint value of the k+1th motor angle range and the angle deviation of the kth motor resolver angle, and the corresponding formula is:
[0024] θ t (k+1)=(θ l (k+1)+θ r (k+1)) / 2+θ d (k);
[0025] Among them, θ t (k+1) is the k+1th magnetic field angle, θ l (k+1) is the left endpoint of the k+1th motor angle range, θ r (k+1) is the right endpoint of the k+1th motor angle range, θ d (k) is the angle deviation of the kth motor resolver angle.
[0026] In combination with the first aspect, in one implementation, determining the angle deviation of the kth motor resolution angle based on the kth motor resolution angle and the initial motor resolution angle includes:
[0027] A second difference between the k-th motor resolution angle and the initial motor resolution angle is calculated, and the second difference is used as an angle deviation of the k-th motor resolution angle.
[0028] In a second aspect, an embodiment of the present application provides a vehicle motor initial angle calculation device, wherein the vehicle motor initial angle calculation device comprises:
[0029] The control module is used to record the initial motor rotation angle and control the motor micro-motion after receiving the motor start command;
[0030] A first determination module, used to determine the kth motor running direction based on the rotation direction of the motor along the kth magnetic field angle;
[0031] A second determination module is used to obtain a k-th motor resolution angle, and determine an angle deviation of the k-th motor resolution angle based on the k-th motor resolution angle and an initial motor resolution angle;
[0032] A third determination module is used to determine the k+1th motor angle range based on the kth motor running direction and the kth motor angle range, wherein k is a positive integer, and the first magnetic field angle and the first motor angle range are both calibration values;
[0033] A judgment module, used to judge whether the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is greater than a range threshold;
[0034] A return module is used to determine the k+1th magnetic field angle based on the left endpoint value, the right endpoint value of the k+1th motor angle range and the angle deviation of the kth motor rotation angle, if it is greater than the range threshold, add 1 to the k value, trigger the motor start command, and return to the step of recording the initial motor rotation angle and controlling the motor micro-motion after receiving the motor start command;
[0035] A calculation module is used to obtain a target motor rotation angle after adjusting the motor rotor position according to the kth magnetic field angle if it is less than or equal to the range threshold, and calculate a first difference between the target motor rotation angle and the kth magnetic field angle, and use the first difference as the motor initial angle.
[0036] In conjunction with the second aspect, in one implementation, the first determining module is specifically configured to:
[0037] If the motor rotates in a clockwise direction along the kth magnetic field angle, the kth motor running direction is determined to be positive;
[0038] If the rotation direction of the motor along the k-th magnetic field angle is counterclockwise, it is determined that the k-th motor running direction is negative.
[0039] In conjunction with the second aspect, in one implementation, the second determining module is specifically configured to:
[0040] A second difference between the k-th motor resolution angle and the initial motor resolution angle is calculated, and the second difference is used as an angle deviation of the k-th motor resolution angle.
[0041] In a third aspect, an embodiment of the present application provides a vehicle motor initial angle calculation device, wherein the vehicle motor initial angle calculation device comprises a processor, a memory, and a vehicle motor initial angle calculation program stored in the memory and executable by the processor, wherein when the vehicle motor initial angle calculation program is executed by the processor, the steps of the vehicle motor initial angle calculation method as described in any one of the first aspects are implemented.
[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a vehicle motor initial angle calculation program is stored. When the vehicle motor initial angle calculation program is executed by a processor, the steps of the vehicle motor initial angle calculation method as described in any one of the first aspects are implemented.
[0043] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:
[0044] After receiving the motor start command, the initial motor resolver angle is recorded to control the motor micro-motion; based on the rotation direction of the motor along the kth magnetic field angle, the kth motor running direction is determined; the kth motor resolver angle is obtained, and based on the kth motor resolver angle and the initial motor resolver angle, the angle deviation of the kth motor resolver angle is determined; based on the kth motor running direction and the kth motor angle range, the k+1th motor angle range is determined, wherein k is a positive integer, and the first magnetic field angle and the first motor angle range are both calibrated values; it is determined whether the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is greater than the range threshold; if it is greater than the range threshold, based on the The left endpoint value, the right endpoint value and the angle deviation of the k+1th motor angle range are used to determine the k+1th magnetic field angle, the k value is added by 1, the motor start command is triggered, and the process returns to the step of recording the initial motor rotation angle and controlling the motor micro-motion after receiving the motor start command; if it is less than or equal to the range threshold, then after adjusting the motor rotor position according to the kth magnetic field angle, the target motor rotation angle is obtained, and the first difference between the target motor rotation angle and the kth magnetic field angle is calculated, and the first difference is used as the motor initial angle. The present application only calculates the motor initial angle through simple calculation reasoning, which is easy to operate, and can also improve calculation efficiency and reduce costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a flow chart of a first embodiment of a method for calculating an initial angle of a motor of a vehicle of the present application;
[0046] Figure 2 This is a functional module diagram of an embodiment of a vehicle motor initial angle calculation device of the present application;
[0047] Figure 3 This is a schematic diagram of the hardware structure of the vehicle motor initial angle calculation device involved in the embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0049] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0050] In a first aspect, an embodiment of the present application provides a method for calculating an initial angle of a vehicle motor.
[0051] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for calculating the initial angle of the motor of a vehicle of the present application. Figure 1 As shown, the method for calculating the initial angle of the vehicle motor includes:
[0052] Step 110, after receiving the motor start command, record the initial motor rotation angle and control the motor micro-motion;
[0053] It can be understood that the vehicle control unit (VCU) sends a motor start command to the motor control unit (MCU), and controls the brakes according to the motor state feedback, thereby achieving motor micro-movement and reducing vehicle shaking.
[0054] In the specific implementation, the vehicle is parked on a smooth road and there are no obstacles in front and behind the vehicle. The motor start command is sent to the MCU through the VCU. After receiving the motor start command sent by the VCU to the MCU, the initial motor rotation angle is recorded first, and then the motor is controlled to move slightly. When the motor rotates, the running direction of the motor can be determined.
[0055] Step 120, determining the kth motor running direction based on the rotation direction of the motor along the kth magnetic field angle;
[0056] It can be understood that after a given magnetic field angle, the rotor in the motor will be attracted to the corresponding angular position. After the motor micro-moves, the rotor begins to rotate. Among them, the rotation direction of the motor along the kth magnetic field angle is clockwise or counterclockwise. After determining the rotation direction, the kth motor running direction can be determined according to the rotation direction. Among them, k takes a positive integer, the first magnetic field angle and the first motor angle range are both calibrated values; illustratively, the first magnetic field angle can be set to 0° and the first motor angle range is set to (0°, 360°). Determine the kth motor running direction in preparation for determining the k+1th motor angle range. After determining the kth motor running direction, stop the motor, and if the motor movement exceeds the motor angle range during the control of the motor micro-movement, stop the motor immediately.
[0057] Further, in one embodiment, determining the kth motor running direction based on the rotation direction of the motor along the kth magnetic field angle includes:
[0058] If the motor rotates in a clockwise direction along the kth magnetic field angle, the kth motor running direction is determined to be positive;
[0059] If the rotation direction of the motor along the k-th magnetic field angle is counterclockwise, it is determined that the k-th motor running direction is negative.
[0060] Step 130, obtaining the k-th motor resolution angle, and determining the angle deviation of the k-th motor resolution angle based on the k-th motor resolution angle and the initial motor resolution angle;
[0061] It can be understood that after the motor is controlled to slightly move, the motor will automatically stop rotating. After the motor stops rotating, the k-th motor rotation angle is obtained through the rotation sensor. Then, combined with the initial motor rotation angle recorded after each motor start command is received, the second difference between the k-th motor rotation angle and the initial motor rotation angle is calculated, and the second difference is used as the angle deviation of the k-th motor rotation angle. The angle deviation of the k-th motor rotation angle is determined to prepare for determining the k+1-th magnetic field angle.
[0062] Step 140, determining the k+1th motor angle range based on the kth motor running direction and the kth motor angle range;
[0063] In specific implementation, based on the kth motor running direction and the kth motor angle range, a binary search algorithm is used to determine the k+1th motor angle range to gradually narrow the motor angle range.
[0064] Exemplarily, if the kth motor running direction is positive, the k+1th motor angle range is determined to be the range formed by the left endpoint value and the midpoint value of the kth motor angle range; if the kth motor running direction is negative, the k+1th motor angle range is determined to be the range formed by the midpoint value and the right endpoint value of the kth motor angle range.
[0065] Further, in one embodiment, the k+1th motor angle range is determined based on the kth motor running direction and the kth motor angle range, and the corresponding formula is:
[0066] If the kth motor running direction is positive,
[0067]
[0068] If the kth motor running direction is negative,
[0069]
[0070] Among them, θ l (k) is the left endpoint of the kth motor angle range, θ r (k) is the right endpoint of the kth motor angle range, θ l (k+1) is the left endpoint of the k+1th motor angle range, θ r(k+1) is the right endpoint value of the k+1th motor angle range. Through the above formula, the k+1th motor angle range can be quickly determined, which can improve the efficiency of calculating the initial angle of the motor.
[0071] Step 150, determining whether the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is greater than the range threshold;
[0072] Further, it is determined whether the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is greater than the range threshold, so as to determine whether the kth magnetic field angle and the kth motor rotation angle are close to coincidence.
[0073] Exemplarily, the range threshold is 2°. If the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is less than or equal to 2°, it can be determined that the kth magnetic field angle and the kth motor resolver angle are almost identical. After adjusting the motor rotor position according to the kth magnetic field angle, the motor hardly moves. At this time, the value read from the resolver sensor is the initial angle of the motor.
[0074] Step 160: If it is greater than the range threshold, then based on the left endpoint value, the right endpoint value of the k+1th motor angle range and the angle deviation of the kth motor resolver angle, determine the k+1th magnetic field angle, add 1 to the k value, trigger the motor start command, and return to the step of recording the initial motor resolver angle and controlling the motor micro-motion after receiving the motor start command;
[0075] If it is greater than the range threshold, it indicates that the kth magnetic field angle and the kth motor rotation angle cannot coincide with each other, and the k+1th magnetic field angle needs to be determined. After determining the k+1th magnetic field angle, the k value is increased by 1, and at the same time, the VCU is triggered to send a motor start instruction to the MCU, and the process returns to step 110.
[0076] Further, in one embodiment, the k+1th magnetic field angle is determined based on the left endpoint value, the right endpoint value of the k+1th motor angle range and the angle deviation of the kth motor resolver angle, and the corresponding formula is:
[0077] θ t (k+1)=(θ l (k+1)+θ r (k+1)) / 2+θ d (k);
[0078] Among them, θ t (k+1) is the k+1th magnetic field angle, θ l (k+1) is the left endpoint of the k+1th motor angle range, θ r (k+1) is the right endpoint of the k+1th motor angle range, θ d(k) is the angle deviation of the kth motor rotation angle. Through the above formula, the k+1th magnetic field angle can be quickly determined, which can improve the efficiency of calculating the initial angle of the motor.
[0079] Step 170: If it is less than or equal to the range threshold, after adjusting the motor rotor position according to the kth magnetic field angle, obtain the target motor rotation angle, and calculate the first difference between the target motor rotation angle and the kth magnetic field angle, and use the first difference as the motor initial angle.
[0080] If it is less than or equal to the range threshold, it indicates that the k-th magnetic field angle and the k-th motor resolver angle are close to coincidence, and the cycle stops. The motor rotor position is adjusted according to the k-th magnetic field angle, that is, the rotor is pulled to the value corresponding to the k-th magnetic field angle, and then the target motor resolver angle is obtained through the resolver sensor. Furthermore, the first difference between the target motor resolver angle and the k-th magnetic field angle is calculated, and the first difference is used as the motor initial angle.
[0081] The present application gradually determines the initial angle of the motor by multiple cycles of reasoning. Taking the initial angle of the motor as 24° as an example, Table 1 is a calculation table of the initial angle of the motor provided in an embodiment of the present application.
[0082] Table 1 Motor initial angle calculation table
[0083] Inference times Motor angle range Magnetic field angle Motor running direction Angle deviation 1 0~360 0 just θd1 2 0~180 90+θd1 just θd2 3 0~90 45+θd2 just θd3 4 0~45 23+θd3 burden θd4 5 23~45 34+θd4 just θd5 6 23~34 29+θd5 just θd6 7 23~29 26+θd6 just θd7 8 23~26 25+θd7 just θd8 9 23~25 - No movement
[0084] As shown in Table 1, k = 1, assuming that the first magnetic field angle θ t (1) can be set to 0° and the first motor angle range is set to (0°, 360°). The rotation direction of the motor along the first magnetic field angle is clockwise, and the first motor running direction is determined to be positive. Based on the first motor running direction and the first motor angle range, the left and right endpoints of the second motor angle range are determined using the above formula for determining the motor angle range. l (2) = θ l (1) = 0°, θ r (2) = θ l (1)+360° / 2 1 =180°; judge θ r (2)-θ l (2) = 180°, assuming that the range threshold is 2°, 180°> 2°, then based on the left endpoint value and the right endpoint value of the second motor angle range and the angle deviation θd1 of the first motor resolver angle, the second magnetic field angle is determined using the above formula for determining the magnetic field angle, θ t (2) = (θ l (2)+θ r(2)) / 2+θd1=(0°+180°) / 2+θd1=90°+θd1, then add 1 to the k value, k=2, trigger the motor start command, and return to step 110;
[0085] Next, k = 2, the second magnetic field angle θ t (2) can be set to 90°+θd1 and the second motor angle range is set to (0°, 180°), the motor rotates in the clockwise direction along the second magnetic field angle, and the second motor running direction is determined to be positive; based on the second motor running direction and the second motor angle range, the left and right endpoints of the third motor angle range are determined using the above formula for determining the motor angle range, θ l (3) = θ l (2) = 0°, θ r (3) = θ l (2)+360° / 2 2 =0°+90°=90°; judge θ r (3)-θ l (3)=90°, 90°>2°, then based on the left endpoint value and the right endpoint value of the third motor angle range and the angle deviation θd2 of the second motor resolver angle, the third magnetic field angle is determined using the above formula for determining the magnetic field angle, θ t (3) = (θ l (3)+θ r (3)) / 2+θd2=(0°+90°) / 2+θd2=45°+θd2, then add 1 to the k value, k=3, trigger the motor start command, and return to step 110;
[0086] Next, k=3, the third magnetic field angle θ t (3) can be set to 45°+θd2 and the third motor angle range is set to (0°, 90°), the rotation direction of the motor along the third magnetic field angle is clockwise, and the third motor running direction is determined to be positive; based on the third motor running direction and the third motor angle range, the left and right endpoints of the fourth motor angle range are determined using the above formula for determining the motor angle range, θ l (4) = θ l (3) = 0°, θ r (4) = θ l (3)+360° / 2 3 =0°+45°=45°; judge θ r (4)-θ l(4)=45°, 45°>2°, then based on the left endpoint value and the right endpoint value of the fourth motor angle range and the angle deviation θd3 of the third motor resolver angle, the fourth magnetic field angle is determined using the above formula for determining the magnetic field angle, θ t (4) = (θ l (4)+θ r (4)) / 2+θd3=(0°+45°) / 2+θd3=23°+θd3, then add 1 to the k value, k=4, trigger the motor start command, and return to step 110;
[0087] Next, k=4, the fourth magnetic field angle θ t (4) can be set to 23°+θd3 and the 4th motor angle range is set to (0°, 45°), the motor rotates in the counterclockwise direction along the 4th magnetic field angle, and the 4th motor running direction is determined to be negative; based on the 4th motor running direction and the 4th motor angle range, the left and right endpoints of the 5th motor angle range are determined using the above formula for determining the motor angle range, θ l (5) = θ l (4)+360° / 2 4 =0°+23°=23°, θ r (5) = θ l (4) = 45°; determine θ r (5)-θ l (5) = 45° - 23° = 22°, 22° > 2°, then based on the left endpoint value and the right endpoint value of the fifth motor angle range and the angle deviation θd4 of the fourth motor resolver angle, the fifth magnetic field angle is determined using the above formula for determining the magnetic field angle, θ t (5) = (θ l (5)+θ r (5)) / 2+θd4=(23°+45°) / 2+θd4=34°+θd4, then add 1 to the k value, k=5, trigger the motor start command, and return to step 110;
[0088] This cycle continues until the 8th magnetic field angle θ is determined. t (8) is 25°+θd7, the 8th motor angle range is set to (23°, 26°), the 9th motor angle range is set to (23°, 25°), and θ is determined. r (9)-θ l(9) = 25°-23° = 2°, 2°≤2°, stop the loop. Adjust the motor rotor position according to the 8th magnetic field angle, that is, pull the rotor to the value corresponding to the 8th magnetic field angle, and then obtain the target motor rotation angle through the rotation sensor. Further, calculate the first difference between the target motor rotation angle and the 8th magnetic field angle, and use the first difference as the motor initial angle.
[0089] As can be seen from Table 1, 0°-360° is continuously divided into two parts to narrow the motor angle range. The number of repeated searches will not exceed 9 times. When the motor moves too much during the search process, the vehicle will brake. The operation is simple and the calculation and reasoning process is simple. It is not only low in cost, but also has a high efficiency in calculating the initial angle of the motor.
[0090] In this embodiment, after receiving the motor start command, the initial motor rotation angle is recorded to control the motor micro-motion; based on the rotation direction of the motor along the kth magnetic field angle, the kth motor running direction is determined; the kth motor rotation angle is obtained, and based on the kth motor rotation angle and the initial motor rotation angle, the angle deviation of the kth motor rotation angle is determined; based on the kth motor running direction and the kth motor angle range, the k+1th motor angle range is determined, where k is a positive integer, and the first magnetic field angle and the first motor angle range are both calibrated values; it is determined whether the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is greater than the range threshold; if it is greater than the range threshold, then based on The k+1th magnetic field angle is determined based on the left endpoint value, the right endpoint value and the angle deviation of the kth motor rotation angle of the k+1th motor angle range, the k value is added by 1, the motor start command is triggered, and the process returns to the step of recording the initial motor rotation angle and controlling the motor micro-motion after receiving the motor start command; if it is less than or equal to the range threshold, then after adjusting the motor rotor position according to the kth magnetic field angle, the target motor rotation angle is obtained, and the first difference between the target motor rotation angle and the kth magnetic field angle is calculated, and the first difference is used as the motor initial angle. The present application only calculates the motor initial angle through simple calculation reasoning, which is easy to operate, and can also improve calculation efficiency and reduce costs.
[0091] In a second aspect, an embodiment of the present application also provides a device for calculating the initial angle of a vehicle motor.
[0092] In one embodiment, referring to Figure 2 , Figure 2 This is a functional module diagram of an embodiment of a vehicle motor initial angle calculation device of the present application. Figure 2 As shown, the vehicle motor initial angle calculation device 200 includes:
[0093] The control module 210 is used to record the initial motor rotation angle and control the motor micro-motion after receiving the motor start command;
[0094] A first determination module 220, configured to determine a k-th motor running direction based on a rotation direction of the motor along a k-th magnetic field angle;
[0095] A second determination module 230 is used to obtain a k-th motor resolution angle, and determine an angle deviation of the k-th motor resolution angle based on the k-th motor resolution angle and an initial motor resolution angle;
[0096] A third determination module 240 is used to determine the k+1th motor angle range based on the kth motor running direction and the kth motor angle range, wherein k is a positive integer, and the first magnetic field angle and the first motor angle range are both calibration values;
[0097] A judging module 250 is used to judge whether the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is greater than a range threshold;
[0098] Return module 260, for determining the k+1th magnetic field angle based on the left endpoint value, the right endpoint value of the k+1th motor angle range and the angle deviation of the kth motor resolver angle, if it is greater than the range threshold, adding 1 to the k value, triggering the motor start command, and returning to the step of recording the initial motor resolver angle and controlling the motor micro-motion after receiving the motor start command;
[0099] The calculation module 270 is used to obtain the target motor rotation angle after adjusting the motor rotor position according to the kth magnetic field angle if it is less than or equal to the range threshold, and calculate the first difference between the target motor rotation angle and the kth magnetic field angle, and use the first difference as the motor initial angle.
[0100] Further, in one embodiment, the first determining module is specifically configured to:
[0101] If the motor rotates in a clockwise direction along the kth magnetic field angle, the kth motor running direction is determined to be positive;
[0102] If the rotation direction of the motor along the k-th magnetic field angle is counterclockwise, it is determined that the k-th motor running direction is negative.
[0103] Further, in one embodiment, the second determining module is specifically configured to:
[0104] A second difference between the k-th motor resolution angle and the initial motor resolution angle is calculated, and the second difference is used as an angle deviation of the k-th motor resolution angle.
[0105] Furthermore, in one embodiment, the third determining module is specifically configured to:
[0106] If the kth motor running direction is positive,
[0107]
[0108] If the kth motor running direction is negative,
[0109]
[0110] Among them, θ l (k) is the left endpoint of the kth motor angle range, θ r (k) is the right endpoint of the kth motor angle range, θ l (k+1) is the left endpoint of the k+1th motor angle range, θ r (k+1) is the right endpoint value of the k+1th motor angle range.
[0111] Furthermore, in one embodiment, the return module is specifically used to determine the k+1th magnetic field angle according to the following formula:
[0112] θ t (k+1)=(θ l (k+1)+θ r (k+1)) / 2+θ d (k);
[0113] Among them, θ t (k+1) is the k+1th magnetic field angle, θ l (k+1) is the left endpoint of the k+1th motor angle range, θ r (k+1) is the right endpoint of the k+1th motor angle range, θ d (k) is the angle deviation of the kth motor resolver angle.
[0114] Among them, the functional implementation of each module in the above-mentioned vehicle motor initial angle calculation device corresponds to the various steps in the above-mentioned vehicle motor initial angle calculation method embodiment, and its functions and implementation processes are no longer repeated here one by one.
[0115] In a third aspect, an embodiment of the present application provides a vehicle motor initial angle calculation device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.
[0116] Reference Figure 3 , Figure 3 The hardware structure diagram of the vehicle motor initial angle calculation device involved in the embodiment of the present application is shown in FIG. In the embodiment of the present application, the vehicle motor initial angle calculation device may include a processor, a memory, a communication interface, and a communication bus.
[0117] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.
[0118] The communication interface includes an input / output (I / O) interface, a physical interface, and a logical interface, etc., which are used to interconnect the devices inside the vehicle motor initial angle calculation device, and an interface used to interconnect the vehicle motor initial angle calculation device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, an optical fiber interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.
[0119] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0120] The processor may be a general-purpose processor, and the general-purpose processor may call the vehicle motor initial angle calculation program stored in the memory and execute the vehicle motor initial angle calculation method provided in the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the vehicle motor initial angle calculation program is called may refer to the various embodiments of the vehicle motor initial angle calculation method of the present application, and will not be repeated here.
[0121] Those skilled in the art will understand that Figure 3 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0122] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.
[0123] The computer-readable storage medium of the present application stores a vehicle motor initial angle calculation program, wherein when the vehicle motor initial angle calculation program is executed by a processor, the steps of the vehicle motor initial angle calculation method as described above are implemented.
[0124] Among them, the method implemented when the vehicle motor initial angle calculation program is executed can refer to the various embodiments of the vehicle motor initial angle calculation method of the present application, and will not be repeated here.
[0125] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0126] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.
[0127] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.
[0128] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, 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” refers to two or more than two.
[0129] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.
[0130] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.
[0131] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for calculating the initial angle of a vehicle motor, characterized in that: The vehicle motor initial angle calculation method comprises: After receiving the motor start command, the initial motor rotation angle is recorded to control the motor micro-motion; Determine the kth motor running direction based on the rotation direction of the motor along the kth magnetic field angle; Obtaining a k-th motor resolution angle, and determining an angle deviation of the k-th motor resolution angle based on the k-th motor resolution angle and an initial motor resolution angle; Based on the kth motor running direction and the kth motor angle range, determine the k+1th motor angle range, where k is a positive integer, and the first magnetic field angle and the first motor angle range are both calibrated values; Determine whether the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is greater than the range threshold; If it is greater than the range threshold, then based on the left endpoint value, the right endpoint value of the k+1th motor angle range and the angle deviation of the kth motor rotation angle, determine the k+1th magnetic field angle, add 1 to the k value, trigger the motor start command, and return to the step of recording the initial motor rotation angle and controlling the motor micro-motion after receiving the motor start command; If it is less than or equal to the range threshold, after adjusting the motor rotor position according to the kth magnetic field angle, the target motor rotation angle is obtained, and the first difference between the target motor rotation angle and the kth magnetic field angle is calculated, and the first difference is used as the motor initial angle.
2. The method for calculating the initial angle of a vehicle motor according to claim 1, characterized in that: The step of determining the kth motor running direction based on the rotation direction of the motor along the kth magnetic field angle comprises: If the motor rotates in a clockwise direction along the kth magnetic field angle, the kth motor running direction is determined to be positive; If the rotation direction of the motor along the k-th magnetic field angle is counterclockwise, it is determined that the k-th motor running direction is negative.
3. The method for calculating the initial angle of a vehicle motor according to claim 2, characterized in that: The k+1th motor angle range is determined based on the kth motor running direction and the kth motor angle range, and the corresponding formula is: If the kth motor running direction is positive, If the kth motor running direction is negative, Among them, θ l (k) is the left endpoint of the kth motor angle range, θ r (k) is the right endpoint of the kth motor angle range, θ l (k+1) is the left endpoint of the k+1th motor angle range, θ r (k+1) is the right endpoint value of the k+1th motor angle range.
4. The method for calculating the initial angle of a vehicle motor according to claim 1, characterized in that: The k+1th magnetic field angle is determined based on the left endpoint value, the right endpoint value of the k+1th motor angle range and the angle deviation of the kth motor resolver angle, and the corresponding formula is: i t (k+1)=(θ l (k+1)+θ r (k+1)) / 2+θ d (k); Among them, θ t (k+1) is the k+1th magnetic field angle, θ l (k+1) is the left endpoint of the k+1th motor angle range, θ r (k+1) is the right endpoint of the k+1th motor angle range, θ d (k) is the angle deviation of the kth motor resolver angle.
5. The method for calculating the initial angle of a vehicle motor according to claim 1, characterized in that: The method of determining the angle deviation of the kth motor resolution angle based on the kth motor resolution angle and the initial motor resolution angle includes: A second difference between the k-th motor resolution angle and the initial motor resolution angle is calculated, and the second difference is used as an angle deviation of the k-th motor resolution angle.
6. A vehicle motor initial angle calculation device, characterized in that: The vehicle motor initial angle calculation device comprises: The control module is used to record the initial motor rotation angle and control the motor micro-motion after receiving the motor start command; A first determination module, used to determine the kth motor running direction based on the rotation direction of the motor along the kth magnetic field angle; A second determination module is used to obtain a k-th motor resolution angle, and determine an angle deviation of the k-th motor resolution angle based on the k-th motor resolution angle and an initial motor resolution angle; A third determination module is used to determine the k+1th motor angle range based on the kth motor running direction and the kth motor angle range, wherein k is a positive integer, and the first magnetic field angle and the first motor angle range are both calibration values; A judgment module, used to judge whether the difference between the left endpoint value and the right endpoint value of the k+1th motor angle range is greater than a range threshold; A return module is used to determine the k+1th magnetic field angle based on the left endpoint value, the right endpoint value of the k+1th motor angle range and the angle deviation of the kth motor rotation angle, if it is greater than the range threshold, add 1 to the k value, trigger the motor start command, and return to the step of recording the initial motor rotation angle and controlling the motor micro-motion after receiving the motor start command; A calculation module is used to obtain a target motor rotation angle after adjusting the motor rotor position according to the kth magnetic field angle if it is less than or equal to the range threshold, and calculate a first difference between the target motor rotation angle and the kth magnetic field angle, and use the first difference as the motor initial angle.
7. The vehicle motor initial angle calculation device according to claim 6, characterized in that: The first determining module is specifically used for: If the motor rotates in a clockwise direction along the kth magnetic field angle, the kth motor running direction is determined to be positive; If the rotation direction of the motor along the k-th magnetic field angle is counterclockwise, it is determined that the k-th motor running direction is negative.
8. The vehicle motor initial angle calculation device according to claim 6, characterized in that: The second determining module is specifically used for: A second difference between the k-th motor resolution angle and the initial motor resolution angle is calculated, and the second difference is used as an angle deviation of the k-th motor resolution angle.
9. A vehicle motor initial angle calculation device, characterized in that: The vehicle motor initial angle calculation device includes a processor, a memory, and a vehicle motor initial angle calculation program stored in the memory and executable by the processor, wherein when the vehicle motor initial angle calculation program is executed by the processor, the steps of the vehicle motor initial angle calculation method as described in any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a vehicle motor initial angle calculation program, wherein when the vehicle motor initial angle calculation program is executed by a processor, the steps of the vehicle motor initial angle calculation method according to any one of claims 1 to 5 are implemented.
