Marlin: AUTO_BED_LEVELING_FEATURE and EXTRUDERS > 1 cause Z-Axis Runaway

Created on 11 Apr 2016  路  6Comments  路  Source: MarlinFirmware/Marlin

I did a bunch more playing and reading the code tonight and I'm pretty sure I've narrowed down the issue so I've decided to overhaul this issue and get right to the point.

When you have AUTO_BED_LEVELING_FEATURE and EXTRUDERS > 1 when you change extruders and issue any movement command the Z-Axis will Runaway. Sometimes up, sometimes drilling into the bed. It doesn't seem to matter if you've leveled the bed already or not.

I did a bunch of playing and narrowed it down to code in the gcode_T function. I suspect it's trying to apply the bed-leveling transformation and ending up with an absurd value for the Z-Axis extruder offset causing it to zoom off up or down.

When I modified the code to disable the AUTO_BED_LEVELING_FEATURE of gcode_T it is now all working as expected with no wild runaway. I just forced a false condition so it only applies X&Y offsets for the extruder... ie

#if ENABLED(AUTO_BED_LEVELING_FEATURE) && 0
            // Offset extruder, make sure to apply the bed level rotation matrix
Confirmed !

Most helpful comment

Pulled and tested. Looks good!

All 6 comments

What kind of machine are you using? Cartesian, Delta, CoreXY, or CoreXZ?

Once #3476 is merged you can download RCBugFix again and rebuild with DEBUG_LEVELING_FEATURE to get additional output for this issue, which will show what's going on in that code block. You will need to use M111 S32 to enable logging of this info. From that output we should be able to figure out what's going on here.

I'm using a Cartesian with an IR Z bed probe and ramps hardware.

So I'm pretty sure I fixed the issue...

Basically the extruder_offset array is initialized with XY values unless you have a dual X carriage machine and then it is initialized with XYZ values... However when using bed leveling it also needs XYZ values. When it applied the offset it was overrunning the array.

I changed the definition to:

// Extruder offsets
#if EXTRUDERS > 1
  #ifndef EXTRUDER_OFFSET_X
    #define EXTRUDER_OFFSET_X { 0 }
  #endif
  #ifndef EXTRUDER_OFFSET_Y
    #define EXTRUDER_OFFSET_Y { 0 }
  #endif
  float extruder_offset[][EXTRUDERS] = {
    EXTRUDER_OFFSET_X,
    EXTRUDER_OFFSET_Y
    #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(AUTO_BED_LEVELING_FEATURE)
      , { 0 } // supports offsets in XYZ plane
    #endif
  };
#endif

Seems okay now...

@snowzach That's a really good catch. I was just looking at that array too, and although it looked strange to me I couldn't pin it down. I will apply the change and merge it asap!

Pulled and tested. Looks good!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heming3501 picture heming3501  路  4Comments

Glod76 picture Glod76  路  3Comments

jerryerry picture jerryerry  路  4Comments

ahsnuet09 picture ahsnuet09  路  3Comments

Bobsta6 picture Bobsta6  路  3Comments