G-code Description
XBot can be controlled by G-code. Currently, a single G-code file can have 200 lines of commands (excluding comments). Due to this limitation, we recommend user to use G-code as an alternative to Motion Macro, and use each line of G-code as a motion command.
Table of supported G-code
The following table shows currently supported G-code:
Code | Behavior | G-code parameters | Example |
---|---|---|---|
G00 | Rapid linear motion at pre-set max velocity. | X (X end position mm) | G0 X120 Y120 |
G01 | Linear motion at user defined velocity. Tries to keep velocity constant between planar motion commands if the trajectories are connected. | X (X end position mm) Or Z (Z end position mm) | G01 X120 Y300 F50000 |
G02 | Clockwise arc motion at user defined velocity. Tries to keep velocity constant between commands if possible. Uses minor arc if the radius is positive and major arc if the radius is negative. | X (X end position mm) Or R (Arc Radius in mm) | G02 X120 Y120 I60 J-60 F50000 |
G03 | Counter-clockwise arc motion at user defined velocity. See G02. | See above | See above |
G04 | Dwell/pause command for a given amount of time in ms. | P (time to pause in ms) | G04 P500 (Pause for 500 ms) |
G06 | Full 6 DOF Motion command, speed is specified for x,y motion, and short axes velocities are calculated based on travel time | X (X end position mm) | G06 X100 Y200 Z2 C-2 F50000 |
G20 | Inch programming | N/A |
|
G21 | Mm Programming (Default) | N/A |
|
G90 | Absolute coordinate programming (Default) | N/A |
|
G91 | Relative coordinate programming | N/A |
|
M98 | Run G-code ID | P (g-code ID) | M98 P1 (Run g-code ID 1) |
M99 | Run PMC Macro | P (macro ID) | M99 P128 (Run macro ID 128) |
Sample G-code
; This is a comment that will be ignored
G21 ; Specifies programming in mm
G90 ; Specifies programming in absolute co-ordinates
G0 X60 Y60 ; Rapid motion to bottom left corner of flyway
G1 X120 Y120 F10 ; Linear motion to center of flyway, specifies speed as 10mm/min
X180 Y180 ; Linear motion to top right corner of flyway, motion will be continuous from previous command
X120 ; Move to the center of the top flyway edge
G2 Y60 R60 ; Clockwise arc motion with radius of 60mm to X120,Y60
G1 X160 ; Linear move to x160, y60, motion will be continuous from previous command
G4 P1000 ; Pause here for 1s
G1 X180 Y180 F20 ; Move to top right corner, new speed will be at 20mm/min
G1 X60 Y60 ; Move to bottom left corner, still at 20mm/min
G6 X120 Y120 C6 ; Move to x120, y120 while rotating 6 degrees in Rz, motion will not be continuous from previous command
C0 ; Rotate back to 0 deg in Rz
M98 P128 ; Run macro ID 128 from the PMC
Feedback and Comments
Please email us at tech.portal@planarmotor.com