Work Origin changes after loading a gcode file

Hi,
I have the problem that the Work Origin changes in laser mode when loading a gcode file.

I have set the Work Origin on my Snapmaker 2.0 A350 to the middle of the laser bed via Cotrol - Set Work origin. This setting remains even after startup. I control this via Control - go to Workorigin. This works.

Now I load the machine from Luban with a laser gcode file via WiFi. At the machine I confirm the loading of the file, start the process and select Auto Focus via the material height. Then the laser moves to the workorigin.

However, this is now not the one generally set, but offset by a few milimeters in x and y axis. Of course, I can now correct this again.

However, I would like it to keep the generally set workorigin.

Where does the new work origin come from?
Is it transferred and set with the gcode file?
Or is it set via the connection of Luban with the machine?
Can I set the work origin in Luban to the same coordinates as in the machine, so that it always remains?

thanks a lot for your help

Josef

1 Like

I ran into the same issue today. I thought I had set the work origin at the center of the bed. I meticulously placed the material on the bed and secured it. I then ran the loaded G code file for the project from the touch screen. Thankfully, I remembered to Run Boundary again to verify the engraving area which, like Josef, found that the origin was off by several centimeters in both the X and Y-axis. I backed out of the project, reset work origin, reloaded the file and sure enough, the origin was off again. I think the work origin is embedded in the projectā€™s G Code file and I canā€™t override-it prior to beginning of project. The problem is that I thought when I set up the project, the work origin was already at the center of the laser bed. Can someone please tell me if the work origin is related to the initial project setup and is saved with the project before G Codes are generated?

Hi ddayue,
I have been testing for days on this problem and gave up in the end because I could not find a solution.

In the meantime I have noted the position of the center of the laser bed and set the Work Origin to this point every time after loading the G-code.

This is especially annoying because for my purposes and my objects to be lasered in series I have built a centering platform including holders.

Not satisfactory, but must be enough for the moment.

Maybe someone from Snapmaker will read this at some point and give us a tip. Or Iā€™ll report an issue again. The first time I reported it, I only got a link to the manual, which doesnā€™t help here.

Greetings
Sepp

I just googled again. There are (at least) 6 G-code codes to set a coordinate system: G54 - G59. Each coordinate system has its own work origin.

see Nullpunktverschiebung (only in German)

Apparently the shifting of the work origin in the G-Code can also be switched off with the codes G53 and G500.

I have to do more research on this ā€¦

However, I would not like to work on the G-code every time in the future ā€¦

my G-Code for laser engraving starts with this sequence:

; G-code for laser engraving
; Generated by Snapmaker Luban
; Sun Mar 07 2021 9:58:26
 
G90
G21
; G-code START <<<
M106 P0 S255
G1 F2500
G1 X-7.40 Y4.30
M3 P25 S63
G4 P5
M5
G1 X-7.30 Y4.70

G90 = All coordinates from now on are absolute relative to the origin of the machine.
G21 = Units from now on are in millimeters.
M106 = Fan on / P0 = Fan 0 / S255 = Fan Speed max
G1 = Move / F = Feed rate / X and Y coordinates
M3 spindle / laser on
G4 Pause the machine for a period of time
M5 spindle / laser off

and so on

Seems the G-Code ist OK ā€¦

1 Like

I always send my G-codes to Snapmaker via WiFi. When connecting Luban to Snapmaker, the following codes are sent from Luban to the mashine:
snapmaker-luban 3.14.0
Connected via Wi-Fi
G54 = Select Coordinate System 1
G53 = Machine coordinates
G28 = Move to Origin
G54 = Select Coordinate System 1

@spitzlbergerj

Once you send the file to the machine and then start to use the Laser engraving module, the machine will always as you to complete the auto-calibration process and select the work origin.

While the coordinates of the work origin and the start point are not the same, the laser module will go to the work origin and then move to the start point.

I am not sure about your Laser file, and what pattern you are going to engrave. As you can see in the picture below, you set the work origin on the touchscreen. The Laser module will move to the start point and then run the boundary. After that, it will come back to the work origin. The path that it goes on depends on the pattern you generated to a large extend.


Hi,

I have since communicated with snapmaker support who got back to me super quickly.

According to support:
The work origin is ALWAYS to be set after loading a new file.

ā€œAfter loading the file, you will be required to set the work origin.
In this step, you set the work origin and save it.
Then run the project.ā€

This makes it hard to make a pre-made mounting plate for the parts to be lasered. Series production is somewhat difficult

Iā€™ll have to try setting the work origin via the G code. Otherwise I will have to set the work origin to the origin of my mounting plate every time.

Not yet optimal ā€¦

@Edwin, thank you for your explanation. I had already understood that.

