{"id":16018,"date":"2022-07-08T09:45:45","date_gmt":"2022-07-08T09:45:45","guid":{"rendered":"https:\/\/ixox.net\/?p=16018"},"modified":"2024-07-18T16:21:28","modified_gmt":"2024-07-18T09:21:28","slug":"g-code-va-m-code-trong-gia-cong-cnc","status":"publish","type":"post","link":"https:\/\/ixox.net\/g-code-va-m-code-trong-gia-cong-cnc\/","title":{"rendered":"M\u00e3 G-code v\u00e0 M-code trong gia c\u00f4ng CNC, s\u1ef1 kh\u00e1c bi\u1ec7t gi\u1eefa 2 lo\u1ea1i m\u00e3 l\u1ec7nh n\u00e0y"},"content":{"rendered":"

M\u00e1y gia c\u00f4ng CNC \u0111\u00e1p \u1ee9ng cho ho\u1ea1t \u0111\u1ed9ng gia c\u00f4ng c\u01a1 kh\u00ed ch\u00ednh x\u00e1c v\u1edbi kh\u1ea3 n\u0103ng gia c\u00f4ng linh ho\u1ea1t. Ch\u00fang lo\u1ea1i b\u1ecf \u0111\u01b0\u1ee3c l\u1ed7i c\u1ee7a con ng\u01b0\u1eddi b\u1eb1ng c\u00e1ch d\u1ef1a v\u00e0o c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh m\u00e1y t\u00ednh nh\u01b0 m\u00e3 G (G-code) v\u00e0 m\u00e3 M (M-code) \u0111\u1ec3 ch\u1ebf t\u1ea1o c\u00e1c s\u1ea3n ph\u1ea9m.<\/span><\/p>\n

G-code v\u00e0 M-code ch\u1ec9 \u0111\u01a1n gi\u1ea3n l\u00e0 ph\u1ea7n m\u1ec1m ng\u00f4n ng\u1eef l\u1eadp tr\u00ecnh (ho\u1eb7c m\u00e3 l\u1ec7nh m\u00e1y t\u00ednh) ra l\u1ec7nh cho chuy\u1ec3n \u0111\u1ed9ng c\u1ee7a c\u00e1c c\u00f4ng c\u1ee5 c\u1eaft CNC \u0111\u1ec3 t\u1ea1o ra chi ti\u1ebft mong mu\u1ed1n. C\u00e1c ch\u01b0\u01a1ng tr\u00ecnh n\u00e0y c\u00f3 th\u1ec3 ph\u1ee9c t\u1ea1p \u0111\u1ec3 vi\u1ebft v\u00ec ch\u00fang kh\u00e1c nhau gi\u1eefa c\u00e1c m\u00e1y v\u00e0 y\u00eau c\u1ea7u chuy\u00ean m\u00f4n c\u1ee7a m\u1ed9t l\u1eadp tr\u00ecnh vi\u00ean CNC c\u00f3 kinh nghi\u1ec7m. Tuy nhi\u00ean, ch\u00fang c\u0169ng c\u00f3 nh\u1eefng ti\u00eau chu\u1ea9n chung trong ng\u00e0nh gia c\u00f4ng v\u00e0 c\u0169ng gi\u00fap ng\u01b0\u1eddi v\u1eadn h\u00e0nh m\u00e1y d\u1ec5 d\u00e0ng ti\u1ebfp c\u1eadn t\u1eeb nh\u1eefng m\u00e3 l\u1ec7nh \u0111\u01a1n gi\u1ea3n nh\u1ea5t.<\/span><\/p>\n

Trong b\u00e0i vi\u1ebft n\u00e0y, ch\u00fang t\u00f4i s\u1ebd tr\u00ecnh b\u00e0y nh\u1eefng ki\u1ebfn th\u1ee9c c\u01a1 b\u1ea3n v\u1ec1 G-code v\u00e0 M-code trong gia c\u00f4ng CNC. B\u1ea1n s\u1ebd hi\u1ec3u \u0111\u01b0\u1ee3c b\u1ea3n ch\u1ea5t c\u1ee7a hai lo\u1ea1i m\u00e3 n\u00e0y, s\u1ef1 kh\u00e1c bi\u1ec7t gi\u1eefa ch\u00fang v\u00e0 bi\u1ebft \u0111\u01b0\u1ee3c m\u1ed9t s\u1ed1 m\u00e3 l\u1ec7nh \u0111\u1ec3 c\u00f3 th\u1ec3 t\u1ea1o \u0111\u01b0\u1ee3c m\u1ed9t ch\u01b0\u01a1ng tr\u00ecnh gia c\u00f4ng \u0111\u01a1n gi\u1ea3n.<\/span><\/p>\n

S\u1ef1 kh\u00e1c bi\u1ec7t gi\u1eefa G-code v\u00e0 M-code l\u00e0 g\u00ec?<\/b><\/span><\/h2>\n

\"T\u1ed5ng<\/p>\n

G-code, c\u00f2n \u0111\u01b0\u1ee3c g\u1ecdi l\u00e0 m\u00e3 h\u00ecnh h\u1ecdc, \u0111i\u1ec1u khi\u1ec3n chuy\u1ec3n \u0111\u1ed9ng tr\u00ean m\u00e1y. V\u00ed d\u1ee5, n\u00f3 c\u00f3 th\u1ec3 h\u01b0\u1edbng dao c\u1eaft di chuy\u1ec3n theo m\u1ed9t \u0111\u01b0\u1eddng th\u1eb3ng ho\u1eb7c m\u1ed9t cung tr\u00f2n. M\u1ed9t l\u1ec7nh G-code th\u01b0\u1eddng \u0111\u01b0\u1ee3c vi\u1ebft \u1edf \u0111\u1ecbnh d\u1ea1ng ch\u1eef v\u00e0 s\u1ed1, b\u1eaft \u0111\u1ea7u b\u1eb1ng ch\u1eef \u201cG\u201d v\u00e0 theo sau l\u00e0 m\u1ed9t s\u1ed1 c\u00f3 hai ch\u1eef s\u1ed1, v\u00ed d\u1ee5 G00.<\/span><\/p>\n

Trong khi \u0111\u00f3, M-code ki\u1ec3m so\u00e1t ho\u1ea1t \u0111\u1ed9ng ho\u1eb7c c\u00e1c ch\u1ee9c n\u0103ng kh\u00e1c c\u1ee7a m\u00e1y CNC<\/a>, ch\u1eb3ng h\u1ea1n nh\u01b0 ho\u1ea1t \u0111\u1ed9ng quay tr\u1ee5c ch\u00ednh, thay \u0111\u1ed5i pallet hay ch\u1ec9 d\u1eabn c\u00e1c c\u00f4ng c\u1ee5 t\u1ea1m d\u1eebng ho\u1eb7c k\u1ebft th\u00fac ho\u1ea1t \u0111\u1ed9ng. M-code c\u0169ng \u0111\u01b0\u1ee3c vi\u1ebft \u1edf \u0111\u1ecbnh d\u1ea1ng ch\u1eef v\u00e0 s\u1ed1, b\u1eaft \u0111\u1ea7u b\u1eb1ng ch\u1eef \u201cM\u201d v\u00e0 theo sau l\u00e0 hai ch\u1eef s\u1ed1.<\/span><\/p>\n

C\u00e1c l\u1ec7nh G-code v\u00e0 M-code ho\u1ea1t \u0111\u1ed9ng c\u00f9ng nhau \u0111\u1ec3 t\u1ea1o ra nh\u1eefng ho\u1ea1t \u0111\u1ed9ng gia c\u00f4ng c\u1eaft g\u1ecdt theo mong mu\u1ed1n c\u1ee7a ng\u01b0\u1eddi v\u1eadn h\u00e0nh. Trong c\u00e1c ph\u1ea7n sau, ch\u00fang t\u00f4i s\u1ebd tr\u00ecnh b\u00e0y m\u1ed9t s\u1ed1 m\u00e3 l\u1ec7nh G v\u00e0 M m\u00e0 b\u1ea1n n\u00ean bi\u1ebft.<\/span><\/p>\n

Hi\u1ec3u v\u1ec1 m\u00e3 l\u1ec7nh G-code d\u00f9ng trong gia c\u00f4ng CNC<\/b><\/span><\/h2>\n

B\u1ea3ng d\u01b0\u1edbi li\u1ec7t k\u00ea m\u1ed9t s\u1ed1 l\u1ec7nh G-code ti\u00eau chu\u1ea9n v\u00e0 ch\u1ee9c n\u0103ng c\u1ee7a ch\u00fang.<\/span><\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
G-code<\/b><\/span><\/td>\nCh\u1ee9c n\u0103ng<\/b><\/span><\/td>\n<\/tr>\n
G00<\/span><\/td>\nL\u1ec7nh ch\u1ea1y dao nhanh kh\u00f4ng c\u1eaft g\u1ecdt<\/span><\/td>\n<\/tr>\n
G01<\/span><\/td>\n\u0110i\u1ec1u khi\u1ec3n dao d\u1ecbch chuy\u1ec3n theo \u0111\u01b0\u1eddng th\u1eb1ng, c\u00f3 c\u1eaft g\u1ecdt<\/span><\/td>\n<\/tr>\n
G02<\/span><\/td>\n\u0110i\u1ec1u khi\u1ec3n d\u1ee5ng c\u1ee5 di chuy\u1ec3n theo cung tr\u00f2n c\u00f9ng chi\u1ec1u kim \u0111\u1ed3ng h\u1ed3<\/span><\/td>\n<\/tr>\n
G03<\/span><\/td>\n\u0110i\u1ec1u khi\u1ec3n d\u1ee5ng c\u1ee5 di chuy\u1ec3n theo cung tr\u00f2n ng\u01b0\u1ee3c chi\u1ec1u kim \u0111\u1ed3ng h\u1ed3<\/span><\/td>\n<\/tr>\n
G04<\/span><\/td>\nL\u1eadp tr\u00ecnh v\u1edbi th\u1eddi gian d\u1eebng \u1edf cu\u1ed1i h\u00e0nh tr\u00ecnh<\/span><\/td>\n<\/tr>\n
G90<\/span><\/td>\nL\u1eadp tr\u00ecnh theo t\u1ecda \u0111\u1ed9 tuy\u1ec7t \u0111\u1ed1i, l\u1ea5y t\u1ecda \u0111\u1ed9 so v\u1edbi \u0111i\u1ec3m chu\u1ea9n \u0111\u00e3 ch\u1ecdn<\/span><\/td>\n<\/tr>\n
G91<\/span><\/td>\nL\u1eadp tr\u00ecnh theo t\u1ecda \u0111\u1ed9 t\u01b0\u01a1ng \u0111\u1ed1i, l\u1ea5y t\u1ecda \u0111\u1ed9 so v\u1edbi \u0111i\u1ec3m ph\u00eda tr\u01b0\u1edbc<\/span><\/td>\n<\/tr>\n
G54<\/span><\/td>\nL\u01b0u g\u1ed1c t\u1ecda \u0111\u1ed9 ph\u00f4i<\/span><\/td>\n<\/tr>\n
G17<\/span><\/td>\nCh\u1ecdn m\u1eb7t ph\u1eb3ng gia c\u00f4ng XY<\/span><\/td>\n<\/tr>\n
G18<\/span><\/td>\nCh\u1ecdn m\u1eb7t ph\u1eb3ng gia c\u00f4ng XZ<\/span><\/td>\n<\/tr>\n
G19<\/span><\/td>\nCh\u1ecdn m\u1eb7t ph\u1eb3ng gia c\u00f4ng YZ<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

C\u00e1c l\u1ec7nh G-code ti\u00eau chu\u1ea9n n\u00e0y \u0111\u01b0\u1ee3c theo sau b\u1edfi m\u1ed9t v\u1ecb tr\u00ed h\u00ecnh h\u1ecdc, th\u01b0\u1eddng \u0111\u01b0\u1ee3c x\u00e1c \u0111\u1ecbnh b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng h\u1ec7 t\u1ecda \u0111\u1ed9 Descartes. Gi\u1ea3 s\u1eed b\u1ea1n mu\u1ed1n di chuy\u1ec3n nhanh dao c\u1eaft \u0111\u1ebfn v\u1ecb tr\u00ed t\u1ecda \u0111\u1ed9 (X = -100, Y = -50, Z = 35) m\u00e0 kh\u00f4ng c\u1ea7n c\u1eaft b\u1ea5t k\u1ef3 v\u1eadt li\u1ec7u n\u00e0o. B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh \u0111\u1ecbnh v\u1ecb nhanh G00 \u0111\u1ec3 \u0111\u1ea1t \u0111\u01b0\u1ee3c \u0111i\u1ec1u n\u00e0y b\u1eb1ng c\u00e1ch vi\u1ebft G00X-100.Y-50.Z35.\u00a0<\/span><\/p>\n

Hi\u1ec3u v\u1ec1 m\u00e3 l\u1ec7nh M-code trong gia c\u00f4ng CNC<\/b><\/span><\/h2>\n

Nh\u01b0 ch\u00fang ta \u0111\u00e3 \u0111\u1ec1 c\u1eadp tr\u01b0\u1edbc \u0111\u00f3, M-code \u0111i\u1ec1u khi\u1ec3n c\u00e1c ch\u1ee9c n\u0103ng c\u1ee7a m\u00e1y gia c\u00f4ng CNC. B\u1ea3ng d\u01b0\u1edbi tr\u00ecnh b\u00e0y m\u1ed9t s\u1ed1 l\u1ec7nh M-code ph\u1ed5 bi\u1ebfn v\u00e0 ch\u1ee9c n\u0103ng c\u1ee7a ch\u00fang.<\/span><\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n
M-code<\/span><\/strong><\/td>\nCh\u1ee9c n\u0103ng<\/span><\/strong><\/td>\n<\/tr>\n
M00<\/span><\/td>\nT\u1ea1m d\u1eebng ch\u01b0\u01a1ng tr\u00ecnh<\/span><\/td>\n<\/tr>\n
M01<\/span><\/td>\nT\u1ea1m d\u1eebng ch\u01b0\u01a1ng tr\u00ecnh c\u00f3 l\u1ef1a ch\u1ecdn<\/span><\/td>\n<\/tr>\n
M02<\/span><\/td>\nK\u1ebft th\u00fac ch\u01b0\u01a1ng tr\u00ecnh<\/span><\/td>\n<\/tr>\n
M03<\/span><\/td>\nTr\u1ee5c ch\u00ednh quay thu\u1eadn<\/span><\/td>\n<\/tr>\n
M04<\/span><\/td>\nTr\u1ee5c ch\u00ednh quay ng\u01b0\u1ee3c<\/span><\/td>\n<\/tr>\n
M05<\/span><\/td>\nD\u1eebng quay tr\u1ee5c ch\u00ednh<\/span><\/td>\n<\/tr>\n
M06<\/span><\/td>\nThay m\u1ed9t d\u1ee5ng c\u1ee5 c\u1eaft kh\u00e1c<\/span><\/td>\n<\/tr>\n
M08<\/span><\/td>\nB\u1eadt t\u01b0\u1edbi ngu\u1ed9i<\/span><\/td>\n<\/tr>\n
M30<\/span><\/td>\nH\u1ebft ch\u01b0\u01a1ng tr\u00ecnh, quay l\u1ea1i \u0111i\u1ec3m \u0111\u1ea7u ch\u01b0\u01a1ng tr\u00ecnh<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Xem l\u1ea1i v\u00ed d\u1ee5 \u1edf ph\u1ea7n tr\u00ean, gi\u1ea3 s\u1eed b\u1ea1n mu\u1ed1n tr\u1ee5c ch\u00ednh c\u1ee7a m\u00e1y b\u1eaft \u0111\u1ea7u quay ngay sau khi d\u1ee5ng c\u1ee5 c\u1eaft c\u1ee7a b\u1ea1n \u0111\u01b0\u1ee3c \u0111\u1eb7t t\u1ea1i (X = -100, Y = -50, Z = 35), th\u00ec b\u1ea1n c\u00f3 th\u1ec3 ch\u1ec9 c\u1ea7n th\u00eam l\u1ec7nh tr\u1ee5c ch\u00ednh M03 b\u1eb1ng c\u00e1ch vi\u1ebft G00X-100.Y-50.Z35M03. Tuy nhi\u00ean, h\u00e3y nh\u1edb r\u1eb1ng b\u1ea1n c\u0169ng c\u1ea7n ch\u1ec9 \u0111\u1ecbnh t\u1ed1c \u0111\u1ed9 m\u00e0 b\u1ea1n mu\u1ed1n tr\u1ee5c ch\u00ednh quay. \u0110\u1ec3 th\u1ef1c hi\u1ec7n \u0111i\u1ec1u n\u00e0y, b\u1ea1n c\u1ea7n hi\u1ec3u m\u1ed9t s\u1ed1 l\u1ec7nh l\u1eadp tr\u00ecnh CNC b\u1ed5 sung kh\u00e1c v\u00e0 ch\u00fang kh\u00f4ng b\u1eaft \u0111\u1ea7u b\u1eb1ng c\u00e1c ch\u1eef c\u00e1i \u201cG\u201d v\u00e0 \u201cM\u201d.<\/span><\/p>\n

C\u00e1c l\u1ec7nh kh\u00e1c d\u00f9ng trong l\u1eadp tr\u00ecnh CNC<\/b><\/span><\/h2>\n

\"T\u1ed5ng<\/p>\n

\u0110\u1ec3 ho\u00e0n thi\u1ec7n cho c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh gia c\u00f4ng tr\u00ean m\u00e1y CNC th\u00ec c\u00f2n nh\u1eefng l\u1ec7nh kh\u00e1c \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ed3ng th\u1eddi v\u1edbi G-code v\u00e0 M-code. V\u00ed d\u1ee5, l\u1ec7nh F, cho ph\u00e9p b\u1ea1n \u0111i\u1ec1u khi\u1ec3n t\u1ed1c \u0111\u1ed9 ch\u1ea1y dao khi c\u1eaft. T\u01b0\u01a1ng t\u1ef1 nh\u01b0 v\u1eady, l\u1ec7nh T cho m\u00e1y bi\u1ebft s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 n\u00e0o \u0111\u1ec3 \u0111\u1ea1t \u0111\u01b0\u1ee3c ho\u1ea1t \u0111\u1ed9ng c\u1eaft mong mu\u1ed1n. Hay nh\u01b0 l\u1ec7nh S cho ph\u00e9p b\u1ea1n ch\u1ec9 \u0111\u1ecbnh t\u1ed1c \u0111\u1ed9 tr\u1ee5c ch\u00ednh.<\/span><\/p>\n

\u0110\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 c\u00e1ch tri\u1ec3n khai c\u00e1c l\u1ec7nh n\u00e0y, h\u00e3y xem x\u00e9t m\u1ed9t t\u00ecnh hu\u1ed1ng m\u00e0 b\u1ea1n \u0111ang t\u00ecm c\u00e1ch di chuy\u1ec3n dao CNC \u0111\u1ebfn v\u1ecb tr\u00ed t\u1ecda \u0111\u1ed9 (X = -100, Y = -50, Z = 35) theo \u0111\u01b0\u1eddng th\u1eb3ng v\u00e0 v\u1edbi t\u1ed1c \u0111\u1ed9 ch\u1ea1y dao 250 mm m\u1ed7i ph\u00fat. B\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ec7nh G01 \u0111\u1ec3 \u0111\u1ea1t \u0111\u01b0\u1ee3c \u0111i\u1ec1u n\u00e0y b\u1eb1ng c\u00e1ch vi\u1ebft G01X-100.Y-50.Z35.F250.<\/span><\/p>\n

T\u01b0\u01a1ng t\u1ef1, gi\u1ea3 s\u1eed b\u1ea1n mu\u1ed1n tr\u1ee5c quay c\u1ee7a m\u00ecnh quay theo chi\u1ec1u kim \u0111\u1ed3ng h\u1ed3 v\u1edbi t\u1ed1c \u0111\u1ed9 3000 v\u00f2ng\/ph\u00fat. \u0110\u1ec3 \u0111\u1ea1t \u0111\u01b0\u1ee3c \u0111i\u1ec1u \u0111\u00f3, b\u1ea1n c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n l\u1ec7nh M03 (cho tr\u1ee5c ch\u00ednh quay) v\u00e0 l\u1ec7nh S (t\u1ed1c \u0111\u1ed9 tr\u1ee5c ch\u00ednh) b\u1eb1ng c\u00e1ch vi\u1ebft G00X-100.Y-50.Z35M03S3000. H\u00e3y nh\u1edb r\u1eb1ng qu\u00e1 tr\u00ecnh quay tr\u1ee5c ch\u00ednh n\u00e0y ch\u1ec9 b\u1eaft \u0111\u1ea7u sau khi dao c\u1eaft n\u1eb1m t\u1ea1i t\u1ecda \u0111\u1ed9 (X = -100, Y = -50, Z = 35).<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

M\u00e1y gia c\u00f4ng CNC \u0111\u00e1p \u1ee9ng cho ho\u1ea1t \u0111\u1ed9ng gia c\u00f4ng c\u01a1 kh\u00ed ch\u00ednh x\u00e1c v\u1edbi kh\u1ea3 n\u0103ng gia c\u00f4ng linh ho\u1ea1t. Ch\u00fang lo\u1ea1i b\u1ecf \u0111\u01b0\u1ee3c l\u1ed7i c\u1ee7a con ng\u01b0\u1eddi b\u1eb1ng c\u00e1ch d\u1ef1a v\u00e0o c\u00e1c ch\u01b0\u01a1ng tr\u00ecnh m\u00e1y t\u00ednh nh\u01b0 m\u00e3 G (G-code) v\u00e0 m\u00e3 M (M-code) \u0111\u1ec3 ch\u1ebf t\u1ea1o c\u00e1c s\u1ea3n ph\u1ea9m. G-code v\u00e0 […]\n","protected":false},"author":9,"featured_media":16021,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[518],"tags":[],"class_list":["post-16018","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tin-ky-thuat"],"lang":"vi","translations":{"vi":16018},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/posts\/16018"}],"collection":[{"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/comments?post=16018"}],"version-history":[{"count":7,"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/posts\/16018\/revisions"}],"predecessor-version":[{"id":23725,"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/posts\/16018\/revisions\/23725"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/media\/16021"}],"wp:attachment":[{"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/media?parent=16018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/categories?post=16018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixox.net\/wp-json\/wp\/v2\/tags?post=16018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}