I'm new to programming Arduino. I've programmed in c/c++/c#/java...even fortran and assembly language so I understand all the discussion of the Arduino c++ variant setup()/loop()...
I haven't actually received my hobby CNC machine yet along with the stepper motors, drivers, etc. so I've just been reading to get a head start.
In addition to programming I will likely be running a CAD program of some sort. So I wonder how those work. Surely they don't generate a c++ code sketch file do they? I'm thinking maybe they run something called GCode which is maybe easier for a program to generate and then run this through some sort of interpreter on the Arduino which interprets the GCode but is itself a c++ sketch file. Am I close?
If so I may want to in certain cases pass my own GCode to the interpreter. I don't really know. I'm just trying to get a handle on the application architecture that various applications use.
I expect most of my use of the CNC will be through some sort of CAD program but I'm adding a rotary axis so I expect I may have to write programs for that to do what I want.
Your CNC machine will have a controller board attached. It will usually have a G code interpreter program like Grbl installed. Its job is to interpret the G code and executes the commands send from the PC by a Gcode sender like Universal Gcode sender.
UGS gets its file from a CAM type program. CAM will take a file from a modeling program and translate it to Gcode.
I'll give an example using my DIY engraver for wood. I will find a bitmap file that i want to engrave or use a paint type program to create it. Then use one of Scorch Works programs to translate to Gcode. Skorch Work is one of many, Plus there are plugins for many graphics programs.
Then I load the Gcode file to my favorite sender, bCNC,. From bCNC (or UGS) I can control the machine, set the machine up and send the file to be cut.
I have simplified the process a bit, but it is not complex and all the software tools that I needed were free and open source.
I use FreeCAD for my 3D modeling (mostly for 3D printer files and Slic3r slicer (generates Gcode from STL files).
Yes, that's close. Assuming that your CNC machine has an Arduino-like board as a processor. A lot of newer machines seem to have more advanced CPU boards (like a Raspberry Pi) (Gotta run the display with fancy graphics and the wireless connection!) The early low-cost 3d printers used a lot of Arduino-compatible boards running G-code interpreters.
GCODE apparently includes a "Direct Stepper Move" command that may be sufficient for your extra axes.
Other CAD output "languages" include Gerber (common for PCBs) (and I believe this has a common origin with GCOde?), Excellon (for PCB Drilling only, afaik) and I think HPGL (originally developed for flatbed plotters.)
You can also write your own code to control the machine by programming for the stepper motors directly, I have a "Zen sand garden" that is controlled by a stand alone Uno. The steppers move to create random patterns in the sand.