The &%$%ing laser cutter …

Yup, I bought a cheap Chinese laser cutter, not a CO2 one but a diode based banggood/A3 clone (5.5 watts 50x60cm bed). It seemed like such a good idea at the time. I couldn’t sleep knowing I’d finally got my hands on something I could use to create physical objects from work on the computer. I could use the laser cutter to build a simple CNC machine and expand my range of products. We’ll that’s what I thought.

So far this is what’s happened, the laser arrived and took a few hours of head scratching, searching and watching videos to put the thing together, you know me, how the %$& am I supposed to RTFM when there is no &%$&ing manual? The thing arrived with zero instructions, apart from the software and drivers on a disk. TBH the build was pretty straight forward, comparable to technic lego for adults. Assemble frame, mount motors, connect to the control board, install drivers and software and burn! Which is exactly what I started to do.

The laser comes with the most unintuitive, backwards, confusing, annoying, looks like it was programmed for fisher price, insulting slap in the face piece of rubbish I’ve ever used, called benbox. Initially all was going well. I burnt a few bitmaps of cats on to some wood and some card, made a half life logo thing cut from acrylic and started to note settings so I could keep a log of the best settings for cutting different types of material. (Power/Speed/Time/Passes). This was where I made a few mistakes or as I like to think started my learning curve.

Initially I was writing down the values and tallying how many passes I’d run, every time I’d made a pass I’d add a mark to my tally to count how may passes I’d done. This whole process was tedious. I hate closed source software, it was time to look for an alternative. (Probably best to mention here I’d been running the laser to attempt to cut 4mm ply wood with varying results I’d also not noticed how hot the power mosfet driving the laser was getting.)


Slot together boxes, a laser cutting right of passage.

Slot together boxes, a laser cutting right of passage.

After a little digging around I found laserweb4 and grbl, not wanting to touch the firmware on the provided arduino, I’d got another arduino nano spare and decided to install grbl v1.1, before I did this I tested laserweb4 with the Chinese firmware, unfortunately this wouldn’t work. So using the guide they provide on github I flashed the arduino with the pre-compiled hex. Swapped out the Chinese one and popped in my new and improved grbl arduino. Loaded laserweb4 and connected to the arduino.

GREAT it worked, the firmware was recognised, I could move the head using the application, everything seemed to be going well. I figured the amount steps per inch needed to be changed in grbl as the head movement was not scaling to the circle I was using to test. So after a few commands (Which I’ll detail later) I got the scaling sorted. End of problem one start of problem two.

Problem two, stepper motor drivers getting very hot. Luckily I noticed the stepper drivers getting extremely hot just after I’d altered the scaling. Immediately shut the machine down. This problem stems from me being an absolute novice to CNC machines. Your stepper drivers must be tuned to your motors. Your stepper drivers not only control the movement of your motors but also the strength. They govern the amount of current going to the motors. Too little and your motors wont move at all / stutter / miss steps. Too much and you risk damaging your motors, drivers and machine. A small search later and I’d found the information i needed. Basically there’s a long-winded mathematical way to calculate the appropriate current using probes and a scope / multi meter and measuring resistance. There’s also a very simple easy way. Turning the pots on the motor drivers ‘down’ till the motors no longer move (to the pots lowest limit) then gradually turning the pots in the opposite direction till adequate movement and torque is acquired. Initially I did this by eye, just looking and seeing that the motors were moving smoothly and that the drivers weren’t getting hot. I ran a series of tests moving the laser along the X and Y axis. I set the laser to move in 100mm steps and continued to test until I’d got what I thought were optimal settings.

I’ve since learned that when tuning the drivers it’s important to tune the torque too, what I mean by this is when you’re adjusting the current on the drivers it’s important to touch the head gently to determine that the motor is moving with adequate force. It’s also important not to over tune them either, these cheap laser cutters don’t come with limit switches so whilst its important to have good torque, you don’t want the head causing damage to your setup if it accidentally exceeds any extents.

Mosfet found on laser cutter control board.

Original mosfet found on the control board. IRFU024N F726CB

