Non classé

First start-up of the ESP32 GRBL shield

Written by Avataar120

The long awaited moment has finally arrived.
However, in order not to damage your machine or your shield during the first start-up, it is advisable to take some precautions.

Setting the drivers (not to be done if you bought my shield fully assembled)

We will start by setting the power of the drivers to zero to avoid any problem

To do this, simply turn the driver adjustment screws fully clockwise.

Connecting the ESP32 GRBL shield to your computer

Connect the USB cable from your PC to your ESP32

Then, in Lightburn, click on the “Console” tab in the right column. You should see something like :

Console de Lightburn
Premier démarrage

Now right click on the “Devices” button in the right column.
This will restart the USB/Serial connection between Lightburn and the ESP32.
You should see indications similar to the one below on the console:

first start-up

If so, your computer and laser cutter are properly connected.

If not, check carefully:

  • That the USB connection speed is correct (Edit/Device Settings): it should be on 115200 bauds
  • That the DTR control is activated (Edit/Device Settings)

It is also possible that the USB driver is not compatible with your ESP32.
In this case, you have to download and install the right version by going here :
https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers
and choose the CP210x Windows Drivers with Serial Enumerator version

First start-up / First moves

When starting up for the first time, it is important to check that all axis behave as we expect and that a movement occurs in the right direction and over the right distance.

Do not click on the “HOME” button at this stage

Place the head of your laser machine in the center of the work area by hand

As long as the “HOME” has not been done, GRBL forbids the movements. Since we can’t do a “HOME” yet at this stage, we will enter the following command in Lightburn’s console (console tab in the right column) to unblock the axis movements:

$x

Click on the “move” tab in the right column of Lightburn
You should see the following window:

Replace the values of distance by 10mm and speed by 10mm/s. This will allow us to check the direction of movement.

Click on the “right” arrow of the Lightburn interface

  • If the head moves on the right -> all is fine
  • If you are using my Shield pre-assembled (option F) and that the X axis is connected via a ribbon cable on your K40, the direction of movement is necessarily correct. If this is not the case, please contact me.
  • If your machine does not have a ribbon cable or if you have programmed your shield yourself and the movement is on the left, you have to intervene. The easiest way is to change the orientation of the connector of your stepper motor on the Shield (if there is no ribbon cable) or change the settings of your machine in GRBL via the menu Edit/Machine Settings (parameter “X direction pin invert”)
  • If there is no movement, if the stepper motor misses steps, or if the machine vibrates, go to the Troubleshooting section below.

Manually put the laser head to the center position and check again that the X-axis movement (right and left arrow on the lightburn interface) is now working properly

Click on the “down” arrow of the Lightburn interface (the one representing a chevron downwards)

  • If the head moves downward -> all is fine
  • If the movement is upwards, you have to intervene. The easiest way is to change the orientation of the connector of your stepper motor on the Shield or change the settings of your machine in GRBL via the menu Edit/Machine Settings (parameter “Y direction pin invert”)
  • If there is no movement, if the stepper motor misses steps, or if the machine vibrates, go to the Troubleshooting section below.

Manually put the laser head to the center position and check again that the Y-axis movement (right and left arrow on the lightburn interface) is now working properly

If you do not have a motorized bed, skip this section
Click on the “down” arrow on the Lightburn interface (the one representing a downward arrow with an intermittent line)

We are waiting for the motorized bed to move to the … up ! (see explanation above in this article)

  • If the bed moves well upwards-> all is fine
  • If the movement is downwards, you have to intervene. The easiest way is to change the orientation of the connector of your stepper motor on the Shield or change the settings of your machine in GRBL via the menu Edit/Machine Settings (parameter “Z direction pin invert”)
  • If there is no movement, if the stepper motor misses steps, or if the machine vibrates, go to the Troubleshooting section below.

Manually put the laser head to the center position and check again that the Y-axis movement (right and left arrow on the lightburn interface) is now working properly

Z-axis adjustment

If you don’t have a Z axis (no motorized bed), make sure that GRBL is not set to ask for a Z axis homing, otherwise the homing won’t work well.
If there is no motorized bed, enter the following command in the console

