Another Chinese laser issue

Hi all,
I Know another stupid chinese laser problem…I’m not sure if I should post it here or at MPCNC. Please move it if needed.
Anyways I been trying to set up a Banggood 5W laser for about 3 weeks now.
I read the Doc page on laser several times, thinking I missed something, Search the Forum and read every single post about laser but could not find any solution. Some got it going but has no documentation of it.
So If we can figure this out I want it to be documented.
Here is the deal, I can turn the laser on (M3) and laser off (M5) witch is connected to pin 45 and negative but always and only at 100% power, the issue is that I can’t control power, nether through LCD, Gcode or Light Burn.

This is what I have.

Rambo 1.4a
V1 dual end stop firmware 425D
Banggood laser (linked above)

Sorry for the bad picture (wire management) ,it is a new machine and I haven’t design the new control box to host the rambo board, Pi and laser control board.
Also some pictures of the jumper cables and screen shots of the Configuration.h and Pin_RAMBO.h

Thank you for looking and I hope someone can help me with this.

Forgot to add a screenshot of the Laser specs.

Hi…first…an M3 command will just turn the laser on, you need to specify the power at which you want it to come on with by adding the Sxxx ie M3 S25 M3 S200 . secondly you seem to have too many connections to the laser PSU. Connect just +12v and ground to the three pin connector to 12v power and connect your Rambo pin 45 to the PWM/ttl pin in the 3 way connector, you should not have anything in the two pin connector. on the laser PSU,. If you meter out the pins you will find the PWM/TTL pin in the three pin connector is attached to the TTL pin in the two pin connector, I suspect you are clamping the pwm from the RAMBo to a rail with your extra wiring.

If you had access to an oscilloscope you could check the pwm output from the RAMBO.

I have neither a Rambo or the laser in question so cannot advise but some lasers require the PWM signal at 3v3, some at 5v and even some at 12v…with a scope you could see what the Rambo is outputting, the usual bull in the specs from banggood…

Input Voltage|DC12V (+,-, PWM/TTL) + DC5V (PWM/TTL,-)
Input Interface|XH2.54-3P (+,-, PWM/TTL) + XH2.54-2P (PWM/TTL,-)|

is just Chinese jibberish…it means nothing.


I concur… too many connections to the PWM input pins on the laser board. Similar to Mike’s suggestion… you could just disconnect the right-most red wire in the 3-pin connector (first photo), leaving “as is” the gray and white wires (which I assume are pin 45 and gnd, respectively, on RAMBO?) in the 2-pin connector to modulate the laser intensity. I’ve not used a RAMBO but have used several Banggood lasers…

That said, I’ve never used Marlin’s M3/M4/M5 commands to control the laser either… only a remapped fan control using M106/M107. As Mike said, a scope would really be helpful. I’m pretty sure the PWM is a +5v signal on these lasers… all my Banggood and Eleksmaker lasers have been.

– David


Hi Mike and David, Thank you for the reply.

I should had been more clear. Yes I know that I need Sxxx to what ever power I’m looking forward.
The problem is if I set lets say M3 S127 to get about 50% power I get nothing, like laser is off.
Like on this exemple.

