Bug in G12.1

More
20 Oct 2026 17:23 #350363 by tuxcnc
Bug in G12.1 was created by tuxcnc
I'm setting up an real milling machine with xyzab_tdr_kins kinematics.
To avoid unnecessary questions, I emphatically declare that everything is correct in my configuration, I made all changes on purpose, it was supposed to be like that, it works well and has no connection with the described below error.

Since this is a real machine, it has real parameters in the ini file.
[AXIS_Z]
         MIN_LIMIT = -10.0
         MAX_LIMIT = 100.0
      MAX_VELOCITY = 100
  MAX_ACCELERATION = 1000.0

[JOINT_2]
              TYPE = LINEAR
            FERROR = 2
        MIN_FERROR = 0.9
      MAX_VELOCITY = 100.0

  MAX_ACCELERATION = 1000.0
         MIN_LIMIT = -10.0
         MAX_LIMIT = 100.0
              HOME = 100.0
       HOME_OFFSET = 100.0
   HOME_SEARCH_VEL = 50.0
    HOME_LATCH_VEL = -5.0
     HOME_SEQUENCE = 0
HOME_IGNORE_LIMITS = YES
    HOME_USE_INDEX = NO
     VOLATILE_HOME = 1
Unfortunately, the Z-axis travel is only 110 mm, but as it turned out, this was a bigger problem than I expected....
After basing it looks like this:
 
Then I issued some commands, which you can see in the MDI window.
 
So far everything works as it should, but after executing G12.1 miracles happen:
 
If you look closely at the pictures above, you can find the reason.

The explanation of this phenomenon is extremely simple.
Well, after a 90-degree rotation, G12.1 actually swaps the axes.
This is probably mathematically correct and works correctly in the simulator and on a real machine in JOG mode.
But when I try to use the g-code in MDI or in a program, this converted Z(abs) value is compared to the Z axis soft limits specified in the ini file, which makes absolutely no sense.
As you can see in the pictures, even an attempt to rotate by a very small value (here 1 degree) causes an error, although it is very far from the soft limits of the Z axis. Basically, it's even worse, because G0A1 here is a movement around the Z axis, the spindle is supposed to stay in place, and the error appears...

I only have reference sensors in the machine, I haven't planned any hardware limits and I don't want to install them because there are Ethercat drives that turn off when overloaded and report an error.
I also don't like the abandonment of soft limits, because they effectively prevent movement outside the working area.
Besides, the error is in G12.1 and it is this that needs to be fixed, not around the problem.

G12.1 should, in addition to what it does, disable soft limits (and G13.1 enable them again).
Attachments:

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

Time to create page: 0.114 seconds
Powered by Kunena Forum