Newbie, questions about Milltronics post and general ?'s

Hello everyone,

I’m a new user of Sheetcam, been playing with the trial version for 3 or 4 months and just got the license the other day. I really like the simplicity and speed with which I can get things done with this software.

As usual though, I have a few newbie questions… first, I’m using a Milltronics Partner 4, with a Centurion 5 (V) control… it takes a pretty generic g-code, very similar to any older Fanuc post. I haven’t experimented with all the possible options in the post section, but settled on the Mach 3 post and remove a few odd codes it puts into the post, like G91.1 (Illegal format on my machine) and an odd F1 in the line below that one. Has anybody found a post better suited for a Milltronics machine? I did search the archives of this and the Yahoo group with almost no results.

My main question is how can I get the post to use more canned cycles? Like spot drilling, peck drilling and so on, I have G72, 73, 74, 81-86, and 89. This would not only shorten a program, but allow me to add in an extra hole or something on the fly without having to re-code the whole program.

Secondary questions… was programming a motor mount bracket for a CNC lathe conversion and revised the part, and it no longer fit the blanks size on the normal XY directions, fortunately the block was big enough to rotate the part outline inside the stock boundary and get it to fit. I had no problem figuring out an angle, but had a little trouble figuring out what point it was shifting to where, when I tried to use the position “bar” along the bottom right of the window. I tried putting in numbers, would cycle thru the X, Y and rotation angle, the part would shift, I still needed more, put in new numbers that I thought would work and the part jumped around pretty unpredictably.

I managed to just rotate, then pick the alignment icon, picked one point on the drawing and could shift it around until I arrived at a position that would allow me clean up all around… it worked, but I felt I might be doing it in a roundabout way…

I’m sure I’ll have more questions as I delve deeper, but that ought to get me started… Thanks in advance for any help!

Brian

If you just need to remove those codes then the easiest thing to do is edit the Mach post. Go to Options->machine->post processor and click on the ‘edit post’ button. Look for this line:

post.Text (" G40 G90 G91.1\n F1\n")

and change it to:

post.Text (" G40 G90\n")

I don’t normally use canned cycles because they vary quite a lot between different machines. It is easier to hard code the movements so I know exactly how the machine will respond. Canned cycles can be added to the posts.

If you want to try this yourself, have a look at the Fagor 8025M MotionMaster Router post. The functions to look at are OnDrillStart(), OnDrill() and OnDrillEnd(). Alternatively send me exact details on the implementation of your drill cycles and I’ll mod the post for you.

For your alignment issue I would first set the material dimensions to the dimensions of your blank (Options->job options->Material). Next switch to nesting mode (Mode->nesting). You can now drag the part around using your mouse. To rotate it use the < and > keys. If the rotation steps are too coarse, right click and select ‘grid options’ then decrease the angle.

Thank you Les,

I can live with the lack of g-codes in general, although I might experiment with the G83 peck drilling cycle because it retracts all the way to the R level (usually Z.1 above the face of the part), unless you can tell me how I get that result in Sheetcam, seems all I get is a retract amount, which is equivalent to my G73 cycle.

Thanks for the tips on nesting, I suspected I was doing it the “hard way” and there would be a simpler solution.

Another couple of questions I forgot to ask, I used to own an aerospace machine shop and in production, we always programmed contour paths to centerline and used G41/G42 to offset for the diameter of end mill, this way you could compensate for tolerances and wear on the tooling to achieve specific size. Will Sheetcam do this “automatically” or do I need to write the program with no offset and then add in a g41/g42 and g40 to cancel as required?

In regards to tools, I’m building up my tool library as I add different size drills, end mills, and other types of tools. When I write a new program and choose tools from the tool table the tool numbers, and therefore corresponding G43 H** offset numbers are based on the tool table and not the order used. Is there a way to use the existing tool table and have the tool number and offset changed to reflect the new order? Currently I post and then go thru the whole program editing all the offsets and tool numbers… again, probably a simpler way that I’m just not seeing.