Great! Motors tuned, laserweb4 working, grbl firmware, scaling sorted, on to my laserweb4 machine settings. The motors were working but the laser wasn’t. To enable the laser I needed to add the grbl gcode commands to the laserweb4 settings. (Added M4 for the tool on command, and M5 for the tool off command.) Finally the laser was on and everything was working. So I started to make some test passes and noticed the laser would switch on, to my initial pleasure, with more power than benbox. However I’d been cutting 4mm ply using benbox and attempted to do the same in laserweb4, this is where my real problems began. So as I’d initial noticed the laser was way more fierce, great! … fewer passes, deeper cuts, increased speed. Very quickly this all came to an end. The mosfet driving the laser got obscenely hot and frazzled. BUMMER. Just as I thought everything was working the way I wanted another spanner in the works.

Another frantic amount of searching and looking up replacement transistors / control boards / component specifications / talking to people with more knowledge on the subject than me (Thanks again advancednewbie.) / making reddit posts and generally being annoyed I’d messed with stuff and it had all gone pear shaped. (Trust me I’m refraining from stronger language.) I was angry, felt I’d been swindled slightly, sold inadequate stuff, shouldn’t have messed. Meh. The whole reason I chose this model was because I knew every part was super simple to replace. I also understood this wouldn’t be straight forward after the whole learning curve with the plotter. Knowing how to use something is important, but knowing how to fix stuff when it goes wrong is way more important the knowledge you gain is invaluable as it’s easily applied to other projects / problems / solutions.

Replacement 4 amp mosfet.

Replacement mosfet. – P4NA40 STP4NA40 N-ch

So what did I do? Well it’s probably been about two weeks since I blew the initial mosfet, that day I ordered a 4 amp replacement, 4 amps that ought to do it and I ordered some heat-sinks. Pah, I got this one in the bag. NOPE. Replaced the transistor, tried to tune for temp / intensity / cut rate / max PWM / passes and the transistor still gets way to hot before optimal cutting passes could be attained. So anyway after a lot of messing about I though I’d de-solder the transistor and add two heat sinks (Back to back for a larger surface area), and move the transistor a little higher on the board for better cooling, at which point I managed to rip two veers on control board and have had trouble trying to locate the traces to solder some track wire for a repair. GRRRR this machine.

So this is where I am now, I have a spare control board that’s just arrived in the post, I have more mosfets enroute, I have more control boards enroute, I also have a few ideas to save me some more frazzled components. The laser driver operates at 12v and has limiting built in to the lasers driver module (This is presumption I’m going to have to do a little searching to make sure it’ll work and im not going to end up cooking the laser completely otherwise I will be up $%$£ creek.) The control board uses PWM to control the power of the laser via the mosfet. This is useful if you’re doing raster operations and engraving picture but not very useful if you want to use the device to make cuts where the laser is switched on continuously at full power. What I now understand is the mosfet even though logic level (Operates at 5v) if the mosfet isn’t fully open the amount of excess heat generated will quickly fry the IC. There are a number of work-arounds, the most simple is to control the laser from a pin on the arduino using a relay to switch the 12v supply on and off, the problem with this is the laser will only work in two states on/off. PWM control allows you to send a value between 0 and 255 to the laser to adjust the beam power allowing you to engrave pictures and also improve control when making slower cuts. The cut rate will determine the amount of passes when using a relay, but when using PWM it can have many advantages for tuning the way you cut and what material you’re working with. So what’s the solution? Turn down the power knowing the laser’s capable much more? NO. I’m thinking about building a mosfet laser driver specifically for the problem. Use a small mosfet to drive a much larger more capable mosfet to drive the laser. This is obviously a long term goal. In the meantime I’m determined to get the machine working using a relay board / adding larger heat sinks / better cooling to the mosfet.

Hopefully ill be in a slightly better mood soon but this thing although expected, fun and a great learning experience has been a monumental pain in the arse. I really didn’t expect this many issues but challenge accepted I’m determined to make it work better / stronger / faster.

Night all, catch up soon.


19/12/17 – Edits: Spelling, grammar, punctuation, minor edits to text, added a few pictures for better context, more detail of components, control boards, laser cut objects and current setup.

Continued …

Right progress, not amazing progress but progress. The first replacement control board that arrived has a three pin connector for the laser (my laser is connected to the original control board using two wires, one red, one black, +/-12v via 2 pin JST connector) I’ve initially not given up on the idea of using a relay to turn the laser on and off. What I discovered on this board, I could use the motor socket and the command M3 S0-1000, to turn the laser on and off. If I issued the command M3 S1000, this turns the laser on full power, M3 S500 half power and M3 S0 to turn off the laser. Great, knowing what I do now I can turn the laser on using the command M3 S275 without the mosfet getting stupidly hot anything more than that and I fear it’ll get damaged.

