cancel
Showing results for 
Search instead for 
Did you mean: 

Motor Control problem in positioning

ABask.1
Associate II

Hello community, i have a problem with Motor in Position mode.
I use kit of two boards X-NUCLEO-IHM08M1 and NUCLEO-G431RB. I connected quadrature encoder using ABZ interface. Everything works well when motor rotates in diapazon from -180 rad to +180 rad.. If I set position more than 180 rad for example 200 rad motor stuck in some position 188 rad, 185 rad and so on, and do not move before reset Do you have any recommendation or suggestions what it might be?

6 REPLIES 6
GMA
ST Employee

Hello @ABask.1,

Could you please be more precise about your test case as described in this post?

Using MCWB6.3.0 and same boards, following commands are executed successfully, 200 and -200 radians are reached, and motor is not stuck (Delay should be higher than position command duration).
Could you check with a scope that, signal A, B and Z are correctly generated?

float_t Dangle = 200;  
  
MC_StartMotor1();
 HAL_Delay(1000);
 MC_ProgramPositionCommandMotor1(0,2);
 HAL_Delay(3000);
 MC_ProgramPositionCommandMotor1(Dangle,2);
 HAL_Delay(3000);
 MC_ProgramPositionCommandMotor1(0,2);
 HAL_Delay(3000);
 MC_ProgramPositionCommandMotor1(-Dangle,2);
 HAL_Delay(3000);
 MC_ProgramPositionCommandMotor1(0,2);
 HAL_Delay(3000);
MC_StopMotor1();

 

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

Hello! @GMA 

I try your example with 200 rad. works. I change to 360 rad and it is not work. I add some logging to understand what happens between movements. I pin some screenshots.

GMA
ST Employee

Hello @ABask.1,

According to your logs, commands are correctly handled, but motor has not processed the number of rotations as expected.
Does your motor can spin freely, or is it connected to mechanical parts that could prevent rotation?
In your code, highest speed will be reach on 360rad to 0rad in 2s transition, that means 1718RPM, have you tested your environment in Speed Control mode and Encoder Speed sensing at such speed?

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

Hello motor spins freely, any mechanical parts connected to the motor. In speed control motor normal rotates at 2000RPM. I also try rotates step by step for ex. 0rad to 20 rad delay, 20rad to 40rad delay and so on, but motor stucks at about 200 rad

GMA
ST Employee

Hello @ABask.1,

Using your FW (122504.png) and the same boards as you, I do not have such behavior.

GMA_0-1725886164219.png
On your first post, you said that you were not able to reach 200rad: "for example 200 rad motor stuck in some position 188 rad, 185 rad", now you are able to do so. What is the difference between both tests?
Is-it possible for you to test another motor?
Could you check A, B, Z signals coming from sensor with a scope?

If you agree with the answer, please accept it by clicking on 'Accept as solution'.
Best regards.
GMA

I change current 7 pole Motor to another, that has 14 poles and now motor stuck at 96 radians.

I also changes optial encoder to magnetic encoder with the same resolution, and i have got same result(((

May i do some wrong while i setup the project? While motor stucks at some angle, the motor try to move "it is looks like jerk".

Could you send me your project from MC Workbench?