2 Questions Spindle and Laser control

MPCNC with ramps 1.4

I know the dreaded laser control questions…
I have a Elekslaser 2500mw 3 wire unit and i am curious if everyone is leaving the ramps configured as EFB or are you changing to SF mode for specific spindle or Laser controls?

second question is in regards to speed control for my spindle, it has Mach3 speed control (10v pwm)
has anyone done this native on the RAMPS or are we needing to build some sort of 10V control circuit to do this?

Hi Bob, Don’t change the firmware other than pin assignment if needed. The laser controls do not work correctly yet. Have quick look at this page,


Not sure about a 10Vpwm, that is new to me.

10v pwm is the spec for mach3 pwm control

thanks Ryan
I just loaded the newest clone of marlin 2.0 and enabled dual steppers to get it back to a match for your version of the older 2.0 clone. I needed to move to the new clone due to a bug in the older 2.0 that would not allow pin debugging to be enabled.
I will post my results of M43 in the morning. but still no pwm control even with no other changes except pin swap for 44. M43 shows pin 44 being listed for multiple items and shows it with a status of protected. Does this mean its in use by another feature and i need to use another pin? if so what is my next best 5v pwm pin on ramps 1.4?

PIN: 0 Port: E0 RXD protected
PIN: 1 Port: E1 TXD protected
PIN: 2 Port: E4 X_MAX_PIN protected
PIN: 3 Port: E5 X_MIN_PIN protected
. X_STOP_PIN protected
PIN: 4 Port: G5 FIL_RUNOUT_PIN Input = 0 TIMER0B PWM: 128 WGM: 3 COM0�: 3 CS: 3 TCCR0A: 3 TCCR0B: 3 TIMSK0: 5 compare interrupt enabled overflow interrupt enabled
. SERVO3_PIN Input = 0
PIN: 5 Port: E3 SERVO2_PIN Input = 0 TIMER3A PWM: 0 WGM: 1 COM3�: 1 CS: 3 TCCR3A: 1 TCCR3B: 3 TIMSK3: 0
PIN: 6 Port: H3 SERVO1_PIN Input = 0 TIMER4A PWM: 0 WGM: 1 COM4�: 1 CS: 3 TCCR4A: 1 TCCR4B: 3 TIMSK4: 0
PIN: 7 Port: H4 <unused/unknown> Input = 0 TIMER4B PWM: 0 WGM: 1 COM4�: 1 CS: 3 TCCR4A: 1 TCCR4B: 3 TIMSK4: 0
PIN: 8 Port: H5 HEATER_BED_PIN protected
. RAMPS_D8_PIN protected
PIN: 9 Port: H6 <unused/unknown> Input = 0 TIMER2B PWM: 0 WGM: 1 COM2�: 1 CS: 4 TCCR2A: 1 TCCR2B: 4 TIMSK2: 0
PIN: 10 Port: B4 HEATER_0_PIN protected
. RAMPS_D10_PIN protected
PIN: 11 Port: B5 SERVO0_PIN Input = 1 TIMER1A PWM: 2000 WGM: 4 COM1�: 0 CS: 2 TCCR1A: 0 TCCR1B: 10 TIMSK1: 2 non-standard PWM mode compare interrupt enabled
PIN: 12 Port: B6 <unused/unknown> Input = 0 TIMER1B PWM: 0 WGM: 4 COM1�: 0 CS: 2 TCCR1A: 0 TCCR1B: 10 TIMSK1: 2 non-standard PWM mode
PIN: 13 Port: B7 LED_PIN Input = 0 TIMER0A PWM: 0 WGM: 3 COM0�: 3 CS: 3 TCCR0A: 3 TCCR0B: 3 TIMSK0: 5 overflow interrupt enabled
. TIMER1C is also tied to this pin TIMER1C PWM: 0 WGM: 4 COM1�: 0 CS: 2 TCCR1A: 0 TCCR1B: 10 TIMSK1: 2 non-standard PWM mode
PIN: 14 Port: J1 Y_MIN_PIN protected
. Y_STOP_PIN protected
PIN: 15 Port: J0 Y_MAX_PIN protected
PIN: 16 Port: H1 LCD_PINS_RS Output = 0
PIN: 17 Port: H0 LCD_PINS_ENABLE Output = 0
PIN: 18 Port: D3 Z_MIN_PIN protected
. Z_STOP_PIN protected
PIN: 19 Port: D2 <unused/unknown> Input = 1
PIN: 20 Port: D1 <unused/unknown> Input = 1
PIN: 21 Port: D0 <unused/unknown> Input = 1
PIN: 22 Port: A0 <unused/unknown> Input = 1
PIN: 23 Port: A1 LCD_PINS_D4 Output = 1
PIN: 24 Port: A2 E1_ENABLE_PIN protected
. X2_ENABLE_PIN protected
PIN: 25 Port: A3 LCD_PINS_D5 Input = 1
PIN: 26 Port: A4 E1_STEP_PIN protected
. X2_STEP_PIN protected
PIN: 27 Port: A5 LCD_PINS_D6 Input = 1
PIN: 28 Port: A6 E1_DIR_PIN protected
. X2_DIR_PIN protected
PIN: 29 Port: A7 LCD_PINS_D7 Input = 0
PIN: 30 Port: C7 E2_ENABLE_PIN protected
. Y2_ENABLE_PIN protected
PIN: 31 Port: C6 BTN_EN1 Input = 1
PIN: 32 Port: C5 <unused/unknown> Input = 0
PIN: 33 Port: C4 BTN_EN2 Input = 1
PIN: 34 Port: C3 E2_DIR_PIN protected
. Y2_DIR_PIN protected
PIN: 35 Port: C2 BTN_ENC Input = 1
PIN: 36 Port: C1 E2_STEP_PIN protected
. Y2_STEP_PIN protected
PIN: 37 Port: C0 BEEPER_PIN Output = 0
PIN: 38 Port: D7 X_ENABLE_PIN protected
PIN: 39 Port: G2 <unused/unknown> Input = 1
PIN: 40 Port: G1 E_MUX0_PIN Input = 0
. Z_CS_PIN Input = 0
PIN: 41 Port: G0 KILL_PIN Input = 1
PIN: 42 Port: L7 E_MUX1_PIN Input = 0
. E1_CS_PIN Input = 0
PIN: 43 Port: L6 <unused/unknown> Input = 0
PIN: 44 Port: L5 E_MUX2_PIN protected
. E2_CS_PIN protected
. FAN_PIN protected
. RAMPS_D9_PIN protected
PIN: 45 Port: L4 <unused/unknown> Input = 0 TIMER5B PWM: 0 WGM: 1 COM5�: 1 CS: 3 TCCR5A: 1 TCCR5B: 3 TIMSK5: 0
PIN: 46 Port: L3 Z_STEP_PIN protected
PIN: 47 Port: L2 <unused/unknown> Input = 0
PIN: 48 Port: L1 Z_DIR_PIN protected
PIN: 49 Port: L0 SD_DETECT_PIN Input = 0
. Y_CS_PIN Input = 0
PIN: 50 Port: B3 AVR_MISO_PIN Input = 0
. MISO_PIN Input = 0
PIN: 51 Port: B2 AVR_MOSI_PIN Output = 1
. DOGLCD_MOSI Output = 1
. MOSI_PIN Output = 1
PIN: 52 Port: B1 AVR_SCK_PIN Output = 0
. DOGLCD_SCK Output = 0
. SCK_PIN Output = 0
PIN: 53 Port: B0 AVR_SS_PIN Output = 1
. SDSS Output = 1
. SS_PIN Output = 1
. X_CS_PIN Output = 1
PIN: 54 Port: F0 (A 0) X_STEP_PIN protected
PIN: 55 Port: F1 (A 1) X_DIR_PIN protected
PIN: 56 Port: F2 (A 2) Y_ENABLE_PIN protected
PIN: 57 Port: F3 (A 3) <unused/unknown> Analog in = 637 Input = 1
PIN: 58 Port: F4 (A 4) <unused/unknown> Analog in = 579 Input = 1
PIN: 59 Port: F5 (A 5) FILWIDTH_PIN Analog in = 824
PIN: 60 Port: F6 (A 6) Y_STEP_PIN protected
PIN: 61 Port: F7 (A 7) Y_DIR_PIN protected
PIN: 62 Port: K0 (A 8) Z_ENABLE_PIN protected
PIN: 63 Port: K1 (A 9) <unused/unknown> Analog in = 726 Input = 1
PIN: 64 Port: K2 (A10) <unused/unknown> Analog in = 1023 Input = 1
PIN: 65 Port: K3 (A11) <unused/unknown> Analog in = 621 Input = 1
PIN: 66 Port: K4 (A12) MAX6675_SS_PIN Input = 0
PIN: 67 Port: K5 (A13) TEMP_0_PIN protected
PIN: 68 Port: K6 (A14) TEMP_BED_PIN protected
PIN: 69 Port: K7 (A15) TEMP_1_PIN Analog in = 1023