Now all I need to do is figure out if I can use the motor socket and arduino pins to drive a relay board using the M3 S1000 command without the mosfet overheating. Wiring the 12v supply for the laser and relay should be trivial.

Failing that I’ve got a few more parts and boards in the post which I should be able to do something with. Thanks to everyone who’s been helping me too I’d be really stuck without you lot. The most sensible suggestion I think has been to build a darlington circuit and invest in some beefier mosfets. Some others have suggested some combined IC’s that might be capable of driving the laser. I’m still yet to read some replies / tweets / messages regarding this.

Something else I neglected to mention was this tiny mod. I cut eight small pieces of 4mm ply and set the engraver square in the middle of my cutting base. I did this using a small amount of hot glue on each piece so if needed I could heat it up with a hair dryer / heat gun and reposition the machine with minimal effort if needed at a later date. The acrylic feet the machine ships with are terribly slick and its far to easy to knock the machine and loose a print / material due mal-alignment / human error.

More trawling of the internet has me thinking a DC-DC solid state relay may be the best option I’m just waiting for a few people to confirm my suspicions. Yet again looks like I might be barking up the wrong tree from what I’ve learnt sold state relays are DC input to control AC via a triac. The SSR I’ve ordered is DC-DC which one person who’s been helping me / giving me some advice believes it may be a fake (using a mosfet to control the voltage) the auction states ‘loads over 10 amps and you might need to provide additional cooling’ well the last mosfet was rated to 4 amps (1 below the total output of the PSU) this one states 10 amps so I might be getting slightly closer to finding a solution.

In the meantime I’ve pulled the arduino from the controller and am trying to control a relay using one of the pins. Pin 12 was the spindle control pin on grbl < v9. They swapped pins 12 and 11 in the version 1.1 update to allow for PWM spindle speed control. Yet again something I thought would be simple ends up being convoluted. The arduino is able to switch the relay  board (I know this from a few past projects I’ve used them.), but the problem I’m encountering now ill describe as an inverted state of operation. The signal on the relay is instantly pulled high when the arduino boots which isnt a problem as the relay has three connections for two different initial states. (Always on when a signal is present or always off when a signal is present.) but if im wiring this to an un-shielded laser i’d much prefer the laser to start up in the off state rather than relying on the arduino to initialise before the relay is triggered and the laser is turned off. Yet another problem to resolve. I suppose it will keep me entertained whilst I wait for more stuff to turn up. I suspect this might have something to do with my gcode settings in laserweb4 or grbl.

20/12/17 – Continued …
This mornings research is yielding some interesting results but still no solution. I found someone having the exact same issue with the relay for spindle control unfortunately there was no solution posted.

Well I just found this on the eleksmaker forums related to a 5.5watt laser …

@grom If the MOSFET is getting hot you probably need to use a different PWM frequency, likely it isn’t being completely biased and that generates heat.

Then I found this …

I run a 5W Laser diode and my TTL laser driver did not like the default 1KHz PWM. I changed mine to 8KHz and it runs perfectly. The drivers documented frequency is 10KHz, but 8 is close enough.

I think part of the problem was the speed I am running it. If I feed at F4800 and my resolution of the raster is 10 pixels per mm, that is 800 pixels per second. This probably means that some pixels only get 1 pulse, and some get 2. At 8KHz, each pixel get 10 shorter pulses and the result is much smoother.

So to answer your question, in my situation the PWM frequency does make a difference.

I have a few more options to try. Plus some very useful information from /r/askelectronics

On this thread …  and once again I know I’ve said it a few time but thank you to everyone helping me.

Notes: (cpu_map.h)
// Prescaled, 8-bit Fast PWM mode.
#define SPINDLE_TCCRA_INIT_MASK ((1<<WGM20) | (1<<WGM21)) // Configures fast PWM mode.
// #define SPINDLE_TCCRB_INIT_MASK (1<<CS20) // Disable prescaler -> 62.5kHz
// #define SPINDLE_TCCRB_INIT_MASK (1<<CS21) // 1/8 prescaler -> 7.8kHz (Used in v0.9) <—–
// #define SPINDLE_TCCRB_INIT_MASK ((1<<CS21) | (1<<CS20)) // 1/32 prescaler -> 1.96kHz
#define SPINDLE_TCCRB_INIT_MASK (1<<CS22) // 1/64 prescaler -> 0.98kHz (J-tech laser)

