Professional Documents
Culture Documents
Compiled by Paul Briozzo School of Aerospace, Mechanical & Mechatronic Engineering University of Sydney 2014
Contents
CNC Machining / Manufacturing Processes: Chapter 1 CNC Machining: Writing CNC code Chapter 2 Forces in Machining Chapter 3 Fundamentals of Casting Chapter 4 Welding Chapter 5 Powder Metallurgy Chapter 6 Metal Forming References Manufacturing Automation: Chapter 1 Blood Pressure Monitoring Case Study Chapter 2 LabVIEW Enviroment Basics Chapter 3 Graphical Programming Chapter 4 Common LabVIEW Tools Chapter 5 Debugging Tools in NI LabVIEW Chapter 6 Data Structures in NI LabVIEW Chapter 7 Execution Structures in NI LabVIEW Chapter 8 Passing Data Between Loop Iterations in LabVIEW Chapter 9 Handling Errors in NI LabVIEW Chapter 10 Finding Examples for NI LabVIEW Chapter 11 LabVIEW Help Options Chapter 12 NI Vision Builder for Automated Inspection
Preface
The MECH3660 5660 students of 2014 are thanked for their enthusiasm for the subject and their support. The keenness and dedication of the students since 2010 towards the Clubman Laboratory is always humbling. 2014 sees the introduction of the Motoman robot as part of the CNC Mill Lab that Mr. Greg Riviera has run for over ten years. Manufacturing Engineering is a very broad subject that is ever changing. You will be provided with additional notes as the semester progresses.
Aims
The aim of the CNC machining part of MECH3660 / MECH5660 is to give students a basic introduction into numerically controlled machine tools such as the Mori Seiki NV4000 mill that are used in practice for producing real products. If each student gains some understanding and feel (and perhaps some enthusiasm!) for this area of manufacturing then the main aim of this component has been largely achieved.
Overview
The topic that students will consider in Manufacturing Engineering MECH3660 / MECH5660 for 2014 is a connecting rod. During semester there will be lectures and tutorials that will concentrate on providing you with the information and time that you will need to produce CNC code for the manufacture of the connecting rod. Some emphasis will also be placed on material removal rates and the forces generated during the machining process. Some basic coverage of rapid prototyping and the kinematics of CNC machines will also be presented as will an appreciation of the precision, accuracy and repeatability of CNC machines.
Figure 1.0
Mori Seiki NV4000 mill System Specifications (Basic-Mechanical)
Table size:..700.0mm x 450.0mm Throat depth:..139.7mm Travel (X Axis):.600.0mm Travel (Y Axis):.400.0mm Travel (Z Axis):.400.0mm Feed rates:..1.0mm to 6000.0mm/min Accuracy:...+/- 0.001mm Spindle speed range:..1 to 12,000 RPM Hold down provision:....Pneumatic air vice and conventional T-Slots Motor - Spindle:11kW (continuous) Motor - Feed:.X:1.6kW x 2, Y:1.6kW x 2, Z:3.0kW x 2 Power requirements...27.4kVA
Writing a Program
A part-program consists of lines of code, each comprising one block and each representing the next location of the tool centre point along the tool path. Traditionally, a line of code begins with a block number, N, followed by a G-code, indicating a geometric motion by the tool, or an M-code, representing a machine function such as turning the spindle on. The Mori Seiki mill does not require block numbers except when you need to reference back to a particular point on the program. Each line of a program has a standard form with variations according to the particular motion required for the tool and the corresponding machine codes used. Referring to Figure 1.1 and the sample code is included below;
Figure 1.1
Sample code N0 M03 N1 G90 N2 G00 X17.1 Y18.0 Z1.0 N3 G01 Z-5.0 F70.0 N4 G01X82.9 Y32.0 F170.0 N5 G00 Z50.0 N6 M05 N7 M02 Comments (set spindle on) (in absolute co-ordinates) (move rapid to next position (17.1 18.0 1.0)) (move tool down (-Z) 5mm at a feed rate of 70mm/min) (move tool to position (82.9 32.0) at a feed rate of 170mm/min) (rapid feed the tool up (+Z) 50.0mm) (spindle motor off) (end of program)
Feed rates, shown by an F-code, will appear in conjunction with a G01, G02 or G03 code. Most Gcodes are followed immediately by X, Y and Z values to show the next physical position of the tool centre. There is in every program an arbitrary point, called the "program zero", chosen by the partprogrammer, to which all co-ordinates are referred, whether absolute or incremental values. This point is not referred to in the program, but is implied by the co-ordinates of the tool path. The location of this zero point has to be communicated to the machine operator using a drawing of the part and of the blank as it appears before any machining is done. N.B. For ease of setting up, and checking that the program does not send the tool into the machine table, the "program zero" should always be
IN THE MIDDLE & AT THE TOP SURFACE OF THE BLANK If a program is already stored on a USB stick, it may be read into the memory of the controller and run. In every case, the program zero, the point from which every co-ordinate dimension is measured, is lost if the machine is shut down. For this reason, the program zero position should be set up at the start of each session. The program contained on your USB stick and the machine settings are always independent. If a co-ordinate is not specified in a line of program, as Z is not in the last example, then the previous value of Z is used. These are 'retained' or 'modal' values until they are changed by another line of program. Some G-codes behave similarly e.g. G90, G91, G01 and G02. Every command code stays effected until cancelled.
Co-ordinate System
The system of axes arranged in the Mori Seiki NV4000, and most milling machines of this type, is that the Z-axis is along the spindle axis (vertically upwards), the X-axis is in the largest slide direction (to the right) and the Y-axis is from the front to the back of the table. These axes are determined by the right-hand-screw direction. This means that looking from the top down onto the table, the X-axis is due east, the Y-axis is due north and the Z-axis is towards you. These directions are set so that the motion of the tool relative to the table is called positive when it moves in the positive X or Y or Z directions. Note that in actual fact it may be the table that is moving while the tool may be stationary, but the RELATIVE motion between the two is as described above.
Absolute dimensions
Each position for the tool is specified by giving its X, Y or Z co-ordinates with respect to a 'program zero' point. On the machine, when the program is run, the 'program zero' is set by the operator according to written instructions supplied by the programmer. When absolute co-ordinates are used the X, Y or Z values are always relative to this zero position, irrespective of where the tool is at any given time. Absolute co-ordinate mode is programmed by the G90 code. You may like to refer to Figures 1.2a and 1.2b to clarify this point.
Figure 1.2a
Typical example segments of programs that use G90 and G91 commands
Figure 1.2b
Typical example segment of a program that uses both G90 and G91 commands
Spindle Speeds
The relative hardness of the material and the type of cutting tool affect spindle speed. The harder the material is, the slower the speed should be. The load put on the spindle motor must also be taken into account. Heavy cuts at low speeds will make the motor run hotter than lighter cuts at higher speeds. The selected feed rate and the depth of cut should not cause the spindle motor to greatly lose speed or cause the tool to chatter against the job. The machinist usually sets the spindle speed however an approximate guide is given in a later part of these notes.
Down-cut milling
Rapid traverse will move the tool at the maximum available feed rate: on the X and Y-axis, on the Z-axis. Rapid traverse is used to reposition the tool in preparation for the next cut, or before ending a program. Rapid traverse can be used for all tool-positioning motions to reduce run time for the part program. The G00 code remains in effect until linear (G01) or circular (G02, G03) interpolation is specified. Linear or circular interpolation will resume at the feed rate last specified prior to the rapid traverse motion unless a new feed rate is specified. Rapid traverse is never used for cutting.
G01
Linear interpolation
Linear interpolation is the movement of the tool in a straight line from its current position to a coordinate location specified in a CNC block. Referring to Figure 1.4 and the sample G code, Sample code Comments N0 M03 (set spindle on) N1 G90 (in absolute co-ordinates) N2 G00 X7.1 Y7.1 Z1.0 (move rapid to next position (7.1 7.1 1.0)) N3 G01 Z-11.0 F70.0 (move tool down (-Z) 11mm at a feed rate of 70mm/min) N4 G01 X39.4 Y39.4 F170.0 (move tool to position (39.4 39.4) at a feed rate of 170mm/min) N5 G00 Z50.0 (rapid feed the tool up (+Z) 50mm for clearance) N6 M05 (spindle motor off) N7 M02 (end of program)
Figure 1.4
10
G02 Circular interpolation (clockwise) G03 Circular interpolation (counter-clockwise) Circular interpolation moves the cutting tool along an arc from the starting point to an end-point specified in the CNC block. The curvature of motion is determined by the location of the arcs radius (R), which must be specified in the same CNC block. The direction of rotation from the starting point determines the actual shape of the arc relative to the spindle axis. A G02 code moves the tool in a clockwise (CW) motion from the starting point; a G03 code moves the tool in counter-clockwise (CCW) motion from the starting point. Referring to Figure 1.5 plus the sample G codes and explanations in Figure 1.6 illustrate these points more clearly. Start Point StartPoint
CW
End Point
CCW
End Point
Figure 1.5
Figure 1.6
G90 G01 X28.0 Y0.0 F50.0 G01 Y20.0 G03 X18.0 Y30.0 R10.0 G01 X-8.0 G02 X-28.0 Y10.0 R20.0 G01 Y-10.0 G02 X-8.0 Y-30.0 R20.0 G01 X18.0 G91 G03 X10.0 Y10.0 R10.0 G90 G01 Y0.0 (ABSOLUTE) (REGION 1) (REGION 2) (REGION 3 (a)) (REGION 4) (REGION 5 (b)) (REGION 6) (REGION 7 (c)) (REGION 8) (INCREMENTAL) (REGION 9 (d)) (ABSOLUTE) (REGION 1(e))
11
G17 Select the XY Plane Using G17 indicates that you are intending to work in the XY plane. All work in this course is based around the XY plane. For reference, G18 refers to the XZ plane and G19 refers to the YZ plane. G28 Return the Axes to the Machine Zero Point Returns the machine to its home position in preparation for a tool change. A G91 (incremental mode) modal command must precede the G28 command. Also note that a G90 (absolute mode) modal command must be initiated before machining takes place. G40 Cancel Cutter Compensation Cutter compensation is used by professional CNC machinists as a finishing cut to a CNC project. It is usually used in conjunction with the cutter compensation commands G41 (cutter radius offset to the left) and G42 (cutter radius offset to the right). In this course we do not use G41 or G42 commands as they are tool specific commands and require more experience and understanding than we are able to provide in the time available. You may r the less please refer to the figure below for an appreciation of their use.
G43 Tool Length Compensation Reference to the Suttons Tool catalogue in your notes illustrates that tool length varies with tool size and type (even short or long series within the same type). The G43 allows compensation for the tool that you have nominated in the Z axis for the tool you have nominated. This command ties in closely with H command.
12
G54 Work Coordinate System1 Select The G54 command moves the coordinate system from the machines coordinate system (usually located on one of the machines corners) to the working area.
Machine Coordinate System G80 Cancel Canned Cycle Some routines such as hole drilling cycles are modal. i.e. they remain active until turned off. When completing a canned cycle or in your case for good practice, you must ensure that any canned cycles are cancelled before your program can proceed.
13
14
M08 Coolant On M09 Coolant Off Turns the coolant on and off as required.
M19 Spindle Orientation ON Turns on the feature which allows alignment of a rotating spindle in preparation for a tool change. Not always required if a M06 tool change command is used but is included for completeness. M30 End of Program and Rewind The M command M30 is similar to a M02 Program End. However G30 allows easier repetition of the same program by pressing one button on the control panel. H Command The H command calls up a predetermined height offset for the particular tool that you have nominated. In our configuration if you are using T1 then you should specify H1 as your height offset. The H commands have been numbered to correlate with the tool numbers. The H values for our pump project have been entered into the Mori Seiki controller memory by the operator beforehand. T Commands Although the T command is not part of the header they are a requirement of any program. The T command rotates the tool carousel into the required position in anticipation of a tool change. Please note that the command does not perform the tool change. The following tools available to you and their relevant T number are listed below for your reference. T1 - 3mm Long Series Slot Drill T2 - 5mm Long Series Slot Drill T3 - 5.1mm Long Series Drill T4 - 10mm Long Series Slot Drill Use the appropriate T number for your program. S Command The S command specifies the spindle speed. The Mori Seiki MV4000 is capable of spindle speeds ranging from 0-12,000 RPM. In the sample program given, a nominal value of 12,000 RPM has been specified. In your code it would be advisable if you could use the same value. If the required value differs from what you have specified. The operator will adjust the spindle speed either by editing your code or manually controlling the spindle speed override knob on the control panel.
15
Figure 1.7
Figure 1.8
The example in Figure 1.7 shows the X and Y plane on top of the object. Figure 1.8 shows the orientation of the positive and negative axis relative to (0,0,0). The Z-axis is positive out of the page. This axis convention is referred to as the right-hand rule. The tools movement in the Z-axis will be mainly to lift and clear the tool as it moves to the next cutting region.
16
17
Figure 1.9
Figure 1.9 is a subset of the drawing included in Figure 1.7. Figure 1.9 has been redimensioned with all of the dimensions, which describe the positions of the holes based from program zero, (0,0,0). This figure has been included to give a clearer picture of where all of the holes are located relative to the home position in the XY plane and the path that the cutting tool will take. The lines of code listed below represent the CNC code instructions as per the comments described in points 1 through to 7 of the Operation Plan on the previous page. N1 M03 N2 G90 N3 G00 X92.5 Y-5.0 Z1.0 N4 G01 Z-10.0 F70.0; N5 G00 Z1.0; N6 G00 X27.5 Y45.0; N7 G01 Z-10.0 F70.0; N8 G00 Z1.0; N9 G00 X-18.0 Y45.0; N10 G01 Z-10.0 F70.0; N11 G00 Z1.0; N12 G00 X-88.5 Y-45.0; N13 G01 Z-10.0 F70.0; N14 G00 Z1.0; N15 G00 X92.5 Y-45.0; N16 G01 Z-10.0 F70.0; N17 G00 Z1.0; (spindle on) (in absolute co-ordinates) (rapid traverse to hole 1-stopping 1mm above the job) (feed tool down (-Z) 11mm at a feed rate of 70mm/min) (rapid traverse up (+Z) 1mm) (rapid traverse to the location of hole 2) (feed tool down (-Z) 11mm at a feed rate of 70mm/min) (rapid traverse up (+Z) 1mm) (rapid traverse to location of hole 3) (feed tool down (-Z) 11mm at a feed rate of 70mm/min) (rapid traverse up (+Z) 1mm) (rapid traverse to the location of hole 4) (feed tool down (-Z) 11mm at a feed rate of 70mm/min) (rapid traverse up (+Z) 1mm) (rapid traverse to the location of hole 5) (feed tool down (-Z) 11mm at a feed rate of 70mm/min) (move tool up (+Z) 1mm at rapid traverse)
18
Figure 1.10
Figure 1.10 is a subset of the drawing included in Figure 1.7. It is included to give a clearer picture of the outside profile relative to the home position in the XY plane and the path that the cutting tool will take. The cutting tool begins cutting the profile at the bottom left hand corner nearest to hole 5. This location is chosen because it is closest to where the tool finished drilling all of the holes. Hence the tool has less distance (and consequently time) to travel to its next cutting position. The lines of code listed below represent the CNC code instructions as per the comments described in points 8 through to 13 of the Operation Plan. The code is a continuation from the previous page. N18 G00 X112.5 Y-65.0 N19 G01 Z-10.0 F70.0 N20 G01 Y-5.0 F170.0 N21 G03 X92.5 Y15.0 R20.0 N22 G01 X57.5 N23 G02 X47.5 Y25.0 R20.0 N24 G01 Y45.0 N25 G03 X27.5 Y65.0 R20.0 N26 G01 X-18.0 N27 G03 X-33.77 Y57.33 R20.0 N28 G01 X-108.25 Y-37.85 N29 G03 X-112.5 Y-50.17 R20.0 N30 G01 Y-65.0 N31 G01 X112.5 N32 G00 Z1.0 N33 G00 X0.0 Y0.0 Z25.0 N34 M05 N35 M02 (rapid traverse to bottom left corner) (offsetting 5mm for the 10mm tool diameter) (feed tool down (-Z) 11mm at a feed rate of 70mm/min) (feed tool towards radius at a feed rate of 170mm/min) (feed tool cclockwise with a 20mm radius turn) (feed tool towards next position) (feed tool clockwise with a 20mm radius turn) (feed tool towards next position) (feed tool cclockwise with a 20mm radius turn) (feed tool towards next position) (feed tool cclockwise with a 20mm radius turn) (the end point of the radius could be found by using trig) (feed tool towards next position) (feed tool cclockwise with a 20mm radius turn) (feed tool towards next position) (feed tool towards next position) (rapid traverse up (+Z) 11mm) (move tool to (0.0,0.0,25.0) to allow tool removal) (spindle motor off) (end of program)
19
N150 G90G80G40G17G94G00 (G90=ABSOLUTE PROGRAMMING, G80=CANCEL CANNED CYCLE, G40=CANCEL CUTTER COMP, G17=XY PLANE, G94=FEED PER MINUTE, G00=RAPID TRAVERSE) N160 G91G28Z0 (G91=INCREMENTAL PROGRAMMING, G28=RETURN TO MACHINE HOME ON "Z" AXIS FIRST) N170 G91G28Y0 (INCREMENTAL PROGRAMMING, RETURN TO MACHINE HOME ON "Y" AXIS SECOND) N180 T? N190 N200 N210 N220 M06 N230 M01 N240 S12000 N250 M03 N260 M08 N270 G90 N280 G54 N290 N300 G00 X?.?? Y?.?? (Select either T1=3mm Dia. Long Series Slot Drill) (or T2=5mm Dia. Long Series Slot Drill) (or T3=5.1mm Dia. Drill) (or T4=10mm Dia. Long Series Slot Drill) (TOOL CHANGE) (OPTIONAL STOP FOR INSPECTION/MEASUREMENT) (SPINDLE SPEED 12000 RPM) (SPINDLE MOTOR ON CW) (COOLANT ON) (ABSOLUTE PROGRAMMING) (WORK COORDINATE SYSTEM 1 SELECTED) (ENSURE ALL MACHINE COORDINATE VALUES HAVE A DECIMAL POINT eg. X2.32) (RAPID TRAVERSE TO FIRST X AND Y COORDINATES)
N310 G43 Z50.0 H? (G43=TOOL LENGTH COMPENSATION POSITIVE H?=HEIGHT OFFSET # ON SAME LINE AS FIRST "Z" RAPID MOVEMENT) N320 G00 Z15.0 N330 N340 G01 Z-?.? F70 N350 G01 X?.? Y?.? F170 N360 G01 Z-12.3 F70.0 OR N370 G01 Z-10.3 F70.0 OR N380 G01 Z-20.3 F70.0 N390 G00 Z50.0 N400 M09 N410 M05 N420 G91G28Z0 N430 G91G28Y0 N440 N450 M30 (RAPID TRAVERSE TO 15MM ABOVE Z0) (MACHINING OPERATIONS-INSERT YOUR CNC MACHINING CODE IN HERE AND RENUMBER) (LINEAR INTERPOLATION TO Z COORDINATE AT PLUNGE FEEDRATE 70mm/MIN) (LINEAR INTERPOLATION TO X AND Y COORDINATES AT FEEDRATE 170mm/MIN) (PLUNGE DISTANCE AND FEEDRATE mm/min FOR PENERATION THROUGH CIRCULAR JOB) (PLUNGE DISTANCE AND FEEDRATE mm/min FOR PENERATION THROUGH 10mm LID JOB) (PLUNGE DISTANCE AND FEEDRATE mm/min FOR PENERATION THROUGH 20mm BASE JOB) (RAPID TRAVERSE TO 50.00mm ABOVE Z0.0 MOVES TOOL AWAY FROM JOB) (COOLANT OFF) (SPINDLE MOTOR OFF) (INCREMENTAL PROGRAMMING, RETURN TO MACHINE HOME ON "Z" AXIS FIRST) (INCREMENTAL PROGRAMMING, RETURN TO MACHINE HOME ON "Y" AXIS SECOND) (RETURN TO MACHINE HOME ON "X" AXIS NOT REQUIRED) (END OF PROGRAM)
20
21
22
23
24
25
26