Thanks for the response, great forum, excellent software, and you must be stretched very thin trying to answer all of the questions, so it is greatly appreciated.

Normally the maximum clearance while peck drilling is equal to the rapid clearance plane. You could modify function OnDrill(). Look for this code:

         if &#40;endZ > safeZ&#41; then
            endZ = safeZ

and change it to:

         if &#40;endZ > drillStart + 2.54&#41; then
            endZ = drillStart + 2.54

This would give 0.1" clearance (2.54mm). Numbers in the post are always metric even if the post is outputting inch code.

we always programmed contour paths to centerline and used G41/G42. Will Sheetcam do this “automatically” or do I need to write the program with no offset and then add in a g41/g42 and g40 to cancel as required?

SheetCam generates code with the offset already applied. You can use no offset then add G41/G42 but that bypasses SheetCam’s gouge detection so it is quite possible to get gouging on inside corners, depending on the geometry. As long as you keep this in mind when creating your drawings it isn’t really a major problem for engineering type work. For artistic work where you have all sorts of weird geometry it would be a big problem. Another option is to use offsetting in SheetCam then set your tool radius in your control just to the correction factor. For example if your tool is cutting 0.002" over size program a radius of 0.001".

In regards to tools, I’m building up my tool library as I add different size drills, end mills, and other types of tools. When I write a new program and choose tools from the tool table the tool numbers, and therefore corresponding G43 H** offset numbers are based on the tool table and not the order used. Is there a way to use the existing tool table and have the tool number and offset changed to reflect the new order?

Not at the moment. I do need to think on this. Maybe I could add a ‘magazine index’ to the tool definitions.

Normally the clearance on a peck comes up to the rapid clearance plane? I’m not seeing that, when I put in my drill parameters, if I put .05" in for “Peck Retract”, then when I’m drilling it just retracts .050" breaking the chip, but it doesn’t come up high enough to clear the part.

Maybe an option on drilling could be just below Peck retract put in a box that states Retract to Z, and a .1 value in that box will have the drill retract to .1 above the part between each peck? That way you have the choice of drilling cycles… as when holes get really deep, it’s best to completely retract so all chips can get out and lube has a chance to get in.

Tools… it would be nice to have a Master tool file, then maybe one more check box, once the tool is selected, ask what tool number you want it to be? I don’t know programming well enough to understand if this is difficult or easy, so ignore my thinking out loud if it’s a huge amount of work, I can deal with it.[/quote]

If you increase the peck retract it will never lift more than the clearance plane. If you want it to always hit the clearance plane then simply set the peck retract to the drill depth or more.

it would be nice to have a Master tool file, then maybe one more check box, once the tool is selected, ask what tool number you want it to be?

That is a possibility. Any ideas are welcome. Don’t worry about the complexity of the programming. For me that is the easy bit. Coming up with a really good, workable method of mapping the tools is harder for me as I don’t have a lot of experience in a production environment.

Ahhh… I see now… so set the retract to the total Z depth plus and it will give me what I’m after, sorry, I didn’t catch that the first time. That would work well, gives you the option or either way.

Tool files… well, the situation is I don’t have a tool changer, but I have maybe 30+ tool holders, so tend to leave my 1/2" End mill in one, .201 drill for 1/4"-20 threads in another and so on. I could get all the tool lengths and put them into the machine, but seeing the machine stop and ask for T3 (third one in the order of running a specific part) and having that be T11 or something in my tool file gets confusing… again, if it was a machine with a tool changer, it could cycle, backwards, forwards, skip to which ever tool it needed, but that’s not the case.

I think, and what sounds the most generic to me, is you create your master tool list, basically setting rpm, depth of cut and peck parameters. Then, as you start your program, say I’m going to face off the material and want to use my 2" shell mill, it’s in the “master” list as T11, I call it up out of the master list, then the next box below the tool selection box could/would be “What Tool Number will this be?”, whatever you put in there would become the T and H numbers transferred into the program.

