Diode laser connection help

Hi, can anyone help me with laser connection, please? My MPCNC run on Marlin on ATMega 2560+RAMPS 1.6 Plus.

I’m working on how to connect a diode 12V/5A laser to a board.

So which cable from laser to which pin on RAMPS?

  1. I think cable at yellow circle on attached photo, right?
  2. And switch A/TTL (green circle) to “TTL”, right?
  3. Cables from blue circle will not connected to board, right?

My configuration.h and configuration_adv.h are here, something will need to change?

Thank you so much!
Tomas

Here is configuration.h and configuration_adv.h and links to my laser (you must to delete spaces at links)

drive.google . com/file/d/1KIeVSvzLKVN0ppX8ECGLyt7TbGb2ZB3j/view?fbclid=IwAR37FgxcSqQa0MHOuoYXbeASQ_lDQI2QGo9WnNHvnL1A8zePuX2WwmYFuVE

drive.google . com/file/d/1vlArbqdLu8li4wCk8W7FlycH5jliajDv/view?fbclid=IwAR0YalACKCAIQ5LMZoy1-Mv1dch8eb2plvY2XmlLFc31YakhzCgTfhcMIBo

aliexpress . com/item/32954633425.html?spm=a2g0s.9042311.0.0.27424c4dNBETUo

Yes, yellow circle is pwm wire to go to the pwm output pin on your mega2560. you will also need the ground connection from your 12v laser power supply to gnd on your mega2560. The blue circled connector is left unused. As to which pin is your pwm pin, that depends on what you have configured in the firmware, it could be any pwm capable pin. See Laser/Spindle Configuration | Marlin Firmware

As to which pin is your pwm pin, that depends on what you have configured in the firmware,

I could not find a Ramps 1.6 PINS file in the ongoing Marlin source, but for Ramps 1.4, the PWM pins is D6 or D44:

// M3/M4/M5 - Spindle/Laser Control
//
#if HAS_CUTTER && !defined(SPINDLE_LASER_ENA_PIN)
  #if !NUM_SERVOS                                 // Use servo connector if possible
    #define SPINDLE_LASER_ENA_PIN              4  // Pullup or pulldown!
    #define SPINDLE_LASER_PWM_PIN              6  // Hardware PWM
    #define SPINDLE_DIR_PIN                    5
  #elif HAS_FREE_AUX2_PINS
    #define SPINDLE_LASER_ENA_PIN             40  // Pullup or pulldown!
    #define SPINDLE_LASER_PWM_PIN             44  // Hardware PWM
    #define SPINDLE_DIR_PIN                   65
  #else
    #error "No auto-assignable Spindle/Laser pins available."
  #endif
#endif

Note in the V1 maintained versions of the firmware, only the Rambo and the SKR Pro versions have the laser support enabled since these are the versions they tested. I couldn’t access tomh’s files.

Pins 4, 6, and 5 are the “servo” pins. If I remember correctly, pin 44 is “covered up” by the Aux connectors used for LCD panels.

Hi guys! Thank you for your responses, I didn’t have time, but I’m back now…

Robert: Sorry, i didn’t have setted permisions for everyone on Google disk. :frowning: So I attached the zip to this post.
mpcnc.zip (49.2 KB)

Tom Traband: PIN 44 I have accessible.

So the wire from yellow circle to D44 and GND from laser board to mega2560, right? Can anyone check the my configs, please? :slight_smile:

Laser information: “the TTL/A can be conversate by each control work; it is 0V open, 5V close;” - Is it OK? Does the mega2560 control only 5V on pin D44?

Thank you so much, guys!
Tomas

I’m familiar with RAMPS from using them on 3D printers, where I repurposed the servo outputs to control RGB leds. My K40 and MPCNC are running grbl on a CNC Shield, so while my PWM configurations are working for me, I don’t feel comfortable putting myself forward as an expert on laser connections to a different board.

Pin 44 will be a 5V pin. So you need to do the following:

  • Verify that your laser can be controlled by a 5V PWM pin. Most can. These days, a lot of lasers support PWM from 3V to 12V, but you need to make sure. If it requires a 3.3V PWM for example, you will burn out your control board if you use a 5V signal.
  • Look at the firmware version you are running and verify that pin 44 is the laser pin. The information about the laser pin was pulled from the V1 maintained version of the Ramps 1.4 board. I don’t know what change between Ramps 1.4 and Ramps 1.6, and when I look at boards.h in the Marlin source, I don’t see any Ramps 1.6 versions.
  • Enable laser support. V1 only has the Marlin laser support enabled by default for the Rambo 1.4 board and the SKR Pro 1.2 board because they explicitly test lasers on these two boards. There are a number of lines in the Marlin configuration files that need to be changed to enable laser support. For this kind of thing I use a free tool called Meld to compare the configuration files between one of the versions that has laser enabled and my target version.

Note it is possible to control the laser in a clunky way without enabling laser support, but you will have quality issues with your cuts and probably your engraving as well if you go down this road.