My EleksMaker laser CNC machine setup

Belt holders and adjustable X-axis
Small dot laser module
Trinamic stepper drivers
1. Snip SPI pins
2. Connect DIAG0 pins to limit switch inputs D9 and D10
3. Connect both SDO pins with D12
4. Connect CS pins separately to D9 and D10
5. Connect both SCK pins to D13
6. Connect both SDI pins to D11
7. Connect VCC and GND

Grbl configuration

Update to the newest GRBL version according to their Wiki:

Open a serial terminal and check the configuration by sending $$. Here’s my config, I have added // comments to the settings that are of special interest:

$3=7 //Direction port invert, mask
$22=1 //Homing cycle, boolean
$24=1000.000 //Homing feed, mm/min
$25=2000.000 //Homing seek, mm/min
$27=10.000 //Homing pull-off, mm
$32=1 //Laser mode, boolean
$100=80.000 // X steps/mm
$101=80.000 // Y steps/mm
$110=5000.000 // X Max rate, mm/min
$111=5000.000 // Y Max rate, mm/min
$120=100.000 // X Acceleration, mm/sec^2
$121=100.000 // Y Acceleration, mm/sec^2

Secondary Arduino Sketch:

There were a few false positive stall detections, so this only a starting point for fine tuning as described in the datasheet.
Use the Arduino IDE library manager (Sketch -> Include library -> Manage libraries…)
Search for TMC2130Stepper and then install.
Or download the zip file from

#include <TMC2130Stepper.h>
TMC2130Stepper X = TMC2130Stepper(2, 3, 4, 9); //Only param 4 (CS pin) matters
TMC2130Stepper Y = TMC2130Stepper(5, 6, 7, 10);

