[go: up one dir, main page]

0% found this document useful (0 votes)
34 views4 pages

Study of Dimensioning Methods

This document outlines a practical exercise focused on CNC programming for turning and milling operations, including the use of simulators to test G-code programs. It details the steps for writing G-code for both a lathe and a milling machine, along with simulation procedures and common commands used in CNC controllers. The practical aims to enhance understanding of CNC programming principles and the importance of simulation in ensuring program accuracy and safety.

Uploaded by

lap.desk.25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views4 pages

Study of Dimensioning Methods

This document outlines a practical exercise focused on CNC programming for turning and milling operations, including the use of simulators to test G-code programs. It details the steps for writing G-code for both a lathe and a milling machine, along with simulation procedures and common commands used in CNC controllers. The practical aims to enhance understanding of CNC programming principles and the importance of simulation in ensuring program accuracy and safety.

Uploaded by

lap.desk.25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Practical No.

4: Program Writing - Turning Simulator & Milling


Simulator, IS Practice, and Commands Menus
This practical focuses on the hands-on application of CNC programming principles by writing
and simulating programs for both turning (lathe) and milling machines. We will also explore the
commands and menus commonly found in modern CNC controllers and simulators, adhering to
industry standards.

1. Introduction to CNC Simulation


A CNC simulator is a software application that mimics the operation of a real CNC machine. It
allows a programmer to test their G-code and M-code programs in a virtual environment before
running them on a physical machine. This is a critical step for verifying program logic, detecting
errors, and preventing machine crashes.

Advantages of using a Simulator:

●​ Safety: Eliminates the risk of damaging the machine, tools, or workpiece.


●​ Cost-effective: Reduces material waste and tool wear.
●​ Efficiency: Speeds up the program development and testing cycle.
●​ Training: Provides a safe and effective learning platform for new programmers.

2. Program Writing for Turning (Lathe Simulator)


We will write a simple G-code program to turn a cylindrical workpiece. The goal is to perform a
facing operation (making the end flat) and a simple turning operation to reduce the diameter of
the workpiece.

a) Program Specifications

●​ Workpiece: Cylindrical bar, \\phi50 mm diameter, 100 mm long.


●​ Material: Mild steel.
●​ Final Part: \\phi40 mm diameter, 80 mm long.
●​ Tool: A standard turning tool (T01).

b) G-Code Program

%​
O0001 (PRACTICAL_4_TURNING)​

N10 G21 G90 G40 G99 ; (Metric, Absolute, Tool Comp Cancel, Feed per
Rev)​
N20 G28 U0 W0 ; (Return to machine home)​

N30 T0101 ; (Select tool 1, offset 1)​
N40 M03 S1500 ; (Spindle ON, 1500 RPM, clockwise)​
N50 G00 X52.0 Z2.0 ; (Rapid move to a safe position)​

N60 G71 U1.0 R0.5 ; (Roughing cycle: depth of cut 1mm, retract 0.5mm)​
N70 G71 P80 Q100 U0.2 W0.1 F0.2 ; (Roughing cycle: start/end block,
finish allowance)​
N80 G00 X40.0 Z-2.0 ; (Profile start point)​
N90 G01 Z-80.0 F0.2 ; (Turn to final length)​
N100 G01 X50.0 F0.2 ; (Chamfer or relief cut)​
N110 G01 Z-82.0 F0.2 ; (Return to a safe position)​

N120 G00 X100.0 Z100.0 ; (Rapid move to clear)​
N130 G28 U0 W0 ; (Return to machine home)​

N140 M05 ; (Spindle OFF)​
N150 M30 ; (Program End and Rewind)​
%​

c) Simulation Steps

1.​ Open the CNC turning simulator software. (e.g., Fanuc, Haas, or third-party simulators
like Cimco, NC-Editor).
2.​ Set up the machine and workpiece. Define the dimensions of the raw material
(\\phi50x100) and the tool.
3.​ Load the G-code program. Copy the code above into the program editor.
4.​ Verify and simulate. Run the simulation in "single-block" or "auto" mode. Observe the
tool path, material removal, and final shape. Check for any collisions or errors.

3. Program Writing for Milling (Milling Simulator)


We will write a simple G-code program to mill a rectangular pocket into a block of material.

a) Program Specifications

