Preprocessor defines can get convoluted, but I believe this is the line that defines the laser pin for the ramps board:
#define SPINDLE_LASER_PWM_PIN 44 // Hardware PWM
And is found the file Marlin/src/pins/ramps/RAMPS.h.
The laser PWM pin must support PWM. On the Ramps/Mega board that will be pins 2 through 13, 44, 45, and 46. Looking at the pinout diagram for the Ramp board, the most likely candidates are on the servos block and highlighted in yellow:
Before making any firmware changes, I’d carefully test the PWM output of your selected replacement pin using M42 and a voltmeter. You should see the voltage vary between 0V and approximately 5V as you increase the PWM value from 0 to 255.
Avoid using pins 8, 9, and 10 since they will be at a higher voltage and be ground-side switched.
Also, you might want to consider how pin 44 is blown since if it is an underlying problem, you will blow the replacement pin as well.
Well, partial success here. Pin 6 works with the laser menu but with lightburn no matter if I use m105/106, M3/5 or online commands. I’ll look at the gcode to be sure it contains correct start commands as noted above. I’m feeling better about this now.
Thanks for the help.
Forbes
Yes, M3 I is required starting with version 515. M3 should also work with Lightburn. It does for me. Also, the laser menu is not working for me in version 515 due to the safety timeout. I’m not sure why it is iworking for you. Are you sure you are modifying the latest V1 maintained Marlin firmware? Previous to 515, behaviors were different, though M3 should work in both versions.
I downloaded the latest 2.1.1 for Ramps. The lcd says 515s I believe.
I do get yellow warnings while compiling. Something like Ardodude or similar.
I’ll try compiling on another cpitee. I’m using the latest version of PlatformIO.
The warnings say something about using the latest version of something or other… I’m not at my machine at the moment.
You don’t say what command you are using to vary the value. Start by trying to control the pin with M42. It doesn’t require M3 I at the beginning of the file. See if you can get the pin to vary between 0V and around 5V with S parameters between 0 and 255.
Hello, thanks to this forum I was able to build the CNC with a 20 W Arduino Mega AtomStack M100 laser and Ramps 1.6 plus, and I wanted to provide some clarifications so that other users do not have problems, the default Marlin pin in its latest version is the pin 6, not 44. In the header file ramps.h it specifies it.
On the other hand, the Marlin laser control menu works correctly, it is used to test the laser by pulse. Greetings to all!!!
While the thread may be old, the issue he is writing about is in the current V1 maintained versions of Marlin. The latest V1 releases (2.1.1 / 515) incorporated updated laser code that includes a safety timeout if the laser is not moved. According to reports, it does not play well with native Marlin display code for turning the laser on and off manually. It also interferes with g-code to manually turn on the laser (very low power) for positioning the origin of a job, though using M42 instead of M3 is a usable workaround.