Trapezoidal Control with Encoder

Hello everyone,

I am trying to implement my own code to have a better understanding of BLDC control theory. I want to implement trapezoidal control as starter. I have Odrive v3.6 driver and D5065 motor with CUI AMT102-V 8192 CPR encoder.

I have implemented current meausrements, parameter settings via spi, encoder measurements so far. In the start up profile to spin the motor, I am energizing A and B coils of motor for a second then I reset my encoder value which has a period of 360 degrees. Since the motor has 7 poles I should have 360/7 degrees of control period. Since trapezoidal control has 6 steps, I should be communtating in every (360/7)/6=8.571 degrees.

I am following exact same procedure above but I couldn’t get motor spinnig yet. I tried to change phase order so many times but no result. What am I missing here?

I would be so appreciated if you can help me.