G54 work offset coordinates (bugfixed)

For those of you who are into these things:

https://github.com/MarlinFirmware/Marlin/issues/14743

Until today, when you used the following command sequence in Marlin bugfix 2.0 release:

G21 ; millimeters
G90 ; absolute coords
G54 ; switch to (1st) work coordinate system
G0 X10 Y10 ; move
G92 X0 Y0 ; set current position as new origin

The following would happen only for G54 (G55-G59 would work fine):

G53 ; switch back to machine coordinates
M114 ; get position
X:0.00 Y:0.00 Z:0.00

This has now been corrected. G54-G59 now all behave in the same correct manner like so:

G53 ; switch back to machine coordinates
M114 ; get position
X:10.00 Y:10.00 Z:0.00

Machine coordinate system G53 is no longer affected when you set an origin in work offset coordinate system G54.

Read the Github ticket to learn if/when the changes will be merged into Marlin bugfix 2.0 codebase.

1 Like

sweet!

I was looking at this and trying to get it flashed onto my board, unfortunately I’m running into some problems as I am not quite savvy with flashing firmware yet. I’m running on an Archim Duel configuration and can’t seem to get it to work.

First I attempted to copy the bug fix into Ryan’s Dropbox Dual Config and flashed my board with that. It flashed successfully (at least it seemed to), but then using Repetier, the G54 commands were still unrecognized.

So okay, maybe there’s something else missing. So I downloaded the latest Marlin 2.0 bugfix, copied the G53-G59.cpp and G28.cpp file into the geometry folder, copied Ryans original configuration.h and configuration_adv.h file and tried to compile.

Now I’m in over my head, Arduino IDE is showing lots of errors that seem to relate to my dual endstop config.

Next, I’ll try the same proceedure on the official V1 engineering github archim dual endstop LCD branch and see if I can compile.

 

Any help would be greatly appreciated. I am very interested in this functionality so that I can do tool changes in machine coordinates and milling in work coordinates.

 

I think your first attempt was probably very close. If G54 is not recognized then you need to enable via

#define CNC_COORDINATE_SYSTEMS

Start again with Ryans code, apply the fix, and enable CNC_COORDINATE_SYSTEMS.

 

Yeah, I definitely checked to see that it was uncommented before flashing. I’m not entirely sure why it didn’t work. I am wondering if I need to reset eeprom with M502, though I’m not convinced that will work since M115 gives me EEPROM:0

I’ll keep trying…

Hello, my config is: MKS Gen l V1.4, ,Arduino 1.8.9

Already, restart computer and Arduino more than once.

Uninstalled Arduino and reinstall.

Run Hello World and works.

When compile “Marlin-MPCNC_Ramps_T8_16T_LCD_32step” return this error:

 

 
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

sketch\src\lcd\dogm\ultralcd_DOGM.cpp: In function ‘draw_boxed_string.constprop’:

sketch\src\lcd\dogm\ultralcd_DOGM.cpp:439:3: internal compiler error: Segmentation fault

}

^

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

lto-wrapper.exe: fatal error: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\tools\avr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files/windowsapps/arduinollc.arduinoide_1.8.21.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/…/lib/gcc/avr/5.4.0/…/…/…/…/avr/bin/ld.exe: error: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

 

I’ve seen reports of segmentation fault on the windows store version of arduino before: https://www.v1engineering.com/forum/topic/kill-caused-by-kill-button-pin/#post-111798

The “internal compiler error: Segmentation fault” is something I’ve seen on the newer Arduino releases and it’s annoying. Sometimes if I try multiple times it will succeed. Another option, also annoying, is to try reinstalling Arduino 1.8.9 and the ug8lib and extra boards as described in the instructions (https://www.v1engineering.com/marlin-firmware/). You could also try the non-windows-store version, which is just a zip file you can run without installing.
1 Like

I will try MAC then :slight_smile:

Thanks Jamie

 

The windows store version has never worked. I have a note on the firmware page.

In case other people might run into this issue, this bugfix will not compile with the current firmware available for the Archim Duel endstop firmware. We will have to wait until that firmware is updated to include any dependencies that this bugfix requires.