Speed behaviour MC_ProgramSpeedMotor1()
Hi
We are using MCSDK v6.3.0 IN STM32G431VBT6.
While running the motor in MC_ProgramSpeedMotor1(400,1000) we found that the average speed read using MC_GetMecSpeedAverageMotor1 is returning speed in range of 382rpm to 416rpm eventhough the commanded speed is 400rpm.
How can we control the motor speed in a range of 398-402 rpm say (+-2 rpm from the commanded speed)
Could you please look into the attached images and pseudo code and let me know how can we achieve the requirement to keep the motor speed within (+ or -2 rpm of commanded speed )
code flow:
HAL_Delay(10);
MC_StartMotor1();
while (MC_GetSTMStateMotor1() != RUN)
{
}
MC_ProgramSpeedRampMotor1(400, 1000);
while (1)
{
velocity1 = MC_GetMecSpeedAverageMotor1();
}


while the torque_qd = MC_GetIqdrefMotor1
torque_qd.q stays within 250 to 260 range