no response when watching with M43 P44 W
and executing M106 S255
i am attaching zip of configs and pin_ramps.h
only files that have had changes are included

From some searching, the PWM pins appear to be as follows: If you look at the Mega, then you’ll see that pins 2 through 13 are marked PWM. Checking the RAMPS pinout, 8,9 and 10 are used for the mosfets on the RAMPS, 2 and 3 are used by the X endstops though most printers don’t use X max, so pin 2 may be free on your machine. Also, 44,45 and 46 are also PWM capable, which isn’t reflected on the silkscreen. So, any of 2,4,5,6,7,11,12,13,44,45 and 46. From: reprap dot org slash forum slash read.php?219,426628

1 Like

thanks i will try 6, i know i have seen it mentioned in a few posts elsewhere as well.
I think i will build a quick LED and resistor circuit to use for plugin testing since i should be able to see it ramp up and down, in case its an issue with the laser im dealing with.

looks like switching to pin 6 i can control the led/resistor circuit and dim it. but no control of the laser. i tried 12v + and 12- from the power supply and signal only on pin 6 and also 12+ from supply and pin 6 signal and ground associated to pin 6 for 12v-. still have just manual on off control using button on top of laser giving only full power or what they call dim light mode by the switch. no fan controled pwm changes

What does everybody think is this a bad elekslaser module?

