Cohesion3DIn The NewsK40 Lasers

Testing K40 Endstops With LightBurn

Sometimes endstops can cause some hard-to-find issues. If you have a Cohesion3D or other Smoothie based controller you can troubleshoot your endstops from within the LightBurn console.

There are a few prerequisites for this to work. Your controller must be G-code based and be supported by LightBurn, LightBurn must be able to communicate with the controller, and you must manually actuate and deactuate the endstops.

There is a command that allows you to debug this kind of situation : the “M119” G-code. When M119 is entered in to the console the controller will answer with the status of each endstop that will look something like this :

X min:1 Y min:0 Z min:0

The above output means that the X endstop IS pressed and the Y and Z endstops are NOT pressed.

Now let’s apply this to your situation and test your endstops:

  1. Make sure the machine is safe to mess around in and turn off the laser power off so the laser cant fire
  2. Open LightBurn and click the Devices button in the Laser panel  the double-click your device
  3. Click Next on “pick your laser”, click Next again on “how to connect”, and click Next once more
  4. Make sure origin is set to FRONT LEFT and that “Auto Home On Startup” is toggled OFF
  5. Click Next, click Finish, and finally click Okay.
  6. Click on the Console tab,  enter M119 in the text box (under the Macro buttons) and hit Enter on the keyboard
  7. See how the console responds. It should look like the above example
  8. Now manually actuate the X endstop (press it if manual or use folded paper to interrupt if optical)
  9. Issue the M119 command again and look at the results. They should be X=1, Y=0, and Z=0 (like above)
  10. UNactuate the endstop and reissue M119. The results should be X=0, Y=0, and Z=0
  11. If the results show a failure then make a note of each condition and move on to the Y and Z axes the same way

If an end-stop is reading as always pressed, or never pressed, even when you press or release it, then you probably have a wiring problem, check everything.

If an endstop is read as pressed when it is not, and not pressed when it is, then your end-stop is inverted.

You can fix that situation by inverting the digital input pin in your configuration file. For example if your X min endstop pin is inverted, change :

alpha_min_endstop                            1.28^

To :

alpha_min_endstop                            1.28^!

Here is the exact mapping of pin names to inputs on the board :

EndstopX MINX MAXY MINY MAXZ MINZ MAX
Config valuealpha_minalpha_maxbeta_minbeta_maxgamma_mingamma_max
Pin name1.241.251.261.271.281.29

Here are more resources for endstops:

Tags

Tech Bravo

My name is Brian and I am a full time geek! Before being pulled in to a real estate firm as their digital marketing guru I was Operations Manager/Senior Network Engineer/Lead Color Digital Imaging Technician for a medium sized Copier/Printer/IT firm. I have been taking things apart since i was old enough to handle a screwdriver and, over the years, have figured out how to put stuff back together. My toys growing up were oscilloscopes, Z80 based microprocessors, tools, and the like and I am heavily addicted to all things technical. I look forward to bringing hi-tech to you! Feel free to contact me if you wish.

Related Articles

2 Comments

  1. Hi Brian,
    Thank you for this guide. I have had a k40 for a couple of years now and have never really got it to run correctly. I’ve tried a few different softwares and a few control boards all without success.
    I’ve been told that the problem is probably with the endstops, or the wiring to them, and that’s how I ended up here.
    I ran the M119 code as you suggest and got the following results, but I’m not sure how to decipher them! I seem to be getting results for a Z stop, which I don’t have…?
    With the x stop activated, I get:
    x_min:1 y_max:0 z_min:1
    with the y stop activated, I get:
    x_min:0 y_max:1 z_min:1
    with both deactivated, I get:
    x_min:0 y_max:0 z_min:1
    It looks to me like they are behaving as they should, apart from “y” being a “max” instead of a “min” and I’m getting a reading for z, which I don’t have.
    Would you be able to tell me what these results mean to you? There is also some info on pins that appears when I use the M119 command, if that is of any use.
    Many thanks in advance,
    John

Leave a Reply

Your email address will not be published. Required fields are marked *

Close