void setup() {
 X.begin(); // Init
 X.rms_current(500); // Current in mA
 X.microsteps(16); // Behave like the original Pololu A4988 driver
 X.interpolate(1); // But generate intermediate steps
 X.shaft_dir(1); // Invert direction to mimic original driver
 X.diag0_stall(1); // diag0 will pull low on stall
 X.diag1_active_high(1); // diag1 will pull high on stall
 X.coolstep_min_speed(25000); // avoid false stall detection at low speeds
 X.sg_stall_value(14); // figured out by trial and error


void loop() {


Test PCB Layout

65 thoughts on “My EleksMaker laser CNC machine setup”

    1. No 2004 is complete without a forum. Don’t stop there. Add an IRC channel, DC++ server and commits on the new SourceForge.
      Or maybe just a forum.

  1. Super project!!! I have EleksMaker too and I want to repeat your project, but I have still an axis Z
    help please with settings axis Z.
    You have connected in addition Arduino nano because there not enough memory?

    1. Usually you can ignore everything related to the Z-axis once you have focussed your laser correctly.
      The extra Arduino makes it very easy to configure the Trinamic drivers, it might be possible to do it with a modified GRBL firmware, but that would be complicated.

  2. Yes, i know about focussed Z-axis, but i want cutting acril and woods.
    and with each pass it is necessary to change focal length.
    I have make sketch but
    Sketch uses 31566 bytes (102%) of program storage space. Maximum is 30720 bytes

  3. Hi,
    In your video, you are disconnecting the SPI-disabling-pads again (thus enabling SPI). However, here you tell us to disable SPI but you are talking to the drivers over SPI from Arduino.

    This makes no sense IMHO, does it?


  4. Is wiring Step 1 (jumper closing) correct? Doing so the TMC2130 could not been configured via SPI and the configuration is the aim of the overall set-up – isn’t it?

  5. By changing the stepper controller out, would that cause any incompatibilities with the stock software from eleksmaker? Currently bought an A3 to do some engraving on wood, and would really enjoy the silent motor operation. Looking to do some PCB projects later on but wasn’t sure if this would permanently affect the other software and what not. Forgive my ignorance, just getting familiar with it all for the first time. Still waiting on hardware from china.

    1. GRBL goes on the “main” Arduino that came with the machine, then you can enable laser mode by sending $32=1
      Then you should be able to use LaserWeb or similar.
      The secondary Arduino is only there to configure the Trinamic drivers.
      It’s software can be found under “Secondary Arduino Sketch”.

      1. I see, thank you for clarifying. I do have a second question I’m hoping you can help me with. I’m looking at purchasing, with this conversation kit, I want a laser that can have variable intensities for gray scale images. Currently the one I have is on or off and sometimes it burn to deep or the wood catches fire, I know I can remedy the catching fire with a fan, which I plan on adding. I haven’t done a tone of research on the program side of it, but I know if I want to run the diode at %50 I need a TTL/PWM one. I’m not sure if LaserWeb4 will work for this out of the box, or if I need to make modifications to the GRBL to accomplish it. If you don’t know off the top of your head you don’t need to go digging for me, I can do that on my own. Just wanted to pick your brain.

        1. You can do that with the normal EleksMaker machine and no conversion kit. If you are using LaserWeb you load an image, skip the “Raster”-step and just pull the image on the gcode generator. Mode: Laser Raster, Power Range is what you have to adjust if your result looks like black and white. Also make sure that $32=1 in GRBL, then it automatically regulates laser power with movement speed (when it stays in one corner for a long time, laser power is reduced to avoid burning).

          1. I’m confused on where $32=1 should go in GRBL. I looked up how to compile it via GitHub but I don’t see anything remotely close to what you have here in the GRBL files I have. All my file has is “#include ” and there is still nothing in Grbl.h or config.h that is close to what you have. I’m using the latus Arduino IDE. I did update the firmware a while back so I think it should be good, but I’d like to know for sure. Also when I load an image and drag it to the Gcode section I don’t see a Mode: Laser raster. The preview that it generates looks like its only black and white. I appreciate all of the help you have given me thus far!

          2. The configuration parameters can be set at run time, so no need to edit the sources. You connect it to the PC and send the command $$ via serial console to view the configuration. You can change values by sending commands like $32=1. Google GRBL configuration

          3. That depends on the laser and focus setting: The blue 445 nm one that came with the machine is a bit larger, not perfectly round. The violet 405 nm that I used for PCBs is weaker but much smaller, might even be smaller than 0.1mm. The diameter is difficult to measure because they tend to have a soft glare around the actual dot.

  6. Thanks for making the videos on the EleksMaker, Marco! I’m excited to try the PCB etching workflow. May I ask how you generated the test_pcb.gcode that’s only around 2MB? When I import the 2400 dpi test_pcb.png into LaserWeb, I end up with .gcode file that’s 22MB in size and makes my computer (and engraver) extremely sluggish about a third of the way through the engraving process.

    1. That was made with FlatCAM which calculates lines based on vectors in gerber files. Importing images into LaserWeb results in an approximation to pixels of the image, which is slower and less precise. You can import svg files into LaserWeb, that’d be a vector-based operation too, but I really prefer FlatCAM!

  7. Did your Arduino that came with the controller have the bootloader burned onto it? I don’t see any ICSP pins and I’m having some issues uploading the firmware using the precompiled HEX file. I’ll probably give try and build from source using the Arduino IDE.

    Also, I’ve read some information online about needing to set a jumper, but that appears to be for the older revision L7 board, not the Mana SE. Did you have to do anything special to allow for firmware uploads?

    1. I did it with the IDE and it worked fine. If I remember correctly I didn’t have to do anything else, even the $$ GRBL config persisted because it is stored in the EEPROM

  8. Thanks for the video with the Eleksmaker upgrade.
    I have installed the TMC2130 just like you did and everything works fine except when i want to burn a circle.
    The circle wont close. The start and endpoint of the circle are misaligned for about 1-2mm in Y Axis.
    This gets worse the bigger the circle gets.
    I already tried with tightening the belt it didnt change at all.
    Also tried to play around with the TMC2130 configuration.
    Did you have the same problems with the Eleksmaker A3 pro ?

    1. I did get a few open shapes, but not with 1-2 mm gaps.
      Are all your parts moving freely? Did you get the 3D printed parts?
      Can you apply a heat sink to the motor drivers and run them at max current to test?

      1. Hi Marco, thanks for the response. Yes the part can move freely and i have the 3d printed parts too so that the belt should be fine. Heatsinks are also installed to the driver so i will try with higher current.

  9. Hi Marco,

    great video’s & content – a question on exposing pcb’s with the laser.
    I’m hoping you can point me in the right direction on which file format to export from Eagle and which format to import into laserweb.
    .png does not seem to work for me as I can only laser raster and not laser cut as you show in the video.


    1. Try exporting gerber, import to FlatCam, generate milling gcode, replace all “Z down”-movements with “laser on” and all “Z up”-movements with “laser off”, use laserweb to preview and send to the machine

      1. Marco – thanks for the response – really helped.
        Everything working fine now.
        I just had some trouble importing Eagle excellon files into Flatcam ie getting them to match with the Gerber.
        The solution for me was setting the leading zero’s parameter to T (set_sys excellon_zeros T) and setting the correct scaling factor for both excellon & Gerber.

        Thanks again


  10. Hi,
    I am having problems getting homing working. The X & Y movement is working perfectly however I can’t seem to get the sg_stall_value set to a value that will trigger the stall.

    The X axis settings are as follows
    X.setCurrent(200, 0.11, 0.5);

    I have tried figures between -64 and +64 for the stall value but the motor runs until it reaches 1.5 times the max X travel, currently set at 470mm.

      1. Thanks Marco,
        I tried using your current settings but found that the 2130’s were running very hot, hence the lower setting in my configuration.
        I have printed out the relevant pages to investigate further.

  11. Hey Marco, thanks for taking the time to document all of this. The mods are working well for me. Couple of things I wanted to run by you .

    I found that the TMC drivers got extremely hot, to the point where the the image I’m burning starts to distort severely. Adding a heatsink helped a bit, but it would still start to warp the image after a few minutes. I also increased the input voltage to them to 30v so that less total current would be drawn, and that plus heatsinks and a fan blowing on them got my laser images coming out consistently well. Did you see the same when you were using these and did you take any other steps to mitigate the heat ?

    Also, I noticed in your video that the schematic for wiring up the new laser module uses a 5v regulator , but the laser spec says it takes 12v input. Was that intentional , and if so why only 5v ? Seems like you’d want to use a 12v regulator .

    One other comment. A user above talked about getting shapes that were left open by 1-2 mm. I noticed the same thing and no amount of belt tension adjustment and carriage adjustment would remedy the situation. I was running laser web on an old core 2 duo laptop running linux, and I switched to my i7 lenovo laptop running windows 10 and the problem was eliminated. I don’t really know what to make of that, the old laptop should have had enough horsepower to send the gcode over the serial connection.

  12. OT GRBL Questions
    I’m using an umodified version (2,5w 445nm laser and the original stepper drivers) – ok, the Nano clone was updated to the actual GRBL 1.1.
    The upgrade to your suggested TRINAMIC solution is on preparation ūüėČ But before my complete processing pipeline has to be established. And during this setup process i’m running into 2 GRBL questions:

    I’ve downloaded your G-Code test file ( The visualization component of the Universal GCode Sender or bCNC displays the various items as expected. But the laser engraves a mirrored version? I#m pretty shure i’ve missed some GRBL aspect…

      1. Hmm, doing so the machine zero point has to be moved to the opposite corner. But even doing so the result is still mirrored…

        1. Solved – looking at the result and thiknig twice was helpful ūüôā
          Moving the machine zero point to the front left and invertiny only the y axis made my day.

  13. That’s fantastic: a helpful hint before i was able to submit my announced second question ūüôā

    Running GRBL 1.1 in laser mode: is the spindle speed linear associated with the PWM? Setting $30 to 1000.000 means 100% PWM and in my case full (2,5w) power? So the G-Code parameter for the spindel speed is [0..1000], resulting in [0..100]% power?

    1. I have never changed $30, but yes, that looks about right. When in laser mode there is also a relatively new feature that adjusts laser power with axis movement speed, so that you don’t overexpose edges and corners etc. where the machine often has to decelerate, turn around and accelerate again.

  14. Hello Marco.
    I tried to load de secondary sketch on an Arduino Nano , but get this error,
    Arduino:1.8.3 (Windows 10), Tarjeta:”Arduino Nano, ATmega328″
    NANO_TCM2130:4: error: #include expects “FILENAME” or
    #include &amp;lt;TMC2130Stepper.h&amp;gt;
    exit status 1
    #include expects “FILENAME” or
    What make I wrong ?
    Thank You for this interesting upgrade

  15. Hi Marco,
    first of all thank you very much for your recommended upgrades and your awesome video(s)!!!
    I have lately upgraded my Eleksmaker 2,5 W Laser with the 3D printed parts and the TMC2130 drivers and the results are realy awesome. But there is one minor problem im trying to solve right now. If I activate the LaserMode over the GRBL commands it seems that i cant get the full 2,5W power out of my laser. So now my question is if you are using the 2,5W laser that was included in and if you can get the full power out of it. I already tried your grbl configuration but it doesn’t seem to work for me.
    Greetings from Germany

    1. How do you measure your laser power? If you are using Laserweb, check if Settings/Gcode/PWM MAX S VALUE and GRBL $30 are equal.

      I don’t know if these help (or they might even be from 3D printer experiments …):
      G21 ; Set units to mm
      G90 ; Absolute positioning
      M4 S0 ; Enable Laser/Spindle (0 power)

      M5 ; Disable Laser/Spindle

      MY TOOL ON:
      M42 P15 S1

      MY TOOL OFF:
      M42 P15 S0

      1. Thank you for your fast reply. I checked PWM Max value and they were indeed different, however it didnt make any difference after I matched them. But I could still figure it out. I started some test-cuts just now and discovered that for whatever reasen when i am using the $32=1 (Laser Mode ON) i have to drastically decrease my cutting rates (down from 1200 mm/min with a power of 60% to 500 mm/min with a power of 100%) to achieve the same resulst. Still works!

  16. Hi,
    is this second arduino really necessary? Can’t we just setup what is needed in the first one and make it to talk with the motor drivers?

    1. Nope, not necessary! I am using the standalone mode without stall detection now and it is perfect. You can sort of try to get the first Arduino (which has GRBL installed) to send the config, but it is very difficult.

      1. So just replacing the motor drivers would be enough to see the difference in accuracy? Or is any part of additional tweaking necessary to make it worth replacing? (I see some potentiometers on them, that I am not really sure about)

        From what you say: without the 2nd arduino (I believe it could be even attiny45 or so) we are loosing only stall detection feature?

        Sorry if you consider my questions as trivial, but I want to understand this concept well.

  17. Just replacing the motor drivers and putting them in their standalone mode (see sellers wiki or datasheet), adjusting a few settings in GRBL will give you a significant improvement in terms of silence, energy efficiency, resolution and maybe a tiny little bit of accuracy.

    The most important mod for accuracy are the 3D printed belt holders and the adjustable rollers IMO

    Yes, the secondary microcontroller has a very trivial task and if you don’t need stall guard and other exotic options you can skip that. I am no longer using stall guard because it has sensed a few falase-positives witch interrupts processes.

  18. I’ve probably just missed it somewhere but, will any of these changes let me use this with a MAC? Any help would be greatly appreciated

  19. I appreciate you posting your Elekslaser upgrades. I’m working on being able to generate prototype pcbs that have 10mil traces/10mil trace spacing. My question is about the replacement laser. I had to order the 500mW version that you suggested. Unlike the 2.5 watt laser that came with the Elekslaser, the 500mW version has an interface board that the 12V/GND leads attach to. Did your 300mW LD also have an interface board?

  20. Hello Marco, Thank you for your great tips. I also ordered the Elekslaser A3 including the EleksIVAxis XYZA 4 Axis Stepper Motor Driver and the Z-Axis module. Do your tips work with this controller? I bought all the parts you described, too. My problem is that I don’t have a 3D printer, but I need the 3D printed parts… Is there a way to get these parts from you?
    Mfg: thomas

    1. Well, I didn’t want to take the chance and I removed the pins. Works perfectly.For now I’m too lazy to do the SPI init. But I’ll do it some day. Thanks for sharing.

  21. I bought the Eleksmaker 2,5 W Laser based on the video and it’s been great. I sorted out the backlash issue by writing a small G-code postprocessor that sorts and orders the paths so the laser burns from one direction. It works pretty well.
    But I am stymied by the oval laser beam. Is there a solution to this? either something to focus the lens or a different laser diode. (I know nothing about electronics – I’m a programmer) and ideas would be appriciated.


  22. I’m having a little trouble getting the stepper to actually move the motors. I believe I’ve wired everything correctly and loaded the sketches right. But as a simple test I want to just use these to be a drop in to work with Eleksmaker Evo Desktop software. Mostly for smooth and silent operation. The moment I put the old A4988 drivers back in the unit works just fine.

    Having everything wired as shown, Diode 4 seems to be getting power just from the micro USB being plugged in.

    Any thoughts? I know earlier SPI pads being solder and un-soldered. I more or less just followed this guide and nothing more.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.