Part Number: TMS320F280039C
Other Parts Discussed in Thread: BOOSTXL-3PHGANINV


Tool/software:
I am using the F280039C microcontroller with the BOOSTXL-3PHGANINV driver and opened Universal_motorcontrol_lab_f28003x.
I connected the Hall sensor of one of my motors to the BOOSTXL-3PHGANINV as explained in the datasheets and I need to do the calibration.
I have not found anything about this procedure, only this post and this comment in the universal motor control lab:
// Enable MOTOR1_HALL_CAL pre-defined symbols, run the motor with FAST for angle calibration
// Copy hall_M1.thetaCalBuf[] to hallAngleBuf[]
// 1->1, 2->2, 3->3, 4->4, 5->5, 6->6, 6->0
// Disable MOTOR1_HALL_CAL pre-defined symbols after calibration for normal operation
// 6 1 2
// 3 4 5
// 6
1) I didn't understand whether I have to activate both the predefined symbol HALL_CAL and MOTOR1_HALL during calibration .. or if I only have to activate HALL_CAL.
2) Where should I write the required code for calibration? Just below the comment in the motor1_drive.c file? In the main?
3) Correct me if I'm wrong, is this the code that needs to be written?
float32_t hallAngleBuf[7] = { 0, 0, 0, 0, 0 , 0, 0 };
hallAngleBuf[0] = hall_M1.thetaCalBuff[0];
hallAngleBuf[1] = hall_M1.thetaCalBuff[1];
hallAngleBuf[2] = hall_M1.thetaCalBuff[2];
hallAngleBuf[3] = hall_M1.thetaCalBuff[3];
hallAngleBuf[4] = hall_M1.thetaCalBuff[4];
hallAngleBuf[5] = hall_M1.thetaCalBuff[5];
hallAngleBuf[6] = hall_M1.thetaCalBuff[6];
hallAngleBuf[0] = hall_M1.thetaCalBuff[6];
After writing the above code in the main, I put hall_M1.thetaCalBuff in the expressions (while debugging) but everything remains at 0.
Investigating a bit, I noticed that the HALL_calibrateIndexAngle function (which I believe is calibration) does not vary ... that is, it is called repeatedly if and only if motorVars_M1.flagEnableRunAndIdentify= 0 but no parameters within it change .. it's all zero!
I should have uploaded some pictures, please tell me if you see them