METHOD AND DEVICE FOR DETERMINING AN ANGLE DIFFERENCE

DE502022004761D1Active Publication Date: 2025-08-07ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
DE502022004761
Authority / Receiving Office
DE · DE
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-05-21
Filing Date
2022-04-29
Publication Date
2025-08-07
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

Existing methods for determining the angular difference between the zero position of a rotor position sensor and the orientation of permanent magnets in electric machines are prone to errors due to disturbances, particularly in zero-sequence current control, leading to inaccurate control of electric machines.

Method used

A method involving field-oriented control with specific d- and q-setpoint currents and voltages, where complementary current values are used to minimize error voltages, allowing precise determination of the angular difference without measuring phase voltages.

Benefits of technology

This approach achieves high accuracy in determining the angular difference, minimizing error influence and enabling precise control of electric machines without requiring phase voltage measurements.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader
Need to check novelty before this filing date? Find Prior Art

Description

[0001] The invention relates to a method and a device for determining an angular difference between a zero position of a rotor position sensor of an electric machine and an orientation of the permanent magnets of the electric machine. Furthermore, the invention relates to a drive train with a corresponding device and a vehicle with a drive train, as well as a computer program and a computer-readable medium. State of the art

[0002] In electric and hybrid vehicles, electric machines, preferably synchronous machines, are often used as traction or drive machines. In order to efficiently control an electric machine, in particular its drive torque, the angular difference, or offset angle, between the zero position of a rotor position sensor and the orientation of the permanent magnets of the rotor of the electric machine must be known. The more precisely this value is known, the more precisely the machine can be controlled. Thus, for the control of the electric machine, the orientation of the permanent magnets of the rotor can preferably be aligned with the d-axis of the rotating coordinate system of the field-oriented control. A resolver, an incremental encoder, or other position encoder is preferably used as a position sensor for determining the rotor position.

[0003] Various approaches to determining this offset angle are known from the prior art. The publications CN 104 079 215 B, EP 2 770 626 B1, DE 10 2012 102898 A1, and EP 2 770 627 A1 disclose methods and devices for determining an angle difference.

[0004] A well-known method for this is zero-sequence current control. In this method, the current in a rotating machine is regulated to a current of zero amperes. In order to regulate the current to zero amperes, the current controller must compensate for the voltage induced in the rotating electrical machine, or rotor. Depending on the control deviation of the reference variable (setpoint current) and the feedback (actual current), the output variable of the current controller in the steady state is the setpoint voltage, the manipulated variable whose phase position corresponds to the induced voltage and thus also to the alignment of the permanent magnets of the rotor or the direction of the positive flux of the permanent magnets. When determining the offset angle using zero-sequence current control, disturbances falsify the result.One of the most relevant disturbance variables is the difference between the target voltage (Udq_Soll) determined by the current controller and the actual voltage (Udq_Ist) present at the windings of the electrical machine. The difference between the determined target voltage (Udq_Soll) and the actual voltage (Udq_Ist) is also referred to as the error voltage (Udq_error). Udq_Ist ≠ Udq_Soll ; Udq_Ist − Udq_Soll = Udq_error

[0005] In the zero-current control method, the error voltage is insufficiently known at the operating point where the current is regulated to a current of zero amperes. Therefore, it cannot be compensated at this operating point.

[0006] An alternative method is disclosed in document DE 10 2008 001 408 A1. The offset angle is determined as a function of the difference between a field angle, an impressed stator magnetic field, and a determined sensor angle.

[0007] There is a need for methods and devices for calibrating the offset angle. Disclosure of the invention

[0008] A method is provided for determining an angular difference between a zero position of a rotor position sensor of an electric machine and an orientation of the permanent magnets of the electric machine, wherein the electric machine is controlled by means of a field-oriented control and the rotor of the electric machine rotates.The method comprises the following steps: specifying a first d-setpoint current value not equal to zero amperes and specifying a first q-setpoint current value; determining a resulting first d-setpoint voltage and first q-setpoint voltage; specifying a second d-setpoint current value, wherein the second d-setpoint current value corresponds to the value of the first d-setpoint current value with complementary signs, and specifying a second q-setpoint current value, wherein the second q-setpoint current value corresponds to the value of the first q-setpoint current value with complementary signs; determining a resulting second d-setpoint voltage and a second q-setpoint voltage; determining an angle error as a function of the determined first d-setpoint voltage, the first q-setpoint voltage, the second d-setpoint voltage and the second q-setpoint voltage; determining the angle difference as a function of the angle error.