●​ Workpiece: Rectangular block, 100 x 100 x 20 mm.


●​ Pocket: 40 x 40 mm, 5 mm deep, centered on the block.
●​ Tool: 10 mm diameter end mill (T01).

b) G-Code Program

%​
O0002 (PRACTICAL_4_MILLING)​

N10 G21 G90 G40 G49 G80 ; (Metric, Absolute, Tool Comp Cancel, Tool
Length Comp Cancel, Canned Cycles Cancel)​
N20 M06 T01 ; (Tool change to tool 1)​
N30 G00 G90 X0 Y0 Z10 ; (Rapid move to G54 origin, 10mm above part)​
N40 G00 Z-5.0 ; (Rapid move 5mm below part, for safety)​
N50 G00 G54 X-20.0 Y-20.0 Z2.0 ; (Rapid move to pocket start point)​

N60 M03 S2000 ; (Spindle ON, 2000 RPM, clockwise)​
N70 G01 Z-5.0 F100 ; (Plunge into the material)​

N80 G01 X20.0 F200 ; (Cut along X axis)​
N90 G01 Y20.0 F200 ; (Cut along Y axis)​
N100 G01 X-20.0 F200 ; (Cut along -X axis)​
N110 G01 Y-20.0 F200 ; (Cut along -Y axis, completing the square)​

N120 G00 Z10.0 ; (Rapid move up to clear the workpiece)​
N130 M05 ; (Spindle OFF)​
N140 G28 G91 Z0.0 ; (Return to machine Z home position)​
N150 G28 G91 X0.0 Y0.0 ; (Return to machine X,Y home position)​
N160 M30 ; (Program End and Rewind)​
%​

c) Simulation Steps

1.​ Open the CNC milling simulator software.


2.​ Set up the workpiece. Define the block dimensions (100x100x20).
3.​ Set up the tool. Define the tool diameter (10 mm) and length.
4.​ Load the G-code program.
5.​ Simulate the program. Observe the tool plunging and cutting the pocket. Use the
simulator's measurement tools to verify the final pocket dimensions.

4. IS Practice and Commands Menus


Modern CNC controllers and simulators follow an intuitive, menu-driven interface to manage
various machine functions. Understanding these menus is essential for practical operation.

a) Common Menu and Screen Features

●​ Program Manager/Editor: Allows creation, editing, loading, and saving of G-code


programs.
●​ Offset Screen: This is where tool length offsets (H codes) and diameter compensation
offsets (D codes) are set. Tool length offset compensates for the different lengths of
tools, ensuring the Z-axis position is always relative to the workpiece. Tool diameter
offset compensates for the tool's radius, allowing the programmer to program the part's
geometry directly.
●​ Position Screen: Displays the current position of the machine's axes in both absolute
(relative to the program origin) and machine coordinates (relative to the machine's home
position).
●​ MDI (Manual Data Input): Allows the operator to enter and execute single lines of
G-code or M-code commands directly, without a full program. This is useful for simple
tasks like jogging the tool or turning the spindle on/off.
●​ Jog Mode: Allows manual movement of the machine's axes using a joystick or arrow
keys.
●​ Handwheel (MPG - Manual Pulse Generator): A physical or virtual dial that allows
precise, incremental movement of the axes.
●​ Setup/Settings Menu: Contains machine-specific settings, such as units (inch/mm),
homing procedures, and safety parameters.

b) G-Code/M-Code in Practice

●​ G54 (Work Coordinate System): Before starting a program, the operator uses G54 (or
G55, G56, etc.) to set the program's origin (X0, Y0, Z0) relative to a specific point on the
workpiece. This is a critical step for aligning the program with the physical part.
●​ M06 (Tool Change): A program line like M06 T01 commands the machine to automatically
change the tool. The T value specifies which tool from the magazine to select.
●​ S (Spindle Speed): The S command, e.g., S2000, is used with M03 or M04 to set the
spindle speed in revolutions per minute (RPM).
●​ F (Feed Rate): The F command sets the feed rate, which is the speed at which the cutting
tool moves through the material. In turning, it's often in millimeters per revolution (G99
F0.2), and in milling, it's typically in millimeters per minute (G98 F200).
This practical exercise provides a solid foundation for writing, simulating, and understanding the
practical application of CNC programs, which is essential for any professional in a
manufacturing or machining environment.

You might also like