Position control (based on AN5464) using quadrature incremental encoder(ABZ)
Hello,
I'm trying to do position control using EVSPIN32G4 board and pmsm motor with incremental encoder. I followed the steps given in AN5464. The motor did not move and the rotor is locked. I'm attaching the code here.
**********************************************************************************************************
/* USER CODE BEGIN 2 */
MC_StartMotor1();
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while(MC_GetAlignmentStatusMotor1()!=TC_ALIGNMENT_COMPLETED){}
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
MC_ProgramPositionCommandMotor1(3.14/2,0.1);
HAL_Delay(2000);
MC_ProgramPositionCommandMotor1(-3.14/2,0.1);
HAL_Delay(2000);
}
/* USER CODE END 3 */
***********************************************************************************************************
While debugging the code stops at "while(MC_GetAlignmentStatusMotor1()!=TC_ALIGNMENT_COMPLETED){}". It never comes out of this while loop.
The A,B & Z pulses are working fine. Motor runs perfectly in sensorless FOC(speed control). I think the alignment does not happen at all. kindly help with this. I'm very short on time to complete the project
MC Workbench 6.2.1
CubeMX 6.6.1
CubeIDE 1.15.0
any help guys?