[0009] Thus, a method is provided for determining the angular difference between the zero position of a rotor position sensor of an electrical machine and the orientation of the permanent magnets of the electrical machine. The electrical machine is controlled using field-oriented control. Field-oriented control of electrical machines is well known. In this case, alternating quantities assumed to be largely sinusoidal (e.g., alternating voltages and alternating currents) are not controlled directly at their instantaneous value over time, but rather at an instantaneous value adjusted for the phase angle within the period. For this purpose, the recorded alternating quantities, for example, the actual phase currents of the electrical machine, are each transferred to a coordinate system rotating at the frequency of the alternating quantities.Within the rotating coordinate system, during steady-state operation of the electrical machine, the alternating quantities result in direct quantities, to which all conventional control engineering methods can be applied. To determine the position of the rotor, position encoders or rotor position sensors are used, which output an angle signal to determine the rotor relative to the stator. Due to the multi-phase, phase-shifted alternating currents impressed on the stator, a rotating magnetic field results during operation of the electrical machine. The direction of this rotating magnetic field corresponds to the direction of the resulting total flux, which is created by the superposition of the rotor flux generated by the permanent magnets and the stator flux generated by the stator currents.For control purposes, precise knowledge of the deviation, i.e. the offset angle or angular difference, between the angle signal of the rotor position sensor and the actual rotor flux direction, or the alignment of the permanent magnets of the electric machine, is important, since for the control of the electric machine the rotor flux direction is calculated from the angle signal and the offset angle. Within the rotating coordinate system, the d / q coordinate system, which rotates synchronously with the rotor flux and whose d-axis points in the direction of the rotor flux, a stator current is represented as a stator current phasor Is, which is characterized by its magnitude and direction. This current phasor rotates synchronously with the rotating stator or rotor flux of the electric machine. In the d / q coordinate system, the current phasor can be broken down into two components Isd and Isq, which are equal quantities in the stationary case.In field-oriented control, the actual phase currents lu, Iv, Iw are recorded, for example, using current sensors. Using the d / q transformation, or Park transformation, the three-phase variables are converted into a two-axis coordinate system with the d and q axes. A target current is determined and specified as the reference variable for the control, usually as a function of a desired torque. In the d / q system, a control deviation is determined from the difference between the target current and the d / q actual currents and provided to the current controller as an input variable. The controller outputs d / q target voltages as the manipulated variable. These d / q target voltages are transformed back into the three-phase system. These three-phase target voltages are provided by an inverter to supply current to the electrical machine and are applied to the individual phases of the electrical machine. The rotor of the electrical machine rotates during the process of determining the angular difference.For this purpose, the rotor is preferably driven externally, preferably, for example, during an unloaded run-out of a drive axle of a vehicle or on a test bench, preferably without load, preferably decoupled from the drive train.

[0010] The method comprises the steps of: specifying a first target current value as a reference variable, wherein in the d / q system a first d target current value not equal to zero amperes and a first q target current value are specified. Determining a first resulting or resulting d / q target voltage as a manipulated variable of the current controller, wherein in the d / q system a first d target voltage and a first q target voltage are determined. Specifying a second target current value as a reference variable, wherein in the d / q system a second d target current value and a second q target current value are specified. The second d target current value corresponds to the value of the first d target current value with complementary signs, and likewise the second q target current value corresponds to the value of the first q target current value with complementary signs.A second resulting or resulting d / q setpoint voltage is determined as the manipulated variable of the current controller, wherein a second d setpoint voltage and a second q setpoint voltage are determined in the d / q system. The setpoint currents are preferably specified using constant setpoint current values. The setpoint currents can preferably also be specified as alternating variables whose mean values correspond to a predetermined setpoint current value. Alternating variables can then preferably also be established as setpoint voltages, the mean values of which are determined as the setpoint voltage. Furthermore, an angle error is determined as a function of the determined first d setpoint voltage, the first q setpoint voltage, the second d setpoint voltage and the second q setpoint voltage. Finally, the angle difference is determined as a function of the angle error. The determined angle difference is preferably fed to the current controller for further control of the electrical machine.

