Speed monitoring and Single stepping a motor
I am running a 28 pole 20A nominal motor using x-Nucleo IHM08M1 and a nucleo -G431RB. I have been doing a number of tests verifying locked rotor current/torque and checking the effect of different settings of proportional gain.
I am using Stm32CubeMonitor to monitor all the variables.
I am using 6 step control. and Hall devices for sensing
My understanding seems to be progressing. answers to the following two questions would assist me greatly.
1/ When I use the following code to monitor the speed
MC_ProgramSpeedRampMotor1(1,0);
MC_StartMotor1();
for (int i = 1; i <= 200; i++)
{
Faults =MC_GetOccurredFaultsMotor1();
speed = MC_GetAverageMecSpeedMotor1_F();
HAL_Delay(50);
}
MC_StopMotor1();
I get integer values for speed and in multiples of 6. eg the speed value jumps from 0 to 6 to 12 etc whereas I am expecting a float as an answer.
The final speed is 36 rpm whereas I expect it to be 6 rpm.
What am I doing wrong?
2/ At 28 poles x 6 steps gives me 168 positions per rotation and with a 300 mm Outside diameter rotor I expect to be able to do position control giving me approximately a 3mm resolution.
How do I single step this motor or move it a set number of steps.
Thanks
Roy
