M6 remap not working in AUTO mode

More
22 Feb 2024 14:06 #293981 by polobear189
Hello machine configurators,

I have been setting up my emco compact 5 with 6 pos tool changer...All works in MDI mode!

LinuxCNC version 2.7.15

Tool changer runs on the A axis, when a tool change is requested (T1 M6) m6 has been remapped to call an O code sub program tool_change.ngc which calls t1m6.ngc

I suspect there is a problem with either the HAL loop back or prelog or epilog of tool change?

when test program is run, test1.ngc, tool changes from "NO TOOL" and any other tool than 2, to tool 2 and loads the correct offsets but just stops after tool change. Spindle doesn't start.

Having followed the documentation and loads of posts on this forum, i cannot take it any further with my limited knowledge!

Many thanks!

 

Please Log in or Create an account to join the conversation.

More
22 Feb 2024 17:12 #293999 by Aciera
I' no expert with tool change remaps but I notice that you are using 'M2' inconsistently (eg no m2 in your 'tool_change.ngc',  but m2 _inside_  your 't1m6' subroutine. Might be worth a shot to fix that.

The (current) documentation warns about using m2 inside a subroutine, which is probably also true for older versions.
linuxcnc.org/docs/html/gcode/o-code.html
 
Attachments:

Please Log in or Create an account to join the conversation.

More
23 Feb 2024 00:16 #294036 by polobear189
Thought the M2s might be an issue, so took them out the programs I was running, hence the inconsistancies,despite them being used all throughout documentation of all example o code programs.

All replaced with M30, machine does the same thing, changes tool, applies offsets and correct tool number appears bottom left, but spindle wont start and program stops.

Noticed in HAL configuration > signals > tool-number, signal just stays at zero even when a tool is selected (picture shows no tool selected currently) what is the proper functioning of this signal I have no idea.

I also sometimes get the error message no percent or program end, when all sub routines and running program have program ends.

Andy

Please Log in or Create an account to join the conversation.

More
23 Feb 2024 00:22 #294037 by polobear189
Attachments:

Please Log in or Create an account to join the conversation.

More
23 Feb 2024 08:35 #294053 by Aciera
Again, not really familiar with automatic tool change, but it seems odd to me that you would have lines with 'hal_manualtoolchange' in you hal file:
loadusr -W hal_manualtoolchangenet tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number

It may be useful to insert debug statements in your ngc remaps to find out where the process stalls.

Please Log in or Create an account to join the conversation.

More
26 Feb 2024 17:22 #294537 by polobear189
Thanks for the suggestions,

From ALL tool change file i have removed Txx M6 ( i was concerned that calling it again in the ngc file it was entering an endless loop) and replaced it with M61 Qxx

i have changed all M02's to M30 (also tried M99 but apparently its not a recognised m code in linux cnc)

Put debug statements in ngc files, ngc programs seem to run as expected, only after the tool change i cannot submit any MDI commands, and program stops, interpreter is apparently IDLE according to machine > axis information.

I have manual toolchange loaded in HAL because i do not have a component for a tool change for my lathe, i was under the impression that remapping M6 would still allow you to do an auto tool change, i was either going to just press the ok button to aknowledge the tool change or somehow force the OK button pressed in software or HAL. Does an automatic tool change component have to be loaded?

It appears as though a tool change has happened if i monitor signals in HAL config, tool-number is correct and tool changed signal pulses after tool change.

Is there any way to prove if m6 prolog and epilog are working?

I have also done some minor changes to HAL and ini

INI_VARS = 1
HAL_PIN_VARS = 1
TOOL_CHANGE_WITH_SPINDLE_ON = 1
TOOL_CHANGE_QUILL_UP = 1
RANDOM_TOOLCHANGER = 0

Completely at my wits end with this problem now, any other suggestions would be very much appreciated!

Andy



 
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Feb 2024 17:24 #294539 by polobear189
Attachments:

Please Log in or Create an account to join the conversation.

More
26 Feb 2024 18:13 #294540 by Aciera
Have you tried starting linuxcnc from the terminal and check for information/errors in the terminal window?

$ linuxcnc

Please Log in or Create an account to join the conversation.

More
28 Feb 2024 00:17 #294650 by polobear189
 

File Attachment:

File Name: errorreport.ngc
File Size:35 KB
Can't see any errors, but might not be looking in the right place.. 
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.127 seconds
Powered by Kunena Forum