I'm currently developing a motor controller with FOC (Field Oriented Control) and I have some trouble with the offset calibration of a motor.
What I actually do to calculate the offset: I inject a voltage directly in the d-axis, such that the motor alignes. The offset is then chosen as this position. When I then calculate the electrical angle, I add PI/2, such that I get an alignement with the q-axis.
What I expect: When the offset is chosen the right way with the method above, the motor produces the maximum amount of torque/ampere for the motor and it should run the same in both directions.
What I get: The motor produces the maximum amount of torque, but the motor turns way better in one direction than the other. I see also high id spikes when this happens as shown below. When I manually adjust offset a little, then it turns the same in both directions and the spikes depicted below are gone, but it has no more the maximum torque.
What I further see is, that when I exchange the Phase U and W, it works better in the other direction, so the motor should not be the problem here. Has anyone an idea, what could cause this problems?