7886| 9
|
和Dreammaker一起来了解Gcode |
现在大部分的3D打印机,特别是开源的3D打印机大都采用Gcode来运行,我们今天就一点点的了解下gcode 首先我们先看下基本的Gcode有哪些。 ========================= G代码 G0: Rapid Positioning G1: Coordinated Motion G2: Clockwise Arc G3: Counter Clockwise Arc G4: Dwell G10: Create Coordinate System Offset from the Absolute one G20: Use Inches as Units G21: Use Milimeters as Units G28: Home given axes to maximum G53: Set absolute coordinate system G54: Use coordinate system from G10 P0 G55: Use coordinate system from G10 P1 G56: Use coordinate system from G10 P2 G57: Use coordinate system from G10 P3 G58: Use coordinate system from G10 P4 G59: Use coordinate system from G10 P5 G70: Use Inches as Units G71: Use Milimeters as Units G90: Absolute Positioning G91: Relative Positioning G92: Define current position on axes G97: Spindle speed rate G130: Set given axes potentiometer Value G161: Home given axes to minimum G162: Home given axes to maximum M代码 M0: Unconditional Halt, not supported on SD? M1: Optional Halt, not supported on SD? M2: End program M3: Spindle On - Clockwise M4: Spindle On - Counter Clockwise M5: Spindle Off M6: Wait for toolhead to come up to reach (or exceed) temperature M7: Coolant A on (flood coolant) M8: Coolant B on (mist coolant) M9: All Coolant Off M10: Close Clamp M11: Open Clamp M13: Spindle CW and Coolant A On M14: Spindle CCW and Coolant A On M17: Enable Motor(s) M18: Disable Motor(s) M21: Open Collet M22: Close Collet M30: Program Rewind M40: Change Gear Ratio to 0 M41: Change Gear Ratio to 1 M42: Change Gear Ratio to 2 M43: Change Gear Ratio to 3 M44: Change Gear Ratio to 4 M45: Change Gear Ratio to 5 M46: Change Gear Ratio to 6 M50: Read Spindle Speed M70: Display Message On Machine M71: Display Message, Wait For User Button Press M72: Play a Tone or Song M73: Manual Set Build % M101: Turn Extruder On, Forward M102: Turn Extruder On, Reverse M103: Turn Extruder Off M104: Set Temperature M105: Get Temperature M106: Turn Automated Build Platform (or the Fan, on older models) On M107: Turn Automated Build Platform (or the Fan, on older models) Off M108: Set Extruder's Max Speed (R = RPM, P = PWM) M109: Set Build Platform Temperature M110: Set Build Chamber Temperature M126: Valve Open M127: Valve Close M128: Get Position M131: Store Current Position to EEPROM M132: Load Current Position from EEPROM M140: Set Build Platform Temperature M141: Set Chamber Temperature (Ignored) M142: Set Chamber Holding Pressure (Ignored) M200: Reset driver M300: Set Servo 1 Position M301: Set Servo 2 Position M310: Start data capture M311: Stop data capture M312: Log a note to the data capture store ========================= 上面就是基本的Gcode代码 所有的3D打印生成的gcode或多或少的都由gcode组成。 基本的Gcode分为G代码,M代码 G代码主要是执行代码 M代码主要是设置代码 今后我们将在这个帖子里面将这些G代码和M代码进行分析,同时我们也会介绍一些打印时修改代码的技巧。 |
今天我们来讲讲G1命令 打开任何一个生成好的gcode命令,可以发现大量的G1命令, G1命令的格式一般如下: G1 X123 Y123 Z123 E123 F123 其中G1命令表示去哪里 G1后面跟着的称为参数,注意在Gcode中,所有的参数必须大写,数字要紧跟在字母后面,并用空格分开不同的参数。 后面空格跟的X123 Y123 Z123表示去的坐标 在3D打印机的坐标系里,这个点就是据home点的直角坐标系位置,一般为毫米单位。 上面的参数表示X坐标123mm,Y坐标123mm,Z坐标123mm的一个点。 E123表示挤出多少数量的丝料。 上面的参数表示挤出123mm的丝料。 而F表示的是到那里的速度,不同的打印机有不同的反应,有的打印机是逐步提升速度,有的打印机是直接加速到这个速度。 典型的Gcode一般需要包括上面所有的参数和数字,不过有时候你可以根据情况省略一些参数。 比如如果Z轴已经固定,那就可以仅仅输入 G1 X123 Y123 即可 或者需要调整一下高度,可以输入 G1 Z123 即可 当然需要输出一定的丝料可以试着输入 G1 E123 不过需要注意的是,一般挤出的值是收到设备的保护的,一般需要有一定的温度才能运行挤出步进电机的运行。所以有可能输入的这条命令会无效。 以上介绍了一下G1的命令,大家会发现其实Gcode是可以输入的,但是如何输入呢?可以使用一些软件来进行。具体下一节来介绍。 |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed