200 likes | 378 Views
CNC Machine Language. گرد آورنده: بابک دلخون. delkhoon@gmail.com. CNC Machine Language. G-Code.
E N D
CNC Machine Language گرد آورنده: بابک دلخون delkhoon@gmail.com
G-Code • G-Code is one of a number of computer code languages that are used to instruct CNC machining devices what motions they need to perform such as work coordinates, canned cycles, and multiple repetitive cycles. Industry has standardized on G-Code as its basic set of CNC machine codes.
G-Code is the most popular programming language used for programming CNC machinery. Some G words alter the state of the machine so that it changes from cutting straight lines to cutting arcs. Other G words cause the interpretation of numbers as millimeters rather than inches. Some G words set or remove tool length or diameter offsets.
There are other codes; the type codes can be thought of likeregiesterin a computer • X absolute position • Y absolute position • Z absolute position • A position (rotary around X) • B position (rotary around Y) • C position (rotary around Z) • U Relative axis parallel to X)
V Relative axis parallel to Y • W Relative axis parallel to Z • M code (another "action" register or Machine code(*))(otherwise referred to as a "Miscellaneous" function" • F feed rate • S spindle speed • N line number • R Arc radius or optional word passed to a subprogram/canned cycle • P Dwell time or optional word passed to a subprogram/canned
T Tool selection • I Arc data X axis • J Arc data Y axis. • K Arc data Z axis, or optional word passed to a subprogram/canned cycle • D Cutter diameter/radius offset • H Tool length offset
Below is a complete listing of current codes • G00Rapid Linear Interpolation • G01Linear Interpolation • G02Clockwise Circular Interpolation • G03Counter Clockwise Circular Interpolation • G04Dwell • G05High Speed Machining Mode • G10Offset Input By Program
G12Clockwise Circle With Entrance And Exit Arcs • G13Counter Clockwise Circle With Entrance And Exit Arcs • G17X-Y Plane Selection • G18Z-X Plane Selection • G19Y-Z Plane Selection • G28Return To Reference Point • G34Special Fixed Cycle (Bolt Hole Circle)
G35Special Fixed Cycle (Line At Angle) • G36Special Fixed Cycle (Arc) • G37Special Fixed Cycle (Grid) • G40Tool Radius Compensation Cancel • G41Tool Radius Compensation Left • G42Tool Radius Compensation Right • G43Tool Length Compensation
G44Tool Length Compensation Cancel • G45Tool Offset Increase • G46Tool Offset Decrease • G50.1Programmed Mirror Image Cancel • G51.1Programmed Mirror Image OnG52Local Coordinate Setting • G54 - G59Work Coordinate Registers 1 Thru 6 • G60Unidirectional Positioning • G61Exact Stop Check Mode
G65Macro Call (Non Modal) • G66Macro Call (Modal) • G68Programmed Coordinate Rotation G69Coordinate Rotation Cancel • G73Fixed Cycle (Step) • G74Fixed Cycle (Reverse Tapping) • G76Fixed Cycle (Fine Boring) • G80Fixed Cycle Cancel • G81Fixed Cycle (Drilling / Spot Drilling) • G82Fixed Cycle (Drilling / Counter Boring) • G83Fixed Cycle (Deep Hole Drilling) • G84Fixed Cycle (Tapping) • G85Fixed Cycle (Boring)
G86Fixed Cycle (Boring) • G87Fixed Cycle (Back Boring) • G88Fixed Cycle (Boring) • G89Fixed Cycle (Boring) • G90Absolute Value Command G91Incremental Value Command • G92Work Offset Set
G107User macro 1 (sine) sin • G108User macro 1 (cosine) cos • G109User macro 1 (arc tangent) tan • G110User macro (square root) • G200User macro 1 (unconditional branch) • G201User macro 1 (zero condition branch) • G202User macro (negative condition branch)
Basic ISO CNC Code • M03, M04, M05 Spindle CW, Spindle CCW, Spindle Stop • M08, M09 Coolant/lubricant On, Coolant/lubricant Off • M02 Program Stop • M30 Program end, rewind • M98 Subprogram call • M99 Returnto call program
M00, M01 Program stop, optional stop • G96, G97 Constant surface speed, Constant Spindle speed • G50 Maximum spindle speed • G95, G94 Feed mm per revolution, feed mm/min • G00, G01 rapid movement, Linear Interpolation (cutting in a straight line) • F Feed • S Spindle Speed
Example • This is a generic program that demonstrates the use of G-Code to turn a 1" diameter X 1" long part. Assume that a bar of material is in the machine and that the bar is slightly oversized in length and diameter and that the bar protrudes by more than 1" from the face of the chuck. (Caution: This is generic, it might not work on any real machine! Pay particular attention to point 5 below.)
Line Code • N01 M216 • N02 G00 X20 Z20 • N03 G50 S2000 • N04 M01 • N05 T0303 M6 • N06 G96 S854 M42 M03 M08 • N07 G00 X1.1 Z1.1 • N08 G01 Z1.0 F.05
Line Code • N09 X0.0 • N10 G00 Z1.1 • N11 X1.0N12G01 Z0.0 • N13 M05 M09 • N14 G28 G91 X0 • N15 M215 • N16 M30
منابع:: ماشينهاي كنترل عددي كامپيوتري (مهندس محسن لطفي) • برنامه نويسي جامع ماشينهاي cnc ( مهندس بصارتي) • وب سايت CNCezPRO™ • وب سايت Tesko laser ارائه کننده: بابک د لخون سال تحصیلی 87-88 Email : delkhoon@gmail.com