; LightBurn 0.9.14
; Marlin device profile, absolute coords
; Bounds: X63 Y61 to X161 Y161
; Cut @ 6000 mm/min, 100% power
G0 X63 Y61 F0
M03 S255
G1 Y161 F6000
G1 X161
G1 Y61
G1 X63
; Cut @ 6000 mm/min, 50% power
G0 X93.75 Y77.66 F0
M03 S127.5
G1 X75.5 Y111 F6000
G1 X93.75 Y144.34
G1 X130.25
G1 X148.5 Y111
G1 X130.25 Y77.66
G1 X93.75 Y77.66
; Cut @ 6000 mm/min, 20% power
G0 X107.02 Y95.96 F0
M03 S51
G1 X106.24 Y96.21 F6000
G1 X105.48 Y96.49
G1 X104.74 Y96.8
G1 X104.02 Y97.15
G1 X103.31 Y97.53
G1 X102.63 Y97.94
G1 X101.98 Y98.38
G1 X101.35 Y98.85
G1 X100.74 Y99.34
G1 X100.16 Y99.86
G1 X99.6 Y100.41
G1 X99.07 Y100.98
G1 X98.58 Y101.58
G1 X98.11 Y102.19
G1 X97.67 Y102.83
G1 X97.27 Y103.49
G1 X96.9 Y104.17
G1 X96.57 Y104.87
G1 X96.27 Y105.58
G1 X96 Y106.32
G1 X95.78 Y107.06
G1 X95.59 Y107.83
G1 X95.44 Y108.6
G1 X95.34 Y109.39
G1 X95.27 Y110.19
G1 X95.25 Y111
G1 X95.27 Y111.81
G1 X95.34 Y112.61
G1 X95.44 Y113.4
G1 X95.59 Y114.17
G1 X95.78 Y114.94
G1 X96 Y115.68
G1 X96.27 Y116.42
G1 X96.57 Y117.13
G1 X96.9 Y117.83
G1 X97.27 Y118.51
G1 X97.67 Y119.17
G1 X98.11 Y119.81
G1 X98.58 Y120.42
G1 X99.07 Y121.02
G1 X99.6 Y121.59
G1 X100.16 Y122.14
G1 X100.74 Y122.66
G1 X101.35 Y123.15
G1 X101.98 Y123.62
G1 X102.63 Y124.06
G1 X103.31 Y124.47
G1 X104.02 Y124.85
G1 X104.74 Y125.2
G1 X105.48 Y125.51
G1 X106.24 Y125.79
G1 X107.02 Y126.04
G1 X107.81 Y126.25
G1 X108.62 Y126.43
G1 X109.45 Y126.57
G1 X110.29 Y126.67
G1 X111.14 Y126.73
G1 X112 Y126.75
G1 X112.86 Y126.73
G1 X113.71 Y126.67
G1 X114.55 Y126.57
G1 X115.38 Y126.43
G1 X116.19 Y126.25
G1 X116.98 Y126.04
G1 X117.76 Y125.79
G1 X118.52 Y125.51
G1 X119.26 Y125.2
G1 X119.98 Y124.85
G1 X120.69 Y124.47
G1 X121.37 Y124.06
G1 X122.02 Y123.62
G1 X122.65 Y123.15
G1 X123.26 Y122.66
G1 X123.84 Y122.14
G1 X124.4 Y121.59
G1 X124.93 Y121.02
G1 X125.42 Y120.42
G1 X125.89 Y119.81
G1 X126.33 Y119.17
G1 X126.73 Y118.51
G1 X127.1 Y117.83
G1 X127.43 Y117.13
G1 X127.73 Y116.42
G1 X128 Y115.68
G1 X128.22 Y114.94
G1 X128.41 Y114.17
G1 X128.56 Y113.4
G1 X128.66 Y112.61
G1 X128.73 Y111.81
G1 X128.75 Y111
G1 X128.73 Y110.19
G1 X128.66 Y109.39
G1 X128.56 Y108.6
G1 X128.41 Y107.83
G1 X128.22 Y107.06
G1 X128 Y106.32
G1 X127.73 Y105.58
G1 X127.43 Y104.87
G1 X127.1 Y104.17
G1 X126.73 Y103.49
G1 X126.33 Y102.83
G1 X125.89 Y102.19
G1 X125.42 Y101.58
G1 X124.93 Y100.98
G1 X124.4 Y100.41
G1 X123.84 Y99.86
G1 X123.26 Y99.34
G1 X122.65 Y98.85
G1 X122.02 Y98.38
G1 X121.37 Y97.94
G1 X120.69 Y97.53
G1 X119.98 Y97.15
G1 X119.26 Y96.8
G1 X118.52 Y96.49
G1 X117.76 Y96.21
G1 X116.98 Y95.96
G1 X116.19 Y95.75
G1 X115.38 Y95.57
G1 X114.55 Y95.43
G1 X113.71 Y95.33
G1 X112.86 Y95.27
G1 X112 Y95.25
G1 X111.14 Y95.27
G1 X110.29 Y95.33
G1 X109.45 Y95.43
G1 X108.62 Y95.57
G1 X107.81 Y95.75
G1 X107.02 Y95.96
; return to user-defined finish pos
G0 X0 Y0 F0

The left red and middle black are 12V from a external power supply the red on the far right is going nowhere.
I did try the way you are describing but no lazer control. the only way I can control (on/off) is the way it is connected, white to gnd
and Gray to pin 45.

I will try to get hold of a scope.

Anything else that I should try?

I order a scope, one of the kits from Amazon, I hope it will good enough for this.
Any thoughts?

I actually have a couple of those scopes (one still in the box) and they perform quite nicely for this particular task. Check out a couple of posts and you’ll see it displaying side-by-side the same signal with my nicer $300 Rigol scope…

At this point I was testing a mini-Rambo board… using the remapped fan controls M106/M107 to provide the PWM signal for laser intensity control. This earlier post in that thread shows what the PWM signal on a RAMPS board looks like for various M106 Sxxx (where xxx = 0 - 255) commands… and how the duty cycle (ratio of time ON to total period) determines laser intensity. That signal is how it should look… regardless of the board used.

1 Like

