G-Code API
Warning: This is an early version of the feature and some behaviors are subject to change.
The RapidCode G-Code Parser and Executor are not a replacement for a true CNC controller. It is not a simple drop-in replacement for a full function CNC provided by companies who offer turn-key solutions in this field. However, the flexibility of the RMP mototion controller as well as interoperability with PathMotion and arbitrary kinematic robot models make it ideal for designing specialized machines which use G-Code as the motion command source.
G-Code is not running in the RMP but instead a program that buffers motions to the RMP
(Getters and setters will not work accross multiple applicaions at the same time)
G-Code is a programming language for specifying coordinated motions in cartesian space used by many manufacturing machines.
.gif?alt=media&token=29bfd1a1-62e7-42a0-aff2-0350c11deb99)
Our G-Code parser is built into our MultiAxis class. In order to use it you will need to set up a MultiAxis object with 6 axes in the order X, Y, Z, A, B, C. If your machine does not have all these axes you will need to add a phantom axis. If your machine has a prime or redundant axis you will need to set up electronic gearing. In such cases, it is recommended that you set up two MultiAxis objects (One for propagating faults to all axes, one for G-Code)
We currently only support a very basic set of codes.
If you would like us to support more codes in the future reach out to us and we can look into supporting a new feature for your needs.
Code | Description | Explanation |
G1 | Linear interpolation | Coordinated linear motion between points in cartesian space |
G2 | Circular interpolation, clockwise | Clockwise arc motion about a center point to an end point |
G3 | Circular interpolation, counter clockwise | Counter clockwise arc motion about a center point to an end point |
G9 | Exact stop check
(non-modal) | Placed before a motion group command, the machine will come to a complete stop at end of the move before continuing to the next. Only remains active for one line. |
G17 | XY plane selection | G2/3 commands happen on the XY plane (Default mode) |
G18 | ZX plane selection | G2/3 commands happen on the ZX plane |
G19 | YZ plane selection | G2/3 commands happen on the YZ plane |
G20 | Programming in inches
(in) | Distances after this command will be interpreted as inches |
G21 | Programming in millimeters
(mm) | Distances after this command will be interpreted as mm |
G54-59 | Work Offset | Applies a pre-configured XYZ offset relative to home(origin) to all motions. |
G61 | Exact Stop Check (modal) | The machine will come to a complete stop at end of the move before continuing to the next for all future moves until G64 is called. |
G64 | Cancel Exact Stop | Reset to default cutting mode (cancel G61) |
G90 | Absolute programming | Distances after this command will be interpreted as absolute
(relative to origin 0,0,0) |
G91 | Incremental programming (relative) | Distances after this command will be interpreted as incremental
(relative to current position at start of move) |
M Codes
Helical G2/3 motions
Features not listed above
Last modified 11mo ago