Fanuc Subprogram (Local Subroutine)

Category : Fanuc

Fanuc Subprogram (Local Subroutine)

If you have ever used local subroutines on Heidenhain or Yasnac. Then you will know how convenient it is to save all your programs in one go. No need to remember to save all those shitty external sub programs.

What’s He On About?

If you are now saying “what the fuck is he on about”. Here is an explanation.

A local subroutine or subprogram is where you stuff all your subprograms at the end of your main program.

So on a Fanuc control if you were making this part below.

Drill spot drill then tap.

Fanuc Subprogram

Programme would look like this.

Fanuc Subprogram

 

Thing is the code is just repeated three times. I have nice round numbers in here like X40. and Y20. so it’s easy to notice mistakes. But if it was X40.392 for example you wouldn’t spot a slight mistake.

So if you call a subprogram it looks like this.

Fanuc Subprogram

And then your Subprogram is like this.

Fanuc Subprogram

Fanuc Subprogram

The M98 P500 calls the external Fanuc Subprogram. Read this if you don’t know about sub programmes.

Saves you having to repeatedly write shit loads of code.

So that’s why we use a Fanuc Subprogram. But……

You have to look after these bloody things and they seem to be able to just get lost on their own.

You find them at the back of the fridge sometimes along with a piece of mouldy old cheese.

Fanuc Subprogram No More Lost Programs

So this is how it looks with a Local Subroutine.

All you need to do is replace P with Q. So mind your P’s and Q’s as they say.

The Q corresponds to any N number. So you could have loads of these stacked up at the end of your programme and you only need to save it once. All this shit will go with it and you don’t need to worry about it ever again.

Just A word Of Caution.

There are PARAMETERS involved. Arrrrrrrrrrrh……..the dreaded PARAMETERS

To call a subroutine on your Fanuc control. You first need to make sure that Bit 0 of parameter 06005 is set to 1

Fanuc Subprogram

This should make it work. If it doesn’t then maybe you should call the Samaritans.

It’s only on the newer controls by the way.

Sub programs on a Siemens control.

Thanks For Reading My Articles We Love you all .

If you have been affected by any of the issues in this post or need CNC Counselling then contact me.

If you want to learn to program CNC Milling Machines

 

 

 

 


CNC Sub Program

Call 07834 858 407

CNC Sub Program, all CNC machines will have some form of sub programs.

 This article deals with G code (ISO) type programming but most of the features talked about will be available in some form on any CNC control. 

A CNC sub program is a branch from your main program into another program.

After completing this, your control will return to the main program and continue where it left off.

It’s like the branches of a tree.

Sub Program 

Probably the most common use of a CNC Sub Program would be for a tool change position. You could have a sub program which took the machine to a position for tool change. Your machine probably does this anyway but it’s hidden.

The advantage of this is that you could use it for any program and you don’t have to keep writing it. It is going to be very reliable because you know you never touched it. (Honest governor). 

You could use a sub-program for a set of hole positions, call it out once to spot drill and again to drill and again to tap. Just use it as many times as you want.Got to be good for the environment too.

CNC Sub Programme

 

Some controls have internal sub programs Haas and Yasnac as well as Heidenhain and Siemens have this facility.

You can do it on a certain Fanuc controls but it is an option.

It means you can stuff these at the end of your program and jump into them the same way as you would an external one. 

CNC Sub ProgrammeCNC Sub ProgrammeCNC Sub Programme

Why would I want to do that you say?

Easier to manage is the quick answer.

You know when you save your main program there are no pesky sub programs lurking that you forgot to save. They are all built into your main program.

Normally you would call your sub-program once only and you don’t need to tell it “oh I want this once” it says “come on mate I know that I’m not stupid.

But you can call it several times and if you get into incremental programming, and I hope you do, you will definitely find a need for this.

Sometimes with sub-programs it’s what you don’t put in that matters. What I mean is if your milling and you put the feed in the sub-program you are stuck with it. If it’s not there then you can state the feed externally and use a different one every time.

On Machines Like The BMC 800 from Toshiba

Tosnuc 888

This machine has the Tosnuc 888 control.

It uses G72 followed by the dollar sign, oh and for the repeat command it uses L but don’t forget the comma.

G72 $MYPROGRAM , L2

Yes Tosnuc uses anything for a program name up to eight characters. So that it doesn’t get confused by the L you have to put in a comma.