[0011] Advantageously, a method is provided for determining an angular difference between the zero position of a rotor position sensor of an electrical machine and the alignment of the permanent magnets of the electrical machine. This control-engineering solution enables precise determination of the angular difference without measuring the phase voltages. The higher quality compared to known methods results from the fact that the error voltages and the target current are point-symmetrical to the origin for small currents. By specifying two target currents with opposite signs ((Id_soll_1, Iq_soll_1), (-ld_soll_1,-lq_soll_1)), error voltages (Udq_error(Id_soll_1, Iq_soll_1), Udq_error(-ld_soll_1,-lq_soll_1)) with opposite signs are also obtained: Udq_error Id_soll_ 1 , Iq_soll_ 1 = − Udq_error − Id_soll_ 1 , − Iq_soll_ 1 .

[0012] Expressed mathematically, the error voltages are: Ud_error Id Iq = − Ud_error − Id , − Iq und Uq_error Id Iq = − Uq_error − Id , − Iq

[0013] The actual voltages present are: Ud_Ist 1 = Ud_soll_ 1 + Ud_error ; Ud_Ist 2 = Ud_soll_ 2 − Ud_error ; Uq_Ist 1 = Uq_soll_ 1 + Uq_error ; Uq_Ist 2 = Uq_soll_ 2 − Uq_error ;

[0014] When the two actual voltages are added together, the symmetrical error voltages approximately cancel each other out. This results in: Ud_soll_ 1 + Ud_soll_ 2 = Ud_Ist 1 + Ud_Ist 2 Uq_soll_ 1 + Uq_soll_ 2 = Uq_Ist 1 + Uq_Ist 2

[0015] By taking these relationships into account when determining the angle difference, the error influence of the error voltage is minimized.

[0016] In another embodiment of the invention, the first q-set current value is set to zero amperes.

[0017] When specifying the first target current value as a reference variable, the first d-target current value in the d / q system is specified as not equal to zero amperes and the first q-target current value is specified as equal to zero amperes.

[0018] Advantageously, an alternative method is provided which generates no or only a small moment during implementation.

[0019] In another embodiment of the invention, the angle error is determined as a function of the arctangent of the quotient of a first sum of the first d-setpoint voltage and the second d-setpoint voltage and a second sum of the first q-setpoint voltage and the second q-setpoint voltage.

[0020] To determine the angle error, an arctangent of a quotient is calculated. The numerator of the quotient is a first sum of the first d-set voltage and the second d-set voltage. The denominator of the quotient is a second sum of the first q-set voltage and the second q-set voltage.

[0021] Mathematically, this results in: PhiErr_opt = atan Ud_soll_ 1 + Ud_soll_ 2 / Uq_soll_ 1 + Uq_soll_ 2

[0022] Advantageously, a calculation rule is provided to determine the angle error as a function of the current controller variables.

[0023] In another embodiment of the invention, the method comprises a further step: determining the angle difference as a function of a predetermined angle difference.

[0024] In the event that a predetermined angle difference, in particular a somewhat less precise predetermined angle difference, is already known in the system, the angle difference is calculated as a function of the predetermined angle difference.

[0025] Advantageously, a method is provided for a more accurate determination of the angle difference.

[0026] In another embodiment of the invention, the predetermined angle difference is determined as a function of a predetermined angle error. In particular, the predetermined angle difference is determined as a function of a difference between a sensor angle difference and a predetermined angle error. A sensor angle difference is, for example, a value that describes the installation position of a rotor position sensor relative to the orientation of the permanent magnets of the electric machine or a zero position of the rotor, or a value specific to the rotor position sensor that describes a sensor signal deviation relative to the orientation of the permanent magnets of the electric machine or a zero position of the rotor.

[0027] Advantageously, a method for determining the predetermined angle difference is provided.

[0028] In another embodiment of the invention, the predetermined angle error is determined as a function of a zero current control or a test pulse method.

[0029] A zero-current control is described as an example in the introduction; a test pulse method is known as an example from the document DE 10 2008 042 360 A1.

[0030] Advantageously, a method for determining the predetermined angular error is provided.

[0031] In another embodiment of the invention, the angle difference is determined as a function of the difference between the predetermined angle difference and the angle error.

[0032] Furthermore, the invention relates to a device for determining an angular difference between the zero position of a rotor position sensor of an electrical machine and the orientation of the permanent magnets of the electrical machine, wherein the electrical machine is controlled by means of a field-oriented control and the rotor of the electrical machine rotates, with a logic device which is configured to carry out a method described above.

