2024-06-22 01:46 AM - edited 2024-06-22 01:54 AM
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
@msingh @smaiti and many others faced same issue. But there wasn't any explanation on how they overcome this issue.
MC Workbench 6.2.1
CubeMX 6.6.1
CubeIDE 1.15.0
any help guys?
2024-07-19 11:02 PM
I have almost same question. You asked this question and many members replied your question by reading their answers my problem is solved almost 80 percent.
I hope Your problem will be also solved.
2024-07-22 01:25 AM
Hello @Rajeswari,
Yes, test has been done with EVSPIN32G4, 1000ppr Encoder, 4500 RPM max motor, and signal Z pulse generated at each rotation.
RC low pass is used on encoder MCU input, smaller is your resistor higher is your cutoff frequency.