CNC Gcode Sender

7,834

30

10

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

    • Trash to Treasure

      Trash to Treasure
    • Tape Contest

      Tape Contest
    • Arduino Contest 2019

      Arduino Contest 2019

    10 Discussions

    0
    None
    kaitoti21

    6 weeks ago

    Hello thank you for sharing this project,,
    1. I managed to make the motors move in your coreXY_plotter_1a code but we got a problem because our design of the drawing machine is there's only one stepper motor each for the X-axis and the Y-axis how to manage when moving horizontally only one stepper will move.
    2. I used the downloaded processing_terminal but the menu looks like this(image) how to use the outline.ngc help

    errormenu.PNG
    1 reply
    0
    None
    lingibkaitoti21

    Reply 5 weeks ago

    My coreXY_plotter_1a.ino code will NOT work with a conventional XY plotter that has a separate motor for each of the X-axis and Y-axis.

    A CoreXY plotter is not a conventional plotter as it does not have separate X-axis and
    Y-axis motors.

    If you simultaneously step BOTH motors of a core-XY plotter in the same direction the pen will move horizontally.

    If you simultaneously step BOTH motors of a core-XY plotter in opposite directions the pen will move vertically.

    If you only step a SINGLE motor of a core-XY plotter the pen will move diagonally.

    0
    None
    kaitoti21

    Question 6 weeks ago

    I used the downloaded processing_terminal but the menu looks like this(image), but I manage to make the motors move on the Arduino file my problem is how to use the outline.ngc help

    help.jpg
    1 answer
    0
    None
    lingibkaitoti21

    Answer 5 weeks ago

    Apart from an unintentional code change somewhere while installing the software I have no idea why you are getting this response?

    Something to try:
    - download the CoolTerm software terminal from http://freeware.the-meiers.org/
    - installation instructions for using it may be found in Step 7 of my instructable https://www.instructables.com/id/Omni-Wheel-CNC-P...
    - copy outline.ngc to the "CoolTermWin" folder
    - instructions for sending this file are given in Step 8.

    0
    None
    SHAMSUDHEEN MARAKKAR

    Question 5 months ago

    How can I learn the CNC programming for a cd drive turned 2d plotter. I made one by referring an instructable that used a typical arduino code for the x and y steppers and the processing ide. It works well, but I can't understand the codes in arduino and processing. Could you please help me.

    1 answer
    0
    None
    lingibSHAMSUDHEEN MARAKKAR

    Answer 5 months ago

    "How can I learn the CNC programming for a cd drive turned 2d plotter .......I can't understand the codes in arduino and processing. Could you please help me."
    --------------------------------------
    "How can I learn the CNC programming"
    --------------------------------------
    The following link may be helpful:
    https://makezine.com/2016/10/24/get-to-know-your-cnc-how-to-read-g-code/
    There are many codes ... fortunately you only need to know a few.
    Codes that refer to positioning start with the letter 'G' ... they tell the machine where to go and how to get there.
    Examples:
    (1) G00 X100 Y150 = Go (rapidly with your pen up) to location X=100, Y=150
    (2) G01 X100 Y150 = Go (slowly with your pen down) to location X=100, Y=150
    (3) G02 X100 Y150 = Go clockwise (with your pen down) to location X=100, Y=150
    (4) G03 X100 Y100 = Go CCW (with your pen down) to location X=100, Y=150
    Codes that start with the letter 'M' are general machine instructions.
    Examples:
    (1) M0 = Stop
    (2) M2 = Program End
    (3) M3 = Spindle On (Clockwise)
    (4) M4 = Spindle On (Counterclockwise)
    -----------------------------------------------------------------------
    With regards to "I can't understand the codes in arduino and processing"
    -----------------------------------------------------------------------
    Arduino, and Processing, programs both use the C, C++ language.
    If you have never written an arduino program then I recommend purchasing a copy of
    "Programming Arduino: Getting Started with Sketches", Second Edition, 2016
    by Simon Monk.
    The C & C++ languages do not use Gcode, but it is possible to a write program in C/C++, such as interpreter, that intercepts Gcode sent to it and makes your plotter perform the requested action.
    Such a program is GRBL ... see my instructable https://www.instructables.com/id/How-to-Control-a-Servo-Using-GRBL/ which includes instructions on how to create Gcode from a drawing.

    0
    None
    mimax

    Question 8 months ago

    Why is there no response to the operation?

    w2.jpg
    1 answer
    0
    None
    lingibmimax

    Answer 8 months ago

    In order to help I need further information:

    (1) What operation?

    (2) This terminal program will (unless modified) only work with my plotters. Are you attempting to talk to one of my plotters or are you connected to a 3rd-party plotter?

    (3) All of my plotters respond with a menu. Did a "menu" and a "grey box" appear?

    (4) Your screen indicates that you have something attached to your serial port (as there is no error message). Does your serial baud speed match your plotter?

    0
    None
    guptajatin15

    Question 11 months ago

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

    Please help!

    Capture.PNG
    1 answer
    0
    None
    lingibguptajatin15

    Answer 11 months ago

    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;"