Think the 7.8khz might be the value I need. I’m a bit worried about changing it because on the lines above it says … Do not change unless you know what you are doing. … LEEROY JENKINS!

Guide on building grbl:

Time for a coffee.


Time for another coffee.

This also worries me slightly …


Procrastination ensues. One more hot beverage, some food and I”m going to upload it.

Results, well it works, but the mosfet is still getting hot, it even seems a little warm at idle, not sure if that is normal? But the laser is working, going to spend an hour or so double checking everything gcode settings, grbl settings and also maybe re-flash with the other PWM rates and see if it has any affect on temperature.

Back to mosfets and relays I suppose. (Considerable amount of reading inbound.)

Starting to get a few definite answers. The laser driver supplied isn’t the correct type to drive a 5.5 watt laser using the two wires on the JST connection. The laser driver should be wired using 3 wires (+/GND/Signal) to connect to the matching socket on the board. So the question is now which driver board do I order?

I’m still digesting all the information given to me regarding mosfets, gate voltages and datasheets. I feel pretty exhausted though I’ve been searching for a solution now for around two weeks. Maybe the end is in sight, but as I’ve been reminded especially by this venture, not to hold my breath. It’s not been a negative experience though I’ve certainly learnt a lot of stuff, although I did just sigh whilst typing that, I just hope 95% of people who purchase these don’t have to go through the same troubleshooting rigmarole that I have so far. (It’s not over yet either, its only just begun.)

Continued …. 22/12/17
I was hoping the guy I spoke to last night would have left me a link to the laser driver I needed to get up and running but nope. So todays plan is to trawl ebay and find a 3 wire TTL/ PWN driver for the laser. I’m also going to sign up to the forum he mentioned and see if I can get any sense from anyone. Seems sensible, a high density of people with similar equipment. Will report back later.

Finally some action!

Well I have a minor success to report, I managed to get the laser working flawlessly using the relay unit which is handy because if I do go the CNC route and abandon the laser till I can afford a CO2 cutter it’ll be very handy for spindle control / air / vacuum / misc. device that needs enabling whilst the machine is running / cutting. Luckily I have a stepper and a lead screw I used in an old project to initially make a g-code plotter I can probably put to use.

Observations whilst running the relay …

  • Laser doesn’t seem as powerful as when it was running using the mosfet / TTL / PWM which is slightly annoying.
  • All the circuits are at a reasonable temperature. Nothing is beyond touchable temperature.
  • Issue with the relays state of inverted operation. This is fine as long as I load the arduino first and ensure to turn the 12v supply off when I’m not using the device.
  • Cutting is definitely working. I’ve encountered a few annoyances though. The interpreter in GRBL doesn’t like arcs and the processor on the nano doesn’t handle the calculations required to move in a very precise arc well. Whilst this doesn’t have a direct effect when milling, when using a laser and the head stalls in a location for any amount of time excess burning occurs and this can give undesirable results. To overcome this before generating any gcode in laserweb4 ensure you set the segment value to something sensible. (Something between 0.1mm and 1mm work well for me.)  if this was a routing operation I wouldn’t mind the loss in speed if it mean gains in precision.
  • Cutting through 1/16th inch balsa in approx 16 passes with a cut rate of 12.5mm/s so operations to cut things are slower than I would’ve liked but at least I’m now cutting stuff.
  • Ill probably get shouted at by lots of people when I post my wiring / setup.
  • Power supply is slightly warmer but nothing too shocking.

In the meantime I’m looking at TTL drivers for lasers I’ve found a few for 3W laser units but nothing for a 5W unit (apart from one unit from Poland which is about £50). Spending a little time considering before rushing to ‘invest’ any more money. I’ve still got a lot of components en-route and I’m interested to see if this DC-DC (fake?) solid state relay can drive the laser board using the mosfet and get some PWM on the go.

So I’ll post a few pictures of the modifications I’ve made and maybe start a new post pertaining to something created using lasers. WOOOO HOOOO … happy days … Catch up later, pics asap.

