2024-07-31 07:12 AM
I just started testing the Motor Control API ,such as the ones below for initializing the motor control
MC_ProgramSpeedRampMotor1(0, 0);
MC_StartMotor1();
Followed by this command which gets executed every 10 seconds.
if (speed>0){
// sets a given speed to the motor
MC_ProgramSpeedRampMotor1_F(speed*20, 0);
HAL_Delay(100);
}
else{
// stops the motor
MC_ProgramSpeedRampMotor1_F(0, 100);
HAL_Delay(100);
}
While the commands work and are able to control the motor. I'm noticing a lag of several seconds between when the target speed is set and when the motor actually starts moving. Please see the video below for reference. You can see how the "Speed Reference" moves first followed by several seconds of delay before the motor starts moving.
Any idea as to what maybe causing it and how I can get rid of that delay?