Inquire About Our Sheet Metal Machines Now!

Exploring the Role of Grating Ruler in CNC Machine Tools


The grating ruler is a positioning detection element for the linear axis of CNC machine tools.

It acts as the “eyes” of a human operator, monitoring whether the linear axis moves accurately to the position required by the numerical control system after executing the NC program.

Without a grating ruler, the accuracy of the linear axis movement depends entirely on the precision of the NC system and mechanical transmission accuracy.

After prolonged use of CNC machine tools, due to changes in electrical calibration parameters and increased mechanical errors, the linear axis may deviate significantly from the position required by the numerical control system program.

In such case, neither the control system nor the machine operators would be aware of this deviation. In order to accurately detect such issues, maintenance personnel need to carry out precision testing of the machine tool.

Therefore, for CNC machine tools without a grating ruler, periodic accuracy testing is essential, failure to do so can result in excessive variations in machining accuracy, or even scrap of the products being processed.

Semi-closed loop control of machine tools

If a grating ruler is installed on the linear axis of a CNC machine tool, the aforementioned problem would be solved without the need for human intervention.

The grating ruler acts as a position detection element, and if the linear axis fails to reach the accurate position required by the numerical control system due to mechanical reasons, the grating ruler sends feedback to the NC system, allowing the linear axis to accurately reach its position.

In this case, the grating ruler acts as an independent monitoring function, similar to the eyes of a human operator, continuously “observing” the position of the linear axis, ensuring that it reaches the position required by the numerical control system.

Fully closed loop control of machine tools

In the production of new machine tools or the overhaul of old ones, the purpose of using a grating ruler is to increase the accuracy of the linear axis.

However, the accuracy of this axis does not only depend on the grating ruler, but mainly on the mechanical geometry accuracy of the linear axis itself.

The grating ruler cannot replace the accuracy of the mechanical component; it merely enhances its performance.

Many people have misunderstandings about this issue, especially if the geometric accuracy of the linear axis of the machine tool is poor. For instance, some lathes use a gear rack for transmission, which results in large reverse clearance.

Even when a grating ruler is used with such an axis, it may cause oscillations when it approaches the precise position due to low transmission precision.

Semi-closed loop control systems cannot control the transmission errors caused by the transmission mechanism of the machine tool, thermal deformation errors produced by transmission mechanisms during high speed operation, and errors caused by the wear of transmission systems during high-speed operation.

During the machining process, these errors have severely affected the machining accuracy and stability of CNC machine tools.

Grating rulers for linear axes achieve fully closed loop control of CNC machine tool’s linear coordinates, reducing the aforementioned errors, improving the positioning accuracy, repeatability accuracy, and precision reliability of the machine tool.

As a key component for improving the positioning accuracy of CNC machine tools, grating ruler’s popularity is increasing among users.

Accuracy of CNC Machine

Accuracy of CNC machine tools can be classified into three main aspects, including geometric accuracy, positioning accuracy, and machining accuracy.

Geometric accuracy, also called mechanical accuracy, is the comprehensive geometric shape error of critical components of the machine tool after assembly.

The measurement tools and methods used for detecting it are basically the same as those used for ordinary machine tools but with higher requirements.

Taking a typical vertical machining center as an example, its geometric accuracy includes the following parameters:

  • 1. Flatness of the working table
  • 2. Orthogonality of movement in different coordinate directions
  • 3. Parallelism of the working table with respect to the X and Y coordinate directions
  • 4. Rotation accuracy of the spindle
  • 5. Parallelism of the spindle axis with respect to the Z coordinate direction on the main spindle box’s movement
  • 6. Linearity of the spindle’s movement in the Z coordinate direction

Positioning accuracy

Positioning accuracy refers to the actual positional accuracy that the machine tool’s major components can achieve at the end of movement. The difference between actual and targeted position is known as positioning error.

In CNC machine tools, positioning accuracy is also referred to as the machine’s motion accuracy, and is determined by the accuracy of the CNC system and mechanical transmission error.

The movement of each component of the machine tool is completed under the control of the CNC device, and the accuracy that each movement component can achieve directly affects the precision of the machined part.

Therefore, the positioning accuracy is a critical inspection item.

Repeatability accuracy

Repeatability accuracy refers to the degree of consistency in the position accuracy obtained by repeatedly running the same program code on a CNC machine tool.

The repeatability accuracy is affected by factors such as servo system characteristics, backlash and rigidity of the feed transmission links, as well as friction characteristics.

In general, repeatability accuracy is subject to occasional errors in normal distribution, and it impacts the consistency of a batch of parts processed, making it an essential accuracy indicator.

Related reading: Positioning Accuracy vs. Repeatability in CNC Machines

Machining accuracy

Machining accuracy is affected by various factors that are not fully reflected by geometric and positioning accuracy, which are typically detected without cutting load or with the machine tool in a stationary or slow-moving state.

For example, under the influence of cutting forces and clamping forces, the machine tool’s components will undergo elastic deformation. The machine tool’s components will also undergo thermal deformation due to internal heat sources (such as overheated bearings and gears, etc.) and changes in ambient temperature.

Additionally, the machine tool generates vibrations under the influence of cutting forces and motion speed. Furthermore, when the machine tool’s moving components move at working speeds, their motion accuracy differs from that measured at low speeds due to the oil film at sliding surfaces and other factors.

All of these factors can cause changes in the machine tool’s static accuracy, affecting the machining accuracy of the workpiece.

The accuracy of the machine tool under the influence of external loads, heating, and vibrations during work is known as the machine tool’s dynamic accuracy.

Dynamic accuracy is closely related to static accuracy and largely depends on the machine tool’s stiffness, vibration resistance, and thermal stability.

At present, the comprehensive dynamic accuracy of the machine tool is generally evaluated by the machining accuracy of workpieces produced through cutting operations, which is known as the machine tool’s working accuracy. The working accuracy reflects the comprehensive influence of various factors on machining accuracy.

Methods to Improve the Precision of CNC Machining

Currently, there are mainly two methods of improving the machining accuracy of CNC machine tools in the part machining industry: error prevention and error compensation.

Error prevention methods

Error prevention refers to measures taken to improve the quality level of component design, processing, and assembly, effectively control environmental factors, and achieve the purpose of eliminating or reducing error sources.

For example, using high-rigidity, thermally symmetrical guide rails and ball screws for temperature control can effectively reduce the thermal deformation of the machine tool and the temperature rise of the heat source, thereby reducing the occurrence of errors.

Error prevention methods are mainly divided into three categories: size error, geometric error prevention, thermal deformation error prevention, and other error prevention.

These methods can reduce the probability of error occurrence to some extent, but it is almost impossible to completely eliminate thermal deformation and geometric errors.

In addition, the machining accuracy of the machine tool has a significant impact, and improving the quality of the parts comes at a high cost, making it not common in practical applications.

Error compensation methods

Error compensation involves installing precision probes, position sensors, grating rulers, and other equipment on CNC machine tools to provide feedback on the machining errors of the machine tool in real-time to the CNC system.

The machine tool automatically compensates for machining accuracy, improving the accuracy of parts machining while significantly reducing raw material costs.

Common Faults of Grating Rulers as Position Detection Elements in Linear Axes

1. Zero pulse cannot be found when the linear axis returns to the reference point.

In terms of performance, the axis continues to run until it collides with the limit of the axis during the return to reference point.

This fault is generally caused by the reading head or grating ruler being dirty. To address this issue, remove the reading head and clean it with anhydrous alcohol, and clean the scaled part with a silk cloth dipped in anhydrous alcohol.

Zero pulse cannot be found when the linear axis returns to the reference point

2. An alarm has been triggered on the linear axis of the CNC machine tool during operation.

If the linear axis of a CNC machine produces an alarm during operation, the following alarms may appear depending on the control system used: “Hardware encoder error” for Siemens 840D or LNC systems, and “Feedback error” for Fanuc systems.


(1) Due to vibrations or other reasons, the distance between the reading head and the grating scale on the machine tool increases during use, causing the CNC system to incorrectly assume that the grating scale is faulty.