This way as you continue to build your Master tool list, it has all these available tools listed, you could even set up say 1/2" end mill, then list a variety, 2fl, 4fl, HSS, Carbide, and then cutting what, AL or Mild Steel… you could get as detailed or not as you desired, then you just choose the right set of parameters for your current situation and off you go.

I have a CNC knee mill, so keeping track of tool length really isn’t practical as I might raise/lower the knee at will to accommodate vises, different material height and tool lengths. Those that have VMC’s with tool changers and a static bed height, might want to include tool lengths right into the database and then they could just make sure their carousel is loaded in the correct order and they don’t even have to set any tool lengths other than one correction factor for the part height above the bed.

I’ll think on tool translation a bit more. I’m also thinking about scrapping the tool offset in SheetCam’s tool definitions. I don’t think anyone actually uses it.

Tool offsets, I could see that, if folks are using a standard offset, the library is kept in the machine.

I have modified the Mach 3 post to eliminate some glitches to better suit the Milltronics, and so far that is working fine. I do have one question, and feel I’ve read the answer somewhere, but can’t find it again.

When I finish with a tool, the machine retracts to safe Z (usually Z.1 in my case), kills the spindle and then rapids to my tool change position. I would prefer to have the spindle return to safe Z, then call a G49 Z0, canceling the tool offset and returning the spindle to full retract position… before it rapids anywhere. This makes it easier to not crash a tool into clamps or something.

Do you have a parking position defined (Options->job options->parking)? That will move in work coordinates. You can’t switch to machine coordinates in SheetCam. There are a couple of options:

1)Modify the post. function OnFinish() could be modified to output your parking sequence. This assumes you will always want to park in the same position.
2)Use a code snippet to output a parking sequence. the disadvantage with this technique is that you need to remember to add teh snippet every time you set up the job

I’m not using a parking position yet, that would be if I were running more than one part, and I wanted my vise to cycle to to the left (X positive) so that I could clear the spindle when changing parts in the vise. I also, correct me if I’m wrong, but doesn’t the parking position only come about at the end of the program, the M30 line?

Between tool changes I use a X minus move and a Y minus move, to shift the table to the right and rearward a bit (usually something like X-3 Y-10) as it makes it easier for me to reach the spindle and tool change button from my wheelchair.

I’m going to attach a .tap file of a belt cover I am making… I have change the tool numbers to be in order. I have some questions about the order of lines and how I might accomplish the Z retract I’m after. First, I want the spindle to be all the way up at the beginning of the program, so I could add a G49 Z0 to the Function OnInit in the G40 G90\n line, it would then read " G40 G49 Z0 G90\n", I think that would work there.

Now, currently the post finishes a tool, then the next line is an Operation line, telling me what operation, tool and tool number it is. Then the next line is Spindle speed, G00 if it needs it, and rapid to Z safe level. Then the next line is actually an M05 line, then the move to my tool change position line. After that is a text line of my next tool and then the tool call as below:

