Hi all, I guess 98% clicked already away, when it comes to this stupid Lasers again.
The very short version:
PWM is working, as soon an axis start to move it’s stopping.
Long-very long version:
Well, I start at the very beginning. I ordered pretty exactly 2 years ago a small NEJE Laser for my MPCNC #2 build in Thailand, back then I never got it to work. I can’t recall all the details, but in hindsight, it was probably just a grounding issue with the PWM signal. Then in between came a small inconvenience, called itself a pandemic.
On my MPCNC #1 build in Europe, I had a laser running well, after going through all the help from here, mainly this 400 post thread Laser engraving - not really getting great results
Meanwhile, a LR2 has replaced the MPCNC, all of them I have/had running with a MKS Gen 1.4 board. So with Christmas nearing, so are the requests for deco material. I got this laser I suspected death already out, and Ohh wonder, if connected correctly, it’s working. The neje_pwm.doc what I could download helped a lot.
I went through the above-mentioned thread again, and thought you got it once running so that will be just an afternoon b4 it’s running…….well, there would be probably no post here if the answer was yes.
First problem, My super accurate file management capabilities. It seems I had not a single Marlin firmware that would work with my build down in the garage. So I started from scrap, the only good thing is, I have enough spares (board, steppers, PSU) that I can start from scrap in the office. So I downloaded the latest (almost) firmware 2.0.7.2 https://github.com/V1EngineeringInc/MarlinBuilder/releases/download/510/V1CNC_Ramps_DualLR-2.0.7.2-src.zip
I tried to follow those steps working successfully more than 2 years ago, (link above) but hell, I did not even find this Marlin.cpp file anymore in this new build, searching for solutions in the web regarding PWM-laser, usually leads to pre 2.0 versions of Marlin.
I guess the most helpful thing was this link on Github. McUtty/Marlin2.0-Laser-with-M3-M4-M5-G-Code-for-Power: Marlin 2.0 optimised for Laser Engraver (1 X Axes Motor, 2 Y Axes Motors, Optional Z Axes) (github.com)
So the very few changes I did was actually in config_adv.h uncommenting (1486) #define SPINDLE_LASER_ENABLE, then I looked in pins_RAMPS.h the following entries.
(311) #define SPINDLE_LASER_ENABLE_PIN 4 // Pin should have a pullup/pulldown!
(312) #define SPINDLE_LASER_PWM_PIN 44 // MUST BE HARDWARE PWM
(313) #define SPINDLE_DIR_PIN 5
Originally the SPINDLE_LASER_PWM_PIN was on the Servo pin 6, so I left it untouched, and just connected my laser-pwm to Pin6 and that worked, well at least that’s what I thought. I was able to fire the laser in various intensities, but as soon I started a G-code file, I just saw the laser firing up a very short moment and stopped until the next section began. I was suspecting the G-code, but the behavior was the same if created with Estlcam or Lightburn.
I became suspicious and started the laser manually in Repetier-host, and it stays steady, but as soon I moved any axis, the PWM signal is down. Well I moved then to Pin44, I was thinking, Pin6 is used elsewhere in the code. Well, Pin44 is exact same behavior like Pin6 .
And that’s where I stand now, running out of ideas.