Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "Virtual CNC machining & G-code Dept. of Mechanical Engineering The Hong Kong University of science and Technology."— 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 toolController NC codes Coordinates System parameters Control panel

4 Virtual CNC machining: Interactive operation 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 Set transparency View option Safety door can be open

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

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

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

8 Zero return: Virtual CNC machining: Controller operation Why Z-axis should be zero returned first?? 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

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

10 Handle : move x, y, z axes by rolling the wheel Virtual CNC machining: Controller operation 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 Rapid: To rapidly move X, Y, Z axes individually Virtual CNC machining: Controller operation 1. Click the Rapid operation mode 3. Select the movement speed 2. Choose the axis 4. Select the direction and move rapidly

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

13 MDI: Input NC blocks and execute in MDI mode Virtual CNC machining: Controller operation 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 MEM: Automatic execution mode Virtual CNC machining: Controller operation 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 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) Virtual CNC machining: Controller operation CW: Clockwise STOP: Stop rotating CCW: Counter-Clockwise Inc: Increase Speed Nor: Normal Speed Dec: Decrease Speed

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 1.Zero return Z-axis. 2.Load the workpiece 1 (if not). 3.Change to the cutter T3. 4.Choose Auto edge finding function. 5.The Auto edge finding window will be prompted. 6.Use JOG and Handle mode to Move the T3 cutter to the location X , Y , and Z , near the edge of workpiece. 7.Rotate the spindle by clicking CW. 8.Select X, click + to drive the cutter automatically to find the edge. 9.The cutter will stop moving when it sticks onto the edge. Virtual CNC machining: Automatic edge-finding

20

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

22 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. Virtual CNC machining: Over-travel alarm

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

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

25 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 Virtual CNC machining: Example 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. 1.Which function is activated in machine? 2.Where to move to? 3.How fast to move? 4.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 N1 M06 T1 ; Change to tool #1 Block Sequence # Miscellaneous code: Tool change Tool Number Comment Comment separator Sample Program Block

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 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 Introduction of G-code Terminology N00 G90 G01 X.5 Y.5 Z0 F1

30 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 Introduction of G-code Address character

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

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

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

34 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 Introduction of G-code Suggestions

35 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 Introduction of G-code Suggestions

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

37 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 Introduction of G-code Example 1- Absolute coordinates

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

39 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 Introduction of G-code Example 1 - Relative coordinates

40 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 Dept. of Mechanical Engineering The Hong Kong University of science and Technology."

Similar presentations


Ads by Google