The Machine Daily
General Machine Tools

Using a State Machine Drawing Tool to Map CNC Lubrication Logic

Learn how to use a state machine drawing tool to map, troubleshoot, and program CNC machine tool lubrication system logic and PMC schedules.

Published Thomas Eriksson

The Architecture of Automated Machine Tool Lubrication

Modern CNC machine tools rely on precise, automated lubrication schedules to maintain way bearing films, ballscrew integrity, and spindle thermal stability. Unlike older manual or gravity-fed systems, contemporary single-line parallel and resistance systems operate on strict pressure-cycle logic managed by the machine's Programmable Machine Controller (PMC) or PLC. When maintenance engineers and integrators need to design, audit, or troubleshoot these cycles, utilizing a state machine drawing tool is the most effective method for visualizing the sequential logic, timer dependencies, and fault transitions.

Technical Definition: State Machines in CNC Lube Systems

In the context of machine tool lubrication, a state machine is a mathematical model of computation where the PMC transitions between discrete operational states (e.g., Idle, Pressurize, Dwell, Vent, Fault) based on specific inputs (pressure switch triggers, timer expirations, axis movement signals). A state machine drawing tool allows programmers to map these transitions visually before writing or debugging ladder logic.

Mapping the PMC Ladder Logic via a State Machine Drawing Tool

When retrofitting an older CNC mill with a modern Bijur Delimon PDI (Parallel Dispensing Injector) system, or troubleshooting intermittent Fanuc Alarm 1010 (Lube Pressure Drop) on a 31i-B controller, guessing the ladder logic sequence leads to extended downtime. By opening a state machine drawing tool—such as PlantUML, Lucidchart, or Draw.io—engineers can document the exact PMC scan-cycle behavior.

The 5-State Lubrication Cycle

A standard single-line parallel lubrication system operates in a continuous five-state loop. Below is the technical breakdown of how a state machine diagram models this sequence:

  1. S_IDLE: The pump is off. The system waits for a trigger (either a macro-level cycle timer, e.g., every 30 minutes, or a distance-coded trigger based on axis travel).
  2. S_PUMP (Pressurize): The PMC energizes the pump contactor (Y-address). Hydraulic oil flows through the metering units. The state transitions to S_DWELL only when the physical pressure switch closes (X-address input = 1), typically at 140–160 PSI.
  3. S_DWELL: The pump remains on to hold system pressure, allowing the PDI injectors to fully stroke and discharge their precise volume (e.g., 0.05cc per shot) to the way covers and ballscrews.
  4. S_VENT (Depressurize): The pump turns off, and an electronic vent valve opens. System pressure drops to 0 PSI. This zero-pressure state is mandatory; without it, the internal check valves in the injectors will not reset for the next cycle.
  5. S_FAULT: If any timer expires before the expected input is received (e.g., pressure switch fails to trip within 90 seconds), the PMC immediately transitions to the Fault state, halting axis feed and triggering an alarm.

State Transition Matrix: Fanuc 31i-B PMC Example

When using a state machine drawing tool to document a specific controller, it is critical to map the physical I/O addresses to the state transitions. The table below represents a standard configuration for a vertical machining center utilizing a Bijur PDI system.

Current State Trigger / Condition Next State PMC Address / Timer
S_IDLE Lube Timer (T001) Expires S_PUMP Y2.0 (Pump Relay) = ON
S_PUMP Pressure Switch Closes S_DWELL X3.4 = 1 (160 PSI Trip)
S_PUMP Max Pump Timer (T002) Expires S_FAULT T002 = 90s (Alarm 1010)
S_DWELL Dwell Timer (T003) Expires S_VENT T003 = 15s, Y2.0 = OFF
S_VENT Vent Timer (T004) Expires S_IDLE T004 = 30s, Reset Cycle

Technical Specifications: Timing and Pressure Thresholds