N0180 (Operation: Drill, CONTINUOUS, T2: 1/4" center drill, 0.25 in Deep)
N0190 S3000 G00 Z0.1000
N0200 M05
N0210 X-2.0000 Y-10.0000
N0220 (1/4" center drill)
N0230 T2 M06 G43 H2

Would it be possible to change the order of this? It seems like it should really be:

M05 (and could I add my G49 Z0 to this line?)
X-2.0000 Y-10.0000
(Operation: Drill, Continuous, T2: 1/4" center drill, 0.25 deep)
(1/4" Center drill)
T2 M06 G43 H2

This would, to me, seem to make more sense, kill the spindle, retract, shift to tool change position, then call up the next tool and continue on.

I don’t mean to be a pain in the ass, but it seems that most of the users are plasma, laser or router users who rarely change tools.

That code does look a bit odd. Try this: In Options->job options->tool change, turn off ‘Use Z’ if it is turned on. Turn on ‘no move to safe Z after tool change’ and enter the following in the ‘Run code before toolchange’:
G49 Z0
That should make it raise to machine Z0 just before the tool change (but after the move to tool change X,Y position). After the tool change it will rapid to the cut start at machine Z0 before dropping down to the cut.

Another option would be to hard code this in the post processor. In that case don’t have any tool change position or any tool change code defined. Leave ‘No move to safe Z after tool change’ turned on. In the post, add this to the start of function OnToolChange()

   post.Text&#40;" G49 Z0\n"&#41;
   endX = -3 * 25.4
   endY = -10 * 25.4
   OnRapid&#40;&#41;

This hard codes a move to machine Z0 then X-3, Y-10 (the 25.4 is in there because the post operates in metric).

By the way, do you always renumber your tools in sequence? If so, here is a quick and dirty hack for the post to do this:
In function OnInit() add this:

   thisTool = 0

At the start of function OnToolChange() add this code

   thisTool = thisTool + 1

Now change every occurence of ‘tool’ to ‘thisTool’ in function OnToolChange. This will fall over if you need to re-use a tool that you used earlier. It will end up with a new number the second time round. As I said, it is a hack!

OK, made the changes, Use Z was not checked to begin with, but I did check “no move to safe Z after tool change” and added the G49 Z0 code. That seems to work, it actually does it before the move to tool change position, which is what I wanted, for it to pull up in Z before any XY moves are executed. I don’t think I want to hard code this, as my tool change position varies with each job… so I’d rather be able to change that value at will.

The only issue I noticed is that my fourth tool the 1/2" end mill, will now feed down all the way from G49 Z0 to the first Z depth called for at the specified feedrate. Now my face mill, and the center drill and drill all rapid down to z.1, then feed from there, so I’m not sure what the difference is, and what I need to do to change it.

I tried to do the renumber the tool, but I must be doing something wrong, I’ll see if I can attach the modified post, but in case I can’t, here is what the two sections look like now:


function OnInit()
thisTool = 0
post.SetCommentChars (“()”, “”) --make sure ( and ) characters do not appear in system text
post.Text (" (Filename: “, fileName, “)\n”)
post.Text (” (Post processor: “, postName, “)\n”)
post.Text(” (Date:“,date,” Time:“,time,”)\n")
if(scale == metric) then
post.Text (" G21 (Units: Metric)\n") --metric mode
else
post.Text (" G20 (Units: Inches)\n") --inch mode
end
post.Text (" G40 G90\n")
bigArcs = 1 --stitch arc segments together
minArcSize = 0.05 --arcs smaller than this are converted to moves
end

and then this:

function OnToolChange()
thisTool = thisTool + 1
post.Text (" (“, toolName, “)\n”)
post.Text (” T")
post.Number (tool, “0”)
post.Text (" M06 G43 H")
post.Number (tool, “0”)
post.Eol()
if (plungeRate <= 0) then
post.Warning(“WARNING: Plunge rate is zero”)
end
if (feedRate <= 0) then
post.Warning(“WARNING: Feed rate is zero”)
end
end

I don’t usually re-use a tool, so if this “hack” will work, it’ll be good enough for me. If I did need to use a tool a second time, I could always call it the next tool number in order and just load the tool offset in both locations in the tool table of the machine.

You are close. Just make these extra changes:

post.Number (thisTool, “0”)
post.Text (" M06 G43 H")
post.Number (thisTool, “0”)

I’m not quite sure why your 1/2" end mill feeds down all the way. Could you post your job file so I can run it here and see if I can figure out what is going on.

Will make those changes momentarily, in the mean time, here is the job file.

That was a sneaky one. The problem is that the post does not know about your G49 Z0. It assumes the cutter is at clearance height. In Job options you have set the plunge safety clearance to be the same as the clearance plane. The move from plunge safety clearance height to the top of the work is always done at feed rate. As it thinks it is at clearance height the next move will be the plunge at feed rate to the top of the work.

To get around this reduce your plunge safety clearance to something like 0.05" or even less. Generally I use 0.5mm (0.020"). Plunge safety is only there to allow for any slight misalignment of the work or any chips in the way.

OK, I’m about to loose my mind on this, but I’ve modified the post around some more. Removed the add G49 Z0 in the tool change situation, added the tool number changes to get them to come up in order.

So… where I am at now with this last post, which I have called “Milltronics Rev B”, I changed my spindle stop command to be G49 Z0 M05, so any time a spindle stop is called, the tool will retract to machine zero. I also added some codes into my safe line in the OnInit() section, G50, G70 and G80, these cancel scaling, mirror and any canned cycles, just in case. I also added a second line below that with G00 G49 Z0 to make sure the tool goes all the way up first, before it starts moving. This gets my posts pretty darn close, with two last problems to figure out.

As you will see in the code, after the OnNewOperation line, yet before the OnComment line, I get a line, which has a spindle speed, G00 and Z.1000, if possible, could I get rid of that speed call on that line as it is coming from the upcoming tool, yet being applied to the tool that is still in the spindle… this could be kind of catastrophic if I have an offset boring head that shakes like a son of a gun over 700 rpm and the next tool is a center drill at 3000 rpm… it speeds up the old tool with the “new/next” tools rpm before the actual tool change. That was a butt puckering moment, let me tell ya… :open_mouth:

Now, I need that G00 Z.1000, except for the first tool, which I could deal with deleting this one line out of a new program if necessary, as I do need that call at the end of every subsequent tool other than the first one. I don’t know if there would be a way to just delete the whole line when it applies to tool number 1 or not…

The last problem and it’s nit-picky, is that now that I have the tool numbers coming up in order, i.e. 01,02,03 and so on, is there a way to change in the OnNewOperation line the tool number that shows up on the comment?

Thinking about it, that speed change is a bug but no-one has pointed it out to me before. To work around it, find OnSpindleChanged() and remove this line:
post.ModalNumber (" S", spindleSpeed, “0.##”)
I will fix this bug the next release.


The G00 Z0.1 on the first tool change is a bug or a feature, depending on how you look at it. The problem is that you have specified a tool change X,Y position. SheetCam needs to move the tool but it doesn’t know the Z position. As an emergency measure it first moves Z to the rapid clearance plane. This isn’t ideal either as you may not have the correct tool offsets in place for the tool that is currently in the spindle. This is a case of being damned if I do and damned if I don’t.

I would remove the G0 G49 calls in the post. Instead use these settings in job options->tool change:
Turn off ‘use X’ and ‘use Y’. Leave ‘No move to safe Z after tool change’ on. In the ‘Run code before tool change’ use this:
G49 Z0
G00 X-2 Y-10

Basically you are overriding SheetCam’s default tool change code positioning code and substituting your own. The resultant code with these settings and the above post mods looks pretty good to me.

The last problem and it’s nit-picky, is that now that I have the tool numbers coming up in order, i.e. 01,02,03 and so on, is there a way to change in the OnNewOperation line the tool number that shows up on the comment?

Damn, I was hoping you wouldn’t notice that :wink: I am afraid you can’t easily change it. It is possible but it is a bit complicated. Basically you would have to search the operation name for the tool number then change it to the correct number.

Les,

I want to thank you for all the help… the last suggestions seem to get me 99% there. I have a G49 Z0 call before the first tool, and before the move to tool change position on all subsequent tools. I’m getting a rapid move back down to the part after the tool change, although I set that to .090" above instead of safe Z which is at .100". The rpm change for the next tool also now happens after the tool change.

I have the tool numbers in order, with the right H call included. The only thing I have now is the comments section has the wrong T number, but that’s easy to fix, and honestly, it might not even show on my screen if I was to leave it alone, but for clarity’s sake, I’ll just change that manually or delete the T# entirely, as it shows up in the next comment line.

Thanks again for being patient with my endless questions and I do appreciate all the effort!