IDP said:
Greetings all,
I am considering converting one of my mill to CNC, I have the computer / controller / stepper motor side of things sourced. I draw in Autocad but what is the best software to convert Autocad drawings to g code.
I've had a look on the net and am bewildered.
I ought to say I'm going to use the mill for the production of steam loco parts etc.
Regards,
IDP
If you want to save the money on cam software and your parts are fairly simple 2d machine operations you may find it simple enough to use auto cad to give you the program. Of course you will have to type the program out but once you do one or two you will find it is pretty simple especially if you have a couple sample programs as your guide. All you need to do is simply pick or create a point where ever you like to use as your program zero. Create dimensions or just measure from that point to each of the the end points going around the part. You will need the radius size and center point for any arcs as well. If your controller supports the G2 or G3 circle commands with only an R value you wont need the centers however most use I, J and K to determine arc size and location. K is only used for arcs using the Z axis (quill or head moving up and down) . I and J are what is commonly used in 2d part programs and depending upon the controller there are differences in how they are used but most commonly I refers to the distance from the start point in the X axis to the center point of the arc you are cutting and J is the same start to center distance but in the y axis. These are commonly know as the incremental distance from start to center of the arc. An example would be if you wanted to cut a 1 inch square and on each corner have a radius of .25 cut as you go. disregard for now the cutter size and consider that x0. and y0. for your program will be the center of that square. This means for a square that is 1 inch each side of that square resides at .5 from center in both the positive and negative direction. therefore to cut that square you would need to start the spindle at a selected speed and move to a place safe like .5 in x and 1. in y which is .5 away from your finished side and for our purpose far enough to not hit the rough stock we are cutting this block from. Next you move down to your depth in z that you wish to make this square which for this example lets pick .25 as the thickness. Typically the top of the part will be the program zero point in z to go with the x0. y0. that we set at the center of our square. Now I am not to good at this so bear with my jumping around like that but here is where we are in code form at this point.
we set x0. y0. at the center of our future square
we set z zero at the top of the finished part.
assuming the use of work offsets (G55 for this example) and standard Fanuc style g code here is the code to start our program as discussed above. NOTE the comments in quotes are not part of the program they are only to explain each codes function.
T1 M6 "T1 = select tool #1; M6 = Change the tool in the spindle to the selected tool"
S500 M3 "S500 = set spindle rpm to 500; M3 = spindle rotation right(forward) [M4 = left(reverse)]"
G0 G55 X.5 Y1. "G0 = move at rapid rate; G55 = work offset where we stored our program zero location; X and Y = location to start"
Z-.25 "Z = move at last commanded rate (rapid see above G0) to our selected cut depth"
Now we can cut our square and lets assume that arcs using R is available and continue to disregard cutter size for now. We know that each side is located at .5 in each direction and we want a corner radius of .25 on each corner so to do that we must stop the tool at the beginning and end of each arc. We must travel from our start point at y1. and x.5 down a straight line to the start of our first arc. to do this we subtract the radius size from the location of the next wall to be cut. because we are at y positive and x positive to start and we want to travel in a direction creating a climb cut condition we will need to proceed down y to -.5 to get to the next side wall cut which will be going to the left along the y minus side wall to the x minus .5 side then up to the y positive wall and back across to the right to the x positive .5 location we are starting at. Now that we know the direction and location we need to end up at the rest is easy. subtract .25 from each of the end points and you have your arc start points and add/subtract .25 to eather the x or y values depending on the direction of the next straight line to be commanded. This sounds harder then it is. starting at y.1 and x.5 your at the upper right corner but .5 inch away from the finished side you will cut last. to make a square you nee to travel around the center point going from upper right to lower right a move in y axis leaving x at .5 where you started. next you need to move from right to left along the bottom of the square which is x leaving y where you ended your last cut. then up the left side to the top of the square moving y and leaving x. Last you need to go across the top in x from left to right leaving y where it is to finish your square. Now just add the corner radius keeping the direction in mind. Your code will look like this in standard Fanuc style g code. Also I am assuming absolute programming for this example if you use incremental the commands would remain but the x and y numbers would change so this example would not produce a square for those using incremental.
G1 Y-.25 F2. "G1 = move at the rate specified by the current or last F commanded; Y= final end of .5 minus .25 for (arc start point)."
G3 X.25 Y-.5 R.25 "G3 = counter clockwise arc; x=the next move axis current location less the radius; y=finial side location(arc end point)"
G1 X-.25
G3 X-.5 Y-.25 R.25
G1 Y.25
G3 X-.25 Y.5 R.25
G1 X.25
G3 X.5 Y.25 R.25
Now that x.5 looks similar to where we started and that y.25 is between the y1. we started at and the y-.25 that our first line traveled to which means we have already cut the side we are currently sitting on and we are done all that is left is to move off the part and stop the machine so here we go.
G1 x.75 "feed off the part away from the part in x positive direction. "
G91G28Z0. "G91 = incremental command used here to tell the machine to go to machine reference return rather then a program reference point that can be used on some machines this is the safest way to send z home on almost every control but check your manual first. the G28 means "return to reference point at rapid rate of travel. and the z0 defines the axis and reference point to return to.
add an M5 to stop the spindle and M30 program end and your done except for accounting for tool length and diameter which are controlled by offsets both in z which is the TLO or tool length offset and the cutter comp or R value offset which I will add later but I have a feeling this has all been a waist of time and it will likely either bore people to tears as useless already long know info or picked apart by those with different controls or who know more after there year doing CNC programming then I know after 30+ years of doing it but hey I hope it helps someone because that's all its meant to do. by the way if you pick you center in auto cad and find your end points and move around the part as i just did this square you will have a program for your part just by getting the start and end points and travel from one to the next in a single direction around the part. Use your cutter comp G41 and in your offset place the full cutter radius or diameter which ever your control requires IE a half inch end mill use .25 for the radius offset or .5 if your control requires diameter inputs. This is called part profile programming and it is the simplest way to produce a part using any size cutter you choose or have available at the moment capable of making the necessary cuts. It requires no cam package or importing and exporting of DXF files which can be problematic if you are not careful about your scale and paperspace (older autocads). Auto cad is a great design tool for civil engineers and a useless pain in the but for manufacturing (sorry all you autocad lovers, take heart thou, none of the manufacturing software can touch autocad for civil engineering not even close).
P.S. note to IDP, I have a 2-8-0 1/8 scale late 1800's style built by my father and I over about a 5 year span. I am still working out the bugs on my 800 feet of track I reciently put in the yard. Hoping to be steaming along soon here in the arizona desert.