Motor angle detection method and device and electric power steering equipment
By identifying the peak positions of the sine and cosine signals output by the rotary transformer and performing error compensation, the problem of inaccurate motor angle calculation in the EPS system was solved, improving the accuracy of the motor angle and the control accuracy of the EPS system, and reducing motor speed fluctuations.
Patent Information
- Application Number
- CN202511219275.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-28
- Publication Date
- 2025-10-17
AI Technical Summary
In existing EPS systems, the sine and cosine signals output by the rotary transformer often have inconsistent amplitudes and are not ideally orthogonal, resulting in amplitude and phase errors, which affect the accuracy of motor angle calculation and the control precision of the EPS system.
By identifying the peak position of the sine and cosine signals output by the resolver, the amplitude error and phase error are calculated, and a second-order phase-locked loop tracker is used to compensate for the error, thereby improving the calculation accuracy of the motor angle.
Without requiring additional circuitry or calibration, it can calculate error compensation parameters for different devices, improving the accuracy of motor angle calculation and EPS system control, and reducing motor speed fluctuations.
Smart Images

Figure CN120792947A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of automobile braking technology, and particularly relates to a motor angle detection method and device and an electric power steering device. BACKGROUND
[0002] Electric power steering (EPS) is a kind of automobile steering system, which provides auxiliary power through a motor to help the driver more easily control the vehicle steering. Compared with the traditional hydraulic power steering (HPS), it has the advantages of energy saving, fast response, high integration, etc., and has been widely used in modern vehicles. EPS system plays an increasingly important role in emergency obstacle avoidance, lane keeping and other driving assistance functions, therefore, higher requirements are put forward for the control accuracy and response speed of the EPS system. SUMMARY
[0003] The motor angle detection method and device and the electric power steering device provided by the embodiments of the present application can improve the accuracy of the motor angle, thereby improving the control accuracy of the EPS system.
[0004] The technical solution of the present application is implemented as follows:
[0005] In a first aspect, the embodiments of the present application provide a motor angle detection method, which comprises:
[0006] obtaining a sine signal and a cosine signal of the motor angle through a resolver;
[0007] performing peak recognition on the sine signal and the cosine signal to determine two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal within the same time range;
[0008] calculating an amplitude error and a phase error according to the two adjacent peak positions on the sine signal and the two adjacent peak positions on the cosine signal; performing compensation calculation according to the amplitude error and the phase error to obtain a compensation value;
[0009] determining the motor angle according to the sine signal, the cosine signal and the compensation value.
[0010] In one of the embodiments, the peak recognition on the sine signal and the cosine signal to determine the two adjacent peak positions on the sine signal and the two adjacent peak positions on the cosine signal within the same time range comprises:
[0011] cutting a target signal segment from the sine signal and the cosine signal, the target signal segment including at least one complete period of the sine signal and the cosine signal;
[0012] The two adjacent peak positions on the sinusoidal signal and the two adjacent peak positions on the cosine signal are identified by using a multi-scale peak detection algorithm.
[0013] In one of the embodiments, the two adjacent peak positions on the sinusoidal signal include a first peak position and a second peak position, and the two adjacent peak positions on the cosine signal include a third peak position and a fourth peak position, and before the amplitude error and the phase error are calculated according to the two adjacent peak positions on the sinusoidal signal and the two adjacent peak positions on the cosine signal, the method further comprises:
[0014] A first difference value is obtained by calculating a difference between a time coordinate of the first peak position and a time coordinate of the third peak position, and a validity of the first peak position and the third peak position is determined according to the first difference value;
[0015] A second difference value is obtained by calculating a difference between a time coordinate of the second peak position and a time coordinate of the fourth peak position, and a validity of the second peak position and the fourth peak position is determined according to the second difference value.
[0016] In one of the embodiments, the amplitude error is calculated according to the two adjacent peak positions on the sinusoidal signal and the two adjacent peak positions on the cosine signal, comprising:
[0017] A first ratio value is obtained by calculating a ratio between an amplitude coordinate of the third peak position and an amplitude coordinate of the first peak position;
[0018] A second ratio value is obtained by calculating a ratio between an amplitude coordinate of the fourth peak position and an amplitude coordinate of the second peak position;
[0019] The amplitude error is determined according to the first ratio value and the second ratio value.
[0020] In one of the embodiments, the phase error is calculated according to the two adjacent peak positions on the sinusoidal signal and the two adjacent peak positions on the cosine signal, comprising:
[0021] A sine duration is determined according to a difference between a time coordinate of the second peak position and a time coordinate of the first peak position;
[0022] A cosine duration is determined according to a difference between a time coordinate of the fourth peak position and a time coordinate of the third peak position;
[0023] The phase error is determined according to a ratio between the first difference value and the sine duration and a ratio between the second difference value and the cosine duration.
[0024] In one of the embodiments, a compensation value is calculated according to the amplitude error and the phase error, comprising:
[0025] A tracking angle output by a second-order phase-locked loop tracker is obtained;
[0026] The tracking angle, the amplitude error and the phase error are input into the compensation model to obtain a compensation value output by the compensation model.
[0027] In one of the embodiments, the motor angle is determined according to the sine signal, the cosine signal and the compensation value, including:
[0028] The sine signal, the cosine signal and the compensation value are input into a second-order phase-locked loop tracker to obtain a motor angle output by the second-order phase-locked loop tracker.
[0029] In one of the embodiments, the sine signal and the cosine signal are subjected to peak identification, including:
[0030] The motor speed is detected.
[0031] The sine signal and the cosine signal are subjected to peak identification in a case where the motor speed reaches a preset speed range.
[0032] In a second aspect, the embodiments of the present application provide a motor angle detection device, which includes:
[0033] A collection unit is configured to acquire a sine signal and a cosine signal of a motor angle through a resolver.
[0034] A peak identification unit is configured to identify peaks of the sine signal and the cosine signal, and determine two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal in a same time range.
[0035] A compensation calculation unit is configured to calculate an amplitude error and a phase error according to the two adjacent peak positions on the sine signal and the two adjacent peak positions on the cosine signal, and perform compensation calculation according to the amplitude error and the phase error to obtain a compensation value.
[0036] An angle determination unit is configured to determine a motor angle according to the sine signal, the cosine signal and the compensation value.
[0037] In a third aspect, the embodiments of the present application provide an electric power steering device, which includes a processor and a memory. The memory is configured to store a computer program capable of running on the processor, and the processor is configured to execute steps of the motor angle detection method according to any one of the above first aspect when the computer program is running.
[0038] The beneficial effects of the embodiments of the present application include:
[0039] (1) The embodiment of the present application takes the sine and cosine signals output by the resolver as the reference, identifies the peak positions of the sine and cosine signals, calculates the amplitude error and phase error of the sine and cosine signals according to the peak positions, and then compensates the second harmonic brought by the amplitude error and phase error of the resolver in the angle calculation. This scheme does not require additional circuits and calibration work, can calculate the corresponding error compensation parameters according to the conditions of different devices, and improves the universality. In addition, compared with the conventional scheme, the motor angle detection method provided by the embodiment of the present application improves the calculation accuracy of the motor angle, and also reduces the motor speed fluctuation after error compensation.
[0040] (2) The motor angle detection method provided by the embodiment of the present application can make the EPS system obtain better control accuracy and response speed by providing a simple angle detection method, and can be applied to various EPS systems, steer-by-wire (SBW) and other scenes.
[0041] It should be understood that the above general description and the following detailed description are only illustrative and explanatory, but not limiting the technical solutions of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0042] Figure 1 is a flowchart of a motor angle detection method provided by the embodiment of the present application;
[0043] Figure 2 is a schematic diagram of an exemplary sine signal and cosine signal provided by the embodiment of the present application;
[0044] Figure 3 is a calculation principle block diagram corresponding to an exemplary compensation detection method provided by the embodiment of the present application;
[0045] Figure 4 is a principle block diagram of an exemplary motor angle detection method provided by the embodiment of the present application;
[0046] Fig. 5(a) is a schematic diagram of an exemplary actual motor angle provided by the embodiment of the present application;
[0047] Fig. 5(b) is a schematic diagram of an exemplary motor angle calculated by using the arctangent method provided by the embodiment of the present application;
[0048] Fig. 5(c) is a schematic diagram of an exemplary motor angle calculated by using the second-order phase-locked loop angle tracker provided by the embodiment of the present application;
[0049] Fig. 5(d) is a schematic diagram of an exemplary motor angle calculated by using the motor angle detection method provided by the embodiment of the present application;
[0050] Figure 6is an exemplary comparison diagram of the motor speed, the arctangent, and the second-order phase-locked loop angle tracker provided by the Simulink modeling of an embodiment of the present application;
[0051] Figure 7 is a flow diagram of an exemplary motor angle detection method provided by an embodiment of the present application;
[0052] Figure 8 is a block diagram of an exemplary motor angle detection method provided by an embodiment of the present application;
[0053] Figure 9 is a logic block diagram of a motor angle detection device provided by an embodiment of the present application;
[0054] Figure 10 is a hardware structure diagram of an electric power steering device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to enable a more detailed understanding of the features and technical content of the embodiments of the present application, the implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings, which are only used for reference and are not intended to limit the embodiments of the present application.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terminology used in the specification is for the purpose of describing the embodiments of the present application only and is not intended to be limiting of the present application.
[0057] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0058] It should also be noted that the terms "first", "second", "third" used in the embodiments of the present application are only used to distinguish similar objects, and do not represent a specific order of the objects. It can be understood that "first", "second", "third" can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0059] In addition, the reference to "embodiments" in this document means that the specific features, structures or characteristics described in conjunction with the embodiments can be included in at least one embodiment of the present application. The phrase appears at various places in the specification does not necessarily all refer to the same embodiment, nor is it necessarily independent or alternative embodiments to other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0060] With the development of intelligent driving technology, people's requirements for driving assistance functions are getting higher and higher. EPS system is a kind of automobile steering system, which provides auxiliary power through motor to help the driver more easily control the vehicle steering. Compared with the traditional HPS system, it has the advantages of energy saving, fast response, high integration, etc., and has been widely used in modern cars. EPS system plays an increasingly important role in emergency obstacle avoidance, lane keeping and other driving assistance functions, and at the same time puts forward higher requirements on the control accuracy and response speed of EPS system.
[0061] At present, the control of EPS system on motor is usually to adopt vector control (Field-Oriented Control, FOC), and the motor angle (i.e. rotor position angle) is the key signal required by vector control, and the accuracy of motor angle directly affects the control accuracy of EPS system.
[0062] Among them, in one implementation scheme, the motor in the EPS system usually includes a high-precision rotary transformer, which usually uses a tracking rotary transformer-digital signal converter to calculate the sine and cosine signals of the angle position information, and then uses a soft decoding algorithm to calculate the angle of the motor rotor. Among them, the tracking rotary transformer-digital signal converter calculation means that it is based on the assumption that the sine and cosine signals output by the rotary transformer have equal amplitude and orthogonal envelope.
[0063] However, in actual application, affected by various factors such as machining error, assembly error and magnetic field distortion, the sine and cosine signals output by the rotary transformer often have inconsistent amplitudes and non-ideal orthogonal conditions, which leads to secondary harmonic errors such as amplitude error and phase error.
[0064] In addition, in the process of calculating the angle of the motor rotor using the soft decoding algorithm, the arctangent is the most common soft decoding algorithm, as shown in formula (1), that is, the sine value sinθ and the cosine value cosθ output are calculated by arctangent to obtain the angle:
[0065]
[0066] However, this method of calculating the angle of the motor rotor has the disadvantages of poor noise resistance, large static fluctuation, high resource occupation, and the need to use angle difference to calculate the motor speed separately.
[0067] In order to solve the above technical problems, an embodiment of the present application provides a motor angle detection method, which uses the sine and cosine signals output by the rotary transformer as a reference, identifies the peak position of the sine and cosine signals, calculates the amplitude error and phase error of the sine and cosine signals according to the peak position, and then compensates for the second harmonic caused by the amplitude error and phase error of the rotary transformer in the angle calculation. This solution does not require additional circuits and calibration work, and can calculate corresponding error compensation parameters according to the conditions of different devices, thereby improving versatility. In addition, compared with conventional solutions, the motor angle detection method provided in the embodiment of the present application improves the calculation accuracy of the motor angle, and at the same time, the motor speed fluctuation is reduced after error compensation.
[0068] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0069] It can be understood that the execution entity of each step in the motor angle detection method provided in the embodiment of the present application can be a processor with data processing function, or an electronic device containing the processor with data processing function, such as an electric power steering device equipped with an EPS system, a vehicle-mounted control system, etc.
[0070] Please refer to Figure 1 , Figure 1 This is a flow chart of a motor angle detection method provided by an embodiment of the present application. Figure 1 As shown, the method may include the following steps 101 to 105:
[0071] Step 101: Obtain the sine signal and cosine signal of the motor angle through a rotary transformer.
[0072] In an embodiment of the present application, a rotary transformer is an angular displacement sensor based on the principle of electromagnetic induction. Through the electromagnetic coupling of the stator and rotor windings, the mechanical angle is converted into an electrical signal proportional to the sine and cosine functions. For example, the rotary transformer is composed of a stator and a rotor. When the rotary transformer is powered, the stator winding receives the excitation voltage (usually an alternating current of 400Hz-5kHz) as the primary side, and the rotor winding generates an output voltage through electromagnetic induction as the secondary side. Since the secondary winding is mechanically displaced by 90 degrees, the two sinusoidal signals output by the secondary winding differ in phase by 90 degrees from each other. When the rotor rotates, the relative position of the stator and rotor windings changes, causing the coupling coefficient to change periodically according to the angle, and the amplitude of the output electrical signal is a sine or cosine function relationship with the angle.
[0073] In the embodiment of the present application, the sine signal and the cosine signal of the motor angle can be obtained by collecting the electrical signal output by the resolver. Please refer to Figure 2 , Figure 2 is an exemplary schematic diagram of the sine signal and the cosine signal provided by the embodiment of the present application, in which the horizontal axis (X axis) represents time and the vertical axis (Y axis) represents signal amplitude. Figure 2 The sine signal and the cosine signal in the embodiment are only exemplary and the actual sine signal and the cosine signal are larger than the range shown in Figure 2 .
[0074] In step 102, the peak of the sine signal and the cosine signal is identified to determine the two adjacent peak positions of the sine signal and the two adjacent peak positions of the cosine signal in the same time range.
[0075] In the embodiment of the present application, the automatic multiscale-based peak detection (AMPD) algorithm can be used to identify the peak positions of the sine signal and the cosine signal respectively.
[0076] The automatic multiscale-based peak detection algorithm is to compare the values of the current point and the two side points on the vertical axis by traversing windows of different scales (such as 1-N). If the value of the current point on the vertical axis is greater than the values of the two side points on the vertical axis, the current point is marked as a candidate peak. Finally, the real peak position is determined by counting the number of times each point is marked. For example, the candidate peak with the most marked times is selected as the real peak position.
[0077] In the embodiment of the present application, the accuracy of the peak position directly affects the accuracy of the subsequent error calculation. Since the automatic multiscale-based peak detection algorithm has good anti-noise ability and almost no additional parameter setting is required, the automatic multiscale-based peak detection algorithm can improve the identification accuracy of the peak position and improve the accuracy of the subsequent error calculation.
[0078] In one implementation, the automatic multiscale-based peak detection algorithm can be used to identify the peaks of the continuous sine signal and the cosine signal to identify a plurality of peak positions. For example, Figure 2 The embodiment of the present application can also extract the two adjacent peak positions of the sine signal and the two adjacent peak positions of the cosine signal in the same time range from the plurality of peak positions that have been identified. Figure 2 The window with a size of N is exemplary shown in Figure 2As shown in the interval between the two dotted lines, the time range corresponding to the two dotted lines includes two adjacent peak positions A(x1, y1) and B(x2, y2) on the sine signal, and two adjacent peak positions E(x3, y3) and F(x4, y4) on the cosine signal.
[0079] Since a large number of peaks are identified for continuous sine and cosine signals, the computational pressure increases. Considering that only a portion of the peak positions are intercepted for calculation in actual calculation, the embodiment of the present application also provides another possible implementation method: a target signal segment can be intercepted from the sine and cosine signals, and the target signal segment includes at least one complete cycle of the sine and cosine signals; a multi-scale peak detection algorithm is used to identify two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal within the target signal segment.
[0080] In this implementation, only the sine signal and cosine signal in the target signal segment need to be peak identified, which reduces the amount of computation required for peak identification, helps improve efficiency, and reduces computational pressure.
[0081] In the embodiment of the present application, when performing peak recognition, target signal segments signal_sin and signal_cos of the sine and cosine signals input by the resolver can be intercepted respectively, with a window size of N. The target signal segment includes a sine signal segment and a cosine signal segment, and the sine signal segment and the cosine signal segment have the same duration and are within the same time range.
[0082] The duration corresponding to the window size N includes at least one complete cycle of a sine signal and a cosine signal.
[0083] On this basis, an automatic multi-scale peak detection algorithm can be used to identify the peaks of the sine signal segment and the cosine signal segment respectively, and the two adjacent peak positions on the sine signal and the two adjacent peak positions on the cosine signal can be obtained.
[0084] It should be noted that, in some cases, it may happen that only one peak position is identified from the target signal segment (sine signal segment or cosine signal segment). This situation is usually caused by an inappropriate setting of the window size N. In an embodiment of the present application, if the identified peak position does not meet the result of "two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal", it is determined that the recognition has failed. In the case of recognition failure, the value of the window size N is usually adjusted, and then a new target signal segment is re-intercepted based on the new window size, and peak recognition is performed on the new target signal segment until two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal are obtained.
[0085] On the basis of the above-mentioned embodiments, the embodiments of the present application further propose that, before the peak identification of the sine signal and the cosine signal, the rotating speed is judged. The method comprises the following contents: detecting the rotating speed of the motor; and when the rotating speed of the motor reaches a preset rotating speed range, the peak identification of the sine signal and the cosine signal is performed.
[0086] The rotating speed of the motor is, for example, the currently calculated filtered rotating speed of the motor.
[0087] In the embodiments of the present application, the control accuracy requirement of the EPS system for the motor is not high when the motor rotates at a low speed. Therefore, in order to avoid resource waste, the peak identification is not usually performed when the motor rotates at a low speed. When the rotating speed of the motor reaches a preset rotating speed range (ω1, ω2), the peak identification is started. Otherwise, the peak identification is not started.
[0088] In some embodiments, the preset rotating speed range is, for example, 1000 rpm-2000 rpm.
[0089] The embodiments of the present application ensure that the peak identification is performed when the rotating speed is moderate by setting the preset rotating speed range and starting the peak identification when the rotating speed of the motor is in the preset rotating speed range, thereby avoiding the increase of invalid calculation caused by insufficient signal sampling or excessive peaks at an extreme rotating speed.
[0090] On the basis of the above-mentioned embodiments, the embodiments of the present application further propose that the effectiveness of the peaks is judged. The process of judging the effectiveness of the peaks comprises the following contents:
[0091] In the embodiments of the present application, the two adjacent peak positions on the sine signal include a first peak position and a second peak position, and the two adjacent peak positions on the cosine signal include a third peak position and a fourth peak position. Based on this, the process of judging the effectiveness of the peaks can comprise:
[0092] The difference between the time coordinate of the first peak position and the time coordinate of the third peak position is calculated to obtain a first difference, and the effectiveness of the first peak position and the third peak position is determined according to the first difference.
[0093] The difference between the time coordinate of the second peak position and the time coordinate of the fourth peak position is calculated to obtain a second difference, and the effectiveness of the second peak position and the fourth peak position is determined according to the second difference.
[0094] For example, please continue to refer to Figure 2 , for example, the first peak position corresponds to A(x1, y1) in Figure 2 , the second peak position corresponds to B(x2, y2) in Figure 2 , the third peak position corresponds to E(x3, y3) in Figure 2 , and the fourth peak position corresponds to F(x4, y4) in Figure 2F(x4, y4) in the F(x4, y4).
[0095] In the embodiments of the present application, a difference between the first wave peak position and the third wave peak position on the X axis can be calculated to obtain a first difference, which can be represented as |x1-x3|. Then the first difference is compared with a first threshold value to determine whether the first wave peak position and the third wave peak position are valid.
[0096] If the first difference is less than the first threshold value, it is determined that the first wave peak position and the third wave peak position are valid. If the first difference is greater than or equal to the first threshold value, it is determined that the first wave peak position and the third wave peak position are invalid.
[0097] In the embodiments of the present application, the case where the first wave peak position and the third wave peak position are invalid is identified as a wave peak recognition failure. Then the value of the window size N is adjusted, and a new target signal segment is re-cut based on the new window size, and wave peak recognition is performed on the new target signal segment until two adjacent wave peak positions on the sine signal and two adjacent wave peak positions on the cosine signal are obtained.
[0098] Based on the same principle, a difference between the second wave peak position and the fourth wave peak position on the X axis can be calculated to obtain a second difference, which can be represented as |x2-x4|. Then the second difference is compared with the first threshold value to determine whether the second wave peak position and the fourth wave peak position are valid.
[0099] If the second difference is less than the first threshold value, it is determined that the second wave peak position and the fourth wave peak position are valid. If the second difference is greater than or equal to the first threshold value, it is determined that the second wave peak position and the fourth wave peak position are invalid.
[0100] In the embodiments of the present application, the case where the second wave peak position and the fourth wave peak position are invalid is identified as a wave peak recognition failure. Then the value of the window size N is adjusted, and a new target signal segment is re-cut based on the new window size, and wave peak recognition is performed on the new target signal segment until two adjacent wave peak positions on the sine signal and two adjacent wave peak positions on the cosine signal are obtained.
[0101] In the embodiments of the present application, one half of a difference between the time coordinate of the first wave peak position and the time coordinate of the second wave peak position can be calculated to obtain a third difference, and one half of a difference between the time coordinate of the third wave peak position and the time coordinate of the fourth wave peak position can be calculated to obtain a fourth difference, and then the minimum value of the third difference and the fourth difference is taken as the first threshold value.
[0102] The first threshold value can be represented by formula (1).
[0103]
[0104] In the embodiments of the present application, by judging the effectiveness of the wave peak, not only can the wave peak recognition error caused by signal distortion be effectively avoided, but also the non-nearest neighbor position of adjacent sine and cosine wave peaks caused by improper signal segment selection can be avoided.
[0105] In step 103, the amplitude error and the phase error are calculated according to the positions of the two adjacent wave peaks on the sine signal and the positions of the two adjacent wave peaks on the cosine signal.
[0106] In the embodiments of the present application, the process of calculating the amplitude error according to the positions of the two adjacent wave peaks on the sine signal and the positions of the two adjacent wave peaks on the cosine signal includes:
[0107] The ratio of the amplitude coordinate of the third wave peak position to the amplitude coordinate of the first wave peak position is calculated to obtain a first ratio, and the ratio of the amplitude coordinate of the fourth wave peak position to the amplitude coordinate of the second wave peak position is calculated to obtain a second ratio, and the amplitude error is determined according to the first ratio and the second ratio.
[0108] The amplitude error δ can be represented by formula (2).
[0109]
[0110] Wherein, The first ratio is represented by a1, The second ratio is represented by a2, and the amplitude error δ is the average of the decimal parts of the first ratio and the second ratio.
[0111] In the embodiments of the present application, the process of calculating the phase error according to the positions of the two adjacent wave peaks on the sine signal and the positions of the two adjacent wave peaks on the cosine signal includes:
[0112] The sine duration is determined according to the difference between the time coordinate of the second wave peak position and the time coordinate of the first wave peak position, the cosine duration is determined according to the difference between the time coordinate of the fourth wave peak position and the time coordinate of the third wave peak position, and the phase error is determined according to the ratio of the first difference value to the sine duration and the ratio of the second difference value to the cosine duration.
[0113] The phase error Δ θ can be represented by formula (3).
[0114]
[0115] Wherein, x2-x1 represents the sine duration, x4-x3 represents the cosine duration, x1-x3 represents the first difference value, and x2-x4 represents the second difference value.
[0116] In the embodiments of the present application, by accurately identifying the amplitude error and the phase error, a basis is provided for subsequent error compensation, which is conducive to improving the calculation accuracy of the motor angle.
[0117] Step 104 : Perform compensation calculation based on the amplitude error and the phase error to obtain a compensation value.
[0118] In an embodiment of the present application, the process of performing compensation calculation based on the amplitude error and the phase error includes: obtaining the tracking angle output by the second-order phase-locked loop tracker; inputting the tracking angle, the amplitude error, and the phase error into the compensation model to obtain the compensation value output by the compensation model.
[0119] The compensation model can be expressed by formula (4):
[0120]
[0121] Where Cmp represents the compensation value, δ represents the amplitude error, Δ θ represents the phase error, Indicates the tracking angle.
[0122] It should be noted that in the embodiment of the present application, whether in a low-speed operating condition with peak detection not started, or in a high-speed operating condition with peak detection started and compensation value calculated, the second-order phase-locked loop tracker will always output the tracking angle.
[0123] The calculation principle of the compensation model can be referred to Figure 2 As shown, Figure 3 This is a block diagram of the calculation principles corresponding to an exemplary compensation detection method provided in an embodiment of the present application.
[0124] Figure 3 In the formula, cos represents cosine operation, sin represents sine operation, x represents multiplication operation, + represents addition operation, - represents subtraction operation, "1" represents constant, μ represents 2 Indicates square operation, "0.5" indicates 1 / 2 operation. Figure 3 The compensation calculation process provided in the embodiment of the present application is described.
[0125] like Figure 3 As shown, first, the tracking angle Perform sine and cosine calculations to obtain and Then and Multiplying together, we get And transfer to step 1. Multiplying by itself, we get And transfer to step 2.
[0126] like Figure 3 As shown, for the amplitude error δ, first add δ to the constant 1 to get (δ+1), and then add (δ+1) to the phase error Δ θMultiplying them, we get (δ+1)Δ θ , and (δ+1)Δ θ Transfer to step 2, in step 2 (δ+1)Δ θ and Multiplying together, we get And send to step3.
[0127] like Figure 3 As shown, for the phase error Δ θ , first of all, the phase error Δ θ Conduct μ 2 Operation, that is, the phase error Δ θ Perform square calculation to get Δ θ 2 , then Δ θ 2 Perform 1 / 2 calculation and get 0.5Δ θ 2 and use the amplitude error δ to 0.5Δ θ 2 Taking the difference, we get δ-0.5Δ θ 2 , δ-0.5Δ θ 2 Transfer to step 1, in step 1, δ-0.5Δ θ 2 and Multiplying them, we get (δ-0.5Δ θ 2 )· And send to step3.
[0128] Finally, in step 3, and Calculate the difference and get the compensation value Cmp,
[0129] In the embodiment of the present application, after the compensation value is obtained, it can be written into an external electrically erasable programmable read-only memory (EEPROM) for subsequent determination of the motor angle. The initial value of the compensation value is 0.
[0130] Step 105 : determining the motor angle according to the sine signal, the cosine signal and the compensation value.
[0131] In the embodiment of the present application, the compensation value can be read from the external EEPROM, and then the sine signal, cosine signal and compensation value are input to the second-order phase-locked loop tracker, and the second-order phase-locked loop tracker can output the tracking angle And get the motor speed ω. Among them, the tracking angle is also the motor angle.
[0132] In this embodiment of the present application, the sine signal and cosine signal of the motor angle θ are obtained through a rotary transformer, and then a target signal segment of length N within the same time is intercepted, and the peak position of the sine signal in the target signal segment and the peak position of the cosine signal in the target signal segment are respectively identified using an automatic multi-scale peak detection algorithm. Then, the amplitude error δ and phase error Δ of the cosine signal relative to the sine signal are calculated based on the sine signal. θ , then the actual motor angle θ and the tracking angle of the second-order phase-locked loop tracker The error e between them can be expressed by formula (5).
[0133]
[0134] in, is the angle tracked by the second-order phase-locked loop tracker.
[0135] Due to the amplitude error δ and phase error Δ θ In general, it is much smaller than 1, so formula (5) can be transformed into formula (6).
[0136]
[0137] When the actual motor angle θ approaches the tracking angle When the error e is expressed as An oscillation. Due to the amplitude error δ and phase error Δ θ It has been calculated that the oscillation term obtained earlier Since the actual motor angle θ is unknown, the tracking angle is needed Approximate substitution, to the amplitude error δ and phase error Δ θ compensation, then the oscillation term can be expressed as in, yes An approximate replacement for , that is, the calculation formula for the required compensation value.
[0138] Then the error e can be expressed as:
[0139]
[0140] On this basis, the error e and the compensation value Cmp are input into the second-order phase-locked loop tracker, and the tracking angle output by the second-order phase-locked loop tracker can be obtained. and the motor speed ω.
[0141] Please refer to Figure 3 , Figure 4is an exemplary principle block diagram for detecting motor angle provided by an embodiment of the present application. Figure 4 In the formula, cos represents cosine operation, sin represents sine operation, x represents multiplication operation, + represents addition operation, and - represents subtraction operation. The following will be described in combination with Figure 4 The compensation calculation process provided by an embodiment of the present application is described.
[0142] The sine value sinθ of the motor angle θ is multiplied by the cosine value of the tracking angle output by the second-order phase-locked loop tracker, to obtain and send to step 1. The cosine value cosθ of the motor angle θ is multiplied by the sine value of the tracking angle output by the second-order phase-locked loop tracker, to obtain and send to step 1. In step 1, the compensation value Cmp is obtained, and the correction error e between the real motor angle θ and the tracking angle output by the second-order phase-locked loop tracker is calculated as follows: ′ :
[0143]
[0144] In the formula, cos represents cosine operation, sin represents sine operation, x represents multiplication operation, + represents addition operation, and - represents subtraction operation. The following will be described in combination with may be approximately replaced by
[0145] , so as to eliminate the oscillation term. Finally, the result of e+Cmp is input into the PI transfer function of the phase-locked loop (PLL) for subsequent calculation. It should be noted that the PI transfer function specifically refers to the transfer function of the loop filter thereof, which is usually composed of a proportional path and an integral path. For example, the proportional path can be represented as: For example, the integral path can be represented as
[0146]
[0147] In an embodiment of the present application, the motor speed ω can be obtained through the PI transfer function of the phase-locked loop, and the tracking angle is obtained by integrating the motor speed ω. In an embodiment of the present application, the tracking angle may also be fed back to the input end in the form of the sine value and the cosine value for the next round of calculation process.
[0148] In the embodiment of the present application, by introducing the compensation value, the influence of the amplitude error and the phase error on the motor angle can be effectively inhibited, thereby improving the accuracy of the motor angle calculation. In addition, the second-order phase-locked loop tracker also has good anti-noise ability and dynamic tracking performance, and can adapt to the angle calculation requirements under different working conditions.
[0149] The effect of the motor angle detection method provided in the embodiment of the present application is described below by comparison.
[0150] Please refer to FIG. 5(a), FIG. 5(b), FIG. 5(c), FIG. 5(d) and Figure 4 FIG. 5(a) is a schematic diagram of an exemplary actual motor angle provided in the embodiment of the present application, which is used as a control group. FIG. 5(b) is a schematic diagram of an exemplary motor angle calculated by using the arctangent method provided in the embodiment of the present application. FIG. 5(c) is a schematic diagram of an exemplary motor angle calculated by using the second-order phase-locked loop angle tracker provided in the embodiment of the present application. FIG. 5(d) is a schematic diagram of an exemplary motor angle calculated by using the motor angle detection method provided in the embodiment of the present application. FIG. 5(a), FIG. 5(b), FIG. 5(c) and FIG. 5(d) are all realized by Simulink modeling. Figure 6 FIG. 5(a), FIG. 5(b), FIG. 5(c) and FIG. 5(d) are exemplary comparison diagrams of the actual motor angle, the motor angle calculated by using the arctangent method, the motor angle calculated by using the second-order phase-locked loop angle tracker and the motor speed respectively provided in the embodiment of the present application.
[0151] In the embodiment of the present application, at the speed of 1000 rpm, random noise is added to the actual motor angle, and the sine and cosine signals input by the resolver have amplitude imbalance and phase quadrature. Then, the motor angle is calculated by using the arctangent method, the second-order phase-locked loop angle tracker method and the motor angle detection method provided in the embodiment of the present application respectively. As can be seen from FIG. 5(a), FIG. 5(b), FIG. 5(c) and FIG. 5(d), the motor angle calculated by using the motor angle detection method provided in the embodiment of the present application is closest to the actual motor angle. In addition, as shown in FIG. 6(a), FIG. 6(b) and FIG. 6(c), under the same conditions, the motor speed is determined by using the arctangent method, the second-order phase-locked loop angle tracker method and the motor angle detection method provided in the embodiment of the present application respectively. In order not to lose generality, all methods are processed and output by using the same first-order low-pass filter unit. The actual effect is shown in FIG. 7(a), FIG. 7(b) and FIG. 7(c). Figure 6 Figure 6
[0152] In summary, the embodiment of the present application uses the sinusoidal signal output by the rotary transformer as a reference and identifies the peak position through an automatic multi-scale peak detection algorithm. This peak recognition algorithm has good noise resistance and almost no need to set additional parameters. Determining the motor angle and speed does not require additional circuits and calibration work, and can calculate the corresponding error compensation parameters for the respective conditions of different devices. The method is highly versatile. Compared with the other two commonly used methods, the accuracy of the motor angle calculation of the present invention is improved, and the resulting motor speed fluctuation is reduced.
[0153] The following combination Figure 6 The motor angle detection method provided in the embodiment of the present application is described. Figure 7 FIG. 1 is a flow chart of an exemplary method for detecting a motor angle provided in an embodiment of the present application. The method includes:
[0154] Step 701: Detect whether the filtering speed is greater than ω1 and less than ω2.
[0155] Wherein, the filter speed refers to the motor speed. ω1 and ω2 represent the speed, with ω2 being greater than ω1.
[0156] If the filtered rotation speed is less than or equal to ω1, or the filtered rotation speed is greater than or equal to ω2, then proceed to step 706. If the filtered rotation speed is greater than ω1 and less than ω2, then proceed to step 702.
[0157] Step 702 , intercepting target signal segments signal_sin and signal_cos with a sine and cosine signal window size of N input from the resolver, and performing peak identification on the target signal segments using an automatic multi-scale peak detection algorithm to obtain two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal.
[0158] The target signal segment includes a sine signal segment and a cosine signal segment.
[0159] In the embodiment of the present application, an automatic multi-scale peak detection algorithm may be used to perform peak identification on the sine signal segment and the cosine signal segment respectively.
[0160] Among them, the two adjacent peak positions on the sine signal can be expressed as A(x1, y1) and B(x2, y2), and the two adjacent peak positions on the cosine signal can be expressed as E(x3, y3) and F(x4, y4).
[0161] Step 703: Detect whether two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal are valid.
[0162] In the embodiments of the present application, whether the two adjacent peak positions on the sine signal and the two adjacent peak positions on the cosine signal are valid can be determined by detecting whether |x1-x3|<Threshold1 and |x2-x4|<Threshold1 are satisfied.
[0163] wherein Threshold1 represents a first threshold value,
[0164] If yes, go to step 704; if no, go to step 706.
[0165] In the embodiments of the present application, if |x1-x3|<Threshold1 and |x2-x4|<Threshold1, it means that the two adjacent peak positions on the sine signal and the two adjacent peak positions on the cosine signal are valid, otherwise, they are invalid.
[0166] Step 704: calculate the phase error and the amplitude error.
[0167] The process can refer to the content disclosed in the above embodiments, which is not limited herein.
[0168] Step 705: calculate the compensation value according to the phase error and the amplitude error, and write it into the EEPROM.
[0169] The process can refer to the content disclosed in the above embodiments, which is not limited herein.
[0170] Step 706: read the compensation value in the EEPROM, input the sine signal, the cosine signal and the compensation value into the second-order phase-locked loop tracker to obtain the tracking angle and the motor speed.
[0171] The process can refer to the content disclosed in the above embodiments, which is not limited herein.
[0172] Step 707: the motor speed ω is output after first-order low-pass filtering.
[0173] The technical concept of the embodiments of the present application will be described below. Figure 7 The technical concept of the embodiments of the present application will be described below. Figure 8 is a block diagram of an exemplary motor angle detection method provided by the embodiments of the present application. Wherein,
[0174] The sine signal and the cosine signal enter the peak recognition unit, and the peak recognition unit also determines whether to start the peak recognition according to the filtered speed. When the filtered speed is within the preset speed range, the peak recognition is started.
[0175] The peak recognition unit can recognize two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal in the same time range, and then determine the amplitude error and the phase error according to the two adjacent peak positions on the sine signal and the two adjacent peak positions on the cosine signal. The amplitude error and the phase error are compensated and calculated by the compensation calculation unit, and the compensation value is sent to the second-order phase-locked loop tracker. The compensation value, the sine signal and the cosine signal are angle-tracked by the second-order phase-locked loop tracker to obtain a tracking angle and a motor speed. Finally, the motor speed ω is output through the first-order low-pass filter unit to obtain a filtered speed. The filtered speed is the speed in the peak recognition process.
[0176] It should be understood that the steps in the above embodiments disclosed in the drawings are not necessarily executed in the order indicated in the drawings. Unless otherwise specified herein, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least some of the steps in the drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or sub-steps or stages of other steps.
[0177] In another embodiment of the present application, a motor angle detection device is provided. Please refer to Figure 8 , Figure 9 A logic block diagram of a motor angle detection device provided in an embodiment of the present application. The motor angle detection device can include a collection unit 901, a peak recognition unit 902, a compensation calculation unit 903 and an angle determination unit 904, wherein:
[0178] The collection unit 901 is configured to obtain a sine signal and a cosine signal of a motor angle through a resolver;
[0179] The peak recognition unit 902 is configured to recognize peaks of the sine signal and the cosine signal, and determine two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal in the same time range;
[0180] The compensation calculation unit 903 is configured to calculate an amplitude error and a phase error according to the two adjacent peak positions on the sine signal and the two adjacent peak positions on the cosine signal, and perform compensation calculation according to the amplitude error and the phase error to obtain a compensation value;
[0181] The angle determination unit 904 is configured to determine a motor angle according to the sine signal, the cosine signal and the compensation value.
[0182] In one of the embodiments, the wave peak identification unit 902 is specifically configured to cut a target signal segment from the sine signal and the cosine signal, the target signal segment including at least one complete period of the sine signal and the cosine signal;
[0183] The multi-scale wave peak detection algorithm is used to identify two adjacent wave peak positions on the sine signal and two adjacent wave peak positions on the cosine signal in the target signal segment.
[0184] In one of the embodiments, the two adjacent wave peak positions on the sine signal include a first wave peak position and a second wave peak position, and the two adjacent wave peak positions on the cosine signal include a third wave peak position and a fourth wave peak position, and the wave peak identification unit 902 is further configured to calculate a difference between a time coordinate of the first wave peak position and a time coordinate of the third wave peak position to obtain a first difference, and determine validity of the first wave peak position and the third wave peak position according to the first difference;
[0185] calculate a difference between a time coordinate of the second wave peak position and a time coordinate of the fourth wave peak position to obtain a second difference, and determine validity of the second wave peak position and the fourth wave peak position according to the second difference.
[0186] In one of the embodiments, the compensation calculation unit 903 is specifically configured to calculate a ratio between an amplitude coordinate of the third wave peak position and an amplitude coordinate of the first wave peak position to obtain a first ratio;
[0187] calculate a ratio between an amplitude coordinate of the fourth wave peak position and an amplitude coordinate of the second wave peak position to obtain a second ratio;
[0188] determine an amplitude error according to the first ratio and the second ratio.
[0189] In one of the embodiments, the compensation calculation unit 903 is specifically configured to determine a sine duration according to a difference between the time coordinate of the second wave peak position and the time coordinate of the first wave peak position;
[0190] determine a cosine duration according to a difference between the time coordinate of the fourth wave peak position and the time coordinate of the third wave peak position;
[0191] determine a phase error according to a ratio between the first difference and the sine duration and a ratio between the second difference and the cosine duration.
[0192] In one of the embodiments, the compensation calculation unit 903 is specifically configured to obtain a tracking angle output by a second-order phase-locked loop tracker;
[0193] input the tracking angle, the amplitude error and the phase error into a compensation model to obtain a compensation value output by the compensation model.
[0194] In one of the embodiments, the angle determination unit 904 is specifically configured to input the sine signal, the cosine signal and the compensation value into a second-order phase-locked loop tracker to obtain a motor angle of a second-order phase-locked loop tracker output.
[0195] In one of the embodiments, the peak identification unit 902 is further configured to detect a motor speed, and perform peak identification on the sine signal and the cosine signal when the motor speed reaches a preset speed range.
[0196] The modules in the motor angle detection device described above can be implemented by software, hardware or a combination thereof. The modules described above can be embedded in or independent of a processor in a computer device in a hardware form, or stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform the operations corresponding to the modules.
[0197] Please refer to Figure 9 , Figure 10 A hardware structure schematic diagram of an electric power steering device is provided in the embodiments of the present application, and the electric power steering device includes a processor, a memory and a communication bus. The electric power steering device can include a communication interface 1001, a memory 1002 and a processor 1003. The components are coupled together through a bus system 1004. It can be understood that the bus system 1004 is used to realize the connection and communication between the components. The bus system 1004 includes a data bus, a power bus, a control bus and a status signal bus. However, in order to clearly illustrate, all the buses are marked as the bus system 1004 in the drawings. Figure 10 Figure 10
[0198] In the embodiments of the present application, the communication interface 1001 is configured to transceive information with other external devices; the memory 1002 is configured to store a computer program capable of running on the processor 1003; and the processor 1003 is configured to execute the steps of the charging control method in any one of the preceding embodiments when running the computer program.
[0199] It is to be appreciated that the memory 1002 of the embodiments herein can be volatile or nonvolatile memory, or can include both volatile and nonvolatile memory. In one example, nonvolatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which acts as the external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), SynchBurst SDRAM (SLDRAM), and direct Rambus RAM (DRRAM). The memory 1002 of the system and method described herein are intended to include, without being limited to, these and any other suitable types of memory.
[0200] The processor 1003 can be an integrated circuit chip with signal processing capability. In implementation, each step of the above method can be completed by integrated logic circuits or instructions in software form in the processor 1003. The processor 1003 described above can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block diagram disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the storage 1002, and the processor 1003 reads the information in the storage 1002 and combines the hardware to complete the steps of the above method.
[0201] It can also be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing units can be implemented within one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.
[0202] For software implementation, the techniques described herein can be implemented by means of a module for performing the functions described herein, such as procedures, functions, and so on. Software codes can be stored in memory and executed by a processor. The memory can be implemented within the processor or implemented externally to the processor. In the case of the latter, it can be stored in a computer-readable storage medium, such as a ROM, a RAM, a magnetic disk, or an optical disk, and so on. Based on such an understanding, the technical solutions of the embodiments of the present application essentially, or partly, or all, can be embodied in a software product, and the computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (such as a personal computer, a server, or a network device, etc.) or a processor (or a plurality of processors) to perform all or part of the steps of the methods described in the embodiments of the present application. The foregoing memory medium can be a volatile memory or a non-volatile memory, or a combination of the two.
[0203] Therefore, the embodiments of the present application provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps of the motor angle detection method described in the foregoing embodiments.
[0204] The embodiments of the present application also provide a computer program product, which includes a computer program or instructions. The computer program or instructions are executed by a processor to implement the steps of the motor angle detection method described in the foregoing embodiments.
[0205] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, device, equipment, or computer program product. Therefore, the present application can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage, etc.) containing computer-usable program codes.
[0206] It should be noted that, in the present application, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or other elements inherent to such a process, method, article, or device. Without more limitations, the element defined by the phrase "including a" does not exclude the presence of additional identical elements in the process, method, article, or device including the element.
[0207] The above-mentioned sequence numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0208] The features disclosed in the several product embodiments of the present application can be arbitrarily combined without conflict, to obtain new product embodiments.
[0209] The features disclosed in the several method or device embodiments of the present application can be arbitrarily combined without conflict, to obtain new method embodiments or device embodiments.
[0210] The above-mentioned sequence numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
Claims
1. A motor angle detection method, characterized in that: The method comprises: Obtain the sine and cosine signals of the motor angle through the resolver; Performing peak recognition on the sine signal and the cosine signal to determine two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal within the same time range; Calculating an amplitude error and a phase error based on two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal; performing compensation calculation based on the amplitude error and the phase error to obtain a compensation value; The motor angle is determined according to the sine signal, the cosine signal, and the compensation value.
2. The method according to claim 1, characterized in that The performing peak recognition on the sine signal and the cosine signal to determine two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal within the same time range includes: Extracting a target signal segment from the sine signal and the cosine signal, wherein the target signal segment includes at least one complete cycle of the sine signal and the cosine signal; A multi-scale peak detection algorithm is used to identify two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal within the target signal segment.
3. The method according to claim 1, characterized in that The two adjacent peak positions on the sine signal include a first peak position and a second peak position, and the two adjacent peak positions on the cosine signal include a third peak position and a fourth peak position; Before calculating the amplitude error and the phase error based on the two adjacent peak positions on the sine signal and the two adjacent peak positions on the cosine signal, the method further includes: calculating a difference between a time coordinate of the first wave peak position and a time coordinate of the third wave peak position to obtain a first difference, and determining the validity of the first wave peak position and the third wave peak position according to the first difference; A second difference is obtained according to the difference between the time coordinate of the second wave peak position and the time coordinate of the fourth wave peak position, and the validity of the second wave peak position and the fourth wave peak position is determined according to the second difference.
4. The method according to claim 3, characterized in that The calculating the amplitude error according to two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal includes: Calculating a ratio of the amplitude coordinate of the third wave peak position to the amplitude coordinate of the first wave peak position to obtain a first ratio; Calculating a ratio of the amplitude coordinate of the fourth wave peak position to the amplitude coordinate of the second wave peak position to obtain a second ratio; The amplitude error is determined based on the first ratio and the second ratio.
5. The method according to claim 3, characterized in that The calculating the phase error according to two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal includes: determining a sine duration according to a difference between a time coordinate of the second wave peak position and a time coordinate of the first wave peak position; determining a cosine duration according to a difference between a time coordinate of the fourth wave peak position and a time coordinate of the third wave peak position; The phase error is determined according to a ratio of the first difference to the sine duration and a ratio of the second difference to the cosine duration.
6. The method according to any one of claims 1 to 5, characterized in that The performing compensation calculation according to the amplitude error and the phase error to obtain a compensation value includes: Get the tracking angle output by the second-order phase-locked loop tracker; The tracking angle, the amplitude error, and the phase error are input into a compensation model to obtain the compensation value output by the compensation model.
7. The method according to any one of claims 1 to 5, characterized in that The determining the motor angle according to the sine signal, the cosine signal and the compensation value includes: The sine signal, the cosine signal and the compensation value are input into a second-order phase-locked loop tracker, so that the second-order phase-locked loop tracker outputs the motor angle.
8. The method according to any one of claims 1 to 5, characterized in that The performing peak recognition on the sine signal and the cosine signal includes: Detect motor speed; When the motor speed reaches a preset speed range, peak recognition is performed on the sine signal and the cosine signal.
9. A motor angle detection device, characterized in that: The device comprises: An acquisition unit, used to obtain the sine signal and cosine signal of the motor angle through a rotary transformer; A peak recognition unit is used to perform peak recognition on the sine signal and the cosine signal, and determine two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal within the same time range; a compensation calculation unit, configured to calculate an amplitude error and a phase error based on two adjacent peak positions on the sine signal and two adjacent peak positions on the cosine signal; and perform compensation calculation based on the amplitude error and the phase error to obtain a compensation value; An angle determination unit is used to determine the motor angle according to the sine signal, the cosine signal and the compensation value.
10. An electric power steering device, characterized in that: The method comprises a processor and a memory; the memory is used to store a computer program that can be run on the processor, and the processor is used to execute the steps of the motor angle detection method according to any one of claims 1 to 8 when running the computer program.