This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28052F: Very first step of every lab: angle calibration

Part Number: TMS320F28052F

Hello everyone,
I am working on a software for sensorless motor control. The software (state machine etc.) is complex but as for the motor control it seems like the code contains every step of the lab contents.
Though we have a problem : sometimes it works perfectly well (our motor rotates at the wanted speed and stops whenever it detects an obstacle) but sometimes it rotates in the wrong direction and does anything but what it was supposed to do.
We believe it might concern a sort of rotor angle calibration that would not be done correctly at the very beginning. What make us think so is that with the labs we can see the motor doesn't rotate right away at SpdRef. First there is some current running in the motor phases, then we can see a very small rotation and only then the motor starts rotating.

I looked eveywhere in the lab code to find where and what could lead to this very first step of rotor angle calibration but couldn't find it.

An information could be useful :
I ran labs 2 and 3 first with the motor alone (no load) and then on our whole structure (no negligible load) and I got very different values of Rs/Ls and Flux. In both cases is used these values :
USER_MOTOR_RES_EST_CURRENT = 3.0
USER_MOTOR_IND_EST_CURRENT = -3.0

When running lab2 with the load I got these values which are incorrect (couldn't run lab 3) :
Rs = 0.398371309
Ls = .00000000280963386
Flux = 0.253554195

So I continued with the values I got from lab2 without load :
Rs = 0.423598498
Ls = 0.00102948234
Flux = 0.165455088

Which influence do you think this could have ?

We are using :
- a microcontroler TMS320F28052F
- a 2 poles BLDC motor

If you need any more information to help me i would be glad to provide them.
Thank you in advance for your help and have a nice day !
Isabelle