Full Control Lightburn + Rotary Guide

I will start out by saying, I do NOT recommend this. This was mostly for me to test could it be done. Since I’m writing this guide… guess it can! For those who want to try it anyway, I’ll layout how to do it, but be warned. This is an advanced process. It will require a lot of double-checks, a bit of initial setup for origins, and a bit more gcode editing (nothing hard though, and most can be done with a batch script if someone chose to write it). That being said, onward I guess!

This is an extension of my Lightburn + Rotary Guide found here;

However, do note, there IS a specific gcode header/footer that needs to be inserted. I suggest making a new device in Lightburn so you can swap between them easily.

In this guide, my equipment used is as follows;
Machine: Snapmaker 2.0 A350
Tool: 1.6W Laser
Accessory: Rotary Module
Material: Cherry wood.
Software: Lightburn 1.3.01 (current as of writing)

Since this is a bit advanced, I’m assuming you’re familiar with the custom firmware from my Lightburn guide, so we’ll assume you have that already, and you already enabled the rotary module with the proper settings/diameter in Lightburn.

To start, we’re going to have to find a repeatable, unchanging origin. This assumes you’ve setup the rotary module and calibrated before. The snapmaker sets your laser height to the center of the rotary module, so instead of the plate like in my standard guide, our Z0 is the center of the rotary module. This seems to be about 84mm taking the current laser height, minus my focal length. 107 - 23 = 84. However, this is technically irrelevant. As last time, we’re using the Laser Height as Z0 from the homescreen. Mine is 107mm.

Next, you will need to get a zero point on the rotary, I like to make one of the jaws directly up and center it using one of the chuck keys. Just slightly open the chuck enough that it sits infront of the key, but not hitting it, and rotate until centered.

Afterwards, set B origin on the touchscreen to make this B0. I would suggest power cycling the machine here, because for some reason, the Snapmaker likes to move whatever degrees you moved to set it before a job for no apparent reason. So if the machine starts here, it stays here. Rehome after reboot and move on.

Since we know this is where the laser focuses in the center of the rotary (where the chuck jaws meet in the center), we can figure out how to focus the laser on the chuck to get an origin. I measured the jaws and each one is 25.5mm so add that to your Laser Height to get the focus height ontop of the jaw. So on my machine that’s 107 + 25.5 = 132.5. Jog Z down to this height in Machine Coords, column on the left. Now you’ll want to move the laser to where it lands directly on the center front of the top jaw, you’ll have to move, turn the laser on, move, turn the laser on. Afterwards, gently bump it so the laser just goes off the edge infront of the jaw. This is going to be our Origin. You can use my locations to get close, then dial it in on your machine. WRITE THESE LOCATIONS DOWN FROM YOUR MACHINE.


Should look like this:

Note I do not use the shroud on my 1.6W laser, so yours might look closer than mine, but the laser should be focused directly on the very tip of the jaw.

Now that we have our Origin location, we can move over to setting up Lightburn. You will need to plug in your X/Y/Z into the header. I’m listing mine, but REMEMBER TO EDIT YOUR NUMBERS IN.
Header;

M106 P0 S255
G28
G53
G0 Z107 F6000 ; Put Laser Height For Z
G54
G92 Z0
G53
G0 Z330
G0 Q162 Y202 F6000 ; Put X/Y From Machine Coords 
G54
G92 Q0 Y0
M3 S0

Footer;

M5
G53
G0 Z330 F6000
G0 Q0 Y350
G54
G0 B0
G28

You may notice a Q in place of X, this is required for when we do gcode edits later, else the X would become a Y, so we gotta do a double-swap there.

Now for setting up your project, there’s a few things that are a bit confusing, but keep in mind, the way you’re looking at the layout is as if you’re looking at your snapmaker from the right side (the touchscreen side) or the left of the Lightburn panel is the front of your machine.

Unlike the standard rotary guide, you will need to be in Absolute Coords, which means 0,0 is actually the upper left.
Screenshot 2022-12-25 115838
So when we place our object, rotate it 90 degrees as normal, resize, then use the move buttons to shove it in the upper left corner.
Screenshot 2022-12-25 114746

The starting point is the upper left if you ran this as-is. We’ll cover centering a bit later, as it requires MATHS. Now, you have to remember to set a Material Height this is going to be the radius of your material or half the diameter you put in the rotary setup. I’m using a round stock that’s 45.5mm in diameter, so I set the thickness to 22.7mm.
Screenshot 2022-12-25 115823

EDIT: The math below is now obsolete, I found an option that’ll allow you to place an image outside of the box to make it center correctly and not be ignored :person_facepalming: See the second post for details, I’m leaving the original guide intact as it might give people some ideas on moving their project around.

For now the setup is done, except for the gcode edits. If you want to center the bottom of the image on the origin this is the math you have to do. You have to take Circumference from the rotary setup window, and subtract it from the Y Pos in the upper left, then add half of the height back to the result. In my example, I’m doing a 40x40 engrave. So in the upper left corner, it’s at 310.
Screenshot 2022-12-25 115931
My circumference is 142.942.
Screenshot 2022-12-25 115807
Subtracting that from the 310 position, gives me 167.058, add half my size, so 20, gives me 187.058. Move your object there in Y.
Screenshot 2022-12-25 115914

