MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.16k stars 19.21k forks source link

[BUG] M423 X-Twist Compensation command not recognized when enabled. #24359

Closed Mark4004 closed 2 years ago

Mark4004 commented 2 years ago

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

M423 command isn't recognized when enabled. Sending M423 results in:

Send: M423
Recv: echo:Unknown command: "M423"
Recv: ok

The LCD menu item Configuration>Advanced Settings>Probe Offsets>X-Twist Wizard is active and seems to function. Entering M503 displays the values collected after running the X-Twist wizard:

Recv: echo:; X-Twist Correction:
Recv:   M423 A2.00 I36.00
Recv:   M423 X0 Z0.00
Recv:   M423 X1 Z0.00
Recv:   M423 X2 Z0.00
Recv:   M423 X3 Z0.00
Recv:   M423 X4 Z0.00
Recv:   M423 X5 Z0.00
Recv:   M423 X6 Z0.00

Even though the function operates through the LCD it doesn't actually seem to compensate properly. Without the M423 function I can't reset or manually change the parameters to try to see why it's not working correctly. That will be raised in future bug report if I can properly diagnose issue.

Bug Timeline

I don't know if it was an issue previous to 2.1.x. The function was not available in 2.0.9.1 which was my last version.

Expected behavior

M423 should report and allow editing of the parameters collected by the X-Twist wizard.

Actual behavior

Sending M423 results in:

Send: M423
Recv: echo:Unknown command: "M423"
Recv: ok

Steps to Reproduce

  1. Remove comment from #define X_AXIS_TWIST_COMPENSATION on line 1312 of Configuration_adv.h
  2. Build firmware
  3. Flash firmware
  4. Initialize EEPROM
  5. Send command M423

Version of Marlin Firmware

FIRMWARE_NAME:Marlin bugfix-2.1.x (Jun 15 2022 22:03:15)

Printer model

Customized I3 mk2 style

Electronics

Arduino mega2650, RAMPS 1.4

Add-ons

BLTouch probe

Bed Leveling

UBL Bilinear mesh

Your Slicer

Prusa Slicer

Host Software

OctoPrint

Don't forget to include

Additional information & file uploads

Modified pins_RAMPS.h (Included with config files) to allow hardware serial communication to TMC2209 drivers. Enabled dual Z-axis. Enabled Z_STEPPER_AUTO_ALIGN Enabled UBL. Enabled extruder fan control.

config.zip

ellensp commented 2 years ago

Code is simply missing from Marlin/src/gcode/gcode.cpp

Add the following

diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp
index 5425fc701f..0e11ad6efb 100644
--- a/Marlin/src/gcode/gcode.cpp
+++ b/Marlin/src/gcode/gcode.cpp
@@ -1050,6 +1050,10 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
         case 1000: M1000(); break;                                // M1000: [INTERNAL] Resume from power-loss
       #endif

+      #if ENABLED(X_AXIS_TWIST_COMPENSATION)
+        case  423: M423(); break;                                 // M423: Reset, modify, or report X-Twist Compensation data
+      #endif
+
       #if ENABLED(SDSUPPORT)
         case 1001: M1001(); break;                                // M1001: [INTERNAL] Handle SD completion
       #endif
thisiskeithb commented 2 years ago

Closing since a PR has been created.

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.