[0033] The device for determining an angular difference between the zero position of a rotor position sensor of an electrical machine and the orientation of the permanent magnets of the electrical machine comprises a logic device which is designed to specify the current setpoints as reference variables to the current controller, as well as to determine or read out the setpoint voltages as a manipulated variable of the current controller and to carry out described calculations for determining the angular difference.

[0034] Advantageously, a device is provided for determining an angular difference between the zero position of a rotor position sensor of an electric machine and the alignment of the permanent magnets of the electric machine. The achievable accuracy is very high compared to known solutions and does not require measurement of the phase voltages on the electric machine. Furthermore, the invention relates to a drive train with a described device. In particular, the drive train comprises power electronics, an electric drive and / or a battery for supplying the electric drive with electrical energy. Such a drive train serves, for example, to drive an electric vehicle. Safe operation of the drive train is enabled by means of the method and the device.

[0035] The invention further relates to a vehicle having a described drive train. Advantageously, a vehicle is thus provided which comprises a device for determining an angular difference between the zero position of a rotor position sensor of an electric machine and the orientation of the permanent magnets of the electric machine.

[0036] The invention further relates to a computer program comprising instructions that cause the described device to execute the described method steps. The invention further relates to a computer-readable medium on which the computer program is stored.

[0037] It is understood that the features, properties and advantages of the method according to the invention apply or are applicable accordingly to the device or the drive train and the vehicle and vice versa.

[0038] Further features and advantages of embodiments of the invention will become apparent from the following description with reference to the accompanying drawings. Short description of the drawing

[0039] In the following, the invention will be explained in more detail with reference to some figures, which show: Figure 1 a schematic representation of a device for determining an angular difference between the zero position of a rotor position sensor of an electrical machine and the orientation of the permanent magnets of the electrical machine Figure 2 a schematically illustrated flow chart for a method for determining an angular difference between the zero position of a rotor position sensor of an electrical machine and the orientation of the permanent magnets of the electrical machine. Figure 3 a schematically illustrated vehicle with a drive train, Embodiments of the invention

