I could use some advice on how to implement a simple spindle interface as follows...
1) The 0-10V analog output for speed reference is on KANALOG DAC0
2) Run forward is on Opto Out 5
3) Run reverse is on Opto Out 6
Obviously the spindle needs to respond to the KMotionCNC controls including the M3-5 commands.
I can see there are 'C' programs...
OffJog.c
OnCCWJog.c
OnCWJog.c
SpindleJog.c
...and a header file MySpindleDefs.h
I can see how to select the DAC channel and output bits in the header file, but what do I do with the 'C' files?
I can point the appropriate buttons in KMotionCNC to the OnCWJog.c file etc, but what do I need to do to output the correct Analog reference voltage and to get it to respond to G3-5 commands?
Presumably SpindleJog.c is used, but how? It looks like it gets called repeatedly by something, but by what and how? If the body of the code cut and pasted into the same endless loop at the end of the Init.c file in the same way as the Enable is handled?
It would be really helpful to have a YouTube video that explains the relationship that KMotionCNC has with the various variables and this pretty typical spindle control implementation.
Simple KMotionCNC Spindle Interface
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2741
- Joined: Mon Dec 04, 2017 1:49 am
-
- Posts: 78
- Joined: Tue Mar 30, 2021 8:07 am
Re: Simple KMotionCNC Spindle Interface
Thanks Tom, I couldn't see that.