Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

macros / subprogram resources


Joeyls319
 Share

Recommended Posts

Morning everyone.

Just started a new job and I got to learn the Seimens 840D controller.  They use a lot of subroutines/subprograms here.  Wondering if anyone can point me in the direction of some good books or resources to help me learn this stuff (ie: idiots guide to subprograms).  We're running Mastercam 2017 and the machines are DMG milltap 700. 

 

Thanks

Joey

Link to comment
Share on other sites

One of the best people I knew (that was hard to type) is no longer with us. Check out Tim Markoski's site it still has some good information there:

Tim's site.

Siemens has all of their manuals downloadable from here. Siemens Link:

All macros and sub programs are just logical equations and problems. Break it down to the equation and solve the problem. Each macro has a value see what the value does and how it solves the problem. Then once you track down the math process you can work backwards and forwards to understand how the process works. Throw up something you are fighting with and lets see if the group can help you solve the problem.

  • Like 5
Link to comment
Share on other sites
2 minutes ago, Joeyls319 said:

Thanks for the information Ron.

I'm just starting this journey so I'm sure there will be plenty of questions.  When, not if I come across something I can't figure out, I'll be sure to ask.

Thanks again

Joey

I give thanks to Tim he helped me a lot over the years and if I can pass on anything he taught me than I am honored to honor him by doing so.

  • Like 8
Link to comment
Share on other sites

This is for Siemens 840D guys, those books are all practically useless.


I love Siemens 840D for "macros."  I have done A LOT.  If you have any specific questions I can help.  I also can probably round up some samples if you message me your email.

The thing I love about Siemens is DEF REAL MY-VARIABLE!

