ESTLCAM G04 SERIAL
Relative Mode: Move (X,Y) amount at speed F CommandĪbsolute mode: Move in a line to (X,Y) at speed F Here are the codes I’m going to build into the interpreter. Gcode commands all consist of an uppercase letter followed by a number. The rules of gcode – the punctuation, syntax, grammar, and vocabulary – are very easy to explain to a machine. I could even make up a language! To keep life simple I’m going to use a language other people know and understand, called gcode. The messages I send to the Arduino could be in any language.
Most programs today are written using interpreters that were built using interpreters that were built using the original interpreters. Every language since then has been a different flavor of the same ice cream: trying to find easier ways of letting humans tell machines what to do. Then somebody got smart and wrote the first interpreter – a binary program that could turn a more human language (assembly) into binary. Each program probably did one small job because they were so hard to write. They memorized the binary machine language and wrote programs in that machine language. In the very beginnings of computers the programmers talked to the machines in machine languages – the ones and zeros of binary. There’s even a few ?: style if statements.
That means variables, methods, while(), if(), switch(), and manipulating strings. This tutorial is meant for people who have an Arduino and understand the basics of programming in C. I’m going to show you a simple interpreter written for Arduino that lets you move stepper motors for your robots. In effect we need our robot brain to be an interpreter. To command the stepper motors we need a way to easily turn our human desires into machine instructions into stepper motor steps. Stepper motors are a great way to move accurately – they move a predictable amount and then stay where you put them. CNC machines need to move accurately and on command. 3D printers, laser cutters, water jet cutters, robot arms, delta robots, stewart platforms, the Makelangelo: all of these are examples of computer numerical control (CNC) machines.