$Homing/Cycle1=

Adjusting the Z-axis (when you have a motorized bed) can be a bit … tedious.

The following steps need to be performed only once. Then GRBL stores the information in non-volatile memory and will not lose it.

  • Check that your GRBL is configured in Workspace coordinate mode (setting $10 or Lightburn/Edit/Machine Settings)
  • Check that your Z axis is not in relative mode (Lightburn / Edit / Device Setting / Relative Z moves only must be at 0
  • Check that your bed works in reverse 🙂 i.e. if you ask for a downward movement via Lightburn / Move, the bed will rise
  • Homing, by clicking on the Home button in the lightburn window or by typing $H in the lightburn console
  • Once the homing is finished, enter the command G10 L20 P0 X0Y0Z0 in the Lightburn console which will take the current position and consider it as the origin of all your axes
  • Identify roughly what your focus value is (it takes about 50.8mm between the lens and the material), so if you measure 60mm from the top of your material to the bottom of the laser head, start with 60-51 = 9mm
  • Enter this value in the Material (mm) box – we don’t care about the actual thickness of the material at this point
  • Draw a line with lightburn on your material with a power and speed compatible with an engraving (not a cutting). Check beforehand in the layer parameters that the offset is set to 0 !
  • Find around this value, by varying the value of the thickness of the material in lightburn what is the best value, that is to say the value for which the line is the thinnest
  • Once the right value is found, we will recalibrate the Z of GRBL with the command G10 L20 P0 X0Y0Zmyz where myz must be replaced by the thickness of your material. Ex, if my plywood is 3.3mm thick, I would enter G10 L20 P0 X0Y0Z3.3
  • Now put in the material (mm) box of lightburn the real thickness of your material
  • That’s it! Your Z is calibrated!

Troubleshooting

When starting for the first time, it is necessary to set the maximum power allowed by the stepper motor drivers.

Normally, if you opted for option F when you purchased your Shield, the drivers have already been set.

However, the friction, motors, axes, … being different from one machine to another, it is probably necessary to adjust the settings.

If your axis does not move, or if it misses steps, or if it is noisy or vibrates, do not hesitate to watch videos on youtube to learn how to adjust your drivers.

For my part, I apply the following method:

  • I turn the adjustment screw of the incriminated driver until blocking by turning clockwise (on a DRV8825) – this puts the power at minimum.
  • Put your laser head manually in the middle of the work area
  • Set a long movement on the offending axis: 100mm for the X axis, 80mm for the Y axis, 10mm for the Z axis
  • Set a slow speed of movement: 10mm/s whatever the axis you set
  • Launch a movement on the concerned axis via lightburn
  • During the movement, turn the driver adjustment screw counterclockwise very slowly. The movement should start
  • Look for the best trade off to avoid missing steps and noise/vibration (by turning counterclockwise), while staying at the minimum setting (by turning clockwise)

If your stepper motor still refuses to move or vibrates a lot, you probably have a wiring problem (bad connection of one of the 4 wires of the stepper motor) or bad connection in the order of the wires of the stepper motor.

Checking the end stops

We will check the 2 or 3 limit switches of the machine

To do this, put the laser head in the center of the bed by hand
Enter the command “?” in the lightburn console

The response should be something like
This means that none of the limit sensors are detected

If instead you get something like:
<Idle|WPos:0.000,0.000,7.700|Bf:31,127|FS:0,0|Pn:XYZ|WCO

This means that your limit switches are reversed.
You will have to change them in the GRBL configuration
In the example below, Pn:XYZ means that all 3 limit switches are detected -> I need to swap the 3 limit switches.
Unfortunately, this can only be changed in the GBRL settings file (your MachineName.h file) and you have to recompile GRBL and then reload it into your ESP32 (see Installation of GRBL ESP32 article)

For the record, it is impossible to load the SW via arduino IDE in the ESP32 if it is mounted on the shield, however, it is possible to update via the web interface of GRBL ESP32 (menu ESP3D, and yellow cloud icon)
Example on my K40 to reverse the X and Y axis limit switches.

#define INVERT_LIMIT_PIN_MASK 	(bit(X_AXIS)|bit(Y_AXIS))

Once you get a good answer like
<Idle|WPos:0.000,0.000,7.700|Bf:31,127|FS:0,0> (that is to say without Pn:….), your limit switches are correctly configured.

We will now verify that they work well …

Put the laser head in the center of the X-axis, and in the upper stop of the Y-axis by moving the head by hand.
Check that you get a response like :
<Idle|WPos:0.000,0.000,7.700|Bf:31,127|FS:0,0|Pn:Y|WCO> à la commande “?”
Only the Pn:Y information must be present.
If this is not the case, you have a wiring problem, check everything!

Move the laser head to the center of the Y axis, and to the left stop of the X axis by moving the head by hand.
Check that you get a response like :
<Idle|WPos:0.000,0.000,7.700|Bf:31,127|FS:0,0|Pn:X|WCO> à la commande “?”
Only the Pn:X information must be present.
If this is not the case, you have a wiring problem, check everything!

Return the head to the center of the work area by moving it by hand.
With a fine screwdriver, press on the limit switch of your motorized bed. As you press, check that you get a response like :
<Idle|WPos:0.000,0.000,7.700|Bf:31,127|FS:0,0|Pn:Z|WCO> à la commande “?”
Only the Pn:Z information must be present.
If this is not the case, you have a wiring problem, check everything!

At this point, your end stops should be working properly

First Homing

Be alert because the movement will probably be quite fast.
In the event of a problem, you will immediately press the emergency stop button on your machine to avoid a crash of the axes.

Press the “Home” button on the Lightburn interface
If you have followed my settings in the article “GRBL Installation”, X and Y axis begin their homing and once they have finished, the Z axis performs its homing.

If a move does not go the right way, stop the machine immediately with the emergency stop button. Please note that the “Stop” button on the Lightburn interface has no effect on a Homing maneuver!

Change the parameters “X homing direction invert” and/or “Y homing direction invert” and/or “Z homing direction invert” in the “edit/machine settings” menu according to the reactions you observed during the first homing.

Test again the “home” button and adjust the Z axis homing direction if necessary.

If you get to this point, you should have a machine capable of performing a Homing operation

Verification of distances

If you use my settings and have a K40, there should be no problem.

Start an engraving of a 100mm x 100mm square via lightburn

Measure the square, in case of deviation you can use the function in the menu Edit/machine settings/Calibrate axis to change the settings.

As a reminder for the X and Y axis:

A K40 uses MXL pulleys and belts. The number of microsteps per mm is 39.37 if you use my 4 microsteps per step (stepper motor driver setting via jumper).

A more standard machine will use BT2 belts and pulleys. The number of microsteps per mm will then be 40 if your setting is 4 microsteps per step (stepper motor driver setting via jumper).

For Z axis :

If you use the JP. Civade design for the motorized bed, you probably used a BT2 belt and 4 microsteps for a step. The threaded rods have a pitch of 0.8mm per turn of the screw.
The adjustment for the Z axis is therefore 500 microsteps for 1mm

Laser firing test

If you have a machine with the new digital panel, it is completely disconnected and its laser test button no longer works

If you have an old machine with the potentiometer, it is normally disconnected as well as the laser test button

To carry out the tests, it is thus necessary to use lightburn.

In Lightburn / Edit / Device settings, check that the option “enable fire laser button” is activated

In the move tab of lightburn, you can now make laser fire tests.
Put 14% in power and click on the Fire button.
Attention, to stop the laser fire, you have to press this button again

If everything went well, you can try a cut.

With the v2 shield, you need 45%-50% power to get 10mA in the tube
With the v3 shield, you need 30% to have 10mA in the tube
For my part, I never go above 11mA in my tube to avoid damaging it.

Congrats !!

Congratulations, at this point you have a K40 with brand new electronics capable of working with Lightburn, a motorized bed and lots of new features!

You still need to learn how to use Lightburn in detail : link

About the author

Avataar120

Leave a Comment

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