Under Construction..... I may have this figured out by Feb 2018 (late - maybe April :)) .... there - I've given myself 8 weeks to get this right!
OK - done and success.... see below video - will update post in coming weeks to detail how this is accomplished.
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.
Currently for normal half nut feed rate operation I simply look up RPM once, calculate feed rate and away I go. On testing this, I realized that not only do I have small errors due to time spent executing code but the actual spindle speed can decrease by 2-4% when engaging the cutter into the work. These small errors will be problematic for threading and therefore I'll need to actively monitor the spindle RPM and constantly adjust the feed rate with each index mark of the spindle. Currently I only have a single index mark monitoring the spindle and although this limited monitoring input may become insufficient, to increase the monitoring to say a 2000 count encoder would certainly not be ok as the arduino would certainly not be able to handle this amount of input while trying to send multiple motor counts. I may find that this is an issue - for now I start with one index pulse per spindle revolution.
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