The reason for this, is moving it a full circumference out, moved the origin a full turn, so we can back if off half to center it. Lightburn refuses to burn anything outside the box, so we can’t just half it off the top of the box. Again, the above is optional, just keep in mind the left side your image/whatever will be directly up if you do not.

The last thing to do is mount your stock and measure where you want the bottom of the engrave to be from the chuck jaw. For my example, I just slapped it at the end of the material.

Click “Save Gcode” in Lightburn to export and open in a text editor. IN THIS ORDER, REPLACE X > Y, A > B, and Q > X. Then in the header section, or “User Script” in the gcode file, put in the measurement you got where you want the bottom of the engrave for Y right before the M3.

;USER STBRT SCRIPT ; Look, the A got replaced with B :) 
M106 P0 S255
G28
G53
G0 Z107 F6000
G54
G92 Z0
G53
G0 Z330
G0 X162 Y202 F6000
G54
G92 X0 Y86 ; PUT LENGTH FOR Y HERE
M3 S0
;USER STBRT SCRIPT

Save the file, and click “Run Gcode” in lightburn and select your .nc file. If all goes right, you should get something similar to this;

I used a -45 degree scan angle, it was a bit neat to watch the rotary and Y move in tandem. :slight_smile: (I suggest -90 so the rotary spins back and forth) Also note how the rotary made almost a full turn before starting, this is because I did the centering math above and it’s just a result of how we had to trick it to get a centered origin. If you do NOT do the math above and just use the upper left corner in Lightburn, then the left edge of your engrave will be directly up and it won’t do a full turn before starting.

I hope this was informational, entertaining, and educational. It was about -7.8C or about 18F in my workshop, so I froze a bit for this experiment. I would say, this method might be good for batch production. Engraving many of the same objects so you can just repeat the same program without any of the fuss or moving the origin by hand.

Merry Christmas to those who celebrate, and happy holidays. :slight_smile:

3 Likes

A quick update, going back through the options in Lightburn, you can disable an option called Ignore out-of-bounds shapes if possible and it allows you to place an object outside of the box and it will actually generate the code instead of ignoring it. Why I didn’t notice this option a long time ago, I don’t know. Woulda been super helpful on previous projects.

Screenshot 2022-12-28 131519

Now all you have to do is rotate the image as normal, throw it in the upper left corner, then take the “height” and divide it in half, add it to “YPos” and there you go, centered.

Upper left position/size.
Screenshot 2022-12-28 131633

Divide height, 50, in half, makes 25, add to YPos, 325.
Screenshot 2022-12-28 131618

Results look like this;
Screenshot 2022-12-28 131656

Notice it hanging off the ‘edge’ at the top. This makes the origin center left (or center bottom of the image) Exporting the gcode, we can see it actually rotates negative to begin instead of needing the almost full rotation to get back to the proper start.

; Image @ 2000 mm/min, 75% power
M9
M5
G0 X0.11A-61.809 < Movement to starting position
; Layer C00
G91
M3
G1 X0.255A-0.641F2000S191.3

Overall, easier math, less time wasted (though not much). Pro-tip; if doing flat projects, it means you can ‘overburn’ by a little now. i.e. you want to burn a portrait all the way to the edge. Say 200mm square material. I make a square on a non-output layer (in the lower left 0,0 corner), then insert my image into Lightburn and scale it to say, 202mm, then center it to the 200mm square. With the option on; this would result in Lightburn complaining and not outputting gcode. However, with the option off, it actually generates the gcode with negative movements outside the burn area. So when ran, the burn will actually run 1mm off the edge of your material on all sides, guaranteeing your burn goes all the way to the edge. This helps cover up any possible misalignment or origin being off by a smidge. Nothing like trying to burn it at the exact size, to realize your material is off by 0.5mm and now you have a line up one side, or worse, slightly angled.

1 Like

Hah, found myself using my own guide. How ironic. Repeating the same project is definitely better using this method. Doing a set of mugs and just slappin’ 'em on and hitting run g-code. A couple quirks (had to turn the machine off between a pair), but otherwise, flawless.

Cheap mugs + titanium dioxide = custom white mugs.

I just have a quick question before attempting this. With the updated Snapmaker firmware, do you still have to flash your personal firmware before starting?

No, you no longer need the custom firmware. Any above 1.17.17 Should :tm: be fine.

I read through your guide and I was on lightburn reading through that as well about the rotary in the artisan I have lightburn 1.4.0.5 trying to get this to work can’t seem to get rotary to turn, in your guide anything I should not do since you don’t have to flash the firmware anymore. In the rotary setup there is no B axis

In Lightburn 1.4.05, you can change your machine to snapmaker. We had a discussion on the Lightburn forum and got the B-Axis fixed in the gcode generation. However DO NOT FRAME, the framing sizes at the top are still listed as X/Y, so it will not frame correctly. You will have to do a little experimentation to figure out proper origin/mirror/etc. I haven’t had the time to do this myself, but the gcode editing should no longer be required.

Every time I try and change machine to Snapmaker in lightburn it never works for me in artisan I use grbl and it fine something I have to add?