Week 6: Communication


We will cover common techniques for communicating and controlling XYZ robots.


Bot of the Week

Apis Cor 3D Prints a House

Apis Cor


Lots of air bubbles in today’s #ceramic3dprint

A post shared by Bryan J Cera (@cera.tops) on


Bot of the Week in Action

We’re going to revisit some old friends today and see what they have in common.

Makeblock XY Plotter



Let’s see where we all are.  How did the H-Bridge boards go?  What did we think of the AxiDraw?



How do we tell our robots to do what we want them to do?



G-code is the generic name for a plain-text language that CNC machines can understand. – via Make: Getting Started with CNC, page 111.

G-code Specific Codes

There is a great, very straight forward, example of Drawing a Square, Chapter 8 Make: Getting Started with CNC

“Imagine telling someone how to make a square with a pen on a piece of paper—it might go something like this:

  1. Put pen down on paper
  2. Move pen 1 inch toward the top of the page
  3. Move pen 1 inch toward the right edge of the page
  4. Move pen 1 inch toward the bottom of the page
  5. Move pen 1 inch toward the left edge of the page
  6. Lift pen 1 inch from the paper

If these instructions are followed correctly, they’ll find themselves with a nice square drawn on the page (see below).

Now let’s do the same thing in G-code

  • English – Put the pen down on the paper
  • G-code – G20 F20 X0 Y0 Z0
  • English – Move the pen 1 inch toward the top of the page
  • G-code –  G1 Y1
  • English – Move the pen 1 inch toward the right edge of the page
  • G-code –  G1 X1
  • English – Move the pen 1 inch toward the bottom of the page
  • G-code –  G1 Y0
  • English – Move the pen 1 inch toward the left edge of the page
  • G-code –  G1 X0
  • English – Lift the pen 1 inch from the paper
  • G-code –  G1 Z1″


Motion Control is software that reads G-code and converts it into electrical signals that tell the CNC to move.  At its core, motion control is the link between the software and the hardware. -via Make: Getting Started with CNC, page 105.

Grbl is a free, open source, high performance software for controlling the motion (motion control) of machines that move, that make things, or that make things move, and will run on a straight Arduino.  Grbl is already loaded on your X-Carve Arduinos.

You can interact with Grbl from the terminal, but traditionally uses another software to control the CNC (in our case so far Easel).

List of Supported G-Codes in Grbl v0.9 Master:
– Non-Modal Commands: G4, G10L2, G10L20, G28, G30, G28.1, G30.1, G53, G92, G92.1
– Motion Modes: G0, G1, G2, G3, G38.2, G38.3, G38.4, G38.5, G80
– Feed Rate Modes: G93, G94
– Unit Modes: G20, G21
– Distance Modes: G90, G91
– Arc IJK Distance Modes: G91.1
– Plane Select Modes: G17, G18, G19
– Tool Length Offset Modes: G43.1, G49
– Cutter Compensation Modes: G40
– Coordinate System Modes: G54, G55, G56, G57, G58, G59
– Control Modes: G61
– Program Flow: M0, M1, M2, M30*
– Coolant Control: M7*, M8, M9
– Spindle Control: M3, M4, M5
– Valid Non-Command Words: F, I, J, K, L, N, P, R, S, T, X, Y, Z


Interfacing with the X-Carve

Sejo’s write up on communicating with the X-Carve using the Arduino Serial Monitor.  Grbl can be interfaced with a normal serial communication at 115200 baud.


Easel – web-based software platform that allows you to design and carve from a single, simple program.

Easel Screen shot


MakerCAM – MakerCAM is a web based CAM program. Simple by design, MakerCAM allows you to produce toolpaths for use with 3 axis CNC machines such as Shapeoko, Probotics, Zenworks CNC, ShopBot, or any other 3 axis machine that accepts standard RS274D gcode (most hobby/small business CNC machines accept this).

SVG to G-Code



Other Ways Control Machines

MasterCAM – We have access to MasterCAM in the shop, an NC programming software for 2-axis, 3-axis, simultaneous 4-axis & 5-axis milling, multi axis lathe, Mill-Turn, Wire EDM and routers.

CoolTerm is a simple serial port terminal application (no terminal emulation) that is geared towards hobbyists and professionals with a need to exchange data with hardware connected to serial ports such as servo controllers, robotic kits, GPS receivers, microcontrollers, etc.  Windows only.

ChiliPeppr is a hardware fiddle, meaning it is a website that lets you easily create a workspace to fiddle with your hardware from software. ChiliPeppr provides a Serial Port JSON Server that you run locally on your computer, or remotely on another computer, to connect to the serial port of your hardware like an Arduino or other microcontroller.

ChiliPeppr Grbl Workspace – Grbl devices are now supported inside ChiliPeppr. The workspace connects to your Arduino via the serial port over the ChiliPeppr Serial Port JSON Server. Maintained by Jarret Luft.


Image to G Code

image2Gcode – web based

dmap2gcode – windows and Linux

Halftoner – half toning the image

Single Line Drawings – Tsp sld – An entire drawing comprised of a single line. If done by hand, you would place the pencil onto your drawing surface and never lift the tip from the media.

F-Engrave is a text or image to g-code program (for both engraving and v-carving) that is written in python and is based on the text engraving software.

Webgcode – g code visulaizer


In Class Work/Assignment

Talking to the AxiDraw 

The AxiDraw does not use g-code to control its movements.  There command set is specific.

You will need Processing 2.2.1 and the Ani library.

AxiDrawProcessing2 – A method of using AxiDraw with Processing using only serial.

AxiDrawProcessing – Some simple examples showing how one can control the AxiDraw, directly from within Processing.


Draw a Square

Using g-code, we will code the square, upload, and make a machine “draw” a square.

Run g-code on the X-Carve, the Othermill, and if possible the Makeblock XY Plotter.


Develop Your Final Project Idea

In our next class, each of us will present an idea for our final project, nothing is written in stone, for an XYZ robot.  What is the original element you will be creating?  What do you want your robot to do? Pick your verb, what does it do?  Be as general as you can.  Then be as specific as you can.


Related Reading/Viewing

Interfacing with the X-Carve

AxiDraw for Developers

EBB Command Set

Hewlett-Packard Graphics Language