Hello Guest it is April 27, 2024, 03:48:11 PM

Author Topic: Lua script to toggle/swap betweenC axis as spindle AND C as rotary axis  (Read 1495 times)

0 Members and 1 Guest are viewing this topic.

 Hello everyone,

      I am looking for Macro/ Lua script  to TOGGLE  between C axis as Spindle (OBB) accepts S command  AND to index ROTORY axis when ever require  and accept G code commands ,
Re: Lua script to toggle/swap betweenC axis as spindle AND C as rotary axis
« Reply #1 on: September 28, 2023, 09:45:46 AM »
Hai is there  anyone have any idea

Offline cncmagic

*
  •  63 63
  • what me worry? heck...it ain't my machine anyway
    • View Profile
Re: Lua script to toggle/swap betweenC axis as spindle AND C as rotary axis
« Reply #2 on: September 29, 2023, 07:23:53 PM »
why not simply define another axis as rotary.. I'm guessing you're using pulse and dir for both? otherwise you'd also need to change the mode of whatever drive you're using.. flip the axis thru a relay that simply swaps which pins go to the drive. Thats a cheap and dirty approach.. you'd probably need one of the more advanced users to actually point you in the direction of how to swap the axis internally to Mach4. Bob :P
any semblance of information posted to anything remotely  close to accuracy is merely coincidence. Use at you own discretion.. or play the lottery.. same odds
Re: Lua script to toggle/swap betweenC axis as spindle AND C as rotary axis
« Reply #3 on: September 30, 2023, 05:58:28 AM »
I am just trying to make mill-turn, having basic 5 axis mill and A axis need to run as Spindle when in lathe mode ,  yes  trying to have index axis and spindle are in STEP/ DIR input
Re: Lua script to toggle/swap betweenC axis as spindle AND C as rotary axis
« Reply #4 on: September 30, 2023, 06:04:18 AM »
I have seen codes
mc.AxisSetSpindle
mc.AxisMapMotor
mc.AxisUnmapMotor  in Mach4 API core coding, 
is these codes can work in user defined M code macros?.

Offline cncmagic

*
  •  63 63
  • what me worry? heck...it ain't my machine anyway
    • View Profile
Re: Lua script to toggle/swap betweenC axis as spindle AND C as rotary axis
« Reply #5 on: September 30, 2023, 12:33:36 PM »
I'm not experienced enough to determine how these can and should be implemented.. you'll need someone a lot more involved in the API and with LUA to help. Bob :o
any semblance of information posted to anything remotely  close to accuracy is merely coincidence. Use at you own discretion.. or play the lottery.. same odds