Z Homing / Auto-focus

I’ve been searching the forum for the last couple of days but can’t find anything definitive for Smoothieware based controllers regarding Z-homing and auto-focusing. I don’t have a motorized table yet, but I do have a motorized laser head. I want to be able to home to Z max, then X/Y. After that I want to be able to auto-focus my laser using the auto-focus probe. I think I can write a macro to perform all this but I’d like to know what’s natively available in LightBurn. So here are a couple of questions:

  1. Does LightBurn actually perform homing on a Z-axis for Smoothieware? The home buttons just seem to home X/Y, and I can’t find an option to add in the Z-axis. (Z-axis is Enabled in Device Settings.)
  2. What does the Focus Z button do? It says it will run the auto-focus cycle, but there’s no output in the console, and no documentation on what the auto-focus cycle is supposed to do.

If these aren’t available in LightBurn my intention is to write my own Homing and Auto-focusing macros. (I already have a Test Fire macro so this will make 3 out of 6 permanently used up. Can we get more please!? :smiley: ) I know I can use the G30 probe function to find the top of the material, and then using the focusing test can find the offset to apply to a given lens. From there I can put that offset in to my macro such that it will find the top of the material, back off the amount of the offset, and then set Z to zero.

EDIT: I’ve been playing around with this on my test system and now realize that LightBurn works in machine coordinate system. So all the above works with the exception of setting Z to zero. I assume I can just switch on ‘Relative Z moves only’ in Device Settings and all will be good?

I’ve been looking for sort of the same thing. Yes, I noticed LB only homes XY but not Z. You can issue a G28.2 and Smoothieware will home all 3 axis (if you have it properly configured). The default logic assumes a moving bed and fixed tool. I had to invert it as I have the opposite.

I wrote a couple of macros which work on my test bed, (SKR V1.3 sitting on my desk with limit switches and nothing else attached). The first homes Z first and then XY together. I couldn’t find out how to get Smoothieware to home in this specific order.

; Home Z and then XY together
G28.2 Z
G28.2 XY

The second will perform auto-focus after the correct offset has been determined for a given lens, but requires LightBurn to run in Relative Z movements mode.

G30 Z0 ; Sets WCS which we don't use, but stops head from retracting
G91 ; Absolute mode
G0 Z3.25 ; Z offset value from focus test

; Following are made up offset numbers for now
; 2" lens - 3.25
; 2.5" lens - 3.35
; 4" lens - 3.6

A third which I use is for test firing the laser for a given duration. I use this for mirror alignment with my CO2 laser. Something that isn’t documented but I found by digging through the Smoothieware source code:

; fire nnn dddd - nnn = power %, dddd = duration ms
fire 15 200

It would be nice if LightBurn added Duration to the Test Fire button that they provide, but like I said it isn’t documented so they can’t really rely on it.

This is all for my custom built CO2 laser and I’d be happy to share the config file if you’d like, but I know nothing about the Neje lasers and what might be different. It seems like you can find your way around the config file just fine though.

Lol, what I have is far from a real machine. It’s all about having fun, designing and building a light cartesian frame from scratch just for the sake of it. I had quite a few steppers scavenged from old (large format) printers and decided to do something with it. A diode laser was simply a good excuse for the frame. My other option was a rubber index finger drawing zen shapes on sand :stuck_out_tongue:

A week ago, I had never heard of Lightburn. Two weeks ago, I had never heard of Grbl or Marlin and would think that Smoothieware was some wearable fruit juice. It looks this (hobby) CNC controller/software field is quite fragmented but with a huge emphasis on 3D printers.

I am really impressed with the breath of work done with Lightburn. It’s an impressive piece of software given what appears to be a one-man labor of love.

As to the SKR 1.3, I’m still on the fence about it. I started with a simple Grbl controller but its limitations drove me nuts. These BTT controllers are dirt cheap so I decided to try one. Started with Marlin and then found this forum with folks talking about Smoothieware running on these boards. Hence where I am now.

I’ve been going over the code to see what can be done with its deficiencies but it may be more work than I’m willing to spend the time on.

As to the homing sequence, have you looked into homing_order? If nothing is defined it defaults to XYZ. You can define ZXY, though it will be done one at a time. It appears it can’t handle a slave axis with two limit switches though. I need to hand align them each time.


Optional order in which axis will home, default is XY home at the same time then Z, then A,B,C. If this is set it will force each axis to home one at a time in the specified order. For example XZY means : X axis followed by Z, then Y last. NOTE If an axis is not specified here then it will not be homed at all. If ABC are set they must also be specified if they need to be homed.

This Neje unit is a very simple laser diode with a built in driver. A toy really but fun to play with. The included lens isn’t that great and I’m still trying to sort out focusing (using Z moves). I also want to be able to see DROs in realtime, which I don’t think Smoothieware provides (I’m still going through the code looking to see what it does with its secondary UART).

1 Like

You want to compare machines? Well OK then!!! :smiley:

It has progressed a little from this picture, but it’s still just a prototype and should be vastly improved in the next iteration. Maybe closer to a real machine, but still very DIY! All for the same reasons as you, for fun, the design challenge, the learning, etc.

I’m only testing on the SKR because like you said, they’re dirt cheap, (and they have no preconceived ideas of what a laser controller should offer - however, predominately aimed at 3D printers like you say). I’m still in the build process having taken most of last year off from the project, but I’m back on it now by building a proper frame. I agree with your opinion of LightBurn, but I’m far from a laser expert or advanced user of the software.

LightBurn homes by sending G28.2 XY specifically, (both axis home at the same time), and from what I can tell if you try and get Smoothiware to home in any order other than default it does each axis individually, e.g. Z THEN X THEN Y. By issuing the two separate commands I can get Z followed by X and Y together, which is just a preference based on the size of my machine. I still haven’t confirmed this on an actual working machine, so please let me know if I’m mistaken. (Just re-read your post and you’ve already pointed this out!)

The secondary UART is just there for initial programming and will mimic the USB otherwise. I’ve been looking in to it myself. I think if you dig you’ll find that Smoothiware, (like GRBL), doesn’t send out any info that you don’t query for. I have been writing a simple piece of CNC software and to get a DRO I query the GRBL board every 200ms. Works pretty well, but LightBurn doesn’t do that yet.

1 Like

Lol -

Two birds of a feather. That tube is obscenely large! It reminds of the movie Real Genius. I’ve never played with lasers before. I’ve been building CNC machines (hobby) for many years and this is the first laser. Our house is in the middle of a remodel, which with Covid and all turned into a multi-year project so I’m stuck with a small area to “play”. Hence, the idea of putting together a small cartesian frame. If you are around Nova Scotia one day, let me know…. Well, after the remodel is done :slight_smile:

Yes, exactly what I’m planning on doing. I got one of those TFT displays with the idea of turning it into a DRO.

Wait, I spy something “fun” going on here and I think you are missing out being inside. :wink:
image…and I spy again…here! image

Well each to their own I guess. I much prefer the sun going down at 1:00AM in the summer than the temperature getting below -20F. Winter sports are for a much younger man than I! :smiley: There’s still some of that white stuff lingering in my yard.

California kid (not so kid anymore), so snow can be found, but in most of the state, this requires more than opening a window to start a snowball fight. :wink: You can keep the -20ºF…we trust you to treat it with all the respect it deserves.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.