Arduino relay wiring for grbl is as follows …

Arduino 5v —> Relay shield VCC
Arduino GND —> Relay shield GND
Arduino D11 —> Relay shield Signal1
Laser control board GND pin located next to the power input —> GND laser power board.
Laser control board  +12v pin located after the smoothing capacitor —> Relay input power pin.
Relay output power pin —> +12v laser power board.

M3 S0 will disable the laser.
M3 S1000 will enable the laser.

Yes ill tidy up the wiring in the morning and move it all from the arduino to the back of the control board. Fix the wires in place with some hot snot, so they don’t get fatigued.

Arduino relay wiring









I made a new backing / mounting plate for the control board earlier, looks like ill be making another tomorrow to accommodate the relay board. That will be fun because I should be able to laser cut one now!!!

22/12/20017 Continued …
I’m either expecting too much from this machine or it really needs the TTL/PWm driver to run at it’s full potential. Cutting balsa is tedious, acrylic is barely marked, paper and card are achievable but far from satisfying or really an optimal way to cut stuff, yes ok the machine is precise but really lacks the power (in its current state) to do anything productive I’d be better spending my time in my workshop with my manual tools and a set of callipers. I’m giving this machine one last chance before I call it one on the laser and install a Z-axis. Will order the 3w PWM/TTL driver board I found for <£5 which would equate to a nice cheap fix. I’m not keeping my hopes up though there’s only one distinct difference between my board and this one im looking at, mine has no direct 12v input, the one on ebay has a separate JST input for 12v. Only time will tell I suppose. (I bit the bullet earlier and ordered a 3w driver.)

Small update not much to report, I just wanted to let you lot know that the PWM/TTL driver hasn’t turned up yet, however I have received a couple of MOSFET arduino PWM driver shields which I’m still yet to test. To say I was a little disappointed when the laser first arrived would be a complete understatement, but, over the last week of use I’ve started to realise, even if the diode based unit is underpowered and not as quick/precise to cut as its CO2 counter parts, in it’s current state its a capable laser engraver, especially when marking (and cutting) materials like wood. Even though I still don’t have a fix for the PWM I have this week managed to start producing a few things I’m relatively happy with. Cutting is a bit of a pain in the backside as it requires a lot of passes and a slow cut rate (at present) to cut through 3mm ply (around 40 passes at 20mm/s cut rate) takes a long time, more than accurate enough to use to produce ‘precision’ parts from wood without any manual interaction. Yes, it might be quicker to print a template and use a jig/band saw to cut parts but these processes also require 100% of your time and attention, once you’ve set the machine up its as easy as clicking go and being patient. Engraving currently I’m restricted testing any raster engraving due to the relay, that said though, the machine performs pretty well for line art engraving, fills can be performed with hatching functions and the depth / burn time can some what be pretty accurately controlled via the speed of the head. This also brings me on nicely to some fine tuning I made to the machine.

Initially when I set up GRBL, I ran the machine pretty much with the suggested defaults, which for some people in some instances this would be fine (mostly DIY CNC mill/router builds). I’m never usually happy until something is functioning reliably and as fast as it will perform within realistic limits (not running the machine so hard that it would damage components or the entire build.) but at least at a level where everything is doing what it’s supposed to, and efficiently. I’ll post my full GRBL config when I recompile the binary and finalise everything for the machine. I changed the x/y/z axis acceleration from 10 to 30, I did this in small increments of 5 ensuring the motor drivers and PSU weren’t getting to hot. (Think there’s a little more room to increase these values but wanted to see how the machine ran for a while before increasing them any more.) Max feed rates are set to 5000 on the x/y/z axis. I was experiencing slow down on very small arcs which I think I managed to fix by firstly changing the arc tolerance from 0.002mm to 0.02mm, then also ensuring that any SVG files I processed in laserweb4 I set the segment value to 0.05mm which seems to have done the trick. One more thing is by default GRBL allows time between enabling the tool and moving to perform a cut, useful when milling as it allows the tool to get up to speed, something you really don’t want when running a laser. To stop this from happening make sure you enable laser mode. This can be done by sending the following command $32 = 1 to disable it simply set $32 = 0.

Will update you lot with any PWM progress ASAP. Over the next 24hrs I’ll post a few more pictures of progress and things I’ve been making. Have fun and happy new year to you all!