According to SKF Automated Lubrication Systems documentation, the physical fluid dynamics of single-line injectors dictate the minimum timing requirements that must be programmed into the PMC. If the state machine timers are set too short, the injectors will only partially stroke, leading to localized starvation and eventual bearing damage as classified by ISO 15243.

  • Pump Output Pressure: Typically 250 PSI (17.2 bar) at the pump head, dropping to 160 PSI (11 bar) at the furthest injector manifold.
  • S_PUMP Timeout (T002): Must be calculated based on line volume. A standard 3/8-inch OD nylon line with 12 injector points requires approximately 45 seconds to build 160 PSI. Setting T002 to 60 seconds provides a safe 15-second buffer for cold-weather fluid viscosity increases.
  • S_DWELL Duration (T003): 10 to 20 seconds. This holds pressure to ensure the internal spring in the PDI injector fully compresses and meters the exact volume.
  • S_VENT Duration (T004): Minimum 30 seconds. The indicator pin on the physical injector will not reset until line pressure drops below 15 PSI.

'The most common cause of premature way-wear on retrofitted CNC mills is not pump failure, but incorrect PMC vent-timer logic. If the state machine transitions from S_VENT back to S_PUMP before the line pressure reaches absolute zero, the injector check-valves remain seated, and the entire cycle bypasses the metering pins.' — Senior Fluid Power Engineer, Machine Tool Integration Division

Troubleshooting Lube Alarms Using State Diagrams

When a machine tool faults out, maintenance technicians often waste hours checking physical components when the issue lies in the PLC logic sequence. By referencing the state machine diagram generated by your state machine drawing tool, you can isolate the exact failure node.

Scenario: Machine Alarms Out in S_PUMP State

If the PMC transitions to S_FAULT because T002 expired before X3.4 (Pressure Switch) triggered, the state diagram tells you the system never achieved 160 PSI. Do not replace the pump immediately. Follow this physical diagnostic tree:

  • Check the Relief Valve: Is the main pump relief valve stuck open, bypassing fluid back to the reservoir?
  • Check for Line Ruptures: Inspect the nylon tubing near the Z-axis way covers, where repetitive cable carrier movement often causes fatigue cracking.
  • Verify Injector Seating: If a single PDI injector is unscrewed slightly or missing its copper crush washer, the system will vent to the atmosphere, preventing pressure buildup.

Scenario: Machine Alarms Out in S_DWELL State

Some advanced PMC programs monitor the pressure switch during the S_DWELL state. If pressure drops below 120 PSI before T003 expires, the system faults. This indicates a high-pressure leak. The fluid is escaping past a damaged injector O-ring or a failed check-valve spring inside the manifold block.

Comparing Injector Types and Their State Logic Requirements

Not all machine tool lubrication systems require a venting state. When designing the state machine for a new build or retrofit, the choice of injector hardware fundamentally alters the PLC logic.

System Type Hardware Example Required States PMC Logic Complexity
Single-Line Parallel (PDI) Bijur Delimon PDI / SKF Lincoln Centro-Matic Idle, Pump, Dwell, Vent, Fault High (Requires vent valve logic and pressure decay monitoring)
Single-Line Resistance (SLR) Bijur Delimon SLR / Trico Micro-Mist Idle, Pump, Fault Low (No venting required, relies on continuous low-pressure flow 15-30 PSI)
Air/Oil (MQL / Spindle) SKF Vogel Air-Oil Mixing Valves Idle, Air-On, Oil-Pulse, Fault Very High (Requires synchronized pneumatic and hydraulic PWM pulsing)

Implementing Your Own State Model for Custom Retrofits

For machine shops performing in-house CNC retrofits—such as upgrading a legacy Fadal VMC from relay-based lube control to a modern Automation Direct or Beckhoff PLC—skipping the diagramming phase is a critical error. Relay logic operates on parallel hardware interlocks, whereas PLCs operate on sequential scan cycles.

By utilizing a state machine drawing tool to map out the exact transitions, you can generate the underlying PLC structured text (ST) or ladder rungs directly from the diagram. Modern tools even allow you to export the state diagram into C-code or IEC 61131-3 structured text, ensuring that the physical dwell times required by the single-line injector hardware are perfectly synchronized with the controller's scan rate.

Ultimately, treating machine tool lubrication not just as a mechanical plumbing issue, but as a rigid computational state machine, bridges the gap between fluid dynamics and CNC software engineering. This methodology eliminates phantom alarms, guarantees precise volumetric delivery to high-load way bearings, and extends the mean-time-between-failures (MTBF) for critical ballscrew assemblies.