Hi Ben,
I wired the boards step input to k-flop jp7 step0 pin 15, direction input to direction0 pin 16, and ground to pin 26. On the configuration screen I selected no input and step dir output. On the configuration screen I selected no input and step dir output.
good
For output channels do I select channel 0?
No. Add 8 to switch to TTL Output mode which I think that board requires.
Also do I need to change anything else on the configuration screen?
no
On the step response screen I put 50000 for velocity, 5000 for acceleration and 1000000 for jerk.
good
Do I need anything for pid values or anything else?
no. There is no feedback
In k-motion cnc under the tool setup screen I believe I need to select a action for m3, m5, and s. I believe I need to select execute program for each one.
Correct. But before you do anything in KMotionCNC first test that you can control Spindle from KMotion.exe. Move on the Step Response Screen. And command Jogs on the Console Screen.
Then in KMotionCNC Tool Setup configure the Programs in C:\KMotion431r\C Programs\SpindleUsingJogs\CSS
All the programs in that directory include the file MySpindleDefs.h (shown below) modify it for your situation. Set the Spindle Axis to the axis you are using for your spindle. You will need to compute the Factor for your system. Set the CW and CCW bit to some dummy bits.
Code:
#define SPINDLEAXIS 6 // Axis Channel to Jog to rotate Spindle
#define FACTOR (1000/60.0) // to convert RPM to counts/sec (counts/rev / 60.0sec)
#define SPINDLECW_BIT 154 // bit to activate to cause CW rotation
#define SPINDLECCW_BIT 155 // bit to activate to cause CCW rotation
#define SPEEDVAR 99 // global persistant variable to store latest speed
#define STATEVAR 98 // global persistant variable to store latest state (-1=CCW,0=off,1=CW)
#define KMVAR PC_COMM_CSS_S // variable KMotionCNC will pass speed parameter (113)
Can the same thread be selected for all 3 programs?
Yes because they wont run at the same time (but a different Thread than your Init)
What variables do I choose?
M3,M4,M5 don't pass any information set the Var to 0
S must pass the Speed in Var 113 (as KMVAR above is set at)
Since I am just commanding speed can I just set thing up so sxxxx runs and s0 stops?
I suppose that could be possible but somewhat non-standard. Lets use M3 and M5 to turn the spindle on and off. The C programs are already set up to do this.
How do I get things to show the correct speed?
By adjusting the FACTOR in the MySpindleDefs.h file. After you get the Spindle running command the axis to Jog at various speeds (in counts/sec). For each speed check the RPM. This will allow you to compute the FACTOR.
HTH
Regards