Presentation is loading. Please wait.

Presentation is loading. Please wait.

Virtual CNC machining & G-code

Similar presentations


Presentation on theme: "Virtual CNC machining & G-code"— Presentation transcript:

1 Virtual CNC machining & G-code
Dept. of Mechanical Engineering The Hong Kong University of science and Technology

2 Outline Introduction of virtual CNC machining system
User interface Interactive operation Controller operation Example Introduction of G-code Terminology Address character Suggestions Examples

3 Part1: Virtual CNC machining
Machine tool Controller NC codes Coordinates System parameters Control panel

4 Virtual CNC machining: Interactive operation
View option Safety door can be open Set transparency Hold the left button: move left and right/ zoom in and zoom out Hold the middle button: move up and down Hold the right button: rotate

5 Virtual CNC machining: Interactive operation
Coolant pipe Press “L”, switch on/off the “light” Press ”S”, show/hide the “coolant pipe”

6 Default operation modes
Virtual CNC machining: Controller operation Hand wheel Home return light Emergency stop knob Over travel alarm Single block switch Default operation modes

7 Virtual CNC machining: Controller operation
MEM: To cycle start the NC codes simulation MDI: Manual Data Input that could be used to enter some NC blocks Zero RTN: To return to machine HOME positions of X, Y, and Z axes JOG: To move X, Y, Z axes individually Handle: To operate the virtual machine tool by the wheel of mouse Rapid: To rapidly move X, Y, Z axes individually Step: To move X, Y, Z axes stepwise

8 Virtual CNC machining: Controller operation
1. Click the “zero RTN” operation mode 2. Choose the “Z” axis in XYZ option 3. Click “zero return” button to initiate the Z-axis zero return 4. Next, zero return X-axis and Y-axis respectively Zero return: Why Z-axis should be zero returned first??

9 Virtual CNC machining: Controller operation
Jog: move x, y, z axes individually 1. Click the “JOG” operation mode 2. Choose the axis 3. Select the jog speed 4. Select the direction and jog

10 Virtual CNC machining: Controller operation
Handle : move x, y, z axes by rolling the wheel 1. Click the “Handle” operation mode 2. Choose the axis 3. Select the multiple 4. Roll the wheel of mouse to “handle” the axis

11 Virtual CNC machining: Controller operation
Rapid: To rapidly move X, Y, Z axes individually 1. Click the “Rapid” operation mode 3. Select the movement speed 2. Choose the axis 4. Select the direction and move rapidly

12 Virtual CNC machining: Controller operation
Step: To move X, Y, Z axes stepwise 1. Click the “Step” operation mode 2. Select the direction and move stepwise

13 Virtual CNC machining: Controller operation
MDI: Input NC blocks and execute in MDI mode 1. Click the “MDI” operation mode 0. Zero return Z-axis first! 2. Input your NC blocks here 3. Cycle start to execute NC blocks

14 Virtual CNC machining: Controller operation
MEM: Automatic execution mode 1. Click the “MDI” operation mode 2. Select the NC file 3. The NC code will be read and shown in the screen 4. Cycle start to execute NC blocks

15 Virtual CNC machining: Controller operation
Emergency stop Click this button for emergency stop. The execution will be stopped. Release the button to enable the controller again.

16 Virtual CNC machining: Controller operation
CW: Clockwise STOP: Stop rotating CCW: Counter-Clockwise Inc: Increase Speed Nor: Normal Speed Dec: Decrease Speed Spindle speed control: The rotation speed of spindle can be controlled by these six buttons, and also by S code (will be discussed in the following slides)

17 Virtual CNC machining: Tool exchange
There are 10 built-in milling cutters in the tool magazine. The related cutter dimensions and descriptions can be shown by selecting the “Tools” menu under the “Config” menu.

18 Virtual CNC machining: Tool exchange
3. Input tool exchange command, for example “M6 T10” 2. Choose MDI mode 4. Click Cycle Start to execute tool exchange 1. Zero return Z-axis first for too exchange

19 Virtual CNC machining: Automatic edge-finding
Zero return Z-axis. Load the workpiece 1 (if not). Change to the cutter T3. Choose “Auto edge finding” function. The “Auto edge finding” window will be prompted. Use JOG and Handle mode to Move the T3 cutter to the location “X ”, “Y , and Z , near the edge of workpiece. Rotate the spindle by clicking CW. Select “X”, click “+” to drive the cutter automatically to find the edge. The cutter will stop moving when it sticks onto the edge.

