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.
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?
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.