Welcome to our simple guide on the M106 CNC code. Whether you are new to CNC programming or an experienced machinist, understanding the M106 code is essential.
This guide will explain everything you need to know about this unit mode command—what it is, when to use it, and why it matters.
(Step-by-step.)
Key Takeaways
- M106 is a CNC code that controls fan speed and direction, essential for maintaining ideal operating temperatures during machining operations.
- The basic syntax of M106 is M106 S, where represents the spindle speed or laser power in percentage, ranging from 0 to 100.
- M106 gives precise control over the fan’s operation, allowing for adjustments according to machining requirements, and can be used to activate or deactivate the cooling fan.
- Custom M-codes like M106 are specific to the machine manufacturer and don’t appear in standard documentation, but are supported by firmware like Marlin and Repetier.
- M106 is commonly used in 3D printing and CNC machining to adjust fan speed during a print or machining operation, and can be combined with other commands to create custom routines.
Understanding G-Code Commands
When working with CNC code, mastering G-Code commands is essential to control your 3D printer’s movements, temperature settings, and extruder actions.
You’ll use commands like G28 to perform a homing routine, which moves the toolhead to the far edges of the machine until it contacts the endstops. You can specify which axes to home, such as X, Y, or Z.
G90 and G91 set the positioning mode to absolute or relative, controlling the X, Y, and Z axes, while M82 and M83 do the same for the extruder (E-axis).
Meanwhile, G1 performs linear movement, moving the printer to a specified location, and can move multiple axes at once.
Don’t forget to set the fan speed, which is vital for proper cooling and airflow during printing.
M106 Command Overview
You’re now exploring the M106 command, a vital component of CNC coding.
This command comes with several features that allow you to control and customize your CNC machine’s operations.
Specifically, you’ll learn how to use M106 for fan speed control, a pivotal aspect of maintaining peak machine performance.
M106 Command Features
The M106 command is a fundamental component of CNC programming, and its features are crucial to understanding its functionality.
You’ll find that the M106 command controls the cooling fan, which is essential for maintaining ideal operating temperatures during machining operations.
This command’s features allow you to activate or deactivate the cooling fan, depending on your specific needs. Additionally, you can use the M106 command to set the fan’s direction, either clockwise or counterclockwise, to achieve the desired airflow pattern.
M106 Fan Speed Control
Frequently, CNC machinists need to adjust the cooling fan’s speed to maximize its performance during various machining operations. You can control the fan speed using the M106 command, which allows you to set the fan to a specific speed or turn it off.
Fan Speed | Command |
---|---|
Off | M106 S0 |
Half Speed | M106 S128 |
Full Speed | M106 S255 |
When you need to set the fan to full speed, use the command M106 S255. This guarantees the fan operates at its maximum capacity, providing peak cooling performance. You can adjust the fan speed according to your machining requirements, and the M106 command gives you precise control over the fan’s operation.
G-Code Structure and Fields
You’re about to investigate the structure of G-code, which consists of fields separated by white spaces or line breaks, each comprising a letter followed by a number or a standalone letter.
These fields are the building blocks of G-code, and understanding their composition is vital for working with CNC machines.
As you dissect the G-code structure, you’ll discover that letters indicate the field’s meaning, while numbers can be integers or fractionals, and some parameters may be followed by multiple numbers separated by colons.
G-Code Fields Overview
When working with G-code files, you’ll typically encounter a list of fields separated by white spaces or line breaks, with each field consisting of a letter followed by a number, or a standalone letter acting as a flag.
These fields provide specific instructions for your CNC machine, such as the G1 command, which specifies a linear move. The letters in each field indicate the meaning of the field, while numbers can be integers or fractionals, and some parameters can be followed by multiple numbers separated by colons.
Understanding the structure and composition of these fields is vital for creating effective G-code files that accurately control your machine’s movements.
G-Code Line Endings
As you create G-code files, you’ll need to ponder the line endings that separate these fields.
G-code line endings are typically Unix Line Endings, but Windows Line Endings are also accepted in most firmwares. However, it’s vital to examine the firmware you’re using, as some may have specific requirements.
For instance, RepRapFirmware is case-insensitive, except within quoted strings, which means line endings are also treated as case-insensitive.
In the same vein, Druid Firmware version 1.00 is case-insensitive by default, but can be set to case-sensitive, affecting how line endings are treated.
Be aware that not all 3D printer firmwares conform to the case-insensitivity standard, so it’s vital to verify your firmware’s specific requirements for line endings.
G-Code Movement and Extrusion
One fundamental aspect of M106 CNC code is the control of movement and extrusion, which is achieved through a set of specific commands.
When you want to move in a straight line, you’ll use the G1 command, which allows you to set the feedrate and extrusion rate.
However, keep in mind that some firmwares may not support setting the feedrate inline with a move.
There are three key things to remember about G-code movement and extrusion:
- G0 vs G1: Use G0 for rapid moves and G1 for controlled moves. In RepRapFirmware, G1 is always a linear move, but G0 may not be linear.
- Reversing the extruder: Use a negative E value in the G1 command to reverse the extruder, but be aware that not all firmwares support this feature.
- Arc moves: Use G2 and G3 commands for moving in clockwise and counter-clockwise arcs, respectively. These commands are supported in various firmwares, including Marlin, RepRapFirmware, and Klipper.
Custom M-Codes and Functions
You’ll find that custom M-codes, such as M106, are specific to the machine manufacturer and don’t appear in the PLC program or Siemens documentation.
The machine manufacturer defines these M functions, and their documentation may cover these codes, which are related to the machine’s channels and tool change cycles.
Custom routines can be created using the Scripts tab in Edit Process Settings.
Note that M106 commands aren’t permanent and can be stopped by rebooting the printer.
You can set a secondary speed for the fan using M106 Pfan T3-255, and M106 Pfan T2 uses the set secondary speed.
As part of the Marlin firmware, M106 command is available in version 2.0.6 and later, with Marlin 1.1.7 adding support for secondary speed.
Machine Manufacturer’s Role
The machine manufacturer plays a vital role in defining custom M-codes like M106, which are specific to their machines and don’t appear in standard PLC programs or Siemens documentation.
As you work with M106, you’ll realize that the manufacturer’s input is essential in understanding how these custom codes function.
- Code development: The manufacturer develops and tests custom M-codes like M106 to guarantee they integrate seamlessly with their machines.
- Documentation: They provide documentation specific to their machines, explaining how these custom codes work and how to use them effectively.
- Support: The manufacturer offers support and training to help you understand and implement these custom codes in your CNC programming.
CNC Codes Similar to M106
Code | Mode |
---|---|
M105 | Move until open (1 -> 0) |
M115 | Move until open (0 -> 1) |
M116 | Move until close (1 -> 0) |
M125 | Move until open (0 -> 1) |
M126 | Move until close (1 -> 0) |
Quick Navigation