cancel
Showing results for 
Search instead for 
Did you mean: 

MotorControl Workbench 6.1.2 BLDC

boscoLEE
Associate II

hello?
I am trying to perform BLDC position control using STSPIN830(X-NUCLEO-IHM16M1)+ NUCLEO-F072RB and MotorControl Workbench 6.1.2.
Position control is MC_ProgramPositionCommandMotor1(). It can be controlled with a function, but how should the go_home() function be implemented to set the origin?
This function is essential for project progress.
help me !!!
Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Hello boscoLEE,

Can we assume that your issue has been resolved? 

Best regards

If you agree with my answer, please accept it by clicking on 'Accept as solution'."

View solution in original post

5 REPLIES 5
FouadB
ST Employee

Hello,

The API MC_ProgramPositionCommandMotor1() is used to program a movement command with a target position, and the direction of the movement is defined by the sign of the target position.

To return to the previous position before the last command, program the same target position but in the opposite direction. To return to the starting point, apply the accumulate positions in the opposite direction, as the overall commanded movements are initiated at the application level via the API.

Best regards

If you agree with my answer, please accept it by clicking on 'Accept as solution'."

 

Thank you for your reply
The purpose is to have the motor in a random position, move to the home sensor position when the power is turned on, and implement a movement operation after setting the origin (0).
So, we implemented it as follows and got satisfactory results.
I wonder if there will be any problems if I use it like this.

#define ORIGIN_HI_ANGLE 0.5

#define OFF_SENSITIVE 100

 

pSTC[M1]->SPD->wMecAngle = 0;

while(1)

{

if(HAL_GPIO_ReadPin( BM_HOME_GPIO_Port, BM_HOME_Pin) == 1)

{

sensitive=0;

MC_StartMotor1 ();

x = x + ORIGIN_HI_ANGLE;

MC_ProgramPositionCommandMotor1 ( x , 0 );

HAL_Delay(1);

}

else

{

if(sensitive++>OFF_SENSITIVE)

{

break;

}

}

}

pSTC[M1]->SPD->wMecAngle = 0;

 

thank you

 

Hello,

If you have obtained satisfactory results while testing your complete application, then it is a good accomplishment, I suppose.

Please refer to the attached example of API usage (Application Note - chapter 5.8). I hope it will assist you in completing your project.

Best regards

If you agree with my answer, please accept it by clicking on 'Accept as solution'."

Thank you for your answer

Hello boscoLEE,

Can we assume that your issue has been resolved? 

Best regards

If you agree with my answer, please accept it by clicking on 'Accept as solution'."