How to Implement T1M6 and T2M6 for Dual Z-Axis in LinuxCNC

More
1 year 9 months ago #320216 by pd_2832
I'm working on a multihead CNC machine with a dual Z-axis configuration. My goal is to use T1M6 to activate Z1 and T2M6 to activate Z2. I've tried implementing Python remapping, but I'm encountering the following error:


AttributeError: module 'linuxcnc' has no attribute 'remap_command'

Here’s what I’ve tried so far:
1. Created a Python remap script (tool_remap.py).
2. Updated my INI file to include the Python remap.
3. Tested NGC subroutines as an alternative.

My current setup:
- LinuxCNC version: 2.9.3
- INI file configuration: [paste INI file]
- Python script: [paste Python script]
- Error logs: [paste error logs]

Could someone please help me resolve this issue? Thank you!

Please Log in to join the conversation.

More
1 year 9 months ago #320218 by Aciera
Please attach ini file and error log.

All I can see at the moment is:
Code:
# def tool_remap(self, **words): # command = linuxcnc.command() # stat = linuxcnc.stat() # stat.poll()

Here you were confusing python remaps with the python interface.

Please Log in to join the conversation.

More
1 year 9 months ago #320223 by pd_2832
I am using the remap_subs feature in LinuxCNC to control the Z-axis activation for multiple Z axis. Currently, I have implemeted below things:

M428 activates the Z1 axis.
M429 activates the Z2 axis.
However, my goal is to have the activation as mentioned below:

When executing T1 M6, the Z1 axis should be active.
When executing T2 M6, the Z2 axis should be active.
How can I modify the remap logic to achieve this behavior?

Here in gcode file there is T1M6 for Z1 axis instead M428 and T2M6 for Z2 instead of M429.
If i use M428 and M429 in gcode file on the place of T1M6 and T2M6 all things work perfectly but I dont want to change my gcode file how to implement above thing?

Please Log in to join the conversation.

More
1 year 8 months ago #320231 by Aciera
You might want to try a simple ngc remap like this first:

Save this as 'm6remap.ngc' in your './remap_subs' folder
Code:
o<m6remap>sub M66  E0 L0  ;force synch ;(debug, tool: #<_selected_tool>) o1 if [#<_selected_tool> EQ 1]   (print, Tool 1 - Switching to Z1)   M428 o1 elseif [#<_selected_tool> EQ 2]   (print, Tool 2 - Switching to Z2)   M429 o1 else   (print,Unknown tool: #<_selected_tool>) o1 endif o<m6remap>endsub

Add this to the [RS274NGC] section of your ini file:
Code:
REMAP = M6    modalgroup=6   ngc=m6remap

Please Log in to join the conversation.

More
1 year 8 months ago #320470 by pd_2832
Hello,

Thanks for your suggestion, as its working properly, I am able to run both Z axis perfectly. 

Please Log in to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum