Under Construction..... I may have this figured out by Feb 2018 .... there - I've given myself 8 weeks to get this right!
So as I've stated, I would not have converted my Lathe unless I was able to still retain all the manual controls without too much effort. I've accomplished this so far above my expectations but one last, and most difficult, manual control is still outstanding: Threading. My original thought was to simply let the Mach4 side of this conversion perform the threading function because everything I read about threading with a slow controller was labeled impossible to extremely difficult to get right. So I was fine with this one aspect not in the Arduino code; so I thought. Problem is I couldn't seem to shake the lingering feeling that I didn't finish a job, the feeling became a constant nagging, which led to me sitting around starring into space as my mind ran through the possible solutions, and now I'm convinced I can perform threading with the Arduino. So this blog is about my attempt to perform threading with the Arduino Uno. It is NOT (yet) a success story.
Now a side note for the reader. I realize that the web is an amazing place for information from people smarter than I and could have the solution all worked out for this already (yet 1 year ago it was still illusive) but as is typical I'm going to work on this problem with my head firmly buried in the sand. This is not arrogance, it's simply my journey; my puzzle which I need to figure out and refuse to look up the solution - that would be a cheat. So the "note" for the reader is that my results may certainly not be the best way to implement threading with an Arduino.
Current state of program. For normal feed, spindle look up and then ignore through cut. On testing realize spindle changes RPM about 2%... Need to change to continuously monitor index to adjust - adjust will be to capture time at each input and modify the next 'pitch' to match requested feed. This will most certainly be required for threading.
Also must "start" at the same z location on each pass... this is no problem as current program always keeps track of the absolute motor count from program start. Just need to start the z motor motion very slow and look for that first index before I ramp up to the requested feed rate.
Operator input for threading. Don't want to add more buttons or LCD size but I'm out of room.... will use an extra long press of 3rd button (7 secs) to change Lcd and code to "threading". The LCD will then ask a series of questions with a single button confirming input. 1) The potentiometer will be used to dial through thread size options (all metric standard to start with). 2) LCD will then ask operator to take down the outside diameter to a certain size (printed on lcd) and confirm when complete and in position - this will then turn off the x handwheel function. 3) LCD question will ask to identify the end z location of the thread. 4) LCD question will ask to identify the start z location of the thread (with note that it should be at a minimum of 5mm ahead of material) - this will then turn off the y handwheel function. 5) LCD will ask to push button to start threading. The program will then run through the ENTIRE thread routine with operator interaction required at the start of each pass (a long press will exit the threading routine and return to the LCD and code to "non" threading.
I'm going to begin with the hardware at hand which is a single index pulse at the spindle input to the Arduino through a C25 Index Pulse Card. I may need to move to a rotary encoder as I expect the start of the thread will likely be a source of error which pushes the thread form outside allowed tolerances. but hope to keep this simple and