M31 CNC Code: Beginner’s Guide to Chip Conveyor Forward Operation

Welcome to our simple guide on the M31 CNC code. Whether you are new to CNC programming or an experienced machinist, understanding the M31 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

  • M31 macro provides an alternative to G31 function in Mach3 software for precise tool length measurement and edge detection.
  • M31 retrieves “P”, “Q”, and “R” parameters from the MDI line or g-code and passes them to the macro for probing operations.
  • The macro waits for the probing process to complete and displays “M31 START” information in the STATUS line of Mach3 software.
  • M31 transfers parameters to the plugin through UserDRO 1511, 1512, and 1513, and issues a probing start command to the plugin.
  • The M31 macro is used for tool change and probing operations, and is available since plugin version 2.200 (2014-02-13).

M31 CNC Gcode Overview

In terms of precise tool length measurement and determining the location of an edge of a workpiece on a work table, the M31 macro provides an alternative to the G31 function in Mach3 software.

You can use this macro for tool change and probing operations. The M31 macro has been available since plugin version 2.200 (2014-02-13) and can be freely extended and modified as needed.

When you use M31, it transfers “P”, “Q”, and “R” parameters to the plugin and waits for probing to finish, displaying “M31 START” information in the STATUS line of Mach3 software.

This macro operates by transmitting parameter values to the plugin and issuing a command for probing start.

Gcode Syntax and Structure

You’ll need to understand the basics of Gcode to effectively use the M31 macro in your CNC machining projects.

Gcode consists of a series of commands, each composed of several fields that define specific actions or parameters.

Gcode Basics

Gcode commands are built from a series of fields, each consisting of a letter followed by a number or standing alone as a flag.

You’ll notice that each field is separated by white spaces or line breaks, making it easy to read and understand.

When working with G-code, keep in mind the following key aspects:

  1. Command letters: These indicate the meaning of the field, such as G for movement or M for miscellaneous functions.
  2. Numbers: These can be integers or fractionals, and some parameters can be followed by multiple numbers separated by colons.
  3. Line endings: G-code files use Unix Line Endings, but Windows Line Endings are also accepted.
  4. Case sensitivity: Except for characters in comments, G-code interpreters are case-insensitive.

Understanding these basics will help you navigate and create G-code files with ease.

Gcode Fields Explained

The Gcode structure relies on a series of fields, each comprising a letter followed by a number or standing alone as a flag, which are separated by white spaces or line breaks to guarantee clarity.

As you work with your CNC machine, you’ll notice that these fields are vital for precise instructions. The letter in each field indicates its meaning, while the number can be an integer or fractional value.

You’ll encounter standard G-code commands, RepRap-defined commands, tool selection, command parameters, and coordinates like X, Y, and Z axes – think moving along the Y axis to a specific point.

Gcode Case Sensitivity

When working with Gcode, it’s vital to understand that case sensitivity can impact the execution of your commands.

You may encounter case sensitivity issues due to Firmware limitations and Standard compliance challenges.

  1. The original NIST G-code standard requires gcode interpreters to be case-insensitive, except for characters in comments.
  2. Some firmwares, such as RepRapFirmware, are case-sensitive, while others, like Druid Firmware, can be set to case-sensitive.
  3. RepRapFirmware version 1.19 and later are case-insensitive, except within quoted strings.
  4. Druid Firmware version 1.00 is case-insensitive by default.

Understanding these variations is essential to avoid errors and guarantee your Gcode commands are executed correctly.

M31 Macro Mechanism Operation

When you execute an M31 macro, you issue a probing start command to the plugin, which initiates the probing process.

Before that, you set the parameters using the “Param” function, which retrieves the “P”, “Q”, and “R” values from the MDI line or g-code and passes them to the macro.

The macro then transmits these parameter values to the plugin through UserDRO 1511, 1512, and 1513.

Probing Start Command

As you initiate the M31 macro mechanism operation, it begins by transferring “P”, “Q”, and “R” parameters to the plugin, subsequently waiting for the probing process to complete.

The “Param” function is used to retrieve these parameters from the MDI line or g-code and pass them to the macro.

  1. The macro displays “M31 START” information in the STATUS line of Mach3 software.
  2. The macro transmits the parameter values to the plugin through UserDRO 1511, 1512, and 1513.
  3. The macro issues a command for probing start to the plugin.
  4. This probing start command initiates the probing sequence, utilizing various probing techniques to gather data, while being mindful of probing limitations.

Understanding these aspects is vital for effective use of the M31 CNC Gcode.

Parameter Setting Process

