Hi Bill,
So the motor phase rotates properly but the index signal is all wrong for some reason.
It almost looks like the hall sensor signals which occur ~ every 1/3 phase cycle. Maybe there is some cross talk or something?
You really shouldn't print things within the AutoPhaseFind.c loop because that will change the timing and possibly even block execution which might cause the program to miss the index pulse. But that wouldn't explain catching extra index pulses.
Here is a little program that just prints "Index" (and blinks a KFLOP LED) every time the Index pulse is detected. Change the bit number to whatever you are using if not 68.
Code:
#include "KMotionDef.h"
main()
{
for (;;)
{
if (ReadBit(68))
{
SetBit(46);
printf("Index\n"); // send message to console
Delay_sec(0.5);
ClearBit(46);
}
}
}
Then just rotate the motor by hand. Check if the index pulse happens at exactly one place in a rotation.
Regards