CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > G-Code Programing > Parametric Programing


Parametric Programing (custom macro b, fadal macro, okuma user task)


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 06-18-2009, 04:45 PM
 
Join Date: May 2007
Location: USA
Posts: 896
g-codeguy is on a distinguished road
Need some suggestions on developing feedrates.

Will ask here first, but probably on the General Forum shortly because I know this forum doesn't get much traffic.

A little background:

I have master programs for 10-32 UNJF-3A, 1/4-28 UNJF-3A, 5/16-24 UNJF-3A, 3/8-24 UNJF-3A, 7/16-20 UNJF-3A and 1/2-20 UNJF-3A families of studs. Some get a cross drill thru the thread, some thru the bearing diameter and a few thru the shank behind the thread. And in different combination's . Some no cross holes. I have separate subprograms written for holes thru the threads and bearing area for each size, and a couple subprograms for holes in different size shanks. Not all sizes as very few get drilled in this area.

These were written several years ago. The past couple of years I have been teaching myself Macro B programing. Although these cross drill subprograms use variables for RPM, drill locations, and feedrates, I don't consider them Macro programs. The master programs use quite a few variables. Before I changed my cut-off subprogram I was using variables #100 to #142 in my master programs. Now they start at #109. Naturally the set-up person only had to change a few of them. As few as 2 sometimes.

What I am looking to do now is write one subprogram that will run cross holes in all 3 locations regardless of OD size, material, drill diameter, drill type (carbide or HSS), threads or not, etc. I will be using G65 to pass the variables. I want to keep the number being passed as low as possible. Right now there will be 7 or 8 passed depending on hole location.

The problem:

One of the things I want in the sub is the feedrate. Currently I can think of only 4 sizes we run. However assigning a feedrate to these 4 only isn't the best way as there is some tolerance, and there may be more than one size drill we can use for each hole. I feel confident that I can write a program that will assign the correct feedrate for a given size drill. However, it may not be pretty. Nor as short as I'd like. I like to keep my programs short as feasibly possible, and as clean as I can.

The question:

Does anyone have any suggestions on how I can assign the correct feedrates to various size drills? Neat and elegant? Please don't suggest using AND, OR as I've tried examples others said worked on their machines, but they didn't work on mine. Fanuc tells me that I can't use them the way I want to (comparing values). This is for an 18T control on a Hardinge 42 Conquest.

This will necessitate rewriting the master programs, and I am going to take the opportunity to see if I can't make them less complex. Cut down on the number of variables being used. Switch those I can to the #1 to #33 range. Right now I think there is a whole page of variables and calculations before the actual program. There is enough going on so that you can see the time lost before the program starts machining. That is why I put a check in it to see if the variables were already loaded. If they are, then the control skips right to the part machining. No hesitation.

Last edited by g-codeguy; 06-18-2009 at 08:14 PM.
Tweet this Post!Share on Facebook
Reply With Quote

  #2   Ban this user!
Old 06-19-2009, 12:14 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,503
stevo1 is on a distinguished road

Dale,

I don’t know if I am following what exactly you are looking for but I will give a few suggestions anyway.

You say that you are writing a macro to drill holes regardless of drill diameter but you need the drill diameter to calculate the feedrate. I would use a variable in the macro call that dictates the diameter of the drill. Then in your macro have the calculation for the SF and chipload determine your feed.

Ex.
(A=drill size)
G65PxxxxA.625