Tosnuc 888

By the way on this control (Tosnuc 888) you don’t use M99 at the end of your sub program you just use M30 and it works correctly.

Don’t try this on your Fanuc or Haas control as M30 means stop and rewind and that’s what it will do. Then it will just sit laughing at you.

Ok now you can watch the video.

CNC Milling sub programming examples.

 

If you liked this video, please don’t forget to subscribe to my YouTube channel by going to: CNC Training Centre

Please contact me if you require:

  • Fanuc training.
  • CNC programming training.
  • Want to learn CNC programming.
  • Fanuc programming training.
  • Yasnac programming training.
  • Any type of CNC course.

Services offered at CNC Training Centre

Edgecam training.

Classroom programmer training.

Onsite CNC Machine Training.

CNC Training on all controls and machines.

Mazak Training Fanuc Training

Don’t forget we offer training on all types of Mazak Machines and all Fanuc Controls 6m to 31i Oi old to young.


Tool Nose Radius Compensation

Tags :

Category : Fanuc Turn Haas Turn

CNC lathe tool nose radius compensation, I think that sometimes in life we get off to a bad start with things. I know when I was at school I was convinced that I was useless at French, Physics and all sports.

I just got off to a bad start.

Getting stabbed with a javelin in the foot did not enthuse me with regards to sporting activities.

Tool Nose Radius Compenasation

 

Oh and two of my close friends wanted to see if passing a high voltage though my body would give me special strengths a bit like Frankenstein. Needless to say it didn’t work and to this day I can’t watch those films.

So when you have a bad experience with something it just puts you off.

Maybe when you first tried to use G41 and G42 you got loads of ALARMS. Not to mention that nasty rash that you needed a three month course of antibiotics to clear.

We often find ways around our lack of knowledge or whatever.

I know when I was in France my mate always spoke English in a kind of French accent thinking they would know what he was on about. He would put an “a” at the end of each word.

He would say “doa youa knowa thea timea” and they would say “Va te faire foutre”

Here is the video (DON’T YOU DARE WATCH IT YET)

Sorry about the long intro but I have a record to sell as well.

If you liked this video, please don’t forget to subscribe to my YouTube channel by going to: CNC Training Centre

Anyway, Tool Nose Radius Compensation.

People find ways of programming without tool nose radius compensation.

It surprises me when people don’t use it and it is usually because they don’t understand the very simple rules.

Rules CNC Lathe tool nose radius Compensation

The daftest one being, don’t ask it to do the impossible.

So if you are machining a diameter of say 40mm and you move to a bigger diameter 40.5

If your tip radius is 0.8 the machine would alarms out.

You swear at the machine but unfortunately it’s you that’s being rather silly. You can’t fit a .8 radius in that gap.

TNRComp

The same thing applies if you machine around a radius that is smaller than the tip radius.

The other common fault is knowing when and where to apply it. Your shape needs to be one continuous path that does not go back on itself.

No reverse gear.

Tool Nose Radius Compensation

I always say “use it and get rid of it”.

You can’t just move on to another shape.

You need to cancel and then re apply (a bit like lipstick)

If you don’t use compensation your parts are not really correct because you are frigging the figures.

CNC Lathe Tool Nose Radius Compensation

The other big problem is if you need to change the tip radius and you didn’t use tool nose radius compensation you would have to change the program.

Your program and part will simply be wrong without tool nose radius compensation.

If your CAD system is not outputting tool nose radius compensation or cutter compensation in milling then you need to look at your post processor.

If you can’t do it get your software provider to help. Believe me they can all output this if they are set up correctly.

If you liked this video, please don’t forget to subscribe to my YouTube channel by going to: CNC Training Centre

Please contact me if you require:

  • CNC programming training.
  • Want to learn CNC programming.
  • Fanuc control training.
  • Yasnac programming training.
  • Any type of CNC course.
  • Fanuc training courses
  • CNC lathe training
  • CNC Vertical Machining Centre training

Services offered at CNC Training Centre

Edgecam Training.

Classroom programmer training.

Onsite CNC Machine Training.

CNC Training on all controls and machines.

Mazak Training Fanuc Training

Don’t forget we offer training on all types of Mazak Machines and all Fanuc Controls 6m to 31i Oi old to young.


WP to LinkedIn Auto Publish Powered By : XYZScripts.com