CNC Milling – Sub Program

Semester 6

A CNC milling job with a sub program on the Haas TM-1 vertical milling machine. Turn the 3D model, then study the drawing, tool, codes and program below.

3D Model

Drag to rotate · Scroll or pinch to zoom · Right-drag or two fingers to pan

Comments

    Loading comments…

    Please keep it friendly: no bad words or links.

    Engineering Drawing

    Engineering drawing of CNC Milling – Sub Program

    Tool & Machining Sequence

    This job uses one tool only. T1 mills round the profile, 0.25 mm deeper on each pass, until the step is 1 mm deep.

    1. 01. Profile Milling with a Sub Program

      Tool: T1 – Ø10 end mill, 4 flutes, coated (T1 M06)
      Work zero G54, no cutter radius compensation (G40), absolute (G90), mm (G21)
      Spindle: M03 S1500
      Coolant ON: M08
      Sub program N1 run four times: M97 P1 L4
      Each pass 0.25 mm deeper (G91 G01 Z-0.25) – 1 mm in all
      Cutter radius compensation left: G41 D01, off again with G40
      Feed: F300

    Coolant

    The coolant is soluble oil mixed with water. M08 switches it on and M09 switches it off.

    Why it looks like milk

    Soluble oil contains an emulsifier. When it is mixed into water, the oil breaks up into very small drops that stay spread through the water. These drops scatter the light, so the mixture turns milky white. This mixture is called an emulsion.

    What the coolant does

    • Cools: the water carries the heat away from the tool tip and the work, so the tool lasts longer and the size stays correct.
    • Lubricates: the oil reduces the friction between the chip and the tool, which gives a better surface finish.
    • Flushes: it washes the chips away from the cutting zone.
    • Stops rust on the work and the machine.

    G & M Codes

    The codes for this machine.

    Preparatory functions (G codes)

    G00
    Rapid positioning
    G01
    Linear interpolation
    G02
    Circular interpolation, clockwise (CW)
    G03
    Circular interpolation, counter-clockwise (CCW)
    G20
    Dimensions in inch
    G21
    Dimensions in mm
    G28
    Return to home
    G40
    No cutter radius compensation
    G41
    Cutter radius compensation – left
    G42
    Cutter radius compensation – right
    G54–G57
    Work zero (zero offset)
    G90
    Absolute dimensions
    G91
    Incremental dimensions

    Miscellaneous functions (M codes)

    M00
    Program stop
    M01
    Optional stop
    M02
    Program end without reset
    M03
    Spindle clockwise (CW)
    M04
    Spindle counter-clockwise (CCW)
    M05
    Spindle stop
    M06
    Tool change
    M08
    Coolant ON
    M09
    Coolant OFF
    M30
    Program end with reset
    M97
    Local sub program call
    M99
    Sub program return

    Other words

    N
    Sequence or block number
    T
    Tool selection
    S
    Spindle speed in rpm
    F
    Feed in mm/min
    R
    Radius of circle
    P
    Program line number (go to N…)
    L
    Repeats of the sub program call
    D
    Tool diameter offset number. The diameter is entered on the Offset page, in the Diameter column.

    CNC Milling Program & Simulation

    Press Play to run the program on the 3D plate: the end mill goes round the profile four times, 0.25 mm deeper each time, and the running block is highlighted. View brings the 3D view back to the start while the program goes on. Tap a cutting block to see it on the top view, or tap the top view to find its block.

    O00001
    G28
    T1 M06
    G54 G40 G90 G21
    M03 S1500
    M08
    G00 X-20 Y25
    G00 Z10
    G01 Z0 F100
    M97 P1 L4
    
    G00 Z10
    G28
    M09
    M05
    M30
    
    N1
    G91 G01 Z-0.25
    G90 G01 G41 X3 Y25 F300 D01
    G01 X3 Y42
    G01 X8 Y47
    G01 X37 Y47
    G02 X47 Y37 R10
    G01 X47 Y3
    G01 X3 Y3
    G01 X3 Y25
    G01 G40 X-20 Y25
    M99

    Operating the Machine

    Follow these cards in order – from switching on, through zero return, work offset and entering the program, to simulation and the actual run.

    ⚠ Do not operate the machine from this page alone – always work under the guidance of an instructor or an experienced person. We are not responsible for any loss, damage or injury that results from using this information.

    Safety first

    1. Wear safety shoes. No loose clothes; tie back long hair.
    2. Close the door before Cycle Start. Never open it or reach inside while the spindle is turning.

    Machine ON

    1. Compressor ON
    2. Main panel ON
    3. Stabilizer ON
    4. Select three phase (press Menu three times)
    5. Machine main power ON
    6. Power ON

    Note: the Menu button checks that all three phases have voltage. At switch-on the screen shows R–N 230 V; the first press shows Y–N 230 V, the second B–N 230 V and the third the three-phase condition OK.

    Running setup

    Alarm

    1. Reset (low air pressure)
    2. Reset (emergency)
    3. Reset (servo ON)

    Setting

    1. Page down
    2. Bring the cursor to line 51 – Safety override switch
    3. Write enter
    4. Y (to confirm) – the switch is now ON

    Zero return

    1. Zero return
    2. All
    3. Hand jog (twice)
    4. Select the axis (X, Y, Z)
    5. Select 0.1
    6. Turn the hand wheel (the table moves)

    Note: the first Hand jog press opens another page; the second opens the jog window. Only then can the axes be moved after zero return.

    Work offset

    1. Offset
    2. Work offset page – G54
    3. Bring the tool to position
    4. Part zero set (X, Y and Z together)

    Note: only one tool is used, so no tool length offset is taken. X, Y and Z are all set in G54.

    ⚠ Important: do not run the machine without taking the work offset.

    New program

    1. List program
    2. Left arrow key (into the directory)
    3. Type O and the 5-digit number
    4. Write enter
    5. MEM (to open the program)
    6. Edit (to change the program)

    Note: a new number shows New program and makes a new program. A number that already exists is marked with a star (*).

    Simulation

    1. MEM
    2. Home
    3. Setting (twice)
    4. Keep a hand on Reset and press Cycle Start
    5. F4
    6. Single block
    7. Keep a hand on Reset and press Cycle Start, until the program ends (M30)

    Note: Home takes the cursor to the first line of the program. In MEM, the first Setting press opens the settings page and the second the graphics window; outside MEM the machine shows a wrong-entry message.

    ⚠ Important: if the machine moves, press Reset.

    Running the program

    1. MEM
    2. Home (the cursor goes to the first line)
    3. Keep a hand on Reset and press Cycle Start

    ⚠ Important: if there is any movement that is not in the program, press Reset.

    Machine OFF

    1. Press the emergency stop
    2. Power OFF
    3. Machine main power OFF
    4. Stabilizer OFF
    5. Main panel OFF
    6. Compressor OFF

    Viva Questions

    Tick one answer for each question, then press Submit.

    1. What is the full form of CNC?
    2. Which motors move the axes (X, Y and Z) of a CNC machine?
    3. What does M97 do?
    4. In M97 P1 L4, what does L4 do?
    5. What does M99 do?

    Resources