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! > MetalWorking Machines > Fadal


Fadal Discuss Fadal machinery here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 03-17-2009, 04:02 PM
masonbcaldwell4's Avatar  
Join Date: Mar 2009
Location: USA
Posts: 39
masonbcaldwell4 is on a distinguished road
Red face basic subroutine question...

How do I use subroutines? we don't have anyone at the shop who is exceptionally proficient on our fadal, but I've been trying to learn it. As I've said in other posts, I don't have a whole lot of general cnc experience, so please explain how to write a subroutine, I'd really appreciate it. Is a subroutine the same as a macro? we've got a 4020 if that make any difference.
Reply With Quote

  #2  
Old 03-17-2009, 05:29 PM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

Does Fadal list M97 as a valid gcode used for subroutine calls? I'm used to Haas, and that is what Haas uses for subroutines.

A subroutine is a section of gcode that is placed after the current program's M30. It is placed there so that execution of the main program does not accidentally run through the subroutine. You need a line number on the first line of the subroutine, so that its memory address can be identified from the main program.

A subprogram is slightly different in that it actually has a unique program number, and is called with M98.

There is a syntax for identifying the line number (for a subroutine) or a program number (for a subprogram). This can vary a little from one manufacturer to the next. You should be able to find this in the manual.

Both subroutines and subprograms end with an M99, which the control recognizes as a return back to the main program.

A macro contains logic statements and variables. You could have a macro within a subroutine or a subprogram, but you would still need to call it with M97/M98 and return from it with M99 for it to be an actual program sub.
__________________
First you get good, then you get fast. Then grouchiness sets in.

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #3   Ban this user!
Old 03-17-2009, 06:26 PM
sti2011's Avatar  
Join Date: Jan 2008
Location: USA
Age: 42
Posts: 88
sti2011 is on a distinguished road
subroutine answer