20 Virtual CNC machining: Automatic edge-finding
1 2 3 4 5 6 8 9 7

21 Virtual CNC machining: Manual edge-finding
Zero return Z-axis. Load the workpiece 1 (if not). Change to the cutter T5. Use JOG and Handle mode to Move the T5 cutter to the edge of the workpiece. The alarm on T5 will turn red as soon as it reaches the edge.

22 Virtual CNC machining: Over-travel alarm
The over-travel alarm will be shown when any one of the axes is moved out of its range. This alarm could be released by changing to JOG mode and move back to the permissible range.

23 Virtual CNC machining: Example
Dimension and profile of this workpiece

24 Virtual CNC machining: Example
Load the workpiece 1. Read the NC file “ex1.nc”. The G-code will be displayed onto the screen. Choose the MEM mode, and click “Cycle Start”. The tool path will be traced and shown onto the workpiece.

25 Virtual CNC machining: Example
G91 G28 Z0 G91 G28 X0 Y0 T10 M6 G90 G92 X Y Z G0 X0. Y10. Z10. M08 M03 S1000 G1Z-4. F910. X43. X51. Y Y39. X68. Y18. X90. Y90. X40. X18. Y68. Y47. X30. Y35. X10. X Y10. Z20. M09 M05 M30 G-Code of this example: WE WLLL DISCUSS THE DETAILS IN THE NEXT CHAPTER!!

26 Part2: Introduction of G-code
G-code is a common name for the most widely used numerical control (NC) programming language, it is a language in which people tell computerized machine tools what to do and how to do it. Which function is activated in machine? Where to move to? How fast to move? Through what path to move? Operate CNC machines Begin in the form of punch tape Develop into computer chips in the 1970s

27 Introduction of G-code
Sample Program Block N1 M06 T1 ; Change to tool #1 Block Sequence # Miscellaneous code: Tool change Tool Number Comment Comment separator

28 Introduction of G-code
Sample Program Block N02 M03 S1500; Turn spindle on at 1500 rpm Line Number Miscellaneous code: Turn spindle on Spindle Speed: 1500 rpm

29 Introduction of G-code
Terminology Block – A single line of code in an NC part program Word – The programming expression formed when a letter (address character) is combined with a number Address Character – A letter used in G & M code programming to designate a class of functions Parameter – Attribute of a feature for geometrical information, such as a dimension, that can be modified N00 G90 G01 X.5 Y.5 Z0 F1

30 Introduction of G-code
Address character N – Sequence or line number G – Preparatory function M – Miscellaneous function F – Feed rate (inches per minute or millimeters per minute) S – Spindle speed (rpm – revolutions per minute) T – Tool number X, Y, Z – Distance (Relative Coordinates) or position (Absolute Coordinates) in X, Y, Z direction I, J ,K – Circular cutting reference for X, Y, Z axis, respectively

31 Introduction of G-code
Preparatory: G Codes G90 : Absolute Coordinates G91 : Relative Coordinates G92: Programming of absolute zero point. G28: Move to Origin G00 : Rapid Traverse (non-cutting move) G01 : Straight Line Interpolation (cutting move) G02 : Circular Interpolation (clockwise) G03 : Circular Interpolation (counter-clockwise) G04 : Dwell (wait) G05 : Pause – Wait for user intervention

32 Introduction of G-code
Preparatory: G Codes X2Y1 X1Y2 R1 dy Absolute coordinates Example N001 G90 ; Absolute coordinates N002 G01 X1 Y2 ; start N003 G02 X2 Y1 R1; Circular Interpolation Relative coordinates Example N001 G91; Relative coordinates N002 G01 X1 Y2 ; start N003 G02 dx dy R1 ; Circular Interpolation dx

33 Introduction of G-code
Miscellaneous: M Codes M00 : Pause M01 : Sleep M03 /M04: Spindle on (CW/CCW). M05 : Spindle off M06 : Tool change M08 / M09 : Coolant on / off M10 / M11 : Vacuum on / off (Dust collection vacuum system turned on/off) M30 : Program end and reset

34 Introduction of G-code
Suggestions Same code is not required to be repeated every block, machine will use same code until changed Tab remarks away from code to facilitate troubleshooting program Specify absolute or relative coordinates and inch or metric modes at beginning of program Move tool to safe position away from material before tool change command; change tool if necessary Indicate spindle speed each time turned on