You can define your variables and therefore you do not get lost in all the [[#500[#501-#502]]/#503] crap.  You can also do some impressive things with external funtctions that you can do with Fuhnook but it seems to be much easier in my experience.

  • Like 4
Link to comment
Share on other sites

Download the basic and advanced Sinumerik programming manuals. Most powerful control out there IMHO, not necessarily the most complex to learn. 

For subs, make sure to use "RET" to return to the program that called the sub, rather than using "M17" as return code. The last disables G64, which provides smooth motion. 

Siemens commands make sense and are usually acronyms. Like CFTCP, "Constant Feed Tool Center Point."

I love Sinumeriks and like to think I'm deeply versed on them. If you need help, drop us a message here. It will be a pleasure to help. 

  • Like 3
Link to comment
Share on other sites
13 hours ago, jlw™ said:

....

The thing I love about Siemens is DEF REAL MY-VARIABLE!

You can define your variables and therefore you do not get lost in all the [[#500[#501-#502]]/#503] crap. ...

:cough: SETVAR500[BWAAA,HAAAA,ROFL] :cough:

 

:coffee: 

 

I just LOVE it when the Siemens and OSP snobs break that "you can't... with FANUC" rigamarole. I just :rofl: and say keep telling yourself that while I DO it. :yes: :rofl:

 

:coffee:

Link to comment
Share on other sites
2 hours ago, Foghorn Leghorn said:

:cough: SETVAR500[BWAAA,HAAAA,ROFL] :cough:

 

:coffee: 

 

I just LOVE it when the Siemens and OSP snobs break that "you can't... with FANUC" rigamarole. I just :rofl: and say keep telling yourself that while I DO it. :yes: :rofl:

 

:coffee:

So... when did Fuh-nook get this and catch up to 1989 Siemens?  I mean that's cool!  So prob another decade till it trickles down to Mazak.

Link to comment
Share on other sites

btw James... not the same, not exactly.  You're just giving #500 a nickname and some bonehead move in another place can change it.

DEF REAL NOT_THE_SAME

NOT_THE_SAME = FUHNOOK

NOT_THE_SAME<BEST

 

 

 

Notice, that's not an if statement, just a statement!  😝😝😝

  • Like 2
Link to comment
Share on other sites
4 hours ago, Foghorn Leghorn said:

:cough: SETVAR500[BWAAA,HAAAA,ROFL] :cough:

 

:coffee: 

 

I just LOVE it when the Siemens and OSP snobs break that "you can't... with FANUC" rigamarole. I just :rofl: and say keep telling yourself that while I DO it. :yes: :rofl:

 

:coffee:

MTB Chest Off :hrhr:

Tim would have been laughing.

Link to comment
Share on other sites
21 hours ago, Foghorn Leghorn said:

:cough: SETVAR500[BWAAA,HAAAA,ROFL] :cough:

:coffee: 

I just LOVE it when the Siemens and OSP snobs break that "you can't... with FANUC" rigamarole. I just :rofl: and say keep telling yourself that while I DO it. :yes: :rofl:

:coffee:

James,

I have a doubt about how this reasonably complex subject could be handled in a Fanuc or Fanuc based control. I believe that there´s a way, I just don´t know how.

It´s called feedrate interpolation - Here we go - I extracted some images from Sinumerik manuals and commented them so we can have a good understanding...

Sometimes, it would be interesting to be able to interpolate your feeds just like you interpolate coordinates. Basically, in the majority of CNC controls, if not all them, if you say for example:

G0 X0 Y0 Z0
G1 X100 Y200 Z500 F500

Essentially the control will interpolate the axes, calculating the feedrate for every servo so that all axes reach the final destination together right?

But the majority of controls don´t allow you to do that for your feedrate. Let´s see this simple example in a simple 2 axis lathe:

G0 X500 Z0
G1 Z-1000 F0.5

I think we all agree that the machine will do a parallel motion along Z axis with a constant feed of 0.5 units/rev - That is, when I´m at Z-500 the feed will still be 0.5 units/rev right? Regardless the Z coordinate, it is always the same feed.

Now let´s imagine that for whatever reason, you need to interpolate your feedrate?

Let´s say that you have a carbon steel part mixed with Inconel inlays, or you need to progressively vary your surface finish along the 1000 units above, or that you have a raw material that is very difficult to cut in the ends but Ok in the middle. Or even, you need to have a more sophisticated method to control chip break, let´s say, you have a long boring bar, needs to enter gently in the material to avoid insert damage, but can gradually increase the feedrates while the bar moves into the material because you need to have short chips while deep inside, so that they don't accumulate in the rear side of you boring bar and make it to bend...

So in the pic below, we can see the concept of regular feedrate control (What 100% of controls do support) Vs interpolated feedrate:

FLIN_00_zpsfh4n8yld.png

Now let´s visit that simple piece of code again:

G0 X500 Z0
G1 Z-1000 F0.5

What if I wanted to have the feedrate as 0.3 units/rev at Z-500 ?

Let me be more comprehensive here - What if I wanted to have the following feedrates at the given coordinates, for the same geometry:

Z   0 = F0.1
Z-100 = F0.14
Z-200 = F0.18
Z-300 = F0.22
Z-400 = F0.26
Z-500 = F0.30
Z-600 = F0.34
Z-700 = F0.38
Z-800 = F0.42
Z-900 = F0.46
Z-1000 = F0.5

And what if the feedrate had to be interpolated, not programmed by a series of G1 commands - That is, at Z-50 the feedrate should be half of what it would be between F0.1 and F0.14? And so on for every micron Z axis moves?

Ok, one may say, well, this can be programmed by thousands of G1's with different F values... Ok.. let´s have a look in a more useful example...

I wanted to start with a simple lathe example in order to share a common milling problem in machines with MTM capabilities, but if fact it applies for everything that has a rotary axis...

In the problem below, we want to machine a groove or simply use the C axis of our machine (It could be a cylindrical part in the center of the table of a HMC as well) so that with a face mill or a large bull mill we could open a wide groove in the part, by performing a spiral cut from the O.D. to I.D., using as many C axis turns as we want.

Typical scenario would be to avoid a regular turning groove tool (Wide inserts cause vibration and small ones would make it time consuming) or special tooling to open a wide groove in a super alloy. Let´s suppose that better chip control is also necessary.

Well, there´s a problem with that. Because we´re cutting using a rotary axis, the tangential speed plays an important role here. The feedrates we would use in linear axes are not suitable for tangential machining, and to make it worse, they´re dependent of the Ø we´re cutting.

That means even if we convert a feed of 1000 mm/min to a diameter of Ø400, this feedrate would not be suitable to cut a diameter of Ø280, because while cutting the last the rotary would complete a full turn in less time right?

So if you have a scenario like that, your feedrate needs to change for every second of angle the rotary moves, since it is a spiral motion towards the I.D., your tangential speed is constantly changing. It´s highly desirable that you keep your tangential speed constant, otherwise you won't be able to keep a constant tool load, and you will reap all side effects that comes with that.

And this is where feedrate interpolation makes a huge difference in the result.

So in a Sinumerik control, we would achieve the result above with our simple lathe program this way:

G0 X500 Z0 ; Start position
F0.1 ; Initial feedrate at Z0
G1 Z-1000 F0.5 FLIN ;Interpolate feeds - Sets final feedrate at Z-1000
FNORM ; Restore regular feedrate control

I commented the pic below, I hope it´s clear for everybody.

FLIN_01_zpsk4jkhoo0.png

BTW: James, I know you understand all the stuff I put above. The reason I was very didactic is because not everybody understand Siemens code and also because due to my language limitations I wanted to make sure I was understood.

So I have this doubt: In a Fanuc control, how can we address this problem - I´d like to learn:

  • How we interpolate feeds in a simple straight motion like that turning example?
  • How we interpolate feeds in a rotary motion?

This is an old doubt I have because I bumped into the situations above in Moris, Mazaks, and never found a "clean" solution. 

How a Fanuc expert would handle that?

Link to comment
Share on other sites

Inverse time is tied to a time constrain. It has to do with the motion occurring based on a 60 seconds constant. Some controls consider the value 1 second rather than 60. Inverse time was invented in the 60's when controls didn't have TCP and could not handle feed calculations. 

Feed interpolation does not have anything to do with time. The constrains are the initial and the final feedrate.

Last but not least, inverse time on a ZX toolpath (Lathe) ? Lathe mode don't even support G93. 

Hypothetically speaking, if inverse time was the answer, then in my example above, I'd have to have lots of G1's with different F's. 

See now why inverse time is not the answer? 

Link to comment
Share on other sites
16 hours ago, jlw™ said:

So... when did Fuh-nook get this and catch up to 1989 Siemens?  I mean that's cool!  So prob another decade till it trickles down to Mazak.

I don't remember precisely, I just remember doing it on a 16 in the mid 90's...

Link to comment
Share on other sites

The problem with FANUC is most people just don't really "know" it. When I go train customers most of the time, they have only a rudimentary understanding of what the control can actually do for them and the power that it contains. I think honestly, Siemens does a FAR better job of getting that important information to their end users.

Link to comment
Share on other sites
  • 5 months later...
On 4/13/2017 at 7:09 PM, Watcher said:

Download the basic and advanced Sinumerik programming manuals. Most powerful control out there IMHO, not necessarily the most complex to learn. 

For subs, make sure to use "RET" to return to the program that called the sub, rather than using "M17" as return code. The last disables G64, which provides smooth motion. 

Siemens commands make sense and are usually acronyms. Like CFTCP, "Constant Feed Tool Center Point."

I love Sinumeriks and like to think I'm deeply versed on them. If you need help, drop us a message here. It will be a pleasure to help. 

Hi, I'm using a mazak controller with mastercam,  and fairly new with it.

I need to learn how to call subprogram and return. Basic m98 and m99 isn't working..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...