Author: FastPathcnc

  • CNC Tool Break Detection Using In-Process Probing

    CNC Tool Break Detection Using In-Process Probing

    This is how I do CNC tool break detection and tool management on a Haas machine with the Next Gen controller. And it is not by simply touching the tool to a tool setter and calling it good. That only checks the tool. I want to know what happened to the part, so I measure the cut.

    After the tool makes the cut, I call the probe, measure the feature, and use macro logic to decide what happens next. If the tool overcuts, the machine alarms out and stops. If the tool undercuts, I update the wear offset, recut the feature, and measure it again. If it checks good, the machine moves on to the next operation.

    That is why I call this tool management, not just tool break detection. For shops trying to improve in-process probing, CNC automation, lights-out machining, or tool wear compensation, this is a better way to control the process because the program reacts to the actual cut, not just the tool.

    Start With a Simple CNC Program

    Here is the basic code I use on a Haas VF6 with the Next Gen controller.

    I’ll write some sample code and then build on it. Don’t judge the CAM path, the rough formatting, or the fact that this is not production-ready code. I’m keeping it basic so the probing logic is easy to see.

    The goal is to show how CNC macro programming can use an in-process inspection macro and a Renishaw probe macro to measure the feature, adjust the tool wear, and decide whether the machine should stop, recut, or move on.

    G17 G40 G49 G80

    G90 G0 X0. Y0.

    T1M6

    S5500 M3

    M8

    (MAKE SOME CUT)

    G90 G0 Z1.0 M9

    G91 G28 Z0. M5

    M1

    Ok, not much in that, but it gets the idea out there.

    Add a Sequence Number

    First, I add a sequence number. Usually, I try to make it match the tool number if I can.

    N1

    G17 G40 G49 G80

    G90 G0 X0. Y0.

    T1M6

    S5500 M3

    M8

    (MAKE SOME CUT)

    G90 G0 Z1.0 M9

    G91 G28 Z0. M5

    M1

    Call the In-Line Inspection Macro

    Then at the end I call my probe macro to measure the feature. We’ll assume that the feature is a 5.0-inch diameter blind bore with a .5-inch-deep floor. This way I can show how to check both the diameter and the tool length management.

    N1

    G17 G40 G49 G80

    G90 G0 X0. Y0.

    T1M6

    S5500 M3

    M8

    (MAKE SOME CUT)

    G90 G0 Z1.0 M9

    G91 G28 Z0. M5

    G65 P9300 A1. T1.

    M1

    I write my in-line inspection macro so it can cover more than one operation. The A1 in the macro call points to sequence N1. Inside the macro, I use GOTO#1 to jump to the right section of probe code for that feature.

    Build the Renishaw Probe Macro

    So, I will build the macro too. I’ll truncate the code for speed and clarity like I am doing with the main.

    O9300(IN-LINE INSPECTION)

    GOTO#1

    IF[#20 NE20] THEN #3000 = 9300(TOOL FEATURE MISMATCH)

    N1

    T20M6(THE PROBE)

    G90 G0 X0. Y0.

    G43 H20 Z5.0

    G65 P9832

    G65 P9810 Z1. F120.

    G65 P9811 Z-.5 T#20. (THIS WILL UPDATE THE T1 TOOL HEIGHT WEAR)

    (THE MAGIC)

    #30=#148 (#198 FOR THE HAAS)

    G65 P9810 Z-.25

    G65 P9814 D5.0 T#20 (THIS WILL UPDATE THE TOOL DIAMETER WEAR)

    #31 = #148 ( AGAIN #198 FOR HAAS)

    G65 P9810 Z2.0 F300.

    G65 P9833

    G53 Z0.

    M99

    Save the Probe Results into Macro Variables

    “I grabbed the probe result and move it into my own variable so I can use it later in the main program.”

    Ok I didn’t truncate much but here it is. The Renishaw probing cycle knows whether it is dealing with a height move or a diameter check based on the move and the value being evaluated. The adjustment is the difference between the target “Z” and the probe location when the G31 inside the P9811 macro triggers. This difference is applied to the tool number we passed into the O9300 macro above. Which in this case is tool “T1” that made the cut.

    Now I passed the delta(deviation) value  to #30 for the depth and the delta value for the diameter. Again, that is taken care of in the Renishaw macro for you. Now I pass the values into my #900 for the height and #901 for the Diameter variable and run that back into the main program. Now I have control of what I can do with the program.

    N1

    T20M6(THE PROBE)

    G90 G0 X0. Y0.

    G43 H20 Z5.0

    G65 P9832

    G65 P9810 Z1. F120.

    G65 P9811 Z-.5 T#20. (THIS WILL UPDATE THE T1 TOOL HEIGHT WEAR)

    (THE MAGIC)

    #30=#148 (#198 FOR THE HAAS)

    G65 P9810 Z-.25

    G65 P9814 D5.0 T#20 (THIS WILL UPDATE THE TOOL DIAMETER WEAR)

    #31 = #148 ( AGAIN #198 FOR HAAS)

    G65 P9810 Z2.0 F300.

    G65 P9833

    G53 Z0.

    IF[#30 GT .005] THEN #900 =1(TOO DEEP)

    IF[#31 GT .005] THEN #901 =1(TOO BIG)

    IF[#30 LT -.005] THEN #900 =2(TOO SHALLOW)

    IF[#31 LT -.005] THEN #901 =2(TOO SMALL)

    M99

    “In my example, #900 is my depth status and #901 is my diameter status. A value of 1 means the feature went too far or too big and I want to stop. A value of 2 means it is undersize or shallow enough that I can update the offset and recut.”

    Use IF Statements to Stop, Recut, or Continue

    So back to the main program.

    N1

    G17 G40 G49 G80

    G90 G0 X0. Y0.

    T1M6

    S5500 M3

    M8

    (MAKE SOME CUT)

    G90 G0 Z1.0 M9

    G91 G28 Z0. M5

    G65 P9300 A1. T1.

    IF[[#900 EQ 1] OR [#901 EQ 1]] THEN #3000 = 9301(ABORT: CHECK T1)

    IF[[#900 EQ 2] OR [#901 EQ 2]] GOTO1

    M1

    And there it is. The tool adjusted automatically when the probe measured the feature. The first check handled the tool height wear, and the second check handled the tool diameter wear. Then the IF statements decided what happened next. If it was overcut, the machine aborted. If it was undercut, the program went back and recut the feature with the updated offset. If it passed, it moved on and kept making money.

    Skip Probing Every Part During Lights-Out Machining

    We can add a bonus feature because this is for lights out automation manufacturers we know that a feature like this does not need constant probing every time. We can add a gate to see if it should take the time to measure or skip a round.

    So, I add this bit before the probe macro call.

    N1

    G17 G40 G49 G80

    G90 G0 X0. Y0.

    T1M6

    S5500 M3

    M8

    (MAKE SOME CUT)

    G90 G0 Z1.0 M9

    G91 G28 Z0. M5

    IF[[#800MOD5] NE 0] GOTO11

    G65 P9300 A1. T1.

    IF[[#900 EQ 1] OR [#901 EQ 1]] THEN #3000 = 9301(ABORT: CHECK T1)

    IF[[#900 EQ 2] OR [#901 EQ 2]] GOTO1

    N11

    M1

    #800 is my part counter. #800 MOD 5 is the math nerd way of saying “only do this every fifth part.” If the part count is 5, 10, 15, and so on, #800 MOD 5 equals zero. That makes the NE 0 statement false, so the program does not jump to N11. It keeps going and runs the probe check. On the other parts, the value is not zero, so the program jumps to N11 and skips the check.

    Final Thoughts From the Shop Floor

    That’s it. This is the kind of real CNC tool management I wish more shops were using. Not another recycled AI summary of somebody else’s blog post. This is how I actually think through it as a machinist/programmer who has been doing this since 1989. Use the machine, use the probe, use the macro logic, and make the process react to the part.

  • Adding Logic to CNC Programs Is Not Out of Reach

    Adding Logic to CNC Programs Is Not Out of Reach

    Handling Broken Taps

    If you are a CNC programmer or small shop owner, the idea of adding logic to your programs can feel intimidating. Macro variables, probe cycles, IF statements, GOTO commands, alarms—at first glance, it can look like something only large shops or full-time automation engineers can use.

    But the truth is simple: logic is just a way to make your CNC program ask questions before it makes an expensive mistake.

    One of the best examples is using probing logic to prevent broken taps. A broken tap can ruin a part, stop a machine, cost hours of recovery time, and create stress that no shop needs. With a few probing moves and basic Macro-B logic, your program can check the hole before the tap ever touches the part.

    The Problem: Broken Taps Usually Give You Warning Signs

    Before a tap breaks, the hole often gives you a clue. The two big warning signs are:

    • the drilled hole is too small, creating excess torque on the tap
    • the hole is too shallow or obstructed, leaving no room for the tap to complete the thread

    Instead of hoping the drill did its job, we can use the probe to verify the hole diameter and depth before tapping. That simple decision turns the program from a fixed sequence into a smarter process.

    What Logic Adds to a CNC Program

    CNC logic does not have to be complicated. At its core, it usually follows a pattern like this:

    Measure something. Compare it to an acceptable range. Decide what to do next.

    That decision might be to stop the machine with a useful alarm message. It might be to skip the tapping operation and continue with the next tool. It might be to flag the part for review while keeping the machine productive. The important part is that the program is no longer blind.

    Example: Probing Hole Diameter Before Tapping

    For a hole diameter check, a common approach is to use a Renishaw bore measurement cycle such as O9814. The cycle measures the hole and passes the measured value into a macro variable on many controls. On many Fanuc-style setups this value is commonly handled through variables such as #138, while some Haas configurations may use a different variable. Always verify the correct variable in your Inspection Plus manual and on your machine before relying on it in production.

    For example, a 1/2-13 UNC 3B tapped hole may require the drilled hole to fall within a specific acceptable range before tapping. In the original example, the acceptable diameter range is .417 to .434 inches.

    A simplified logic check might look like this:

    G65 P9814 D.4219

    IF[#138 LT .417] THEN #3000 = 1(DRILL HOLE UNDERSIZE: ABORT TAP)

    IF[#138 GT .434] THEN #3000 = 1(DRILL HOLE OVERSIZE: ABORT TAP)

    For a metric example, an M12-1.75 6H tapped hole may use a range such as 10.106 to 10.441 mm:

    IF[#138 LT 10.106] THEN #3000 = 1(DRILL HOLE UNDERSIZE: ABORT TAP)

    IF[#138 GT 10.441] THEN #3000 = 1(DRILL HOLE OVERSIZE: ABORT TAP)

    That small block of logic does something very powerful. It checks the measured hole against the tolerance range and gives the machinist a useful message instead of a mystery alarm. The operator does not have to guess what happened. The program tells them: the hole is undersize, oversize, or safe to tap.

    Why Useful Alarms Matter

    A generic alarm stops the machine, but it does not always help the person standing in front of it. A good alarm should explain the problem clearly enough that the machinist knows what to inspect next.

    That is where custom logic is valuable. Instead of simply stopping, your program can stop with a message that points directly to the cause. In a small shop, that saves time. In a production environment, it helps standardize the response. In unattended or lights-out work, it can keep one bad condition from becoming a bigger problem.

    Example: Checking Hole Depth or Clearance

    Diameter is only one part of the problem. A tap can also break if the hole is too shallow or blocked. For a depth check, you may be able to use a probing cycle such as Renishaw O9811 for a single surface measurement, or you may choose to use G31 skip logic depending on the situation.

    The difference matters when you are checking a through hole. Some probing cycles are designed to alarm when the expected surface is not found. That behavior is useful in many cases, but a through hole may be completely acceptable. In that case, you may want the probe to travel to a target depth, return safely, and then let your logic decide what happens next.

    A simple G31-style check might look like this:

    G31 Z-1.1

    On many Fanuc-style controls, G31 records the skip position in system variables such as #5061, #5062, and #5063 for X, Y, and Z. In this example, the Z result can be checked through #5063.

    IF[#5063 LT -1.09] THEN #3000 = 1(DRILL HOLE OBSTRUCTED: ABORT TAP)

    The concept is straightforward: if the probe does not make it to the expected depth, something stopped it. That something could be chips, an incomplete drill, a broken drill, or another obstruction. Instead of sending the tap into that condition, the program can react before damage occurs.

    Stopping Is Not the Only Option

    Most of the time, stopping with an alarm is the right choice. If the hole is undersize or obstructed, you may want the machinist to inspect the part immediately.

    But there are situations where you may want the program to skip the tapping operation and continue with the next tool. For example, maybe the part has several hours of machining left and tapping can be done later after the issue is reviewed. In that case, the logic can set a flag or jump to another sequence number.

    For example:

    #600 = 1

    IF[#600 EQ 1] GOTO100

    Or, instead of alarming on an undersize hole, you could jump around the tapping tool:

    IF[#138 LT 10.106] GOTO100

    That is the power of adding logic. You are not limited to “run the next line no matter what.” You can build decisions into the program that match the real needs of your shop.

    This Is More Approachable Than It Looks

    You do not need to overhaul your entire programming process to start using logic. You can begin with one high-value problem: broken taps, missed holes, wrong stock, fixture confirmation, tool checks, or simple in-process measurement.

    Start small. Measure one condition. Compare it to one limit. Decide whether to continue, alarm, or skip. That is the foundation of smarter CNC programming.

    For small shops, this kind of logic can make a real difference. It can reduce scrap, protect expensive tools, help operators troubleshoot faster, and create more confidence when running longer cycles or unattended work.

    I Can Help You Add Logic to Your CNC Programs

    If you want to take the next step toward smarter programs, better probing routines, or more dynamic automation, you do not have to figure it out alone.

    I help CNC programmers and small shop owners add practical logic to real programs—logic that fits the machine, the control, the part, and the way the shop actually runs.

    Whether you need help with probing, Macro-B logic, custom alarms, skip conditions, or safer unattended workflows, FastPath CNC can help you move from standard code to smarter code.

    Ready to make your CNC programs work smarter? Visit fastpathcnc.com to get started.

  • Automation for Small CNC Shops

    Automation for Small CNC Shops

    Lights Out Production for Small Shops

    How Smart Probing and Custom Macros Turn Your CNC into a Self-Checking System

    Running a small machine shop today means doing more with less—less time, fewer operators, and tighter margins. “Lights Out” production isn’t just for large OEMs anymore. With the right probing strategies and macro programming, even a single CNC can run smarter, longer, and with far less risk.

    At FastPathCNC, I specialize in helping shop owners and CNC programmers unlock the full power of Renishaw Inspection Plus probing systems—especially on Fanuc, Haas, and Hurco machining centers.

    —

    Why Probing Is the Key to Lights Out

    Most shops use their probe for basic part setup or occasional inspection. That’s just scratching the surface.

    When combined with advanced macro programming, your probe becomes a decision-making tool, capable of:

    • Verifying proper part loading before machining begins
    • Monitoring dimensions during machining (in-process inspection)
    • Automatically adjusting offsets to maintain tolerance
    • Identifying scrap before wasting more cycle time
    • Logging results for traceability and quality documentation

    This is where Lights Out becomes realistic—even in a small shop environment.

    —

    What I Can Build for Your Machines

    I write custom G-code macros using the Renishaw Inspection Plus package that turn your machine into a self-monitoring system.

    ✅ Part Load Verification

    Prevent crashes and scrap before they happen:

    • Detect misloaded, flipped, or missing parts
    • Confirm work offset positions
    • Ensure fixtures and clamps are seated correctly

    —

    ✅ Advanced In-Process Inspection

    Keep parts in tolerance automatically:

    • Measure critical features mid-cycle
    • Adjust tool offsets based on real-time data
    • Maintain consistency across long production runs

    —

    ✅ Tool Wear & Break Detection

    Go beyond basic tool life counters:

    • Probe tools during the cycle to detect wear or breakage
    • Trigger alarms or safe stops when failure is detected
    • Automatically compensate for gradual wear

    —

    ✅ Intelligent Pass / Fail / Recut Logic

    Your machine can make decisions:

    • Pass → Continue production
    • Fail (Scrap) → Stop or flag the part
    • Recut → Adjust offsets and rerun finishing passes

    This helps reduce scrap while maximizing usable parts.

    —

    ✅ Tool Life Monitoring with Operator Alerts

    Keep tooling under control:

    • Track usage time or cycle count
    • Trigger warnings when tools need inspection
    • Prevent unexpected failures that ruin parts

    —

    ✅ Smart Probing Cadence

    Run the probe when it matters—not every cycle:

    • First article inspection
    • Every 5th, 10th, or custom interval
    • Adaptive cycles based on tolerance drift

    —

    ✅ Automated Reporting (CSV Output)

    Capture real data for your quality system:

    • Generate inspection logs using Fanuc’s DPRINT function
    • Output results to CSV format
    • Provide traceability for customers and audits

    —

    Built for the Machines You Already Have

    I work with:

    • Fanuc-controlled machines
    • Haas machining centers
    • Hurco controls

    If you already have a Renishaw probe installed, you likely already have the capability—you just need the right code to unlock it.

    —

    Need a Faster Start?

    If you’re not ready for full custom development, I also offer:

    • ✅ Pre-built macro templates
    • ✅ Downloadable packages through my Payhip store
    • ✅ Plug-and-play solutions you can adapt to your shop

    —

    Why FastPathCNC?

    I founded FastPathCNC to help small and mid-size shops compete with larger operations by using smarter programming—not just more machines.

    You don’t need a million-dollar automation cell to run Lights Out.
    You need reliable code, smart probing, and a system that thinks ahead.

    —

    Ready to Run Smarter?

    If you want to:

    • Reduce scrap
    • Increase unattended runtime
    • Improve consistency
    • Capture real inspection data

    I can help you get there.

    👉 Visit FastPathCNC to learn more or get started.

    —

    Lights Out isn’t just about turning off the lights—it’s about turning on intelligence in your process