Writing G Code - Newbie

slow-poke

Registered
Registered
Joined
Dec 9, 2016
Messages
328
I'm a newbie that recently added CNC capability to an old LC30A mill using Mach3. I have next to no experience other than typing in some simple G0, G1 etc. commands and cutting a few arcs using the Wizard feature. I'm not a machinist, just a guy that likes to tinker.

I now want to attempt machining a fairly simple irregular shaped piece. To start, I just want to cut the perimeter that would be a sequence of straight cuts and 6 arcs. I imagine the mill going around the perimeter several times cutting a bit deeper on each pass until the bit finally cuts through the bottom edge. I suppose I can run the arc wizard 6 times and copy the 6 code segments it generates to a new file and then insert the straight line cuts (G01) in the appropriate locations in the new file, so that the entire perimeter is defined.

Is there a better approach, perhaps with some form of (low cost or free) cad software, or is the method I described above a reasonable approach?

Thanks to all that reply.

Plate.png
 
When I first started playing with CNC I bought D2NC. As I recall it cost about $70. It doesn't have a lot of features like the high dollar programs but got the job done. I'm now using CamBam.
 
I downloaded a free 2.5D (2-axis with the Z-axis being manually controlled) CAD/CAM program called "Techne CAD-CAM". Frankly, I haven't used it much since my Anilam Crusader II has an RS-232 problem so I can't talk to the box with a laptop. Google says they have a 3D version also. A lot of guys here use Fusion 360 which is free (?).

For DNC, my intent was to use a free download of "Cadem NC". However, the problem with my Anilam has me programming in just conversational mode. Wish I could help more, but I entered the CNC realm about 2 months ago and hope to progress to just the beginner status soon.

Bruce
 
As you get into more complex shapes, CAM software become increasingly more important. Cam take a CAD model ans with your selection of tooling and machining strategy, creates the necessary toolpaths to make the part. There are several reasons for using CAM to generate the G code. Programs become so long that it becomes tedious to write them from scratch. I have created G code programs that had over a quarter of a million lines of code. Secondly, debugging that code would become nearly impossible and the possibility of undetected errors will increase dramatically. Finally, CAM G code generated from CAD files can follow some intricate paths that would be otherwise virtually impossible to describe mathematically. A CNC machine with fourth axis capability can recreate a lifelike replica of a human face.

So what is available in software? There is a whole spectrum of software ranging from free to kilobucks/year and from some fairly simple 2D to toolpaths to things like adaptive clearing in three or four or five axes. One that is free for hobby use and is also quite sophuisticated is Fusion 360. It combines CAD and CAM in a single package and is sophisticated. There are others out there as well. My machine is a Tormach and I purchased it with SprutCAM and purchased a seat of SolidWorks for the CAD part. A little searching will turn up others.
 
I'm a fan of CamBam. It does have some limited CAD capability. A 40 free use trial will really allow you to learn how to use it before you need to think about buying a license for $149.
 
Fusion 360 is free for hobbyists. I asked that question directly of their marketing team and was told that Autodesk has no intention of changing that policy. Startup companies can also use it providing their annual revenue doesn'tr exceed something like $100K. Beyond that, they have a monthly or annual subscription which is quite modest compared to other software. You can rent it for only the months that you need it which is quite unique in the CAD/CAM world.

To access the free annual subscription, you can download the free 30 day trial and as you near the end of the the 30 day period, you can resubscribe as a hobbyist for a year. You do have to go through the resubscription process annually. I am in my third year of subscribing.

I should also mention for those who dabble in electronics that Autodesk acquired Eagle PCB layout software and has integrated it into the software family. It is capable of creating electronic schematics and PCB layouts and of converting them into 3D CAD files from which G code for machining can be created.
 
Assuming you've mastered the shape and tool offset, you want to increment z by whatever your depth of cut is, .050 x 6 =.300 depth of cut, running the cycle again until you've hit z.

10 start
20 go to zn yn z=.1
30 goto 100
40 g1 x whatever
50 run cycle
60 if z =-.300 end

100 Sub, set Z
110 g81 g1z-.05
120 g80
130 goto 40

This assumes g81 still does incremental, g80 does absolute.

Its been 15 years, I'm rusty, but this should work.

Tom
 
Thanks to everyone, I'm up and running (one miner crash ooops)

I searched but have not found.......

1) Is there a way to display a loop counter value, If I'm making 10 passes, it would be nice to see what pass is in progress?
2) Is there a way within mach3 to break out of a loop, for example I wrote the progam to make 10 loops, but by increasing the cut depth I'm able to do it in say 7 passes and now want to jump out of the loop.
 
DRO should show z values as you run, When it gets where you want it, let it finish the cycle then hit E-stop.

There's probably another way, I no longer have access to the machines I once ran.
 
Since you have the CNC and Mach3 you will most likely (eventually) end up with a cad program and a cam program. If you don't have full featured programs there will always be one more feature you will want or need.
Since Fusion 360 is free for hobbyists (and said to stay that way) and fairly full featured enough, it only makes sense to go directly there. At least explore the modeling and cam portions of the program.
I have TurboCad Pro and VisualMill for my CNC mill (several thousand dollars worth - and upgrades are expensive), but have been using Fusion 360 almost exclusively for the last year or so. It (so far) has worked flawlessly with my Syil X4+ mill and controller running Mach3. The only trouble I've had is occasional crashes with my old (and borderline capable) Windows 7 computer.
The learning curve isn't any steeper than learning a cad program and a cam program. There are lots and lots of online resources for learning and help. Autodesk and Lars Christensen being 2 of the best I've seen.
 
Back
Top