Oxxxx
#100=60(SF)
#101=.005(chip)
F[#100/#1*3.82]*#101
S[#100/#1]*3.82

Another option if you don’t want to but an extra variable in the macro call. I had put all the drill diameters in the radius of the offset page. Then you can call and set the diameter to a variable used in your macro. #1=#2605—(tool5). Obviously we would set this up to get the info from the current tool in the spindle rather than programming the hard number of the tool.

Please correct me if I am way off base.

Stevo
Tweet this Post!Share on Facebook
Reply With Quote

  #3   Ban this user!
Old 06-19-2009, 12:41 PM
 
Join Date: May 2007
Location: USA
Posts: 896
g-codeguy is on a distinguished road

Hi Steve. The drill diameter is one of the variables being passed. I am hoping NOT to have to pass a feedrate. Drills used are normally .0625, .0781, .0934 and .1094, but I need to see what else might get used.

I don't want to assign feedrates by this method

IF[#7EQ.1094]THEN#9=.0016

because a #35 drill (for example) could also be used. Then a feedrate wouldn't be assigned because I didn't have an IF statement for .1100.



These are the thoughts I've come up with so far. The "Must use decimal" comments are for the operators.

CROSS DRILL SUB

EXAMPLE: 7/64 in. hole in 7/16-20 UNJF threads. Drilled thru in 52100 mat’l

G65P21C1.Z1.562W1.432D.1094M5210S1T20X.4375

EXAMPLE: 1/16 in. hole in bearing surface drilled ˝-way thru in 8620 mat'l

G65P21C.5Z1.562A.384B.188D.0625M8620S1X.468

Use all positive numbers.

Z = face to 1st shoulder. Must be decimal

W = 1st shoulder to centerline in thread or shank hole. Must be decimal
A = 1st shoulder to 2nd shoulder. Must be decimal
B = 2nd shoulder to centerline of bearing hole. Must be decimal
Will be W or A & B but not both. Check finish drawing for these dimensions.

D = drill dia
M = material type. Use 5210 for 52100 mat’l
C = drill ˝-way or thru. Must be decimal. Use .5 or 1.
S = drill type 1= carbide 2=HSS
X = OD size. For threads use the nominal dia. That is 3/8-24 UNJF will be .375
T = threads per inch. Only used when drilling thru threads. 3/8-24 UNJF will be 24


Inside subprogram figure

Feedrate based on drill dia
RPM based on drill dia, drill type and material
Check for pitch and then drill past root based on OD size
Drill half-way or thru?
Tweet this Post!Share on Facebook
Reply With Quote

  #4   Ban this user!
Old 06-19-2009, 01:58 PM
 
Join Date: May 2007
Location: USA
Posts: 896
g-codeguy is on a distinguished road

DELETED

Last edited by g-codeguy; 06-19-2009 at 01:59 PM. Reason: DOUBLE POST
Tweet this Post!Share on Facebook
Reply With Quote

  #5   Ban this user!
Old 06-19-2009, 01:59 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,503
stevo1 is on a distinguished road

Dale,

Is there a particular reason you don’t want to use the IF statements?
You don’t need to have a IF statement for every drill size. If you are going to use the same chip and SF regardless of drill size but want to change it based on material and tool type you set up for it accordingly. First off I would combine the drill type and material into 1 number if it is feasible for you. M8620=(8620 material using HSS). M8621=(8620 material using carbide). M5210=(5210 material using HSS). M5211=(5210 material using carbide).

IF[#13EQ8620]GOTO1
IF[#13EQ8621]GOTO2
IF[#13EQ5210]GOTO3
IF[#13EQ5211]GOTO4
N1
…Calculate SF for 8620 HSS
GOTO50
N2
…Calculate SF for 8620 carbide
GOTO50
N3
…Calculate SF for 5210 HSS
GOTO50
N4
…Calculate SF for 5210 carbide
N50
….

Now you can add to list if more material comes into play.
***

Now if you really want to get creative and not use this way you can set it up as I do with all of my speeds and feeds. It is the same concept but a little different. You will probably like this as you get to play with setting up custom codes. This works really slick.

In your situation I would create a list on paper that sets a number to all the material and drill styles. Then in your macro call set M to which number you want to use.
1=8620 material with HSS
2=8620 material with carbide
3=5210 material with HSS
4=5210 material with carbide.

Now set up a speed and feed program say 7000 and put the S&F in there based on number. Then set up a custom G500 to call program 9014. Now in the beginning of your sub for drilling just do a M98P7000.

Ok say you set M3 in your macro call. Now in the first line it makes a sub call to 9014 because of your G500 code but it also makes #9=1.3 and #19=600. In the 9014 if #13(=3) is equal to #4114 which is your modal N which the first one is N1. it will jump to N1 set your F&S then end the program returning to 7000 but going to N999 and ending that as well. However #13 is 3 so it is not equal to the modal N. so it will end 9014 and return to the N2 block and do the same thing. This will continue until you reach N3 of 7000 which is what you want based off M3. IOW these 2 programs will bounce back and forth until it reaches the S&F you designated with your M value in your macro call.

O7000(S&F program)
N1G500F1.3S600
N2G500F1.1S400
N3G500F2.2S800
N4G500F1.8S700
N999M99

O9014(gather S&F)
IF[#13EQ#4114]GOTO1
M99
N1F#9S#19
M99P999

Your drill sub will use M3S#19. G1F#9. Which you don’t really need to do. Since your F&S are already modal and set all you have to do is give a M3 and G1 anywhere you want in your program.

Did I get way to deep ?

Stevo
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 06-19-2009, 03:29 PM
 
Join Date: May 2007
Location: USA
Posts: 896
g-codeguy is on a distinguished road

Thanks a bunch. I will have to wait until tomorrow to look at it, but it looks good from the quick read I just did.

EDIT: Playing with macros can't be anything but fun.
Tweet this Post!Share on Facebook
Reply With Quote

  #7   Ban this user!
Old 06-19-2009, 09:53 PM
 
Join Date: May 2007
Location: USA
Posts: 896
g-codeguy is on a distinguished road

Steve, I am using IF statements. The tolerance on one cross hole is .076/.086. I don't want to write an IF statement for every possible drill size that could be used in the range of just this one hole. Imagine if I have to do it for every hole! Normally a 5/64 in. carbide drill is used. HOWEVER...I want all the bases covered. I would think that the same feedrate for any drill in this range could be the same. I see no benefit in increasing the feedrate by .0001/.0002 when going from the smallest to the largest.

You are getting a bit deep for me, but I enjoy learning! If you are like me, you get a lot of satisfaction from being able to help others.

I see in the Fanuc manual that #4114 function is a "Sequence number." Unfortunately that tells me zilch. As you know, I am still a babe in the woods when it comes to macros. Undoubtedly I would be further along if I also programmed mills. Ain't going to happen where I work now.

Let's take this one step at a time. Or two. I will understand it completely...eventually. Shall we start with how the #4114 works? Thanks.
Tweet this Post!Share on Facebook
Reply With Quote

  #8   Ban this user!
Old 06-22-2009, 11:09 AM
 
Join Date: Jun 2008
Location: United States
Posts: 1,503
stevo1 is on a distinguished road

Dale,
I am not going to speak much on this topic because based on what you have said I don’t think that you want to do it this way but I do have 1 question. If the reason you don’t want to do it is because you think you have to have an IF statement for every drill size, why do you think you need the IF for every drill? You are passing the drill size over using the G65 so there is no need to compare the drill size to something. Just use the drill size along with the SF you specify based on material and tool type. Similar to what I said in post2 and the beginning of post5.

1. A few steps at a time. I like this way better anyway. The #4114 is the modal N address value. This is the same as your #4120 for the modal “T” or any other of. These variables along with many others are the current condition of the machine. If you were to do a tool call M6T5 once the machine reads that line of code it sets #4120=5(modal T). The #4114 is the same thing except it is your N address value. If your machine reads N200 in the code then #4114=200.

2. This is all used so when program 7000 is running it reads the first line N1G500F1.3S600. Now program 9014 is called because the custom G500 is set to call the program every time. Now when going to program 9014 parameter #4114 is equal to 1 this is your modal N. And because this is a custom macro call your variables are set “F” and “S” so #9=1.3, and #19=600.

3. Now when reading the first line of 9014 it compares to see if it has the proper data for what you specified with your M in your macro call. If you said M3 then #13=3. Now if #13 is equal to #4114 which it is not because #4114=1 it ends the 9014 and returns to N2 of program 7000 which again calls the 9014 setting your #4114=2 along with the new S&F.

Ok I will leave it at that for now. Does it make a bit more sense??

If you don’t know this already to set up the custom G500 code or any G() you want is done with parameters.
#6050-#6059 will call programs 9010-9019. So to use program 9014 you have to set parameter 6054=500. Now every time a G500 is programmed it will call program 9014. If you wanted to use program 9010 then you would have to set parameter 6050=500 etc.

Stevo
Tweet this Post!Share on Facebook
Reply With Quote

  #9   Ban this user!
Old 06-24-2009, 02:53 PM
 
Join Date: May 2007
Location: USA
Posts: 896
g-codeguy is on a distinguished road

Steve, I haven't been ignoring you. I read your last reply, but been a bit too busy to answer it.

First let me say I do know about, and use, the M and G calls, but no harm in mentioning them in case I didn't. I usually am not one of those people who get insulted if you tell me something I already know. I prefer that you cover all the bases. Assume nothing.

I think I understand the the use of #4114 now. Thanks. Pretty slick alright. Will have to see if I can't come up with a couple good uses for it.

Off the top of my head I know that we have run 1/16, 5/64, 3/32, 7/64 and 5/32 diameter cross drills. You are using one feed for all sizes in a given material...if I am reading the example correctly. I don't want to run a 5/32 drill at the same feedrate I run a 1/16 drill.

It may be simpler to pass a feedrate in the G65. I am not in a hurry to get this program written. What I already use works. Just trying to write one program that will replace the 14 or so I currently use. I'd rather take a little extra time, and write one that won't be modified 2 or 3 more times before reaching its final stage.

Am trying to take into consideration the number of values being passed versus the increased length of the macro sub if not passed.

I do appreciate your passing along some of the vast macro knowledge you have. I've considered taking the online parametric programming course, but don't know how well I would do since I don't program mills. I'd bet that most of the course deals with mills since there is a lot more use there than on a lathe. I don't want to take a course I can't do well in.
Tweet this Post!Share on Facebook
Reply With Quote

  #10   Ban this user!
Old 06-24-2009, 03:56 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,503
stevo1 is on a distinguished road

Dale,
No worries I have been quite busy myself.

I would take the class if you get a chance. What I have experienced is macros are macros. It does not matter if it is mill or lathe. Yes there are usually more applications for these in mills. We once set up macros in all of our vertical lathes for every part, about 2000 different models. It ended up being about 25 different macros but super easy to set up and run. The only difference I have encountered is the macros I write for the lathes are much more in depth then the mills.

Ok 2 things.

1.I think that you could really benefit from setting up a S&F program and using the #4114 as I described before. All you need is a sheet that tells the guys what number to use for the combination of the drill, drill type, and material.

2.The example I gave earlier does not use just one feed for every drill. It calculates out the speed and feed based on the SF you specify and the chip load you specify. Lets run a 1/16 drill through the numbers.

(A=drill size)
G65PxxxxA.0625------#1=.0625 drill size.

Oxxxx
#100=60(SF)----set to what you want
#101=.005(chip)----set to what you want
F[[#100/#1]*3.82]*#101-----60/.0625*3.82*.005=18.336(feed rate)
S[#100/#1]*3.82-----60/.0625*3.82=3667(spindle speed)

Am I missing something??

The more I look at this you are probably better off with the S&F program using #4114. The data above works. However this is not taking into account the drill type and the material. This would have to be specified in the macro call which means you would have to pass over more variables. Well really just one more other then the drill size if you use the example I gave on creating a number to match every drill and material then you could code that number to use aspecific SF and chipload.

Stevo


Stevo
Tweet this Post!Share on Facebook
Reply With Quote

Sponsored Links
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Build Thread- Developing an Online Tutorial Site charger19690 Teachers Hang out 0 02-28-2009 03:09 PM
Anyone got any X1 recommended feedrates... digits Benchtop Machines 6 10-03-2006 06:54 PM
Developing 3D Art Work for a Newbie gimmephone General CAM Discussion 7 08-20-2006 12:39 AM
X1 Feedrates etc... itsme Benchtop Machines 2 08-19-2006 08:37 PM
Cheap, small, stepper Pic Driver - Developing Ragnarok Stepper Motors and Drives 44 06-02-2006 03:39 PM




All times are GMT -5. The time now is 03:09 AM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353