How to remove automatic g54 after M2/M30 ?

More
5 months 1 day ago #346795 by zz912
M2 and M30 commands have the following effects:
  • Origin offsets are set to the default (like G54).
linuxcnc.org/docs/devel/html/gcode/m-code.html#mcode:m2-m30

In LCNC 2.7 it fortunately did not work.
In LCNC 2.9 it UNfortunately works.

My friends used LCNC 2.7.  They used G54 for vise number 1 G55 for vise number 2 and so on. They dont use G5X in ngc files. They have many many ngc files. They were happy.

They started use Mesa cards 7i96s so they had to upgrade to LCNC 2.9. But in LCNC 2.9 automatic Ǵ54 UNfortunately works again. It is very dangerous for them. They works on vise number 2 with active G55, but after program end G54 is activated.

I need help. Where is "automatic Ǵ54 after M2/M30" in source code? I want delete it for us using.

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

More
5 months 1 day ago #346797 by rodw
Seems this G54 reset occurs in Interp::convert_stop()
in interp_convert.cc
github.com/LinuxCNC/linuxcnc/blob/master...erp_convert.cc#L5052
edit at your own risk :)

Note this is where Gcode is converted to blocks that are stored in a circular buffer and subsequently executed by motion.
The following user(s) said Thank You: zz912

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

More
5 months 1 day ago - 5 months 1 day ago #346798 by rodw
Pretty sure you would just comment out these two lines
github.com/LinuxCNC/linuxcnc/blob/master...erp_convert.cc#L5177
// settings->origin_index = 1;
// settings->parameters[5220] = 1.0;

1 = G54 so this is where the reset is happening
parameters like 5220 are described here  linuxcnc.org/docs/html/gcode/overview.ht...:numbered-parameters
Last edit: 5 months 1 day ago by rodw.
The following user(s) said Thank You: zz912

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

More
5 months 1 day ago #346799 by rodw
Actually, A neat way of dealing with this could be adding a new parameter (5391?) and modify the code so that if it was set to true, the original 2.7 buggy behaivour was restored eg
if settings->parameters[5391] == 0.0{
    settings->origin_index = 1;
    settings->parameters[5220] = 1.0;
}

Be worth playing with that.

 
The following user(s) said Thank You: zz912

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

More
5 months 1 day ago #346801 by zz912
Thank you for help.

I preffer:
Code:
if (INI configuration "AUTOMATIC_G54") == TRUE { settings->origin_index = 1; settings->parameters[5220] = 1.0; }

Default value AUTOMATIC_G54 = TRUE
 

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

More
5 months 1 day ago #346807 by Aciera
+1

I have wished for a possibility to op-out of this automatic resetting to G54 on M2/M30 several times in the past.
The following user(s) said Thank You: zz912

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

Time to create page: 0.108 seconds
Powered by Kunena Forum