2023-09-15 12:00 AM - edited 2023-09-15 06:18 PM
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.
Solved! Go to Solution.
2023-10-02 11:34 PM
Hello boscoLEE,
Can we assume that your issue has been resolved?
Best regards
2023-09-19 06:23 AM
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
2023-09-21 10:19 PM - edited 2023-09-21 10:22 PM
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
2023-09-25 04:58 AM
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
2023-09-30 04:59 PM
Thank you for your answer
2023-10-02 11:34 PM
Hello boscoLEE,
Can we assume that your issue has been resolved?
Best regards