What does the laser spec sheet say about input voltage and frequency of pwm? You might not be providing the correct signal for it to work.

its an eleksmaker fb03-2500mw, no specsheet really available but here is a link to a few sellers
they say its both ttl and pwm (ttl for on/off, and pwm for power)

  • EleksMaker® FB03 new series of laser modules, exquisite workmanship and nice appearance.

  • 445nm 2500mW focusable blue laser module, with TTL/PWM functions. (TTL and PWM are compatibe while TTL can control the switch and PWM can control the power).


Something to keep in mind is the default pwm rate for 8bit ramps boards is 7Hz. Lots of devices expect pwm signals in the kHz range. If you look at my spindle post (in mpcnc) I go into some detail on how to modify the PWM rate. It’ll lower steps available but might solve your issue.

1 Like

i will try playing with the softpwm to see if i find any change, and let you know

1 Like

Hi Bob. I posted a solution for a 5v TTL controlled 12 v powered laser here. It is for GRBL on a Mega + Ramps board if interested. This version of GRBL MEGA 5X works properly with Lightburn. I haven’t tried spindle speed control with this since I am using routers with adjustable speeds.

Not to butt in, but I’ve used Mega/RAMPS with that same 2.5 watt laser… using remapped D9 fan output (12v) to pin 44 (5v) for the TTL modulation. Check out this post and following (scattered)… where I show scope shots of the output for various M106 Sxxx input…


thanks for the input there, I have a feeling i may have either gotten a faulty unit or a counterfeit unit.
I was able to verify pwm output was variable with use of the lcd and resistor circuit