[0040] The Figure 1shows a device 200 for determining an angular difference PhiOffs_opt between the zero position of a rotor position sensor 210 of an electric machine 220 and the orientation of the permanent magnets of the electric machine 220. The rotor position sensor 210 outputs the signal Phi_Sens. Preferably, an angle signal Phi is determined from the signal Phi_Sens and the determined angular difference PhiOffs_opt, which is used to control the electric machine. The electric machine 220 is controlled by means of a field-oriented control. The field-oriented control comprises, in particular, a d / q transformation 245, according to the invention a current controller 250, and in particular an inverse d / q transformation 255, also called inverse transformation.Preferably, in field-oriented control, a predetermined reference variable, for example a setpoint current I_setpoint, is transformed into the d / q system by means of the d / q transformation 245, or in field-oriented control, the setpoint current is specified directly as a d / q variable, i.e. Id_setpoint and Iq_setpoint. The d / q transformation is preferably carried out as a function of the angle signal Phi. In the d / q system, a control deviation is determined from the difference between the setpoint current Id_setpoint, Iq_setpoint and the d / q actual currents Id_actual, Iq_actual and provided to the current controller 250 as an input variable. The controller outputs setpoint voltages in the d / q system, Ud_setpoint and Uq_setpoint, as the manipulated variable. These d / q setpoint voltages are transformed back into the three-phase system by means of the inverse d / q transformation 255. The back transformation is preferably carried out as a function of the angle signal Phi.The three-phase target voltages Uu, Uv, Uw are provided by an inverter 230 to supply current to the electrical machine and are applied to the individual phases of the electrical machine. The actual currents lu, Iv, Iw result at the windings of the electrical machine 220 and are detected, for example, by current sensors and fed to the field-oriented control. They are transferred to the d / q system by means of the d / q transformation 245. There, they are fed, as described above, to determine the control deviation of the difference between the target current and the d / q actual currents. The device 200 comprises a logic unit 225, in particular a computing unit. The logic unit 225 is configured to output and specify a first d-target current value Id_soll_1 not equal to zero amperes by means of a read / output unit 222. In particular, the first d_setpoint current value Id_setpoint_1 is specified as the d-setpoint current of the field-oriented control, preferably in the d / q system.Likewise, a first q-setpoint current value Iq_soll_1 is output and specified. In particular, the first q-setpoint current value Iq_soll_1 is specified as the q-setpoint current of the field-oriented control, preferably in the d / q system. The logic unit 225 is further configured to read in or determine a first d-setpoint voltage Ud_soll_1 and a first q-setpoint voltage Uq_soll_1 by means of the read-in / output unit 222. This first d-setpoint voltage Ud_soll_1 and the first q-setpoint voltage Uq_soll_1 are the output variables of the current controller 250, in particular when the specified d- and q-setpoint current values have been adjusted. The logic unit 225 is further configured to output and specify a second d-setpoint current value Id_soll_2 not equal to zero amperes by means of the read-in / output unit 222. In particular, the second d_setpoint current value Id_soll_2 is specified as the d-setpoint current of the field-oriented control, preferably in the d / q system.Likewise, a second q-setpoint current value Iq_soll_2 is output and specified. In particular, the second q-setpoint current value Iq_soll_2 is specified as the q-setpoint current of the field-oriented control, preferably in the d / q system. The logic unit 225 is further configured to read in or determine a second d-setpoint voltage Ud_soll_2 and a second q-setpoint voltage Uq_soll_2 using the read / output unit 222. This second d-setpoint voltage Ud_soll_2 and the second q-setpoint voltage Uq_soll_2 are the output variables of the current controller 250, in particular when the specified d- and q-setpoint current values have been adjusted. The logic unit 225 is further configured to determine, by means of the input / output unit 222, an angle error PhiErr_opt as a function of the determined first d-setpoint voltage Ud_soll_1, the first q-setpoint voltage Uq_soll_1, the second d-setpoint voltage Ud_soll_2 and the second q-setpoint voltage Uq_soll_2.The logic unit 225 is further configured to determine and output the angular difference PhiOffs_opt as a function of the angular error PhiErr_opt by means of a determination unit 224. The Phi_Sens signal of the angular position sensor is preferably corrected using the determined angular difference PhiOffs_opt. This preferably results in the angular signal Phi, which is used to control the electric machine. The read-in / output unit 222 preferably outputs and provides a first q-setpoint current value Iq_soll_1 equal to zero amperes. The read-in / output unit 222 preferably determines the angular error PhiErr_opt as a function of the arctangent of the quotient of the sum of the first d-setpoint voltage Ud_soll_1 and the second d-setpoint voltage Ud_soll_2 and the sum of the first q-setpoint voltage Uq_soll_1 and the second q-setpoint voltage Uq_soll_2. Preferably, the determination unit 224 determines the angle difference PhiOffs_opt as a function of a predetermined angle difference PhiOffs_vor.The logic unit 225 is preferably further configured to determine, by means of a specification unit 226, the specified angle difference PhiOffs_vor as a function of a specified angle error PhiErr_vor or as a function of a difference between a sensor angle difference PhiOffs_Sens and the specified angle error PhiErr_vor.

[0041] Figure 2shows a schematically illustrated flowchart for a method 100 for determining an angular difference PhiOffs_opt between a zero position of a rotor position sensor 210 of an electric machine 220 and an orientation of the permanent magnets of the electric machine 220. The electric machine 220 is controlled by means of a field-oriented control and the rotor of the electric machine 220 rotates. The method 100 begins with step 105. In step 150, a first d-setpoint current value Id_soll_1 not equal to zero amperes and a first q-setpoint current value Iq_soll_1 are specified. In step 155, a first d-setpoint voltage Ud_soll_1 and a first q-setpoint voltage Uq_soll_1 are determined.In step 160, a second d-setpoint current value Id_soll_2 is specified, wherein the second d-setpoint current value Id_soll_2 corresponds to the value of the first d-setpoint current value Id_soll_1 with complementary signs, and a second q-setpoint current value Iq_soll_2 is specified, wherein the second q-setpoint current value Iq_soll_2 corresponds to the value of the first q-setpoint current value Iq_soll_1 with complementary signs. In step 170, a second d-setpoint voltage Ud_soll_2 and a second q-setpoint voltage Uq_soll_2 are determined. In step 175, an angle error PhiErr_opt is determined as a function of the determined first d-setpoint voltage Ud_soll_1, the first q-setpoint voltage Uq_soll_1, the second d-setpoint voltage Ud_soll_2, and the second q-setpoint voltage Uq_soll_2. In step 180, the angle difference PhiOffs_opt is determined as a function of the angle error PhiErr_opt. Preferably, in step 182, the angle difference PhiOffs_opt is determined as a function of a predetermined angle difference PhiOffs_vor.The procedure ends with step 195.

