CNC Gcode Sender

4,998

26

2

Published

Introduction: CNC Gcode Sender

About: 55+ years in electronics, computers, and teaching ... now retired.

I have discovered that many XON / XOFF terminal programs require a delay between characters when sending gcode data to my plotters. [1]

While a delay ensures reliable communication, any delay slows the rate at which the gcode commands are sent which lengthens the time taken to plot.

My terminal program solves this problem. 100% reliable data communication is now achieved without the need for any delays. Files that took hours to plot now take minutes :)

[1] A list of my plotters follows:

https://www.instructables.com/id/CNC-Drum-Plotter/

https://www.instructables.com/id/CNC-HANGING-PLOTTE...

https://www.instructables.com/id/CNC-Robot-Plotter/

Step 1: Software

This gcode terminal requires that you have "Processing 3" installed on your computer.

"Processing 3" may be obtained from https://processing.org/download/?processing

Step 2: Installing the Gcode Terminal Software

"Processing 3" is very similar to the Arduino IDE (integrated development environment).

Run "Processing 3" and paste the contents of "Processing3_terminal.pde" into a new sketch.

That's it !

Step 3: Testing

The "CNC Drum Plotter" will accept either Bluetooth or USB output from the terminal.

If you choose to use Bluetooth you must enable Bluetooth on your computer and "pair" your computer with the plotter. If you choose to use a USB cable then uplug the HC-06 Bluetooth module from your plotter.

Copy the attached file "Letter_B.ngc" into your "Processing 3" folder. This file tests each of the G00, G01, G02, and G03 functions. The end result should be a large A4 size portrait image of a capital letter 'B'.

With your "Processing 3" sketch running drag the horizontal bar upwards to maximize the visible terminal area.

Now click the "Run" button which is on the top-left corner of the screen and follow the on screen prompts.

If the terminal doesn't connect change "DEBUG_ON = false;" to "DEBUG_ON = true;" and match the terminal's "COM" port setting to that used by the plotter.

Once you have positioned the plotter's pen at the bottom-left corner of your A4 page, "right-click" the instruction box and type "Letter_B.ngc" (without the quotes). Keep in mind that the terminal is "case-sensitive".

All going well gcode commands, echoed back from the plotter, should start streaming down your screen and the plotter should start moving.

  Click here   to view my other instructables.

Share

    Recommendations

    • Clocks Contest

      Clocks Contest
    • Water Contest

      Water Contest
    • Creative Misuse Contest

      Creative Misuse Contest

    2 Discussions

    your code in processing 3 software is showing error in line 113 saying Array out of bound exception.

    Please help!

    Capture.PNG
    1 more answer

    An error message will appear if the COM port number in line 113 doesn't match your actual COM port number.

    The error message should disappear, and the terminal connect, if you make the following changes to the code:

    Step 1:

    Change line 69 to read "boolean debug_on = true;"

    Step 2:

    Run the code and note your COM port numbers. (Let's assume that your highest COM port number equals 1)

    Step 3:

    Change line 113 from "String arduino_port = Serial.list()[2];" to read "String arduino_port = Serial.list()[1];"

    Step 4:

    Rerun the code ... the error message should disappear. If not try another COM port number.

    Step 5:

    Once the error message disappears change line 69 to read "boolean debug_on = false;"