Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: mcardoso on September 22, 2019, 03:10:45 PM

Title: Request for LUA advice: Rigid Tapping
Post by: mcardoso on September 22, 2019, 03:10:45 PM
Another post here!

Similar to my post about absolute homing, I am able to message my servo drives using serial commands and configure them to have different gear ratios to the Step/Dir input from Mach 4. I have also added a relay in my control cabinet (tied to an output from Mach 4) which physically disconnects the Z axis drive from the Smoothstepper Step/Dir signals and connects it to the encoder output of my spindle motor drive. Using this method, I can cause the Z axis to follow the exact motion generated by my spindle in a true closed loop fashion. By changing the gear ratio at the drive, I can program the threads per inch of the tap that I am using.

With this, I hope to be able to accomplish rigid tapping using the spindle encoder to drive axis motion. This all happens after the smoothstepper and does not rely on any Mach 4 controlled hardware.

My question is, can I modify Mach 4's behavior to a G84 call, or do I need to create a custom M function? Will these functions wait for my code to complete before continuing through the rest of the G code?
Title: Re: Request for LUA advice: Rigid Tapping
Post by: smurph on September 23, 2019, 01:02:41 PM
You cannot modify the G84 call.  If you have Mach Industrial, you can program a G code (say G84.5) to do what you want.  Otherwise, it will have to be an M code.  And in both cases, Mach will wait on those functions to finish.

Steve
Title: Re: Request for LUA advice: Rigid Tapping
Post by: mcardoso on September 24, 2019, 08:31:22 AM
Smurph,

Thanks for the information. I have Mach 4 Hobby so I will be scripting an M code for sure.

Mike