[0042] The Figure 3 shows a schematically illustrated vehicle 400 with a drive train 300. The drive train comprises a device 200 for determining an angular difference PhiOffs_opt between the zero position of a rotor position sensor 210 of an electric machine 220 and the orientation of the permanent magnets of the electric machine 220. The drive train 300 preferably comprises the electric machine 220, an inverter 230 and / or a battery 232 for supplying the electric drive train 300 with electrical energy.

Claims

1. Method (100) for determining an angle difference (PhiOffs_opt) between a zero position of a rotor position sensor (210) of an electric machine (220) and an orientation of the permanent magnets of the electric machine (220), wherein the electric machine (220) is controlled by means of a field-oriented control with a current controller (250) and the rotor of the electric machine (220) rotates, comprising the steps of: specifying (150) a first d setpoint current value (ld_soll_1) not equal to zero amperes as a reference variable of the current controller (250) and specifying a first q setpoint current value (lq_soll_1) as a reference variable of the current controller (250); determining (155) a first d setpoint voltage (Ud_soll_1) and a first q setpoint voltage (Uq_soll_1) as resulting manipulated variables of the current controller (250); specifying (160) a second d setpoint current value (ld_soll_2) as a reference variable of the current controller (250), wherein the second d setpoint current value (ld_soll_2) corresponds to the value of the first d setpoint current value (Id_soll_1) with complementary signs, and specifying a second q setpoint current value (lq_soll_2) as a reference variable of the current controller (250), wherein the second q setpoint current value (lq_soll_2) corresponds to the value of the first q setpoint current value (lq_soll_1) with complementary signs; determining (170) a second d setpoint voltage (Ud_soll_2) and a second q setpoint voltage (Uq_soll_2) as resulting manipulated variables of the current controller; determining (175) an angle error (PhiErr_opt) depending on the determined first d setpoint voltage (Ud_soll_1), the first q setpoint voltage (Uq_soll_1), the second d setpoint voltage (Ud_soll_2) and the second q setpoint voltage (Uq_soll_2); determining (180) the angle difference (PhiOffs_opt) depending on the angle error (PhiErr_opt).

2. Method (100) for determining an angle difference (PhiOffs_opt) according to Claim 1, wherein the first q setpoint current value (lq_soll_1) is specified as equal to zero amperes.

3. Method (100) for determining an angle difference (PhiOffs_opt) according to either of the preceding claims, wherein determining (175) the angle error (PhiErr_opt) is effected as a function of the arc-tangent of the quotient of a first sum of the first d setpoint voltage (Ud_soll_1) and the second d setpoint voltage (Ud_soll_2) and a second sum of the first q setpoint voltage (Uq_soll_1) and the second q setpoint voltage (Uq_soll_2).

4. Method (100) for determining an angle difference (PhiOffs_opt) according to any of the preceding claims, comprising the further step of: determining (182) the angle difference (PhiOffs_opt) depending on a specified angle difference (PhiOffs_vor).

5. Method (100) for determining an angle difference (PhiOffs_opt) according to Claim 4, wherein the specified angle difference (PhiOffs_vor) is determined depending on a specified angle error (PhiErr_vor), in particular depending on a difference between a sensor angle difference (PhiOffs_Sens) and a specified angle error (PhiErr_vor).

6. Method (100) for determining an angle difference (PhiOffs_opt) according to Claim 5, wherein the specified angle error (PhiErr_vor) is determined depending on a zero current control or a test pulse method.

7. Method (100) for determining an angle difference (PhiOffs_opt) according to any of Claims 4 to 6, wherein determining the angle difference (PhiOffs_opt) is effected depending on the difference between the specified angle difference (PhiOffs_vor) and the angle error (PhiErr_opt).

8. Device (200) for determining an angle difference (PhiOffs_opt) between the zero position of a rotor position sensor (210) of an electric machine (220) and the orientation of the permanent magnets of the electric machine (220), wherein the electric machine (220) is controlled by means of a field-oriented control with a current controller (250) and the rotor of the electric machine (220) rotates, comprising a logic unit (225) configured to carry out a method (100) according to any of Claims 1 to 7.

9. Drivetrain (300) comprising a device (200) according to Claim 8.

10. Vehicle (400) comprising a drivetrain (300) according to Claim 9.

11. Computer program, comprising instructions that cause the device (200) according to Claim 8 to carry out the method steps according to Claims 1 to 7.

12. Computer-readable medium on which the computer program according to Claim 11 is stored.