Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Computer numerical control
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Coding== ===G-codes=== [[G-code]]s are used to command specific movements of the machine, such as machine moves or drilling functions. The majority of G-code programs start with a percent (%) symbol on the first line, then followed by an "O" with a numerical name for the program (i.e. "O0001") on the second line, then another percent (%) symbol on the last line of the program. The format for a G-code is the letter G followed by two to three digits; for example G01. G-codes differ slightly between a mill and lathe application, for example: :[G00 Rapid Motion Positioning] :[G01 Linear Interpolation Motion] :[G02 Circular Interpolation Motion-Clockwise] :[G03 Circular Interpolation Motion-Counter Clockwise] :[G04 Dwell (Group 00) Mill] :[G10 Set offsets (Group 00) Mill] :[G12 Circular Pocketing-Clockwise] :[G13 Circular Pocketing-Counter Clockwise] ===M-codes=== [Code Miscellaneous Functions (M-Code)]{{citation needed|date=November 2017}}. M-codes are miscellaneous machine commands that do not command axis motion. The format for an M-code is the letter M followed by two to three digits; for example: :[M01 Operational stop] :[M02 End of Program] :[M03 Start Spindle - Clockwise] :[M04 Start Spindle - Counter Clockwise] :[M05 Stop Spindle] :[M06 Tool Change] :[M07 Coolant on mist coolant] :[M08 Flood coolant on] :[M09 Coolant off] :[M10 Chuck open] :[M11 Chuck close] :[M12 Spindle up] :[M13 BOTH M03&M08 Spindle clockwise rotation & flood coolant] :[M14 BOTH M04&M08 Spindle counter clockwise rotation & flood coolant] :[M15 BOTH M05&M09 Spindle stop and Flood coolant off] :[M16 Special tool call] :[M19 Spindle orientate] :[M29 DNC mode] :[M30 Program reset & rewind] :[M38 Door open] :[M39 Door close] :[M40 Spindle gear at middle] :[M41 Low gear select] :[M42 High gear select] :[M53 Retract Spindle] (raises tool spindle above current position to allow operator to do whatever they would need to do) :[M68 Hydraulic chuck close] :[M69 Hydraulic chuck open] :[M78 Tailstock advancing] :[M79 Tailstock reversing] ===Example=== <syntaxhighlight lang="text"> % O0001 G20 G40 G80 G90 G94 G54(Inch, Cutter Comp. Cancel, Deactivate all canned cycles, moves axes to machine coordinate, feed per min., origin coordinate system) M06 T01 (Tool change to tool 1) G43 H01 (Tool length comp. in a positive direction, length compensation for the tool) M03 S1200 (Spindle turns CW at 1200RPM) G00 X0. Y0. (Rapid Traverse to X=0. Y=0.) G00 Z.5 (Rapid Traverse to z=.5) G00 X1. Y-.75 (Rapid traverse to X1. Y-.75) G01 Z-.1 F10 (Plunge into part at Z-.25 at 10in per min.) G03 X.875 Y-.5 I.1875 J-.75 (CCW arc cut to X.875 Y-.5 with radius origin at I.625 J-.75) G03 X.5 Y-.75 I0.0 J0.0 (CCW arc cut to X.5 Y-.75 with radius origin at I0.0 J0.0) G03 X.75 Y-.9375 I0.0 J0.0(CCW arc cut to X.75 Y-.9375 with radius origin at I0.0 J0.0) G02 X1. Y-1.25 I.75 J-1.25 (CW arc cut to X1. Y-1.25 with radius origin at I.75 J-1.25) G02 X.75 Y-1.5625 I0.0 J0.0 (CW arc cut to X.75 Y-1.5625 with same radius origin as the previous arc) G02 X.5 Y-1.25 I0.0 J0.0 (CW arc cut to X.5 Y-1.25 with same radius origin as the previous arc) G00 Z.5 (Rapid traverse to z.5) M05 (spindle stops) G00 X0.0 Y0.0 (Mill returns to origin) M30 (Program End) % </syntaxhighlight> Having the correct speeds and feeds in the program provides for a more efficient and smoother product run. Incorrect speeds and feeds will cause damage to the tool, machine spindle, and even the product. The quickest and simplest way to find these numbers would be to use a calculator that can be found online. A formula can also be used to calculate the proper speeds and feeds for a material. These values can be found online or in [[Machinery's Handbook]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)