Welcome! Log In Create A New Profile


Laser RAMPS1.4 connection

Posted by ostritch 
Laser RAMPS1.4 connection
February 01, 2017 02:34PM

I have this laser module: 2.5W Laser Module

And I want to use it with my RAMPS 1.4 on an old Prusa Mendel and turn it into a laser cutter for cardboard.

The laser came with a 12V 2.5A power supply and has the driver board built-in. When plugged into mains power the laser comes on and works fine. From what I'm reading, its suggested to use the Fan output on a RAMPS board and adjust the power of the laser with G codes 0-255. Am I on the right track? One issue is that my RAMPS board output labels are Heat 1 (D10) Heat 2 (D9) and Heat Bed (D8). So, I don't have a fan output really but can I just change the board type in the Marlin firmware to BOARD_RAMPS_14_EFB? Will this even work with the type of laser I have?

(I don't have access to the printer until the weekend to test anything but I don't want to blow something then)

Thanks for your help.
Re: Laser RAMPS1.4 connection
February 01, 2017 11:11PM
the laser i have comes with a fan and 12 volt driver and is an on off type when powered the fan and laser are always on from my research this type can't be PWM'd its speed of movement in x and y controls how much an area is burnt and perhaps a z height control could be used to control the burn. It is set a distance from the bed say 20 mm and its focal point lens is adjusted for the burn intensity. Repetier firmware has configuration for laser and cnc control with the ramps board which I am using in printer mode for now but can switch to laser mode. The laser I have is 500 mw violet not very powerful compared to a CO2 at 40 w which in itself weak compared to 1Kw and higher. Use the repetier configuration tool fill in the blanks and download the full zip extract load into arduino ide and upload to the mega board you can have the fan on D8 9 or 10 depending how you set it in config. If you can config marlin and your laser has pwm use D8 for laser D9 for fan. 250-500 mw will burn cardboard, wood, paper and makes a nice hole in PLA. I assume you got glasses with the laser and if not get some for your specific wavelength
Re: Laser RAMPS1.4 connection
February 02, 2017 07:59AM
I may be wrong but I believe for variable power output you would need a laser with TTL input.

Within Marlin there are options for extruder/ fan/ heatbed on D10/D9/D8

M106 S(0-255) Will output 0-100% on D9

