Cnc Course in hobby machinist

Re: Calling Subprograms

Being able to call subprograms is a useful tool, because it helps speedup the writing of programs, Sort of drag and drop feature, let`s you assemble programs with existing programs and standardize. How it can help us? Well, imagine you need a program to make a part that has a profile and holes that will be tapped. From our previous examples, you recorded the following programs: Heading, drilling and tapping. So you just open the heading program, save it with different number (the part number is wise) and call subprogram drilling, then call subprogram tapping. Then you go to the subprograms and only edit the X and Y, the depth and cutting parameters, same for tapping. This assures fewer mistakes, forgotten codes and let`s you call different programs as needed.

Let`s see how ist`s done.

We call our heading program, I will use real numbers instead of the #.

O2959
%
G15 G17 G40 G49 G80;
G20 G54;
G91 G28 X0.0 Y0.0 Z0.0;
M06 T1;
M03 S1500;
G90 G00 X0.0 Y0.0;
G43 Z10.0 H1;
G00 Z0.5 M08;

G99 G82 R0.3 Z-0.5 P200 F3.6 L0; (Here we call a drilling cycle with dwell, the L is used to specify how many times we need to repeat the cycle)
M98 P3545; (Here we call program O3545, in our case let`s think it`s the cartesian array of holes we did, I will write it at the bottom only for reference, you do not need to write it, it should be in the memory of the CNC)

G01 Z0.5;
G04 X10.;
G00 Z10. G40 G49 M09;
G91 G28 Z0.0 M05;
G28 Y0.0;
M01;
M30;
%


Subprogram O3545
%
O3545
X5.8 Y2.3;
X8.0;
Y8.0;
X3.4;
X1.2 Y6.0;
G80 M09; (Drilling Cycle Cancel)
M99; (Subprogram Cancel )
%


With this tool, You can just edit where the holes are, and forget about all other things.:whistle:


This reminds me of "sub-routines" that we used in programming "Basic". Of course that was donkey's years ago!

Question: I have seen the use of "wizards" for performing different functions on a mill. Would that be a form of sub programming?

BTY, this is great stuff. I don't actually own a mill. I intended to convert an SX2 later this year. Seeing what can be accomplished by participating here may cause me to accelerate my schedule!:goodjob:
 
Re: Calling Subprograms

This reminds me of "sub-routines" that we used in programming "Basic". Of course that was donkey's years ago!

Question: I have seen the use of "wizards" for performing different functions on a mill. Would that be a form of sub programming?

BTY, this is great stuff. I don't actually own a mill. I intended to convert an SX2 later this year. Seeing what can be accomplished by participating here may cause me to accelerate my schedule!:goodjob:
Wizards became conversational controls later...on windows. So yes, Wizards are just windows that collect the data for the Variables (Talking of Basic, Fortran 76, C++ and all those we learnt when this galaxy was created):nuts:
 
Real Example calling Subprograms, a Hardinge Bit Holder at 45º.

Fellow Machinists, As some of you know, I have an old Hardinge HC, that is a turret Hardinge. Here in Mexico takes forever for tools to arrive, seldom we end up making our own. I had to make a 45º Toolbit Holder for the Turret of the Hardinge, I believe this is a perfect example of what we can do by calling subprograms.

The Program Below, O2540, after the known heading to assure proper function, will call tool 16 and compensate left, then Go to a position near the steel to cut and call subprogram O2532 and the interesting part is that it will iterate or redo this subprogram 10 times or in other words, the program will describe a profile given per levels and make a part per level cutting.
This is a powerful program, because all you need to do virtually any 2.5D part, is draw the profile with X Y and save it as the subprogram. The machine will do the rest in Levels that you program with L and Z.

