Z "Homing" for Cloudray Autofocus pen

Hello I am not sure if this is the right place to post but here I go.

I am trying to setup a XYZ homing so that the newly purchased Cloudray autofocus can work with my board,

I am just not sure where I find these settings in Lightburn so that I can get this to work.

I am not sure if this is a function of Lightburn or the board manufacturer , all I want to happen is when I home, the bed elevates and the autofucs touches the work surface, records that height and then bounces back to the 50.8 focal point height and then carries on and does XY homing and is all set to go.

I am going to assume here that the autofocus is a one off setting per homing cycle and does not automatically allow for different surface heights if the work surface is textured or of uneven height, I guess that would be a miracle if that would work

I can not seem to find any setting for this in my version of Lightburn, I use a VMS board . I saw in a another video that this “offset” was in Lightburn where you had a Ruida controller or am I wrong on that?

Does anyone have any knowledge please on how you should set this device up in Lightburn please. I am new to this type of device so please forgive my ignorance. I have tried in vane online to set this up and I have not been able to get any further than using it just as a stop when it hits the work surface.

Thank you.

I don’t have any direct experience with autofocus… But Russ Sadler and MJ lasers have a couple of video that might help…

I prefer the way Russ explains things, however MJ is good also…

MJ laser video…

Good luck


Thank you very much, yes they were helpful and now the bed is running as part of the homing sequence. It works very well actually using the Cloudray unit and I have managed also to sort out a decent bounce back

Turns out that the commands are all buried deep in the grbl and it was necessary also to Enable the Z axis in Lightburn.

The following commands we have used to do this

$ 21 Hard Limits Enabled ( if required ) = 1

$ 41 Z Axis Homing Enable = 1

$ 42 This sets the height of the “Bounce Back” which in our case using the CloudRay C series Laser Head and a Nema 17 Planatery gearbox @ 28/1 stepper motor works out to be 13. This is based on a 50.8mm Focal Length Lens and means that the sweet spot of focus is 6 mm below the actual laser head. Changed this later to 19 after changing the position of the lens in the tube to allow more space under the laser head. All about focal length being maintained!!

$ 122 This changes the acceleration rate of the stepper motor . Ours is set to 3

$ 132 This sets the total travel distance of the bed, in our case we have set this to 300

Basic Instructions

Install the CloudRay AutoFocus device and plug the cable into the board. Then install the Red Ring unit on to the 50.8mm mark on the side of the laser head, tighten, Then insert the pen until it is about 10mm lower than the Focal Length of your Lens. Tighten

This is only a starting point, you will then need to adjust this using the Console window in Lightburn and $42 Command in GRBL. Try homing and see what happens, the bed should elevate, touch the pen, go down and then comes back up to its resting point above the workpiece, then it will home X & Y.

At this point you need to adjust the pen a mm at a time until you are happy with the result by adjusting the MM value in $42 in MM’s. Move the pen 1mm adjust the Value in $42 by 1 and so on.

Thanks very much for your help, it connected just a couple of dots that were missing and I didnt understand.



Great you’re up… the biggest hassle with these controllers (all of them) is just configuring them properly.

Mark the thread ‘solved’ with your information thread.

Thanks for the nice detailed description of the fix. I and others appreciate your time.

Have fun, take care


1 Like

my pleasure, I am more than happy as I know what it took to sort and if others can use it to make life easier so be it…I like to help.

1 Like

Where did you get the information on these settings? I’ve not seen this documented in GRBL settings so assume this is proprietary.

What controller are you using?

I use a LX4s Controller by VMS Laser Accessories, Its a new 4 axis 2 amp motion control board. The GRBL loaded is I believe written by the developer.

Its an excellent board, allows the laser to travel well in excess of 1000mms and runs very well.

I believe next year they are going to release a professional commercial board similar to the Ruida board with on screen graphics etc. Again with his own version of GRBL: He is on Facebook under VMS Laser and VMStech.net online.

1 Like

A Ruida is a dsp controller, really is a different ‘animal’ and doesn’t speak ‘grbl’. There are many variations of grbl out there…

Thanks for the update.


Yes, I know. I didnt want to go down that route which is why I went for the VMS board,

I am not too bad with GRBL and understand who it works most of the time, I use it a lot on my Workbee . I just dont have the time to learn another controllers ins and outs now, I know Eric Norton, who makes these very well and he can fine tune things for if I need something else adding on the board or just want a bit of personalisation its easy for him to just add it .

He can easily run off a batch of one off boards for me if I need them, thats the beauty of a small business. He really is a whizz with electronics and CNC-s

I think I said before he is developing a new board similar to the Ruida with on controller screen and graphics, wifi, all the bells and whistles etc etc and all based on his own version of GRBL I dont have any specs but as soon as I do I will be posting them for him to gauge interest I have no idea how he is going to achieve this but he says he can. . I am hoping to test one for him early next year when its ready…

I have an old 40 watt C02 machine that is now a bench tester only, just the gantry and tube at the back nothing else. I use that for experiments and trying out new kit, means I dont screw up my main unit.


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