Hello Guest it is November 16, 2019, 07:38:36 PM

Author Topic: Request for LUA advice: Rigid Tapping  (Read 129 times)

0 Members and 1 Guest are viewing this topic.

Request for LUA advice: Rigid Tapping
« 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?

Offline smurph

  • *
  •  1,149 1,149
  • "That there... that's an RV."
    • View Profile
Re: Request for LUA advice: Rigid Tapping
« Reply #1 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.

Re: Request for LUA advice: Rigid Tapping
« Reply #2 on: September 24, 2019, 08:31:22 AM »

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