Enable laser, and ignore safety Time Out

@vicious1 here is the github Bug report:

and summarized again here:

Currently I have a Endurance Laser with power from Fan port and PWM coming from Pin45. With the latest V515 firmware there is no way I can Power on the laser to allow focus for more then 1 second. I Can update LASER_SAFETY_TIMEOUT_MS in the firmware to use a longer time, but i would prefer to keep the safety untouched and have a gcode command / macro that could temporarily disable the timeout.

Previous Controls for laser focus -v513
M106 S255 ; Power on laser
M3 S30 ; fire laser with low power to focus
focus the laser manually
M5 ; Stop laser
M107 ; Power down the laser

Current version -v515
M106 S255 ; Power on laser
M3 I S0 ; without this after the first laser fire it will not fire again (bug?)
M3 S30 ; fire laser with low power to focus
focus the laser manually while resending M3 S30 multiple times, as the laser automatically shuts off due to LASER_SAFETY_TIMEOUT_MS in firmware
M05 ; Stop laser
M107 ; Power down the laser

Also please note:
I take my power from a fan port for the laser so M106 S255 powers up the controller / cooling fan on the laser. I didn’t direct wire it to the 12v power as there was no way to turn off the laser fan when the endmill is in use. Then if I don’t use the M3 I S0 the laser won’t “fire” but once the M3 I S0 is sent once the laser works totally as expected (except for shutting off because of the safety setting)

Any help or ideas are appricated. in the mean time i did a custom firmware and upped the time out to 9000ms so I can finish the projects im working, and its workable but not ideal

That would be beyond firmware edits and is a setting that would need to be discussed with the Marlin team.

On our end we can decide to change the time limit of the safety or turn it off all together.

Do any of you laser folks have any input on this?

9 seconds is a long time and would probably be better not to have the safety on at all. Your other option is to do a moving laser focus test. I would assume this would be the more accurate way as well.

You need to be very careful with this as most fan ports are not capable of handling the laser current. If you want to do this I highly recommend using the Bed port since it has a much larger mosfet. The correct way would be a relay of some kind.

1 Like

You could always hack the situation. You could use repeated commands with M0 pauses less than the timeout. It may be enough to just send repeated M3 commands, or repeated M3/M5 command, but if that does not work, you could make a tiny relative movement and then (optionally) release the steppers. It does mean a fixed amount of time the laser would be on.

2 Likes

I like that.

I do like having a safety on.

1 Like

the extended time is only temporary, I plan to make some other changes to the firmware and will revert it back then to the 1sec.

I only have a 3watt endurance laser, that seems to work fine on the fan port. If I switch to the Bed Heater, would I use M140 to enable power to the Laser?
Unfortunately I don’t think moving focus will work with my laser (the lens is touchy I find).

Ill keep playing around with the commands and see if I can find something that works in the mean time.

With a moving focus you do not touch the lens. You leave it set and use the Z axis to do the fine focus. This way it is very easy to get a perfect focus in the actual material you are using. Really though I think most people are just using a spacer to set the height correctly and not messing with the actual focus after the initial tests. You have a few mm of pretty good focus so it does not need to be perfect. Moving the Z is far easier than moving the lens.

Look up the ideal focal length for your laser, Set the lens one time to that length and only move the Z after that.

As far as I know there is no G or M code for that. Robert’s suggestion would work though, or you could just use a linear or circular motion really slowly to keep it on.

I like the safety and am very hesitant to disable it in the firmware.

I don’t think so. There is a lot of logic around the bed w.r.t. safety. The best two options would be:

  1. Have a digital out (could be the fan) enable a solid state relay. The ssr would handle the current from the 12V source.
  2. In the pins file, swap the bed and the fan output.

If I change the Pins, would still use the M106 S255, or do I drop the S255? Ive never remapped Pins so I would need to do some reading on that part

Agreed, I like my little woodshop, and I aim to keep it around, so I don’t typically wander far from the laser when its running.

Others do though that is why we need the safety :rofl: :joy:

1 Like

If you swapped the pins, marlin would think the port/mosfet labeled “bed” is the fan. So it should act just like the fan. If you needed S255 before, you will need it after swapping the pins.

If I swap the pins in pins_RAMBO.h for the following items (Rambo 1.4 in my case)
// Heaters / Fans
//
#define HEATER_BED_PIN 3 ; CHANGE FROM 3 TO 8
#ifndef FAN_PIN
#define FAN_PIN 8 ;CHANGE FROM 8 TO 3

Then I can move my laser power from the Fan 0 to the Bed port, and I supply 12v power to the Bed input this would be a better setup for my use case?

The bed mofset can probably handle more power, so yeah, it should be better. You’re just planning on toggling it on or off, and infrequently, right? That should work well.

1 Like

Yeah this power toggle is only when I’ll be working a last project and I turn the laser on and power it through the bed then I use pin 45 for the laser pwm. Currently I’ve used the fan Perry for a couple years now with no issue. (3watt laser I use to engrave) and never had any issues

I managed to find a working macro this weekend that will work for focusing the laser. If anyone is looking for what I worked out, I am using:

G91 :Relative Movements
M3 S30 I ;Laser Power
G1 X1 F3 ;Move laser slightly to focus
G1 X-1 F100 ;Move laser back
G90 ;Absolute Movements

This give me about 15seconds to focus the laser which is plenty. I reverted the safety time back and it works exactly as expected. Thanks for the help guys!

2 Likes

Awesome!

What we really need is an upgrade to the safety monkeys…
death-mob-wizard-of-oz


6 Likes