First assuming that even though it is a Fadal, it has a Fadal control. Our 4020FX has all Fanuc controls and motors.
A subroutine is "native" to the program usually located at the beginning. A subprogram resides outside of the program as it's own entity until a M98 is called in the "main" prog. A simple example of a subroutine follows
%
O0000(CIRC POCKET)
L100(SUB#)G1 Z-.1 F50.
L9401(CIRC POCKET CCW FIXED SUBROUTINE)R0+20.(FR)R1+1.(DIA)
G0 Z.2
M17(END SUBROUTINE)
M30(END ALL SUBROUTINES)
T1 M6(EM)
G0 G90 M3 S3200 E1 X0 Y0 Z2. G43 H1 M8
Z.2
L101(EXECUTE SUBROUTINE 100 1 TIME)
E2 X0 Y0
L101


and so on.......This is just a quick example for cutting pockets.
You were not asking about "fixed subroutines" like the L9400 L9800 and such correct?
Reply With Quote

  #4   Ban this user!
Old 03-17-2009, 08:32 PM
 
Join Date: May 2006
Location: US
Age: 55
Posts: 124
billystein is on a distinguished road
subs

Hi,

let's say you want to call subprogram 2 from main program 1

TA,1
%
O0001
G90 G0 S1000 M3 (AND SO ON)
G4P3000
M98P2
M30

O0002(TURNS OFF SPINDLE)
M5
G4P3000
M99
%
Reply With Quote

  #5   Ban this user!
Old 03-18-2009, 03:53 PM
masonbcaldwell4's Avatar  
Join Date: Mar 2009
Location: USA
Posts: 39
masonbcaldwell4 is on a distinguished road

Originally Posted by sti2011 View Post
First assuming that even though it is a Fadal, it has a Fadal control.

You were not asking about "fixed subroutines" like the L9400 L9800 and such correct?
No, I wasn't. I'm just trying to figure out how to run the machine more efficiently, and try to get it more than just a few of the things it's capable of. Thanks for all of y'alls help. I'm the only other person in our dept. who can turn the machine on, and our other guy is only moderatly proficient, so I appreciate y'all putt'n up with my rookie questions
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-20-2009, 06:13 PM
sti2011's Avatar  
Join Date: Jan 2008
Location: USA
Age: 42
Posts: 88
sti2011 is on a distinguished road
More efficiency for Fadal

As far as making the machine more efficient the subroutines and sub programs are more a programming "style". They save time initially programming so they help out on that end. If you are using a CAM system then they are really not that important until you end up with a prog that won't fit into the memory. They are great for "fixturing" type progs that are usually done at the control manually.
For making a Fadal run faster and more efficiently the one most important thing I can recommend is to make sure to turn OFF fead ramps (G8,G9 toggles them) when contouring. Also be sure to set your machine parameters to roll CRC rather than intersectional (This may not be neccessary if you are cam programming)
In addition use the I,J,K option whenever you are drilling, it is nice to have it native to the machine without having to use a Macro or program long hand and use a sub program or routine to call it.
Also it never hurts to go to the "books" and maximize feedrates for each tool. Funny thing I've learned is that, the people who actually make the tools sometimes know more than me
Reply With Quote

  #7   Ban this user!
Old 03-20-2009, 09:11 PM
masonbcaldwell4's Avatar  
Join Date: Mar 2009
Location: USA
Posts: 39
masonbcaldwell4 is on a distinguished road

Originally Posted by sti2011 View Post
As far as making the machine more efficient the subroutines and sub programs are more a programming "style". They save time initially programming so they help out on that end. If you are using a CAM system then they are really not that important until you end up with a prog that won't fit into the memory. They are great for "fixturing" type progs that are usually done at the control manually.
For making a Fadal run faster and more efficiently the one most important thing I can recommend is to make sure to turn OFF fead ramps (G8,G9 toggles them) when contouring. Also be sure to set your machine parameters to roll CRC rather than intersectional (This may not be neccessary if you are cam programming)
In addition use the I,J,K option whenever you are drilling, it is nice to have it native to the machine without having to use a Macro or program long hand and use a sub program or routine to call it.
Also it never hurts to go to the "books" and maximize feedrates for each tool. Funny thing I've learned is that, the people who actually make the tools sometimes know more than me
thanks, but you've opened up some other rookie ?'s... what are "feed ramps"? what would they be used for? what do you mean by "roll CRC rather than intersectional"? which books? I know I probably sound like a moron, but we don't have a complete users manual at the shop, tho I've found one on the fadal website. I've tried reading it, but it seems to make good "putyoutosleep" reading... we don't really use CAM, they just give us a print and say "go make it". which is cool in that it's great when you figure it out, but if I write a program with 150-200 lines, it's a "complex" part, and we don't use more than 2 axis at a time, though it would be cool to learn up to 5 axis, but I guess thats inexperience talking... thanks ahead of time, Mason

Last edited by masonbcaldwell4; 03-20-2009 at 09:14 PM. Reason: 'nother question
Reply With Quote

  #8   Ban this user!
Old 03-22-2009, 10:22 AM
sti2011's Avatar  
Join Date: Jan 2008
Location: USA
Age: 42
Posts: 88
sti2011 is on a distinguished road
Feed ramps and CRC modes

As far as feed ramps go a Fadal will upon start and end of a G1 move will slowly build up to the feed rate and slow down at the end. This can create a very "jerky" tool movement even when you doing relatively simple 2 axis contours. If there are no feed ramps, the tool path appears much smoother and it is much faster.
The difference between roll and int. is if you have a 90 deg corner for instance, in int. the tool path mimmicks the 90 deg corner. In roll the machine looks ahead at the next move and actually turns or "rolls" around the edge in the direction of the next cut. Program a simple square and put a G96 in the beginning of the prog and watch the path, then change it to G97 and look the difference will be pretty clear.
By the books I mean the tool manufactures recommendation for feeds and speeds. Tools are getting better all the time and speeds and feeds are constantly improving. Especially Lathe work which I also do, it seems there is a new coating or edge prep or whatever every week! And the surface footages can be hundreds of feet different. Hope this helps.......
Reply With Quote

  #9   Ban this user!
Old 03-27-2009, 06:56 PM
masonbcaldwell4's Avatar  
Join Date: Mar 2009
Location: USA
Posts: 39
masonbcaldwell4 is on a distinguished road
Thanks...

thanks, that did help alot. I saw what you meant with the CRC, but I can't seem to turn off the feed ramps. I know they're on, and it's frusterating, trying to mill a small hex and I have to turn the feed rate way up to compensate for it. I think I'm having machine problems anyway, it randomly ran away on me recently, into the part, of course, and an M30 at the end of the program sends the Z slamming into the upper stop.... I changed one of the settings to tell it to let the spindle get to full speed before it starts feeding, but I don't see why that would affect the Z at the end of a program... any suggestions?
Reply With Quote

  #10   Ban this user!
Old 03-29-2009, 04:38 PM
sti2011's Avatar  
Join Date: Jan 2008
Location: USA
Age: 42
Posts: 88
sti2011 is on a distinguished road
Feed Ramps

Put a G8 in the prog right after you go to the initial clearance plane. And put a G9 in the prog before you return the Z home.(this will turn off ramps) Fadal progs should end with an M2 not an M30. Also if you just put an M6 or G90 H0 Z0 or tool change to your first tool in the prog it will not + overtravel in Z.
An example would be...
G0 Z2. M9 M5
G90 H0 Z0
M01
M2
%

OR
G0 Z2. M9 M5
T1 M6
G28(RETURN ALL AXIS HOME)
M2
%
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
Subroutine question (Cincinnati Milacron Acromatic 850 SX) burnthills G-Code Programing 5 09-15-2009 10:34 AM
a very basic fan question. cyclestart General Electronics Discussion 2 07-06-2008 06:43 PM
Very Basic Question H2ODiver General CAM Discussion 4 07-27-2007 08:51 AM
REALLY basic Question Dongle Mechanical Calculations/Engineering Design 25 03-14-2006 03:47 PM
Anyone got any basic examples of a program using a subroutine/program? Darc CamSoft Products 11 10-08-2005 11:45 PM




All times are GMT -5. The time now is 03:56 PM.





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 354 355 356 357 358 359 360 361