![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| Fadal Discuss Fadal machinery here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| ||||
| ||||
| 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. |
|
#2
| ||||
| ||||
| 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) |
|
#3
| ||||
| ||||
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? |
|
#5
| ||||
| ||||
|
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 |
| Sponsored Links |
|
#6
| ||||
| ||||
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 |
|
#7
| ||||
| ||||
Last edited by masonbcaldwell4; 03-20-2009 at 09:14 PM. Reason: 'nother question |
|
#8
| ||||
| ||||
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....... |
|
#9
| ||||
| ||||
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? |
|
#10
| ||||
| ||||
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 % |
| Sponsored Links |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
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 |