Hi,
you could write your own m code.
As I posted earlier Machs Gcode interpreter will on encountering an m code first look in the Macros directory of your current profile.
If it finds such a file it will execute it.
In general I follow the rule that I followed when I used Mach3 with regard to the Numbering of M codes. There are no native m codes in
Mach above 100. Thus you could name your custom macro m105() say, and be assured that it would not corrupt any of Machs native
functionality.
Lets however take an m code, say, m3. This is an m code native to Mach which turns on the spindle with CW rotation. If you write your own
m3(), and install it in the macros folder and Mach encounters m3 in your code it will find and execute your m3 macro in preference
to its native m3. Provided your macro is well coded and provides at least the same functionality as the native m3....all well and good.
If however your m3 is not well coded or has some logic error you can expect Mach to crash.......its following the code you provided, its up to
you to ensure that code is good.
If, as Graham and I opine, that m29 is not native to Mach4Hobby, then you could write your own m29 macro.
If I understand correctly you are anticipating that m29 enables rigid tapping?
Rigid tapping requires that the Z axis be coordinated with the spindle, namely that the Z axis descend the pitch of the thread per revolution of
the spindle. This requires a realtime move, that is to say that the around the loop communication delays imposed by controller/Mach/motion buffer/controller
all but preclude Mach from being able to directly control rigid tapping. If realtime control is sought it MUST be provided by the controller.
I note, but have not used, the rigid tapping feature of the Ethernet SmoothStepper. I would commend you do some research on that feature
of the ESS.
My understanding is that for rigid tapping to work you must have Truly Superb Velocity Control of your spindle. This will require the use of
at least index feedback, but more likely an encoder, and very good, probably PID speed control. Do you have or can you arrange such control?
Even if Mach4Hobby did support m29, your motion controller and most particularly your spindle must support it also.
I have a spindle that I made that uses a secondhand 1.8kW Allen Bradley AC servo. In normal operating conditions I use it as a PWM voltage controlled
free running motor....but because it is a servo I can, and occasionally do, use it in position controlled mode. At that point its really a C axis, ie an
angularly controlled rotation about the Z axis. When I wish to do rigid tapping I use the fact that I can coordinate an angular axis with a linear axis:
g1 c2700 z-20
for example rotates the C axis 7200 degrees or (7200/360) 20 revolutions while the Z axis descends 20mm, thus describing a helically interpolated
controlled point of 1mm pitch and 20mm deep, an ISO M6 thread. This would be followed with a:
g1 c0 z0 move which would back the tap out of the hole.
I very seldom used it in this mode, but it did work. My own design mini-mill of that time started to flex when the spindle exerted much more than about
3Nm of torque. The flexure was inclined to stress and/or break the tap. In order to limit that flexure required that I limit threads to ISO M6 and smaller.
I am commissioning my new build mill, and have been for the last month or so, it is much more rigid and so I will be able to push the rigid tapping
feature to its max...I hope.
I have not bothered to set up for rigid tapping with my new mill yet, I still need to finish way-covers, better flood cooling, a new BoB install.....and the list
goes on. I'll get to rigid tapping. eventually. Note that I have been able to exploit that my spindle has position control, which is most surely Truly
Superb Velocity Control!!
Craig