Created and Maintained by the Real World Software Developers and Machinists at www.KentechInc.com ... click here to check it out !!
Showing posts with label haas programming. Show all posts
Showing posts with label haas programming. Show all posts

Tuesday, November 26, 2013

Fanuc Macro Programming Series - Part #10 - Video Tutorials #7 & #8

In this final installment of our Fanuc Macro Training Series ... we'll take our macro programming outside the realm of actual machining and into the realm of set-up and probing. Illustrating how to utilize some of the functions and parameters of the controller to make adjustments and measure using cutter compensation and probing.

VIDEO #7
Click this link to view the Tool Offset Macro Example
VIDEO #8
Click this link to view the Probing Macro Example
Well that's it !!!

This was our final installment in our series ... we hope you have found it useful and informative.
We hope that you will refer back to the illustrations, explanations and videos at this site as you move forward in your professional CNC programming endeavors.

Please do us a favor ... SPREAD THE WORD about his BLOG and this SERIES so others can grow and learn as well. Thank You in advance.

Happy Chip Making from the SUPPORT TEAM of www.KentechInc.com !!


Thursday, November 7, 2013

Fanuc Macro Programming Series - Part #9 - Video Tutorials #5 & #6

We are continuing our Macro Programming Series with a couple of video tutorials that deal with the creation of a bolt circle macro.

Video #4 illustrates the creation of a complete bolt circle macro ... while Video #5 illustrates how to alter the complete bolt circle macro to convert it into a partial bolt circle macro.

Video #4 - Complete Bolt Circle Macro Creation
Video #5 - Partial Bolt Circle Macro Creation

The Support Team at www.KentechInc.com

Tuesday, October 22, 2013

Fanuc Macro Programming Series - Part #8 - Video Tutorial's #3 & #4

As we continue our Fanuc Macro Programming Series ... we are beginning to put the previous information to work "in the real world".

In these two video tutorials ... we will create macros for holes-on-a-line examples using sme simple examples of illustration.

Video Tutorial #3
Video Tutorial #4

See you next post ... where we will get even more REAL WORLD !!
Happy Chip Making !!

Wednesday, October 2, 2013

Fanuc Macro Programming Series - Part #7 - Video Tutorial #2

On the heels of our successful video #1 ... we're going to "Kick It Up A Notch"!! ... with an arithmetic function tutorial.

Again ... please make sure you understand what's happening here so we can move on in later posts.

CLICK the Reel Icon Below to OPEN the Video Tutorial


Making Chips? ... why not make it an Arithmetic Macro !!
In two weeks ... be here or be square !!

Wednesday, August 28, 2013

Fanuc Macro Programming Series - Part #5 : Arithmetic Functions / Control Commands

The power of the Custom Macro language lies in the use of a variety of arithmetic functions within the custom macro body. This features gives the user the power to re-define and re-calculate the values of variables "on the fly." This post is meant as a brief explanation and overall view of some of these functions available with a more in-depth view given in following posts in this series.

Types of Commands Available 

