Not sure where to start

First off I am brand new to this site. If I am posting in the wrong spot please forgive me and advise.

I am one to have novel ideas, then seek out a solution. I have an electronics background, but to be honest have not dabbled with it since the early 90's. I know a lot has changed, so please don't assume I know much in this area. With that said I am somewhat of a tinkerer and have taken on many complex projects. As an example I recently built my own cnc machine from scratch, but I did use a prebuilt controller. I use an old computer with a parallel feeder port to send G-code using Mach 3 software. I tell you this in hopes you can guide me in the right direction of where to get started with my next project.

I want to control an XY table using G-Code. The X-axis and Y-axis will be driven by stepper motors or possibly servos not sure yet. I would like to design specific 2 axis drawings, create the G-code using my current software and then down load the G-code to the XY table and have the code run in a loop without using a computer. When I started investigating this I came across Arduino. I never heard of Arduino before. Further searching on the internet, I have been unable to find any reference as to how to achieve this but have seen kits for CNC Arduino breakout boards. Unfortunately very little instructions or information can be found. My assumption is that I can download the G-code to an Arduino board of some type, and drive the servos to operate with the specific G-code.

Now to my question, can you point me to a site, a kit, something that will help me educate myself on this subject. Or is what I am wanting to do even possible.

All comments and suggestions are most appreciated

Other than the G-code part (don't know this at all) this does indeed sound like a good job for an Arduino. Controlling steppers and servos - that's right up its alley.
It just depends on how complex this G-code is but if it's a code with simple instructions like "move A to B" then it should be no problem.
For larger files you will have to either send instructions one by one (memory of an Arduino is limited!) or store it on SD card or so first (can be done via the Arduino - read over USB and store on SD card as buffer) and have the Arduino read it from there.

what you ask is being done. the place to look is the CNC forums.
spend some time with google

becikeja:
I want to control an XY table using G-Code.

There is an Arduino program that you can download called GRBL that can interpret Gcode and control stepper motors. You can also buy a "GRBL shield" that makes it easy to connect low power stepper drivers to an Arduino.

However if you need high-amperage stepper motor drivers you could still use GRBL without using a GRBL shield. Most stepper drivers just need step and direction signals.

...R

Appreciate the comments, I am not concerned with the CNC aspect of this. I am comfortable in that area. What I am trying to understand is if the Arduino can hold and execute the g-code. And if it can how do I do it. I am more than willing to learn and not asking for all the answers. But in my internet search, everything I see when it relates to executing stepper motors using g-code it is always connected to a computer. Perhaps the GRBL reference above is the answer I will explore it. If you could point to specific web pages as a starting point it would be appreciated.

becikeja:
Appreciate the comments, I am not concerned with the CNC aspect of this. I am comfortable in that area. What I am trying to understand is if the Arduino can hold and execute the g-code. And if it can how do I do it. I am more than willing to learn and not asking for all the answers. But in my internet search, everything I see when it relates to executing stepper motors using g-code it is always connected to a computer. Perhaps the GRBL reference above is the answer I will explore it. If you could point to specific web pages as a starting point it would be appreciated.

Just to back up one bit, in your choice of stepper versus servo motors, I'd definitely advise steppers. From my memory my Servo-Mechanism's class (also a VERY long time ago), getting the damping and inertia to acceptable standards to control something like an X/Y table with precision will be a bear. (look up PID loops, and plan on the math and mechanics getting pretty sickening). At least with stepper motors, all that you have to deal with is making sure the mechanical resolution of the "steps" is sufficient for the accuracy you require.

But back to your question though, I don't know the particular structure of G code, but its a safe bet the Arduino does not have any built in library support for it. I'm sure, as another responded has suggested, that G code is simply a set of instructions for defining movements and speed. So it certainly should be possible to make an Arduino read and interpret the contents of a file containing G code, perhaps over a serial interface, and translate the directions into control for your stepper motors. I have some doubts about an Arduino holding the entire contents of a G-code file in its memory, but it may be possible to write a state machine to read it byte by byte (as I mentioned, over a serial interface), interpret each instruction, and then move on to the next. But if the Arduino needs to hold the entire G code file in its run time memory, that could present a problem for sizable files. As for interpreting the G code commands, I think you'll have to author this code yourself, but I for one would like to see the end result done as a project. It sounds like something I'd like to have myself! :slight_smile:

Good luck on this!

becikeja:
What I am trying to understand is if the Arduino can hold and execute the g-code.

What part of Reply #3 did you not understand.

...R

becikeja:
Appreciate the comments, I am not concerned with the CNC aspect of this. I am comfortable in that area. What I am trying to understand is if the Arduino can hold and execute the g-code. And if it can how do I do it. I am more than willing to learn and not asking for all the answers. But in my internet search, everything I see when it relates to executing stepper motors using g-code it is always connected to a computer. Perhaps the GRBL reference above is the answer I will explore it. If you could point to specific web pages as a starting point it would be appreciated.

G-Code is generated in some way. some by hand, others by CAD drawing post-processor...
g-Code is loaded to CNC controller
CNC controller controls drivers.
Drivers control the motors (servos' being the best choice for large tables, Steppers for table top units)
you asked about if the Arduino can hold and run the G-code.
See Robin2's post. #3
you asked where to start : read post #2
and since you asked for some links, I googled ' arduino grbl cnc ' for you :

DIY CNC 3 Axis Engraver Machine PCB Milling Wood Carving Router Kit Arduino Grbl - LinkSprite Playgound