G command.
G0 : Quick Move command
G1 : Synthetic motion command G1 X100 Y100 F3000
G4 : Pause command. G4 S2 (pause 2 seconds) G4 P300 (pause 300 milliseconds)
G28 : Zero return command, etc: G28 X5 F600 ( zero return at 10 mm/s, direction negative, 5 mm positive movement after hitting limit), multi-axis movement possible. The P parameter has been added, the so-called Probe mode switch.
G90 : All axes are absolute, or if there is a specified axis, only the specified axis is set to absolute
G91 : All axes are relative, or if there are specified axes, only the specified axes are relative
G92 : Resets the motor position etc: G92 E2 (resets the current position of the E axis to 2)
G92.9 : Sets the target position offset, G92.9 X99.1 (the X-axis position in the G0/G1 command is automatically +99.1), R parameter, used for relative offset, if the original offset was 99, G92.9 X1 R, the offset is now 99+1=100
G92.8 : Enable printhead height offset
G92.7 : Deactivation of nozzle height offset
G92.6 : Application platform level calibration
G92.5 : Save the current coordinate offset setting
G92.4 : Restore the saved coordinate offset settings
M order.
M23 : Use NC file, etc: Select SD file: "M23 /path/file.gco"
M24 : Start/Resume printing / program. Without the P parameter, start directly, with the P parameter, use the file in [] of the P parameter as the NC file. With the L parameter, printing is done from the automatic list.
M25 : Pause printing / pargram
M28 : Start file write: "M28 S:/path/file.gco". S(SD card file) F(spiFlash loop file) R(loop buffer, no file)
M29 : Stop file write. or check saved files, close and open new files. "M29" "M29 M[xxxxxxxxxxxxxxxxxx] Pn".
There are 4 parameters to choose from M/N/R/S. These are MD5 check and open next, next GroupFile, rollback GroupFile, and stop printing.
The MNR command requires the P parameter to ensure that the fileIdx is correct.
M35 : Set max files and max file size of NC Group file. f:files S:size M35 F10 S10240
M42 : Set IO status M42 P4 S2 D5000 P port, S status, D delay
M45 : Defines the port to return to zero. M45 X-2 Z4, defines the X-axis sub-limit as port 2 and the Z-axis positive limit as port 4.
M50 : Save/read system variables to SD card Block M50 B10 V260 S3 Save 3 variables starting from V260 to Block10 / M50 B16 V270 R10 Read 10 system variables starting from Block16 to V270.
M51 : Save/read system variables to FlashVar, M51 F12 V20 S Save variable 20 to FlashVar12 / M51 F10 V22 R, Read FlashVar10 to system variable 22.
M52 : Set nozzle height M52 H192.3 C0.2 H is the height, C is the compensation value.
M53 : Take the maximum or minimum value of the variable interval, M53 V221 F230 T245 L(take the minimum)/G(take the maximum). From V230 to V245 (inclusive), take the minimum (or maximum) value into V221.
M54 : Batch add/subtract/multiply/divide variables in the variable interval, multiple operations are possible, executed in the order +-*/, M54 F230 T245 A22/S22/M22/D22 Mathematical operations from V230 to V245 inclusive and variable V22. A (add) S (subtract) M (multiply) D (divide)
M55 : clear program buf
M56 : Set Print job name. m56 ball.tsg
M57 : manipulate auto print list. s(operate) p[fileanme] t(print times) n(index of job)
//example M57 P[S:/Job2.tsg] S0 //execute operation on job2.tsg, S-parameters - 0:clear list 1:modify or add 2:remove 3:moveup 4:movedown
//example M57 P[S:/Job1.tsg] S1 T1 //set the number of times S:Job1.tsg is printed to 1, and if it is not in the list, add it to the last one.
//example M57 N2 S3 //set the order of the job with number 2 one place up.
M58 : M58: start / pause /restore auto print. S:start P:pause R:restore from sd card, M58 S;start auto print M58 P;stop auto print.
M59 : Wait for the system to enter the Idle state, parameter P is the maximum wait time, unit:ms M59 P500 (wait for the system to enter the Idle state, max. 500ms)
M73 : Set print progress, P(Print percent), T(remian time), L(Layer idx), H(height)
M80 : Turn on the ATX power supply
M81 : Power off ATX
M82 : Set the E axis to absolute coordinates
M83 : Sets the E axis as a relative coordinate
M103 : Sets the arrival / low / high temperature alarm setting for the heater. M103 T1 R8 L20 H20 (Set arrival temperature difference 8, low temperature difference 20, high temperature difference 20 for heater 1 (nozzle 2))
M104 : Set Nozzle Temperature target and return immediately, M104 S210 T1 (set nozzle 2 temperature to 210), parameter B is the temperature deviation, negative values reduce the temperature, positive values increase the target temperature. The H/C parameter turns the heating on or off.
M106 : Set Print fan speed.
M107 : Print fan off
M109 : Set Nozzle Temperature target and wait for reach
M130 : Extruder operate: extruder(1) / withdraw(2) / stop(0).
M140 : Set Bed Temperature target and return immediately
M141 : Set Chamber Temperature target and return immediately
M170 : Set material type and weight
M190 : Set Bed Temperature target and wait for reach.
Set the print base temperature and wait for the temperature to reach or cool down to the specified temperature, 'S' for reach, 'R' for cool down to. Force the heating on/off.
M191 : Sets the temperature of the print chamber and waits for the temperature to reach or cool down to the specified temperature, 'S' for reach and 'R' for cool down to. Forcing the heating on/off.
M201/202 : Set max acceleration in units/s^2 for print and travel moves : "M201 X<accel> Y<accel> Z<accel> E<accel>"
M203 : Set maximum feedrate: "M203 X<fr> Y<fr> Z<fr> E<fr>" in units/sec.
M204 : Set Accelerations in units/sec^2 (M204 P1200 R3000 T3000)
M205 : Set Advanced Settings
M206 : Offset axes
M220 : Set speed / Acc scale; M220 S80( 80% speed and acc). Five parameters B(save/stort) R(restore) S(speed and acc scale) F(only speed) A(only acc)
/ / M220 F150 (set speed 150%).
M221 : Sets the axis position ratio, mainly to control the feed of the E axis. This setting is activated each time the G92 resets the position of the corresponding axis. M221 E90 (material feed at 90%.)
M222 : Sets the acceleration/deceleration and error parameters of the corner, four parameters D/L/C/S, respectively error, length of the connection, non-deceleration angle and stop angle
M223 : Sets the delay time parameter for each axis. It can be advanced or pushed back in ms.
M224 : Sets the input shaping parameters for the XY axis, the parameters are type and frequency. T:type, X:x freq Y:Y freq
M225 - Custom input shaper, custom Input shaper. x:x freq y:y freq, N:m_N, HIJKL:m_A[0~4], OPQRS:m_T[0~4]
M226 - Sets the nozzle shaft pressure advance ratio.
M230 : Set default speed for Travel / Jog / Fast.
M231: Set path head acc and speed, and junction arc. Paramter: S:head speed percent, A:head acc percent, J:0,no junction arc, 1 junction arc
M300 : Play beep sound S<frequency Hz> P<duration ms>
M301 : Set PID parameters P I and D
M310 : Sync printer information or status to host
M410 : Force stop program and moving!
M413 : Resume Config, M413 P(purge broken job resume data), C(reset ResumePrgIdx)
M600 : Pause for filament change: "M600 X<pos> Y<pos> Z<raise> E<first_retract> L<later_retract>". (Requires ADVANCED_PAUSE_FEATURE)
M1000 : resume broken print job.
M1001 : print job finished. purge resume data.
T command: // Specify the nozzle to be used. and percentage.
T0 Px.xx. Specify the printhead and the percentage of this printhead in E. The other printhead takes up the remaining extrusion.
Example: T1 nozzle 2 extruded separately.
T0 Nozzle 1 extruded separately.
T0 P0.33 Nozzle 1 extrudes 33% of the material, nozzle 2 extrudes 67% of the material
T1 P0.4 Nozzle 1 extrudes 60 % of the material and nozzle 2 extrudes 40 % of the material.
Special orders.
END : Ends the program
OUT : IO command, OUT output command, etc: OUT 4 2 5000 ( output port 4, set output status to 2, hold 5000ms.
JOG / LINEAR /TO command: fast movement command.
HOME : Return to zero command, parameters are axis (motor), speed, return to zero offset. HOME 1 10 -5 is equal to G28 Y-5 F600
HZ : Forced setting of the current position zero. Equivalent to G92 X0.0
DWELL : Pause command. DWELL 2000, pause 2000 ms.
DEF: Custom G/M commands. //DEF M300 OUT S{S} {I} Add custom M command. {} contains the parameters of the M command.
Custom commands have higher priority than system built-in commands, custom commands override system built-in commands, empty definitions delete custom commands. DEF M300
SET : Sets the value of the system variable SET 23 1 Sets the system variable 23 to 1.
START : Start the program
STOP : Forced stop of the program, equivalent to the M410 command
ADD : The system variable value increase command ADD V23 2, increases the value of system variable 23 by 2
WAIT ; Wait for condition to be true. WAIT V23 = 2, waits for system variable 23 to equal 2. Supported bool operations include = > < & (bitwise) ! (! & bitwise) |(or) b(bit is true) B(bit is false)
WHILE : while loop command, WHILE V23 = V2 wait for variable 23 to have the same value as 2.
WHEND : The while end command, which appears in pairs with while, cannot be nested.
IF : conditional command, IF / IFELSE(optional) / IFEND form a group of IF commands.
RUN : buffered run command, RUN:SET 4 1 (when the program is executed here, the SET 4 1 command is executed), this command does not interrupt the continuity of G1 movement, it is suitable for execution in continuous movement which is not sensitive to the running time, but sensitive to the order of code compilation, such as setting system variables.
RUNAT : Index buffer run command, RUNAT:OUT 4 1 (when the program index is executed here, the OUT 4 1 command is executed), this command does not interrupt the continuity of G1 movement, and is suitable for operations such as turning on IO during continuous movement, and for operations that are sensitive to the execution position.
PLABEL : Program label command, adds a label to the specified program, marks the jump command PLABEL 2 TO 10 X10 Y10, marks the line TO 10 X10 Y10 as label 2.
PG2 / PGOTO : A jump command that allows you to jump to the program with the specified label. For example: PG2 2 or PGO 2, jumps to the program line with Label 2.
The DEF command defines custom G/M commands that are executed as subroutines when the program is run. Custom commands support multiple commands, each command is split by a comma.
etc: DEF G29 G28 Z-5 F300,G28 X2 Y-5 F600
When G29 is executed in the program, it is converted into two instructions, G28 Z-5 F300 and G28 X2 Y-5 F600, which are executed sequentially.
etc: DEF M300 G0 X{X} Y{Y} F6000,WHILE V92 ! 0x08,JOG 10 Z-0.2,WHEND
When the M300 is executed, the system first moves the XY axis to the specified position, then the Z axis goes -0.2 mm at a time until the value of the third bit of the system variable 92 is 1 (if V92 represents the IO port, this can be interpreted as a high level on the IN3 port)
M300 X100 Y-200. Operation: XY goes to the (100,-200) coordinate point, then Z goes up -0.2 each time until IO3 is high.
Comments
2 comments
Jason, Thanks for providing this. Is there a list of available system variables and ports somewhere?
Can you translate this line? I find it all over the tsg files generated by studio3. No reference to G9 in marlin manuals and not DEF command in tsg to define it.
G9 X115.52 Y96.19 Z-0.35 R-0.00 H1.00
Please sign in to leave a comment.