Skip to main content

Translate- हिंदी, मराठी, English

Converting Part Dimensions to Coordinate System Points

 

Converting Part Dimensions to Coordinate System Points

In CNC machining, the movement of the cutting tool is controlled by specifying coordinates in a defined coordinate system. The most common coordinate system is the Cartesian coordinate system, which uses orthogonal axes (typically X, Y, and Z) to define points in space.

Understanding the Axes:

  • Z-axis: This axis typically represents the spindle axis, which is usually vertical for milling machines and horizontal for lathes. The direction of the positive Z-axis is usually away from the workpiece.
  • X-axis: This axis is generally the primary horizontal axis. Its positive direction is often to the right when facing the machine.
  • Y-axis: This axis is the secondary horizontal axis, perpendicular to both the X and Z axes. Its positive direction is determined by the right-hand rule.

Converting Diameters (for Lathes):

When dealing with cylindrical parts on a lathe, dimensions are often given as diameters. However, the CNC control system typically works with radial coordinates along the X-axis. Therefore, you need to convert the diameter to a radius when programming the X-axis.

  • X-coordinate (radius):

For example, if a cylindrical section has a diameter of 20 mm, the corresponding X-coordinate for that surface would be 10 mm (assuming the center of the workpiece is at X=0).

Converting Lengths:

Lengths on a part directly correspond to movements along the axes of the CNC machine.

  • Lengths along the Z-axis: These dimensions directly translate to Z-coordinates. If a feature is located 50 mm away from the workpiece's face along the Z-axis in the positive direction, the Z-coordinate would be +50.
  • Lengths along the X and Y axes: Similarly, linear dimensions along the X and Y directions directly correspond to the X and Y coordinates, respectively.

Example (Lathe):

Consider a simple cylindrical part with two diameters and a length:

  • Diameter 1: 30 mm, Length 20 mm (from the face)
  • Diameter 2: 50 mm, Length 40 mm (from the face)

Assuming the workpiece's face is at Z=0 and the center is at X=0, the coordinate points for machining these features would be:

  • For Diameter 1 (start of the section): X = 30/2 = 15, Z = 0
  • For Diameter 1 (end of the section): X = 30/2 = 15, Z = -20 (negative because we are moving into the workpiece)
  • For Diameter 2 (start of the section): X = 50/2 = 25, Z = -20
  • For Diameter 2 (end of the section): X = 50/2 = 25, Z = -40

Example (Milling):

Consider a rectangular block with a hole:

  • Block dimensions: 100 mm (X) x 50 mm (Y) x 20 mm (Z)
  • Hole center located at: X = 50 mm, Y = 25 mm, Z = -10 mm (assuming the top surface is Z=0)

The coordinate for the center of the hole would be (50, 25, -10).

Absolute Programming (G90)

In absolute programming, all tool movements are defined with respect to a fixed origin (zero point) of the coordinate system. Each coordinate specified in the program is an exact location in the machine's workspace.

Key Characteristics of Absolute Programming:

  • Coordinates are always relative to the machine's origin or a programmed workpiece origin.
  • Each block of code contains the full coordinates of the destination point.
  • It's easier to visualize the final tool path as each position is explicitly defined.
  • Errors in one block of code do not accumulate in subsequent movements. If a coordinate is wrong, only that specific movement will be incorrect.
  • Generally preferred for complex parts and when accuracy is critical.

G-code Example (Absolute Programming):

G-Code
G90 ; Select absolute programming mode
G00 X10.0 Y20.0 Z5.0 ; Rapid traverse to (10, 20, 5)
G01 X30.0 Y40.0 Z-2.0 F100 ; Linear interpolation to (30, 40, -2) at a feed rate of 100 mm/min
G02 X50.0 Y20.0 I10.0 J0.0 R20.0 F80 ; Circular interpolation clockwise to (50, 20) with center offset (10, 0) or radius 20
G00 Z5.0 ; Rapid retract in Z

In this example, each X, Y, and Z value represents the absolute position of the tool relative to the programmed origin.

Incremental Programming (G91)

In incremental programming, all tool movements are defined as a distance and direction from the current tool position. Each coordinate in the program specifies the change in position along the respective axis.

Key Characteristics of Incremental Programming:

  • Coordinates represent the distance and direction of movement from the previous point.
  • Each block of code describes a vector representing the tool's displacement.
  • Can be useful for repetitive patterns or small, relative movements.
  • Errors in one block of code can accumulate in subsequent movements. If a movement is programmed incorrectly, all subsequent relative movements will be offset.
  • Can be less intuitive to visualize the overall tool path compared to absolute programming.

G-code Example (Incremental Programming):

G-Code
G91 ; Select incremental programming mode
G00 X10.0 Y20.0 Z5.0 ; Rapid traverse by +10 in X, +20 in Y, +5 in Z from the current position
G01 X20.0 Y20.0 Z-7.0 F100 ; Linear interpolation by +20 in X, +20 in Y, -7 in Z from the current position
G02 X20.0 Y-20.0 I10.0 J0.0 R20.0 F80 ; Circular interpolation clockwise by +20 in X, -20 in Y with center offset +10 in X, 0 in Y (relative to the starting point of the arc) or radius 20
G00 Z5.0 ; Rapid retract by +5 in Z from the current position

In this example, the X, Y, and Z values indicate the amount of movement along each axis from the previous position.

Switching Between Absolute and Incremental Modes:

You can switch between absolute and incremental programming modes within the same program using the G-codes G90 (absolute) and G91 (incremental). It's good practice to explicitly define the desired mode at the beginning of your program.

Choosing Between Absolute and Incremental Programming:

  • Absolute programming (G90) is generally preferred for:

    • Complex part geometries.
    • Programs requiring high accuracy.
    • When it's important to easily understand and visualize the tool path.
    • Most common programming scenarios.
  • Incremental programming (G91) can be useful for:

    • Repetitive features or patterns where the relative distances are consistent.
    • Small, precise adjustments to the tool position.
    • Certain specialized machining cycles.

Understanding how to convert part dimensions into coordinate system points and the difference between absolute and incremental programming is crucial for writing effective and accurate CNC programs. By carefully considering the geometry of the part and the desired tool path, you can choose the most appropriate programming method for your application.

Comments