I am trying to drive a 3-phase BLDC motor with FOC and have some questions about obtaining resolver offset angle. In the driver I used ABC notation for phases and FOC accepts A phase as 0 angle electrical. The motor cabling uses UVW notation. The motor has 5 pole-pairs. There is a resolver for angle detection and the logic uses Angle Tracking Observer to calculate the speed and angle. Logic treats the rotation in CW direction seen from the front of the motor shaft as positive.
Now, here comes the issue. The motor operates fine with ABC phases connected to VWU respectively. In this case, the offset is set to -11.5 degrees, meaning that we subtract 11.5 from the angle we get from the resolver and use that as rotor angle. Through the serial port, I get some debug data on the calculations inside the FPGA and through this data I verified that FOC actually produces a field that is 90 degrees ahead of the rotor angle (in magnetic field domain of course).
To obtain the resolver offset for any motor and for any phase connection scheme, we prepared a calibration algorithm. The idea is to command the motor with basic SVPWM vectors and get the angle from the resolver and calculate the offset between them. To test it, I switched the phase connection to ABC-to-UVW respectively and run the calibration algorithm. What I expected was, since I rotated the phase connection in negative direction by 120 degrees, I would get -11.5 - 24 = -35.5 degrees for the new offset value. Because the magnetic field that is produced should move in the negative direction in mechanical world by 24 degrees because of the number of pole pairs. To my surprise, I actually got 12.5 degrees which is -11.5 + 24 and that would mean that magnetic field moved in positive direction. This doesn't make sense for me.
The logic with 12.5 degrees offset and the ABC-to-UVW phase connection also works, and it actually creates the magnetic field 90 degrees ahead of the rotor angle. The power consumption is the same in both cases, so the efficiency is also the same.
I was wondering what might be the cause of 24 degrees change in the offset? Am I missing something? I added a drawing of the phase change that I did to give you a better sense of my understanding of the system.