Configuring the parameters is a crucial step in the M31 macro mechanism operation, as it directly impacts the probing process. You’ll need to set the “P”, “Q”, and “R” parameters, which define the probing limits for each axis, and “F”, which sets the probing feedrate. Using the “Param” function, you can retrieve these parameters from the MDI line or g-code and pass them to the macro.

Parameter Type Description
P Distance X-axis probing limit
Q Distance Y-axis probing limit
R Distance Z-axis probing limit
F Feedrate Probing feedrate

The macro transmits these parameter values to the plugin through UserDRO 1511, 1512, and 1513. Once set, the macro displays “M31 START” information in the STATUS line of Mach3 software, indicating that the probing process has begun.

VB Macro Operation Parameters

Your VB macro relies on a set of operation parameters to execute smoothly.

These parameters define the operation sequences that your macro commands will execute. To guarantee correct execution, you need to input the correct parameters.

The key operation parameters you need to weigh are:

  1. Macro timeout: The time your macro waits for a response from the CNC machine.
  2. Command retry count: The number of times your macro retries a command if it fails.
  3. Parameter input format: The format in which you input parameters to your macro commands.
  4. Operation sequence priority: The order in which your macro executes operation sequences.

Gcode Case Sensitivity Fields

You’ll need to ponder Gcode case sensitivity fields when creating your CNC machine commands, as some firmwares are picky about uppercase and lowercase letters.

Although the original NIST G-code standard requires interpreters to be case-insensitive, except for characters in comments, not all 3D printer firmwares conform to this standard.

Some recognize uppercase command letters and parameters only, affecting firmware compatibility. For instance, RepRapFirmware version 1.19 and later are case-insensitive, except within quoted strings, while Druid Firmware version 1.00 is case-insensitive by default, but can be set to case-sensitive.

Be mindful of these variations to guarantee seamless Gcode execution and to certify flawless performance.

RepRap Firmware Gcode Support

Implementing RepRap Firmware in your CNC machine enables support for a range of Gcode commands, including the M31 macro, which offers a robust probing function for precise tool length measurement and edge detection.

With RepRap Firmware, you can customize your Gcode libraries and update your Firmware to accommodate specific machine requirements.

The M31 macro is particularly useful, as it allows for flexible probing operations with four key parameters:

  1. P: Distance parameter for probing operation
  2. Q: Probing feedrate parameter
  3. R: Additional settings for probing operation
  4. F: Optional parameter for custom probing configurations

CNC Machine Parts and Repairs

With M31 CNC Gcode supporting precise tool length measurement and edge detection, maintaining your CNC machine’s peak performance relies on having access to quality parts and reliable repair services. You can trust TIE Industrial Fanucworld.com for all your CNC machine parts and repair needs. They offer over 100,000 Fanuc CNC parts in stock, with same-day shipping available for convenience.

Benefit Description
Machine Reliability 1-year in-service warranty on all parts and repairs
Part Authenticity Genuine Fanuc CNC parts in stock
Repair Efficiency Knowledgeable customer service representatives available to assist
Convenience Shop parts online 24/7 with secure online payment processing

Their registered domain and online presence guarantee a hassle-free experience. With their expertise, you can focus on optimizing your CNC machine’s performance, knowing that reliable parts and repairs are just a click away.

Customer Service and Support

When it pertains to keeping your M31 CNC Gcode running smoothly, timely and accurate customer service and support are crucial.

You need a reliable partner to provide technical support and customer assistance when you need it.

  1. Call for assistance: Reach our knowledgeable customer service representatives at (877) 876-3994, available Monday – Friday, 7:00 am – 7:00 pm Central Time and Saturday, 8:00 am – 12:00 pm Central Time.
  2. Online shopping: Our online store is open 24/7, with secure checkout and same-day shipping for Fanuc CNC parts, ensuring timely delivery and minimizing downtime.
  3. Warranty protection: We stand behind our parts and repairs with a 1-year in-service warranty, ensuring your satisfaction and protection.
  4. Quality service: Our commitment to service quality means you can trust our technical support and customer assistance to get your M31 CNC Gcode up and running quickly, which is essential.

CNC Codes Similar to M31

Code
Mode
M32 Chip conveyor reverse
M33 Chip auger stop
M34 Increment coolant spigot position
M35 Turns ON the C-axis (rotary-axis)
M36 Pallet part ready
M37 Part catcher OFF
M38 Door Open
M39 Rotate tool turret
M40 Spindle gear at middle
M41 Select low gear to decrease speed.
M42 Select high gear to increase speed
M43 Gear select – gear 3
M44 Gear selection, select gear 4
M45 Select gear stage 5
M46 C axis connection; MC specification cancel
M47 Repeat program from first line
M48 Enable speed and feed overrides
M49 Disable speed and feed overrides
M50 Feedrate Override On
M51 Spindle speed override control

Leave a Comment