35 Introduction of G-code
Suggestions Move tool to start position in two lines First line moves in X-Y plane, then moves in Z axis (WHY?) Raise tool up to position out of the stock at end of program Always move table to safe unload position and turn spindle off at end of program Use M30 command to end program Answer: Prevents ramping or inadvertently cutting a part

36 Introduction of G-code
Example 1- Absolute coordinates Absolute coordinates

37 Introduction of G-code
Example 1- Absolute coordinates N0 G90 G20 ; ABSOLUTE COORD & INCH MODE N5 M06 T1 ; TOOL CHANGE – LOAD TOOL 1 N10 M03 S3000 ; TURN SPINDLE ON CW TO 3000 RPM N15 G00 X.5 Y.5 ; RAPID TO POINT A N20 G00 Z.1 ; RAPID TO .1 ABOVE PART N25 G01 Z F9 ; PLUNGE 1/16 AT 9 IN./MIN N30 G01 X.5 Y1.5 F18 ; STRAIGHT LINE INTERP TO B N35 G01 X.875 Y1 ; STRAIGNT LINE INTERP TO C N40 G01 X1.25 Y1.5 ; STRAIGHT LINE INTERP TO D N45 G01 X1.25 Y.5 ; STRAIGHT LINE INTERP TO E N50 G01 Z.1 ; RETRACT CUTTING TOOL N55 G00 X1.75 Y1.5 ; RAPID TO POINT F N60 G01 Z F9 ; PLUNGE AT 9 IN./MIN N65 G01 X1.75 Y.5 F18 ; STRAIGHT LINE INTERP TO H N70 G03 X1.75 Y1.5 I1.75 J1 ; CCW CIRCLE INTERPOLATION N75 G01 Z.1 ; RETRACT CUTTING TOOL N80 M05 ; TURN OFF SPINDLE N85 G00 Z2 ; RAPID Z TO SAFE POSITION N90 G00 X4 Y3 ; MOVE TABLE TO UNLOAD POSITION N95 M30 ; END OF PROGRAM

38 Introduction of G-code
Example 1 - Relative coordinates Relative coordinates

39 Introduction of G-code
Example 1 - Relative coordinates N00 G90 G20 ; ABSOLUTE COORD & INCH MODE N5 M06 T1 ; TOOL CAHNGE – LOAD TOOL 1 N10 M03 S3000 ; TURN SPINDLE ON CW TO 3000 RPM N15 G00 X.5 Y.5 ; RAPID TO POINT A N20 G00 Z.1 ; RAPID TO .1 ABOVE POINT A N25 G91 ; INCREMENTAL COORD & INCH MODE N30 G01 Z F9 ; PLUNGE 1/16 AT 9 IN./MIN N35 G01 X0 Y1 F16 ; STRAIGHT LINE INTERP TO B N40 G01 X.375 Y-.5 ; STRAIGHT LINE INTERP TO C N45 G01 X.375 Y.5 ; STRAIGHT LINE INTERP TO D N50 G01 X0 Y-1 ; STRAIGHT LINE INTERP TO E N55 G01 Z.1625 ; RETRACT CUTTING TOOL N60 G00 X.5 Y1 ; RAPID TO POINT F N65 G01 Z F9 ; PLUNGE AT 9 IN./MIN N70 G01 X0 Y-1 F16 ; STRAIGHT LINE INTERP TO H N75 G03 X0 Y1 I0 J.5 ; CCW CIRCLE INTERP N80 G01 Z.1625 ; RETRACT CUTTING TOOL N85 M05 ; TURN OFF SPINDLE N90 G90 ; CHANGE TO ABSOLUTE COORD N95 G00 Z2 ; RAPID Z TO SAFE POSITION N100 G00 X4 Y3 ; MOVE TABLE TO UNLOAD POSITION N105 M30 ; END OF PROGRAM

40 Ellipsis: Use the previous parameters
Introduction of G-code Example 2 – The previous example G91 G28 Z0 G91 G28 X0 Y0 M6 T10 G90 G92 X Y Z G0 X0. Y10. Z10. M08 M03 S1000 G1 Z-4. F910. X43. X51. Y Y39. X68. Y18. X90. Y90. X40. X18. Y68. Y47. X30. Y35. X10. X Y10. Z20. M09 M05 M30 Ellipsis: Use the previous parameters Can you explain the code in red?

41 End of tutorial Thank you!


Download ppt "Virtual CNC machining & G-code"

Similar presentations


Ads by Google