Funilly enough DKJ, I have one of those DSO Shell scopes open on my bench right now!! is playing up but would agree that they are good enough for this type of application.
GP… I wonder what the F0 is doing in the rapid move line above each lasing command…
; LightBurn 0.9.14
; Marlin device profile, absolute coords
; Bounds: X63 Y61 to X161 Y161
; Cut @ 6000 mm/min, 100% power
G0 X63 Y61 F0 -----what does this F0 do???
M03 S255
G1 Y161 F6000
G1 X161
G1 Y61
G1 X63
; Cut @ 6000 mm/min, 50% power
G0 X93.75 Y77.66 F0 --------------and this one???
M03 S127.5
G1 X75.5 Y111 F6000
G1 X93.75 Y144.34

I would have thought that would set the feed rate to zero! Have a look in the post processor you are using to see if the instruction to add that F0 is in there.

If you cannot control the laser from the third pin in the 3 wire connector but you can using both the pwm and gnd from the 2 pin connector I just wonder if you have connected both the 12v GND and the 5v ground together?..they should be commoned. (as I said the two pwm connections are wired together in the laser psu so all you are doing by using the 2 wire plug is using the 5v ground instead of the 12v ground)

Everything else looks good. There are many examples of people having problems controlling their Chinese lasers but I have never had a problem, I just connect the 3 wire connector to +12v, GND and PWM output from the controller board - it is most helpful having a little scope to see the waveform (and I notice the scopes are around just $20 at the moment from AliExpress.

1 Like

That F0 appears to be the G0 travel rate and doesn’t make sense if you’re trying to move to those coordinates… never gonna get there. It’s gotta be a G0 travel rate setting in LB that’s missing or improperly set, seems to me.

I googled Marlin’s M3 command syntax and couldn’t really make heads or tails of it, so I’ll be of little/no help with that. Grbl’s M3/M4 command syntax OTOH makes much more sense to me… with the “laser mode” switch ($32=1) making it easy to know how to interpret the Sxxx parameter. I found Marlin’s M106/M107 fan-control syntax straight-forward as well… and had no problems at all simply remapping it to a +5v PWM pin and controlling the laser’s intensity with that.

I’d believe the ground plane on the laser board to be the common/reference for all signals/voltages on that board. It shouldn’t make any difference at all if pin 45 of the RAMBO board is connected to the TTL/PWM pin in either connector… as long as the RAMBO and laser control board commons are tied together somewhere. Safest IMO is to use the 2-pin PWM connection, bringing both pin 45 and its reference ground over to the laser board to insure both boards are referenced to the same ground/common.

GRBL ignores F arguments on G0 commands. I would guess Marlin just ignores an F0.

1 Like

Something else I just spotted… I don’t know how a RAMB0 deals with the SPINDLE_LASER_ENABLE signal but I wonder if the’ //Pullup!’ comment means you have to fit a pullup resistor to pin 31?

Ummm…this is very confusing…have you seen this Laser on Rambo 1.4

It would be so much clearer if you looked at the output on pin 45!

This is why I think you are better off going for the older solutions because all the development work has finished making changes and the documentation is more solid.

ok…so to answer my own question…the RAMBo doesn’t use SPINDLE_ENABLE at all unless you want to, it just makes it available on pin 31, so as you are not using it it doesn’t need pulling up!

Were you able to figure this out? I am able to control the laser on/off with M3 and M5, but unless i set M3 S255 the laser wont come on. If i set S254 the laser doesnt come on. I checked the PWM pin and unless its S255, the voltage is like .2V, when at S255 its 5V.

Are you sure thst pin is PWM enabled?

I have the following line in the firmware.

#define SPINDLE_LASER_PWM_PIN 45 // Hardware PWM

I’m a laser n00b so ignore all the following…

In attempting to get my banggood laser working with my SKR Pro I initially had been using M106 fan control. It worked, but there were some inconsistencies (sometimes it wouldn’t turn off after a move, etc.) Moving to “real” Marlin laser control Via M3 It would flash on, but turn itself off quickly, never really leaving a mark. Turning off LASER_POWER_INLINE it seems to work in very limited testing as I’d expect. LASER_POWER_INLINE seems designed to tweak power based on velocity, which sounds cool, even necessary, but was basically disabling my laser, effectively. Maybe different tunings of it would be better. Point being, try turning it off.

Did you try commanding a move? If it is proportional to speed, then at zero speed, it would be off.

1 Like

Mine would disable after moving as well. I think the laser power would be fine and nice to have if my PWM was working also.

Turning off LASER_POWER_INLINE appears to work while I troubleshoot the PWM issues.

Marlin tends to complain at compile time if you give it a pin that can’t do PWM. However, perhaps like my SKR Pro it has problems detecting what pins are PWM capable and which are not.

1 Like