My point is that I have printed out a mounting plate for little round wooden disks. The wooden discs can be clamped into this and thus always sit in the same place. I have made the mounting plate so that the center of the disk is centered on the aluminum laser platform of the Snapmaker. The Work Origin after loading the G-code is not centered on the platform. It must be set manually nue with each process with it.

Josef

Sureā€¦ if you use their workflow.

Since it sounds like you donā€™t want to set the origin manually each time (which Iā€™ll agree is a cumbersome task for certain workflows) Iā€™ll mention that thereā€™s no hardware requirement you do so, as long as you are careful and take into account required positions.

For example playback the gcode file over serial, possibly from Luban, or from Lightburn or any other gcode playback software. Then there is no touchscreen forcing you to set the origin. I donā€™t use Luban, so if it forces you to set an origin as well then Iā€™d use something else. Strongly recommend Lightburn.

Setting the origin does need to be done though, however it can be just a couple lines of gcode. Letā€™s say you need the work origin to be at machine coordinates X150 Y150, your laser focus is 30mm, and your material thickness is 10mm (total Z of 40mm).

G28 O ; Home if unhomed
G90 ; Absolute
G53 ; Use native space
G0 X150 Y150 Z40 ; Move to desired location
G54 ; Use workspace coordinate
G92 X0 Y0 Z0 ; Set origin here

I have a variety of macros configured in Lightburn to do common tasks, such as set the origin to the center of the board at the laser focal length, moving around, etc. Works great, although of course you wonā€™t have power loss recovery.

Hi brent113,

thanks a lot for your detailed answer, especially for the gcodes. these help a lot

i am still in contact with support who has now sent me a video of how the settings work there. I ā€œactuallyā€ do it the same way, yet my Snapmaker reacts differently. I stay tuned and report here.

Nevertheless, I will also have a look at Lightburn. At first glance, it looks really interesting.

Many greetings

Sepp

Hi all,

first must now praise the support of Snapmaker. Zero Zhao has worked through this issue with me in quite an email ping-pong and many videos from his side and mine. We exchanged a lot of things, I learned a lot about the machine (e.g. how to get into developer mode :wink:

In the end the problem was easy to solve. It is a security feature.

Here is the original answer from Zero Zhao to the solution:

I have confirmed it with our engineer.
The work origin will change if you select the auto mode after you load the file.
For safety concerns, it will rewrite the work origin.
If you need to change the work origin, you need to change it after you load the file.

But if you select the manual mode, you have to manually set up the laser height.

1 Like

Many thanks for this final update @spitzlbergerj, good to understand how things stand.

Now some general questions from my side, more towards staff such as @Edwin:

  • How does the software decide the work origin values after ā€œAuto Modeā€ is selected?
  • So in my case, why do I end up with 172.5 for X and 178.5 for Y?
  • How can a user such as myself also request information on using developer mode and for example editing the work origin settings there?
  • Since I am mainly interested in the X and Y coordinates of the work origin, I assume this should not really be a safety concern?
  • Can you confirm that if ā€œManual Modeā€ is selected, then the work origin set by the user through Control ā†’ Set Work Origin will be respected?

I am facing a complete and utter nightmare with the latest software and firmware. 10W laser. Load application, set as center origin, create design (in center of layout/platform using snapmaker luban tools), export g-code to machine.

load design, Auto calibrate (does all that fine), start print and the head goes straight to the top right of platform and stays at that point trying to print the whole thing on one spotā€¦

So I then decide ok, after it has measured thickness of material, position head in bottom left corner of the platform, and still it goes towards the top right quarter of the platform.

So what is causing that please, anyone?

1 Like

Sorry to bug you, but have you resolved your problem, or has anyone responded to you?

That is my issue too.

that too, is exactly whatā€™s happening for me. No matter what I do, the laser moves to the back/right area and starts, instead of center.

Hi all,
This is for the 10W laserā€¦
Sorry for such a very long time from coming back to this. Health issues within the family has me occupied currently. I did manage to resolve my issue. I went back to firmware and have it printing from pc via wifi (luban) rather than sending to unit and printing from that.

Steps i take:

ā€¢ create project - laser 3 axis
ā€¢ go to workspace
ā€¢ connect to printer
ā€¢ go back to editing screen
ā€¢ create background
ā€¢ start placing your design on image captured by camera
ā€¢ Process the design
ā€¢ export to luban

Note!
Make sure that your out most laser vector/s are done on there own process (I usually do mine individually then highlight all when exporting). Because i found that it always starts from the outer side before doing the inner laser cutting. :wink:

So a circle within a circle, the outer one gets done first.

Hope this helps. Happy new year all!

1 Like

I wonder if the issue will go away in the new version I installed today.

Iā€™ve not looked at the latest version, sticking with this for now. Please do let us know if it is any better.

I have this same problem. Please let me know if the wifi issue is the real issue. I would hate to use a cable when I run mine. Thanks for any help!