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
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Jul 22, 2:35 pm, Ignoramus24043 <ignoramus24...@NOSPAM. 24043.invalid> wrote:

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.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Kind of, sort of yes. The key here is properly separating different concepts, and programming them separately, so that they can be combined.
i
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Yeah, NFS Wizards in Mach 3 have functions to do that built in. You just tell it to ramp to depth. It drills a helical pattern to depth and then finishes the pocket. If the pocket is multi pass it will do it for each pass.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Ignoramus24043 wrote:

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.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I think that what I am trying to do, is build a library of functions to provide CAM functionality.
i
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
2010 14:03:10 -0500 typed in rec.crafts.metalworking the following:

    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
--
pyotr filipivich
We will drink no whiskey before its nine.
  Click to see the full signature.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

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
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Jul 22, 6:21 pm, Ignoramus24043 <ignoramus24...@NOSPAM. 24043.invalid> wrote:

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
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

    [ ... ]

    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.
--
Remove oil spill source from e-mail
Email: < snipped-for-privacy@d-and-d.com> | Voice (all times): (703) 938-4564
  Click to see the full signature.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
wrote:

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?

Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

    [ ... ]

    The provisions on this machine are saving to tape (a weird miniaturized cassette which is not quite compatible with the tiny answering machine tapes) or to punched tape via a RS-232 interface (which is what I use to save to a computer instead -- though it is awkward in any case.
    I do have a (totally undocumented) 3-1/2" floppy drive with a controller card on it from the Emco-Maier people which can replace the tape drive (and which probably acts *just* like the tape drive from the front panel controls) which I have not yet bothered to make up the mounting hardware for. But I'm not at all sure that it is any better than the tapes, other than floppies are easier to find. :-)

    Note that this has no home positions. You move to somewhere and then select absolute mode, and it works from there. If the program stops and power is lost (e.g. the e-Stop) it also loses track of where it was.
    You can't define the tool offsets at the beginning of the program -- *each* time you call up a tool, you have to enter the offsets with it. And the tool turret does not have a home position either. You tell it to move forward N stations (so you have to keep track of where it is -- and have to end the program with a return to the starting station or everything will be a disaster when you start again. :-)
    Remember -- this is not EMC -- or anything else serious. It lives entirely in the address space of a 6502 (the CPU used in the Apple-II or the Commodore PET).
    I believe that it was sold to be used as a training tool, not a working one. :-)
    Enjoy,         DoN.
--
Remove oil spill source from e-mail
Email: < snipped-for-privacy@d-and-d.com> | Voice (all times): (703) 938-4564
  Click to see the full signature.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I am not sure, I will check it out.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Ignoramus7608 wrote:

If his E-stop chain breaks the PPMC estop circuit, then EMC will be notified of the condition, and it stops, showing the current block of G-code. EMC continues reading the encoder position all the time, so you don't have to re-home or reset the part coordinates. Unfortunately, EMC doesn't handle restarts perfectly seamlessly. You have to click on the line (or a different program line that is a better/safer start place) and then select the "start from line" menu. This causes EMC2 to scan through the program and find the coordinates at the beginning of the selected move and go there first before resuming. Most of this works pretty well. One problem is it won't start the spindle and coolant, etc. So, you have to manually set that first before clicking the start from line. (There's an option that disables the ability to start the spindle and go to manual, but this seems to work by default.) You have to leave the machine in such a position that the restart move is clear of crashes.
Jon
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

At the very least, it is very useful to record in non-volatile storage the line number of the G-code step that was started just before the eStop, as that step may be the problem.
More generally, I would build a "flight recorder" in, recording say the last 100 codes and their line numbers, the exact time of execution, and an eStop flag to mark where the airplane crashed.
Joe Gwinn
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Ignoramus24043 wrote:

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
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

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

Sure. I will look into all of it.
i
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Ignoramus24043 wrote:

I've posted my treprectramp.c program, which generates G-code to ramp down while milling along the interior outline of a rectangular cutout, then makes a finish pass at full depth. See
http://pico-systems.com/treprectramp.c
Jon
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Jon, I am writing a function (in perl), to do what you did, but possibly in multiple passes for many pockets. I will reuse that idea.
After maybe half a year, I will provide it as a module on CPAN.
It would be essentially a library with building blocks for CAM. Could be useful for someone willing to write a GUI for it or for some websites.
i
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

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.
--
EA
>
> Jon
  Click to see the full signature.
Add pictures here
✖
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.