To solve this problem, adjust the distance between the reading head and the grating scale according to the grating scale manual. The distance between the reading head and the grating scale body should be around 1-1.5mm, and not exceed 2mm.

(2) Improper installation of the grating scale, such as installation near the oil pool, may result in contamination of the scale by oil and gas.

In this case, the “fixed scale” and “moving scale” of the grating scale should be cleaned separately, and then the grating scale should be adjusted and tested before use.

(3) Improper installation of the reading head can damage the unit itself.

In the worst case, aluminum alloy debris may get into the grating scale’s fixed scale, causing damage to the grating scale’s lines and permanently rendering the grating scale unusable.

3. The linear axis of the CNC machine tool went out of control abruptly.

In most cases, when the linear axis of the CNC machine tool goes out of control, this is due to contamination of the position detection element such as the grating ruler.

To resolve the problem, the grating or reading head of the grating ruler needs to be cleaned thoroughly.

The linear axis of the CNC machine tool went out of control abruptly

4. Other Faults:

After years of experience in maintaining CNC machine tools, we have observed that the grating ruler, as a position detection element of the CNC system, can improve the positioning accuracy of the machine tool’s linear axis when the mechanical part of the machine tool is operating smoothly.

Moreover, the grating ruler can detect potential hazards or issues with the machine tool’s mechanical part.

A C61200 lathe produced by Wuzhong Corporation has been retrofitted with a FAGOR 8055TC CNC system.

During the processing of a roll, which had an elliptical body, the X-axis moved away from the roll when the cutting tool encountered a relatively large area of the roll body, in the absence of an X-axis movement instruction.

When the cutting tool touched a relatively small area of the roll body, the X-axis moved toward the roll, causing the X-axis to move back and forth. Upon inspection of the CNC system of the machine tool, it was found that the AC servo motor of the X-axis was locked in the absence of an “enable” signal.

When the position detection element of the X-axis was shielded and replaced with a semi-closed-loop system, the phenomenon of the X-axis moving back and forth disappeared during cutting.

Some people thought that this phenomenon was caused by problems with the grating ruler, but upon inspection, it was found that the back cover of the X-axis ball screw was loose.

Therefore, when the roll was rotating, because the roll had an elliptical shape, when the cutting tool encountered a relatively large area of the roll body, the roll exerted a “push-up” force on the X-axis, pushing the X-axis away from the direction of the roll diameter.

At this time, the movement of the X-axis was not caused by the machine tool’s numerical control instructions. The grating ruler used for detecting the position of the X-axis detected that the X-axis moved to the “+X” direction (away from the roll body) without receiving any instruction from the CNC system.

The function of the grating ruler is to detect whether the linear axis moves accurately under the action of the numerical control instructions. If the linear axis does not move accurately, the numerical control system intervenes to position the linear axis accurately.

Therefore, when the cutting tool touched a relatively small area of the roll body, the tool had a certain gap with the roll body, and the grating ruler caused the X-axis to move towards the direction of the roll diameter to position at the X-axis coordinate position indicated by the numerical control system.

In this way, when the roll rotates one circle, the X-axis alternately moves towards the “direction away from the roll diameter” and “direction near the roll diameter” when there is no data instruction movement on the X-axis. Therefore, during the processing of the roll, the X-axis moved back and forth due to the loose back cover of the ball screw.

When a linear axis of a CNC machine tool using a closed-loop system experiences motor jittering or oscillation, it is necessary to shield the position detection element to eliminate the abnormal phenomenon.

Generally, first check the cleanliness of the position detection element, such as the grating ruler and the reading head, and whether the installation position of the reading head is reasonable, and exclude factors that cause the position detection element to malfunction.

If the position detection element is found to be functioning properly, it is likely that there is a problem with the mechanical transmission chain of the linear axis.

In this case, it is necessary to check if there is any looseness in the components of the mechanical transmission chain, if there is any wear in the mechanical parts, and if the relevant lubrication of the mechanical transmission chain is adequate.

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Just a Step Away!

Sheet Metal Machines Await!

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top