Marlin firmware is used widely in the 3D printing field. Understanding some common Marlin commands will help us troubleshoot problems quickly.
We can connect the controller with a computer and open Snapmakerjs software. Open the console and enter the proper command to test some functions of the machine. The Snapmaker R&D team has made some modifications to the original codes to achieve different functions.
When the 3D printing module, Laser engraving, and CNC module do not work, please try these commands to test the modules.
Command |
Explanation |
M3 P100 |
Laser on / Spindle on 100 is a variable ranging from 20 to 100. You can customize the value. |
M5 |
Laser off/ Spindle off |
M104 S200 |
Set nozzle temperature to 200 degrees centigrade. 200 is the variable that is decided by you. |
M140 S50 |
S<temp> Set heated bed temperature to 50 degrees. 50 is the variable that is decided by you. |
M17 |
Enable Stepper motors |
M18 |
Disable Stepper motors |
M1005 |
Show firmware information |
G0E<pos>F<rate>X<pos>Y<pos>Z<pos> |
Linear Module Move |
M503 |
Show info, including firmware, coordinates, etc. |
G28 |
Auto Home |
G90 |
Show absolute coordinates |
M1010 (S0 / S1) |
Set Enclosure Door Detection (off / on) |
M1010 S11 |
Remove the laser power limit when opening the enclosure door. |
M1025 (M0/M1) |
Set the Z-Extension (off/on) |
G92 E0 |
Set the Origin of the gear |
G0 E30 F200 |
Make the filament move out at a given rate |
Please make sure both the machine is connected to the computer when you try to enter any command.
The console will show “Connected to COM__”, which indicates that the machine is connected to the computer successfully.
M3 & M5
If the laser does not light or the spindle doesn’t spin when the machine starts working, use M3 and M5 to check if there is something wrong with the main controller.
You can enter the command as shown in the following picture.
After you enter “M3”, the laser will light and you can see it on the surface of the material or the spindle will spin quickly with some noise at the same time.
After you enter the “M5”, the laser will be off or the spindle will stop spinning.
If the laser or spindle reacts to the commands as described, the laser or spindle and the controller is not defective.
M104 & M140
You can enter M104 and M140 to test the thermistor of the heated bed, the heating tube and the thermistor of the 3D printing module.
If the fans begin working and the two parts continually heat up, neither the heated bed nor the 3D printing module is defective.
M109 & M190
You can enter M109 and M190 to check the thermistor of the heated bed, the heating tube and the thermistor of the 3D printing module.
If the fans begin working and the two parts continually heat up, neither the heated bed nor the 3D printing module is defective.
The console will show the working status in real-time until it reaches the target temperature.
M17 & M18
You can enter M17 and M18 to check if there is something wrong with the stepper motor.
M17: Enable the stepper motors. You can hear the motors working after you enter this command.
M18: Disable the stepper motors. The noise of the motors will stop after you enter this command.
M1005
You can check the version of the firmware of your printer, in case that a previous version of the firmware is the reason for the issue you are running into.
M1010
Check the status of the enclosure door detection function.
M1010 S0
Disable enclosure door detection
M1010 S1
Enable enclosure door detection
M1010 S11
Remove the laser power limit when opening the enclosure door.
If, for some reason, you want to disable door detection and proceed with normal laser engraving and cutting, please use the command M1010 S11 before the M1010 S0 command to remove the laser power limit.
M1025 (M1/M0) Set the Z-Extension(on/off)