Hi David,
Yes if you add 2 sensors placed 90 degrees apart on a disk that triggers the sensors for 1/2 of a rev then the AB signals could be connected to a hardware encoder input and it should behave exactly like an encoder with 4 counts/rev.
With just a single pulse you would need to count the transitions in software. Below and attached is an example program. The "pulse" must always be at least 180us long at your highest RPM (probably not an issue). You will need to determine the COUNTS_PER_REV2 value such that the measured speed matches the commanded Jog Speed.
Regards
Code:
#include "KMotionDef.h"
main()
{
for(;;)
{
WaitNextTimeSlice();
ServiceSpindleCount();
}
}
#define SPINDLE_PULSE_BIT 46
#define SPINDLE_AXIS 5
#define COUNTS_PER_REV2 1000
void ServiceSpindleCount(void)
{
static int LastState=0;
int NewState;
NewState=ReadBit(SPINDLE_PULSE_BIT);
if (NewState != LastState)
{
chan[SPINDLE_AXIS].Position+=COUNTS_PER_REV2;
LastState=NewState;
}
}