However the PWM output on these (I'm sure you know) work by pulsing the full 12v supply on and off at varying speeds to achieve the power output. In the case of a laser this would be just on/offs.

ie rather than achieving a low output straight line you would get a full output dashed line. As Roger said; output would be varied by X&Y speed, maybe Z height.

There are probably limits (I'm not sure) to how quick you can pulse the laser just from the input voltage to it. If you do use PWM output you would want to set an appropriate maximum PWM speed in Marlin.

The TTL input takes a 0 to 5v signal and the power modulation is done within the laser module.

Keep us updated with your results, its something I'd like to get into.

Re: Laser RAMPS1.4 connection
February 02, 2017 10:26AM
You can switch the output of D8,D9 and D10 to not use PWM, by commenting out (in marlin anyway) //pidtemp and //pidtempbed. This will then switch these outputs to bangbang i.e on/off. (When on they are at max i.e. 12v constant (assuming a 12v supply)). The next issue is that these outputs are normally temperature controlled but you can manually switch a pin on/off/pwm using M42 P8 S255 would be D8 ON at max, for example, then M42 P8 S0 for OFF.

Its then a case (thinking out loud) that you need some way to generate a gcode file which switches the laser on and off where you want a line and control the speed of movement to control the intensity of that line.

I've not used or built a laser engraver, but would quite like to. Be keen to hear what anyone who actually has says about it.

Simon Khoury

Co-founder of [www.precisionpiezo.co.uk] Accurate, repeatable, versatile Z-Probes
Re: Laser RAMPS1.4 connection
February 10, 2022 06:42AM
I am failing to connect my laser to ramps .
When I plug my PWM laser pin onto the Z limit on a CNC shield as I should. It works just fine.
It also works when plugged onto the 3 pin connector on the board used to drive my 3018 CNC.
So it's not the laser...........
I am running GRBL MEGA 5X. When I connect the laser to 12v + and - the laser fan powers up. I then have the PWM connection to make.. If I connect to D6 negative the laser fires but doesn't respond to any control. If I connect to D6 negative the laser fires without control.
I have a 5v power on D6 and have configured GRBL Mega5X to use D6 for 5v rather than D8 for a 12v output
I'm baffled.
Is there anyone out there who can tell me where I'm going wrong
Re: Laser RAMPS1.4 connection
February 14, 2022 01:11PM
Ok so, forgive me If this isn't exactly the right place to post this, but I'm running out of options and I'm at my wit's end with this.

I've been doing an Arduino+ramps conversion for a chinese K40 laser cutter following THIS tutorial.

From what I've gathered, this seems to be quite a common problem but i've not really been able to find a working fix for it. The one or two posts I HAVE seen have no resolution to them. But basically the problem I'm having is that the X axis wants to go the wrong way. Or that's what it seems like is happening. The supposed alterations to the code on the github writeup dont seem to work and i'm stumped. I'll take it from the top and run you guys through what's happening.

Running a RAMPS1.4 on an Arduino Mega, obviously, with A4988 stepper drivers. all 3 jumpers are on, under each driver. LCD screen is attached. Everything is wired as it should be.

Fresh, untouched upload of Marlin:

PREPARE>AUTO HOME causes the head to move to X0,Y0. Stops clean, quiet and solid, like it should.

Stepper motors are now engaged, and per the fresh marlin copy, they stay engaged. You can hear them and they cant be moved by hand . good holding torque.

Jogging only the Y axis from this point brings the head from top - Y0 to bottom - Y230. Stops clean, quiet and solid

Jogging only the X axis starting at left X0 causes it to grind and skip and grind to the LEFT when it should go right.

Running a print (with laser off) causes the same grinding against the left side with the X-axis. Y-axis continues as normal.

HOWEVER - homing, then disabling the steppers, manually moving the head all the way to the right allows it to think it's still at X0,Y0, and jogging the X-axis at this point allows the head to move from right to left. BUT. Regardless of whether the value is increasing, the head ALWAYS moves from toward the left, and will eventually jam an shudder against the gantry.

Now onto the fixes from the github:

#define DISABLE_X true (from false)

#define DISABLE_Y true (from false)

As they should, these disable the steppers when they are not actively being used. No problems here.

#define X_MAX_POS 330 (from 330)

Doing the home-to-X0-then-push-to-right trick, then jogging it back with the value going to X330 will cause it to stop nicely at a top right home so 330 seems to be a good calibration for the bed.

The "always moving left" bug is still present, and basically moving the dial either way will cause the head to ride left and then shudder up against the gantry unless you do the above and go from X0 to X330 in one go.

At this point, doing the home-to-X0-then-push-to-right trick then telling it to home makes it head home, but it stops just shy of the left side of the extraction duct, and i have no idea why.

#define MANUAL_Y_HOME_POS 230 (from 0)

No idea what this is supposed to do. Apparently is supposed to set the home of the Y axis to Y230 instead of Y0. Homing the head still makes it head for X0,Y0 top left. The home-push-right trick then homing again still has freezes over the duct.

#define Y_HOME_DIR 1 (from -1)

Now this is the one causing me the most bother which is why i've saved it for last. Upon changing this variable to 1, When telling it to home it still freezes over the duct spot when homing X.

Y however, becomes loaded with issues. it reads as Y230 when homed, but when homing, it homes top left... sort of. as above, X homes fine, but the Y axis just sorta scoots towards home a little.

Pulling the Y axis down to bottom, and jogging it from Y230 value to Y0 yields no problems. Axis set to home, thinking it's Y230 when it's really Y0. Attempting to jog the value down to Y0 makes the head shudder against the top of the gantry.

So yeah, I hope that explains what's happening, because it's got me at my wits end, Forgive me if this sounds like absolute waffle and makes no sense, because I'm gonna be honest, i'm doing this with limited experience here. I just want the cutter to the point where it works with some semblance of normality. Hopefully you guys know your way around this sorta thing more than I do, and we can get it fixed and working and I can start making cool things with y'all.

Edited 2 time(s). Last edit at 02/16/2022 07:14AM by shyam.
Sorry, only registered users may post in this forum.

Click here to login