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.

4 Likes

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&gt; 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.

Hello all! Long time no type. I know this is an older post, but I need this code for a project and Iā€™m having trouble getting it working. I downloaded and flashed the latest firmware and still couldnā€™t get G54 or G55 to work. I used the syntax used in the above post and couldnā€™t get things moving. #define CNC_COORDINATE_SYSTEMS is enabled.

Hi There,
is this still an Issue? I ran this weekend in some problems with my new setup.
SKR PRO 1.2 V1 LR Firmware.

It took some time to figure out G54 as reason.
Best regards Matthias