Let`s see the Main program:
O2540 (CALLS PROFILE SUBPROGRAM AND ITERATES L TIMES IN LEVELS TO CUT PROFILE GIVEN IN MM)
G15 G40 G49 G80;
G17 G21 G54 G90 G94;
M6 T16;
G0 X150. Y90. ;
G43 Z80. H16;
G90 G00 G41 X-20. Y-20. Z20. D16 M3 S1500;
G01 X0. Y10. F500;
G01 Z0. F320;
M98 P2532 L10;
G90 G0 Z100.;
G40 G49;
M30;
%

O2532 (SUBPROGRAM TO CUT PROFILE FOR HARDINGE TURRET 45DEG TOOLBIT HOLDER)
G91 G01 Z-1.01 F280;
G1 Y10. F500;
X52.06;
Y-10.;
X-52.06;
M99;
%

draw with a pencil what this program does, it sinks from where it is -1.01 in Z, then advances 10 mm in Y, describing a square. This is done 10 times, in other words, cutting a part 10.1 mm thick in 10 levels of 1.01mm.

So from now on, program 02540 does the trick of all parts you want to cut in 2.5D, all you do is change the L according to the thickness of part. draw a desired profile in the subprogram, according to the cutting conditions permisible, choose a Z for depth and mach with Levels in L.

I hope you are enjoying.
Next program is one I made in polar coordinates to cut Wheel adapters for my Durango, As many of you I liked some rims but had a different bolting pattern that the copius Durango. With this program, you can do your own wheel adapters for your preferred bolt pattern.

Regards.
 
Last edited:
EndMill feeds and speeds

Before rediscovering black thread again, let me ask if there is a resource in hobby machinist for feeds and speeds for carbide, cobalt and HSS tools?
 
Thank you for taking the time to explain and give examples. I have a code book and manual for Mach 3 but it's overwhelming to take it all in at once. This approach gets me there easier.
Will you be covering "M" codes as well?
 
Thank you for taking the time to explain and give examples. I have a code book and manual for Mach 3 but it's overwhelming to take it all in at once. This approach gets me there easier.
Will you be covering "M" codes as well?
Thank you, for caring to learn. M codes were given on thread 46. Not all of them, but only the ones you will really use, I avoid codes like M20, which clamps the 5 th axes....because very few will have a 5 axes machine, yet. If later someone needs help on five axes, which really complicates the tasks, I can help him individually. I left out very few important codes, like M80-M83.
 
Re: EndMill feeds and speeds

Before rediscovering black thread again, let me ask if there is a resource in hobby machinist for feeds and speeds for carbide, cobalt and HSS tools?

What are you looking for in particular. I have a license for GWizard, and can run individual numbers. If you're looking for tables of feeds, I recommend Niagra's site

Here is their page for HSS endmills http://www.niagaracutter.com/techinfo/common_mat/index.html
Here is their page for carbide http://www.niagaracutter.com/techinfo/speedfeed_solcarb.html

For generic endmills, I use the low numbers given in these charts, and have had pretty good luck.
 
Re: EndMill feeds and speeds

What are you looking for in particular. I have a license for GWizard, and can run individual numbers. If you're looking for tables of feeds, I recommend Niagra's site

Here is their page for HSS endmills http://www.niagaracutter.com/techinfo/common_mat/index.html
Here is their page for carbide http://www.niagaracutter.com/techinfo/speedfeed_solcarb.html

For generic endmills, I use the low numbers given in these charts, and have had pretty good luck.
Thanks, Im looking to be congruent with the site of hobby machinists and teach using its resources. If the site does not have one, Im planning on teaching the formulas, just like I did with drills, and then put the sfm info from the cutter fab in the formulas so the student learns to really take advantage of his machine.

What do you think? Makes sense?
 
Re: EndMill feeds and speeds

Before rediscovering black thread again, let me ask if there is a resource in hobby machinist for feeds and speeds for carbide, cobalt and HSS tools?

thank you for your class
this is an open source feeds and speeds wizard i have gwizard and i havent really tried this ( i found it the day i paid for gwizard duhhhh )
hope this helps you
steve
http://zero-divide.net/index.php?page=fswizard

edit: sorry i thought you were looking for a fs wizard i missed the post about you teaching one
 
Re: EndMill feeds and speeds

thank you for your class
this is an open source feeds and speeds wizard i have gwizard and i havent really tried this ( i found it the day i paid for gwizard duhhhh )
hope this helps you
steve
http://zero-divide.net/index.php?page=fswizard

edit: sorry i thought you were looking for a fs wizard i missed the post about you teaching one
I just checked it. It is good, also calculates power needed. Great resource.
 
Back
Top