Definition and Substitution
( #100 = #101 )

Addition and Subtraction
( #100 = #101 + #102 )
( #100 = #101 - #102 )

Multiplication and Division
( #100 = #101 * #102 )
( #100 = #101 / #102 )

Logical Sum -- Exclusive OR -- Logical Product
(  #100 = #101 OR  #102 )
(  #100 = #101 XOR  #102 )
(  #100 = #101 AND  #102 )

Trigonometric Functions
( #100 = SIN(#101)) ----- Sine
( #100 = COS(#101)) ----- Cosine
( #100 = TAN(#101)) ----- Tangent
( #100 = ATAN(#101)) ----- Arc Tangent
( #100 = ASIN(#101)) ----- Arc Sine
( #100 = ACOS(#101)) ----- Arc Cosine

Other Mathematical Functions
( #100 = SQRT(#101)) ----- Square Root
( #100 = ABS(#101)) ----- Absolute Value
( #100 = BIN(#101)) ----- Conversion from BCD to BIN
( #100 = BCD(#101)) ----- Conversion from BIN to BCD
( #100 = ROUND(#101)) ----- Rounding Off
( #100 = FIX(#101)) ----- Discard fractions less than 1
( #100 = FUP(#101)) ----- Add 1 for fractions less than 1
( #100 = LN(#101)) ----- Natural Logarithm
( #100 = EXP(#101)) ----- Exponent with base
( #100 = ADP(#101)) ----- Addition of

Another powerful feature of the Custom Macro language is the ability for the user to control the flow of the programs execution. Using a variety of what is called CONTROL COMMANDS, the user can repeat areas, jump to areas and set conditions for program execution.Again, presented here is a brief explanation and overall view of some of these functions available with a more in-depth view given in following posts in this series.

Types of Control Commands Available 

DIVERGENCE
IF < condition> GOTO N----
When the <condition> is satisfied, the program execution jumps
to sequence number N----.
Example : IF [#100 = #102] GOTO N100

CONDITIONAL EXPRESSIONS EXPLAINED
The following are expressions that can be used to define conditional expressions :
EQ = equal to
NE = not equal to
GT = greater than
LT = less than
GE = greater than or equal to
LE = less than or equal to

ITERATION
WHILE < condition> DO <number>
......
END <number>

While the <condition> is satisfied, the program executes blocks between the WHILE statement and the END statement.

Example : 
WHILE [#100 LT #102] DO 1
( program commands )
( program commands )
( program commands )
#100 = #100 + 1 ( add 1 to #100 at the end of each body run )
END 1

BRANCH COMMAND
GOTO N----

Program execution jumps to sequence number N----
Example : GOTO N101

----------------------------

Being well versed in the information from this post will be a big help as we go forward with some macro programming examples in future posts.

The fun is just beginning ... Stay Tuned !!

Wednesday, August 14, 2013

Fanuc Macro Programming Series - Part #4 : System Variables

The last type of Fanuc Macro Variables we will cover in our series are called SYSTEM VARIABLES. System Variables are fixed variables and read and reflect on conditions or values found somewhere in the CNC system. There are a variety of System Variables available to the user but they can for the most part be classified into some major groups :

INTERFACE SIGNALS :
The status of various input / output signals can be read using System Variables #1000 thru #1035, #1100 thru #1115 and #1132 thru #1135. Users should consult with their own individual electrical diagrams as specific input / output signals can be designed differently by different machine tool builders. But the general configuration looks like this :



TOOL GEOMETRY OFFSET VALUES :
Tool offset values as well as work offset values can also be read and modified through the System Variables as well. Those variable configurations look like :


WORK OFFSET VALUES :
Work offset values ... G54 thru G59 ... can also be read and modified through the System Variables as well. Those variable configurations look like :


ALARM GENERATION :
Users have the ability to generate ALARMS with user defined message using System Variable #3000. The format for using System Variable #3000 is :

#3000 = XX ( error message defined here )

In the above format ... XX is the error message # ( must be less than 999 ) and the error message to display is defined between the (   ) . For example :

#3000 = 123 ( ERROR ENCOUNTERED )

When the macro program executes the line as above, the machine would enter the alarm condition ... the CRT will display Error #123 followed by the message ERROR ENCOUNTERED. Clearing the alarm condition is as normal.

The user has complete control over the Alarm # and the message to be displayed.

SUPPRESSION OF MACHINE FUNCTIONS  :
Through the use of the System Variables as outlined below ... users can suppress certain machine functions. Users should exercise caution when using these System Variables.


MODAL INFORMATION :
Modal information ... up to the current block ... can be read using the System Variables as outlined below :


POSITIONAL INFORMATION :
Using the System Variables as outlined below, the position of each axis of the machine can be read. The chart outlines the type of position ... and whether or not the tool offsets are considered.


----------------------------------------

Now that we have all the definitions out of the way ... the next posts in our series will put all these definitions to use. THE FUN BEGINS ... Stay Tuned !!

Wednesday, July 31, 2013

Fanuc Macro Programming Series - Part #3 : Local & Common Variables

Part #3 in our Fanuc Macro Programming Series is dealing a little bit more in-depth with the definition and use of Local Variables and Common Variables

LOCAL VARIABLES :
Local Variables are so named because they are used "locally" in a macro program. This means that the value of the local variable is retained only in the program for which it was assigned. Values of local variables are not retained when branching out to other sub programs.

Local variables are primarily used for data transfer or for intermediate calculations within a macro. The table below represents the local variable available LETTER ADDRESS and corresponding NUMERICAL ADDRESS contained in the macro program. Local variables are assigned either through the use of the G65 command or by direct data input. All local variables are "vacant" unless assigned, and can be freely used by the user.


Program Example using Local Variables :

Assignment by Macro Call :
Macro Call : 
G65 P1234 A2.00 B5.00 ;
Result :  
G65 call assigns the value of 2.00 to local variable #1 ( A )
G65 call assigns the value of 5.00 to local variable #2 ( B )

Program Command :
G01 X#1 F#2
Actual Command :
G01 X2.00 F5.00

Direct Assignment by Program Command :
Macro Statement : 
#1 = #2
Result :
Direct assignment of variable #1 set to the value of variable #2

Intermediate Calculation within a Macro :
Macro Statement : 
#1 = #2 + #3
Result :
Variable #1 is equal to the sum of variables #2 and #3

---------------------------------------------

COMMON VARIABLES :
Common Variables are different from local variables in that once a value is assigned, that value is shared by all other macros and the values are not cleared at M30 or RESET. This means that #100 used in one program is the same value of #100 used in another program. In addition, if the value of a common variable is calculated in one macro, that value is retained when called in another macro.

The main important feature of common variables lies in the fcat that they can be used between macros and that their values are not cleared at M30 or RESET. Users should be careful when performing calculations with common variables because when the program is re-started, the value of common variables is retained from any previous calculations and may produce unexpected results. Common variables can be freely used by the user.

#100 thru #149
These variables are cleared at power off

#500 thru #549
These variables retain their value even after power off.

--------------------------------------------

Stay Tuned for more ... 

Monday, July 15, 2013

Fanuc Macro Programming Series - Part #2 : Variables

What Are Variables
The Fanuc Custom Macro language uses a variety of what are called VARIABLES in the language. Variables can perform a variety of chores in the language, their main job is to carry and gather data for use in the macro program.

A Variable always begins with the # sign, followed by a number. For example, #100 is a variable. In it's simplest form ( without getting into specifics of how that is done ... it will be covered later ), a variable is used to carry data. An example :

First Program Line : #100 = 2.00
Second Program Line : G01 G90 X#100 F10.0

In the above example, the macro program first defines the value of the variable #100 ... that value is 2.00 as defined in the First program line. The variable #100, carrying the value of 2.00, is called or used in the Second program line. To the control, the value of the Second program line is :

G01 G90 X2.00 F10.0

Once the variable is defined ( without getting into specifics of how that is done ... it will be covered later ) anytime the control sees the variable, it replaces it with it's defined value, in this case 2.00.

To take this just a step further ... remember anytime the control sees the variable #100 it will substitute it's defined numerical value, the following line :

G01 G90 X#100 F#100

would read to the control :

G01 G90 X2.00 F2.00

As mentioned, variables have other functions as well. The types of variables available will be discussed in more detail in various posts in our series.

Types of Variables
There are basically (3) different types of variables available ... the type to utilize is dependant on how you want the data to be transmitted.

Local Variables
( # 1 thru #33 )
Local variables are primarily used for data transfer and their value remains active only within the local program. When a sub-program is executed, the value of the Local Variable does not carry over into the sub-program. The value of a Local Variable is usually set using the G65 macro call command.

Common Variables
( # 100 thru #149 and #500 thru #509 )
The main difference between Common Variables and Local Variables are that Common Variable values are retained between programs. That means that the #100 used in one program is the same in every other program or sub-program called. The value of any Common Variable, even if arrived at via a mathematical instruction, is the same value in subsequent program use.

The value of variables #100 thru #149 are cleared at power off, while those of variables #500 thru #509 are retained, even after power off. However, these conditions may be altered via Parameter Settings.

System Variables
System Variables are normally used to obtain conditions, positions or values from areas within the CNC control. Some examples of the use of System Variables :
  • To record an axis position at a certain time
  • To record or adjust a tool offset value
  • To record or adjust a work coordinate offset setting
  • To generate s user defined alarm condition 
  • Suppress the single block, feed hold, feedrate override functions
  • Read and record modal information
Stay Tuned for more in our series !!

Tuesday, July 2, 2013

Fanuc Macro Programming Series - Part #1 : Basics

R U Sitting Down ??
OK then Buckle up !!!

We are about to begin a long ... somewhat complex ... but very beneficial series teaching the how's ... why's ... and details of the Fanuc Macro B Programming Language. If you do CNC programming and are utilizing a Fanuc Control ... your review and understanding about what we are about to present will definitely send you to the next level of CNC programming.

Over the next months ... we will be interspersing articles in this series covering Fanuc Macro B programming from the basics to the complex. We will still be including and sharing some of our sought after CNC Tips and Tricks ... but we will also be including articles in this series as we go along as well.

So check back often ... follow along ... and hopefully we can help bring your CNC programming skills to the next level.

P.S. - A lot of the information here is included in our KipwareEDU® - CNC Programming Training & Reference Software - Macro Version. So if you like what you see here ... and there's tons more in KipwareEDU® ... you can purchase the Macro Version of KipwareEDU® and have this information at your disposal on your own PC ... or use it to tech your personnel. KipwareEDU® contains the info here and tons more along with in-depth video training not included here.

Part One : The Basics
What is Fanuc Custom Macro B ?
Custom Macro is the name given by Fanuc to it's programming language that enables users to take the standard G code programming to another level. Custom Macro allows users to include instructions, mathematical equations, changing variables and a host of other advanced functions in a G code program.

Because of the power of this language, anytime a thought occurs like " I just need to repeat what I did here" or similar, it's probably a good time to consider using custom macro programming. Some examples where Custom Macro programming can be employed :

  • Dimensions or other values require calculations or re-calculations "on the fly". 
  • The programming of family of parts or parts that repeat the basic operations but contain only dimensional changes.
  • Dimensions or other values need to be stored or transferred to other addresses in a program.
  • Complex operations where the basic pattern or cutting sequence remains the same ... an example would be pocketing ... but dimensional changes, that can be defined by one or a series of mathematical formulas, need to be re-calculated "on the fly".
  • The basic "rule of thumb" is that Macro programming probably can be utilized anywhere where repetition exists.

As you explore this series, we will bring out many instances where macro programming can and should be employed ... but we are also sure that these will open doors to macro programming examples in your own world as well. Keep an open mind !!!!

Macro Programming vs. Sub Programming
There are similarities and many differences between a CUSTOM MACRO program and a standard SUB PROGRAM. We outline in this chapter some of the major differences and similarities.

SIMILARITIES :
  • Both types can be called from another program.
  • Both types are stored in memory  under their own program number.
  • Both types can be called to repeat a pre-determined number of times.
  • Both types can be called multiple times from other sub or macro programs.
  • Both types end with the M99 command.
DIFFERENCES :
  • Macro program body can perform and contain mathematical equations.
  • Macro program calls can establish values for variables used in the macro program. 
  • A macro program can be called and made "modal" to repeat until the cancel command is issued.
  • Macro programs can be called from user defined G, M and T codes via parameter settings.
The creation of a custom macro program is identical to the creation of a sub program. Both types are registered to the memory under their own program number and stored separately in the memory. As with sub programs, the end of the custom macro program is done through the use of the M99 command.

OK ... there are some basics. If you have questions ... I'm sure we will address them in the coming articles.

SOOO ... stay tuned for even Happier Chip Making !!