A realization on "G code scripts"

I had a little light bulb go off in my head.

I think that I know what to do.

I will have functions that could combine different machining notions together.

For example, say, I have a steel plate. I could make a circular cut through it. If the plate is thick or hard, I may need to do it in several passes, with plunging.

Okay so far.

This really involves two separate concepts:

1) Generating the shape of the cut (circular, in this example) and 2) Implementing a cut along an arbitrary shape, with several passes if necessary

If I can do these two tasks separately, then I have a lot of flexibility, as I could easily cut a square shaped hole in plate, egg shaped, etc.

Same applies to "milling out a deep pocket along an arbitrary shape". Generating a shape is one thing, and removing material inside it (in possibly several layers) is another.

This kind of approach, has potential for some very fun results.

i
Reply to
Ignoramus24043
Loading thread data ...

If I'm getting this right, you're putting X and Y moves in an inner loop with minor Z movements outside them and major Z movements outside of that, Correct? No reason at all why something like that shouldn't work.

Reply to
rangerssuck

You're picking up on what CAM software does. CAD provides the design of the part, CAM figures out how to make the part essentially.

Reply to
Pete C.

Kind of, sort of yes. The key here is properly separating different concepts, and programming them separately, so that they can be combined.

i
Reply to
Ignoramus24043

I think that what I am trying to do, is build a library of functions to provide CAM functionality.

i
Reply to
Ignoramus24043

The generally suggested method is to ramp down while performing the cut, rather than plunging in Z and then moving in XY. I have already converted my "treprect" program that plunged first, then cut around the rectangular shape, then made a finish pass at full depth. The new version, which I haven't gotten up on my web page yet ramps down on the first side of each level.

If it is not a simple circle, oval or rectangle, then it may be better to plan the whole thing on a CAD system. Bobcad/CAM, one of the lower-level packages, will do this pretty much automatically. You give the pocket outline, the depth, and set some parameters such as the step-over and plunge increment, and have it draw an offset line to compensate for the tool radius, and it will carve out the interior of the pattern automatically. Pretty much any CAM system ought to be able to do the same.

Jon

Reply to
Jon Elson

That actually makes perfect sense. Thanks for bringing this up.

Sure. I will look into all of it.

i
Reply to
Ignoramus24043

Dudn't dat Mach controller program do all this? These are all standard routines in any Haas/fadal, etc.

If doing a curve with an underlying analytic function, that function can be straightforwardly done in a macro, without the need for cad or cam. Fadal supplies such a macro for an ellipse. I think it has to be done quadrant by quadrant, but no biggie. I've done such a macro for fishmouth chamfering.

Reply to
Existential Angst

Iggy is using EMC2, but yes, Mach3 has "wizards" for these type of functions and I'm pretty sure EMC2 has something comparable as well.

Reply to
Pete C.

See G12,G13 with plane select keyword(G17,18,19). My quick google shows that g2 g3 now take a ramping value on some controls.

In the case of G12, G13 on older controls, it was basically a G2/3 move with an infeed or ramping down/up per revolution. That is if I remember this correctly.

Wes

formatting link

-- "Additionally as a security officer, I carry a gun to protect government officials but my life isn't worth protecting at home in their eyes." Dick Anthony Heller

Reply to
Wes

Even better is to ramp down as you circle. Plunging requires a center-cutting mill. The ramp does not as you get slightly deeper as you progress.

Also consider cutter compensation -- telling the CNC machine what diameter cutter you are using, and which side of the cutter you are using, and it generates a tool path to produce the shape you want -- or complains if the drawing calls for a tighter radius in the pocket than your mill can actually produce. Of course, you don't hit this particular problem when cutting the outside of a rectangle.

But if you don't separate (in time) the tasks, you can do the ramp down instead.

Indeed so.

Enjoy, DoN.

Reply to
DoN. Nichols

Ignoramus24043 on Thu, 22 Jul

2010 14:03:10 -0500 typed >>

And is a good thing to understand in and of itself. That is, when I was taking a class on CNC, we started out having to write the code to move the end mill from point A to point B. All the code, all the way. From "turn on spindle" to descend, to enter metal, to move to starting point, make pass, exit, etc, etc, etc. Once we knew what we wanted, and how it was done, then we moved on to the "neat" CAD/CAM which let us draw the part, then let the program figure out how to mill it. Even then, it required us to understand the process.

pyotr

Reply to
pyotr filipivich

Great approach. Cover the basics first. Since I have a mill, I have to write all codes etc. (and if I cut its table in half accidentally, it will be my loss to eat!)

i
Reply to
Ignoramus24043

If, when using one of your programs, you suddenly hit an emergency stop button, does your program stop, also? Then are you able to go back to the operation that stopped and continue on? Something to consider.

Paul

Reply to
co_farmer
[ ... ]

I consider it to be very likely using EMC.

However -- using my Compact-5/CNC lathe (Emco-Maier 5" swing, stepper driven, 6502 CPU) not only can I not restart from the step which I stopped on -- but I lose the entire program (unless I saved it on tape first), because it drops power from the CPU and spindle motor as well as the stepper motors.

And if you have the encoder counters powered by an alternative power source (e.g. the Servo-To-Go board has provisions for a battery to back up the counters and continue power to the encoders) you can even have the machine record how far it was moved by manually manipulating the powered-down servo motors or the leadscrews (if they rotate -- the Bridgeport BOSS-3 X-axis does not -- the nut rotates in precision bearings instead, so you avoid whip in the leadscrew at high speeds -- as though you could accomplish high speeds with the original stepper motors in the BOSS-3.)

Enjoy, DoN.

Reply to
DoN. Nichols

You really need to have the program written to tape (uggg!!) a floppy, or even a flash device and simply reload from the files.

There is no way to go to Toolx and start from there?

One could not be a successful Leftwinger without realizing that, in contrast to the popular conception supported by newspapers and mothers of Leftwingers, a goodly number of Leftwingers are not only narrow-minded and dull, but also just stupid. Gunner Asch

Reply to
Gunner Asch

Yes, but for circles only. EMC takes arguments to make the cut helical.

I want to make a lifting eye with a egg shaped hole.

an infeed or

You do.

i

EMC is almost all software, so,

Reply to
Ignoramus7608

Great point.

you mean inside rectangle?

I will first try to just learn G codes, I think, but I started experimenting with better way of writing those scripts. Basically a CAM library in perl.

But I think that before running, I need to learn to walk, so, I will practice using G-Codes in a non-idiosyncratic manner.

i

i

Reply to
Ignoramus7608

I am not sure, I will check it out.

Reply to
Ignoramus7608

Have you looked at Mach 3? It has wizards included that do many of these functions already. It has a number of lines of code limit, and I think you need to register to use the wizards, but its worth a look see.

Have you looked at Cam Bam? They claim it's a beta, but I have done some real serious detail work with this CAM software, and it even has some limited CAD capability. The executions limited demo is 100% non crippled, and the price to register is very reasonable.

If you enjoy writing programs soldier on, but otherwise I think you are reinventing the wheel.

Yes, I still do some hand coding of G-code, but as I learn to use the tools I have I do less and less of it.

Reply to
Bob La Londe

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.