I have identified the PWM of the laser on pin 6. When checking with the M43 command, the output data shows that the 6th pin is used as a PWM laser, but when I, for example, run the M03 S255 command, the laser turns on for a few seconds and goes out. I changed the mega2560 and RAMPS 1.4. The problem is the same on both boards. As if the firmware has protection for working with PWM.
Also, when checking the pins on the M43 command, the pwm of the laser and servo 1 were determined on the 6th pin. I have determined for servo 1 that the 7th pin is not occupied, since I do not use servos. The laser lights up for 1 or 2 seconds and goes out. It lights up with the power that I determine. At the same time, the main power supply, which is turned on by the 4 pin, works until I give the M05 command.
Do you have any ideas? Where to look, what to comment out or vice versa to uncomment in the source code?
I believe this is a known problem with the version of the Marlin firmware used as a basis for the V1 releases. The issue is the safety timeout. According to one poster on this forum, it has been fixed in later versions of the firmware, so someday, when Ryan takes a new drop of Marlin, the problem will be fixed.
Note this problem only occurs if the laser is not moving. I have the same problem on my Rambo board. If you are trying to turn the laser on for setting up a job, the easiest workaround is to directly turn the pin on and off using an M42.
As an alternative, you could try the daily release of the firmware rather than the release builds. I believe the daily releases use the latest release of Marlin.
Another solution (a less safe one) would be to extend the safety timeout in the firmware. The value is in milliseconds and is defined in this line in configuration_adv.h:
#define LASER_SAFETY_TIMEOUT_MS 1000
Change the line, recompile, and reflash.
Thank you very much for the hint. The laser really works when the machine is moving. I checked it when there was no movement, so the protection was triggered. There was no such thing on the MPCNC firmware.
Although it’s strange why it doesn’t work when I try to launch it from the laser menu. The laser test pulse doesn’t even work. That’s why I had my doubts.