Marlin 2,0 and Laser Menu Modification

Hi I’m hoping someone on this forum might be able to help me out.

I’m currently in process of updating from a older Marlin build to the latest v1 510 version. I am also switching PWM control from the Fan port to the new dedicated M03 command pin. Since I will still use the Fan ports for Primary power for the laser I wanted to add a command in the laser menu to enable and disable power to the fan ports (M105 s255 and M107). I cannot find the Laser menu in the Configuration_adv.h file.
Am I missing something or is there somewhere else I need to look

I don’t have a laser, but I did take a quick look around the Marlin source. You don’t say what board/display you have. If you have a TFT display, then your laser commands are coming from the TFT firmware, and you will need to make modifications to the TFT firmware, not Marlin. If you don’t have a TFT display (or are running your TFT in Marlin mode), then it appears that the laser menu items are handled in the “guts” of Marlin in Marlin/src/lcd/menu/menu_spindle_laser.cpp. It would take some work to sort out how to add additional menu items to the laser menu, and then you’d have more work if/when you wanted to update the firmware.

As an alternative, you can easily add menu items to the V1 Custom menu. Search for CUSTOM_USER_MENUS in configuration_Adv.h. Your laser controls won’t all be in the same place, but it gets the job done.

All right thanks for the quick response! I have a Rambo board and the TFT that’s supplied from the V1 store. I currently use the custom menus but was kind of hoping to have a one stop for my laser. I was thinking the menus would be as easy as the custom menus but if that’s not the case that’s no big deal.

I’m wondering how other people might be powering their lasers going forward as I know power and gnd pins by the new pwm pin do not provide sufficient power for my endurance laser.
Also when directly connected to the power my laser fan never turns off.

Right now I am using the fan 0 pins for power. I just updated my lightburn and noticed it finally supports start and stop scripts. So I can make everything work except focusing the laser ( that’s where custom commands come in) or octoprint custom commands even.

Judging by what I read on the forum, often the laser is controlled by a separate power supply. The two power supplies (control board and laser) need to share a ground. This is often handled by having two wires from a laser control board to the CNC control board.

Note there is a 12V pin pair (±) on the Rambo board that I believe would work for your laser. The pair is always on, so you would not need to set the fan PWM to get power.

Assuming your laser wants 12V DC, I would give it’s driver power at all times (and let the fan run all the time) and use the PWM pin to control the on/off and intensity.