Programming of CNC machines, base parametric programming for FANUC controllers and Sinumerik, tips, tricks, useful formulas and tables, the basics of CAD / CAM and CNC simulators.

G02, G03 - interpolacja kołowa

G02, G03 - circular interpolation

Taking bows using circular interpolation G02 / G03, it is one of the basic steps for programming CNC machine tools. The key to proper programming of such treatment is knowledge of several elements:
Tabela otworów pod gwint

Table holes for thread

Holes for threads - Table of drills selection under threads
Alfabet CNC

Alphabet CNC

Knowledge of CNC alphabet, which gkodu (g code) is something without which you can not think about professional programming CNC machines. Of course, being a good programmer is also having knowledge of material science, or mathematics, but gkod is a kind, glue 'that combines all these elements into one functional unit - the program ....

As we know, the operation consisting in the repetition of the same action / processing, we can easily use a simple routine. Macro offers us the opportunity to use a parameter of arithmetic and logical functions, and conditional loops, and the same macro can call in the same simple way as a subroutine.

For starters it would be fitting to mention as Fanuc controllers define variables in our macro. For the Sinumerik been done to this by assigning parameters R certain values, such as R10=25 . The Fanucach act similarly, except that the letter R, using, # ', eg #10=25 . More as a curiosity must be given to the fact that the number of our variable we can present also in the form of an arithmetic expression, recognized in square brackets, for example:
 N10 # 1 = 10
 N15 # 2 = 1
 N20 # [# 1 + # 2-8] = 5 // which in our case is 
                     equivalent to # 3 = 5

Variables can be set to zero, and the values ​​in the range (-10 47 -10 -29) ∪ (10 -29, 10 47). Values ​​outside of this range will trigger an alarm No. 111.
In the program, the defined variables, reference is as follows:

 N10 # 2 = 10 # 5 = 100
 N15 G90 G1 X # 2 F # 5 // synonymous with G90 G1 X10 F100
 N20 G90 G1 X # 2 // synonymous with G90 G1 X-10 
 N25 G90 G1 Y [# 1 + # 5] // mandatory in square brackets.
                        equivalent to G90 G1 Y110

When defining variables do not have to use commas, decimals, so important when programming Fanuc controllers, ie .:

 N10 # 1 = 5 // definition of a variable without a point / comma 
 N15 G90 G1 X5.  // Here lack of periods for the X5.  result in an error 
 N20 G90 G2 X # 1 // even though the value was not 
                     dot, it will not cause the program error

Arithmetic and logic operations on variables make very straight

  • the sum of #1+#2
  • difference #1-#2
  • product #1*#2
  • quotient #1/#2

The values ​​define the angle in degrees, which angle e.g.
90 degrees 30 minutes: # 1 = 90.5

  • Sine SIN[#1]
  • cosine COS[#1]
  • Tangent TAN[#1]
  • the arc tangent ATAN[#1]
  • square root SQRT[#1]
  • the absolute value ABS[#1]
  • rounding values ROUND[#1]
  • rounding down FIX[#!]
  • rounding up FUP[#1]
  • boolean OR #1 OR #2
  • boolean XOR #1 XOR #2
  • boolean AND #1 AND #2

We can perform nesting operations and define their execution sequence using square brackets. We can nest up to 5 arithmetic functions, such as:

 N10 # 1 = SIN [[[# 2 + # 3] * # 4 + # 5] * # 6]

Previous post G74: a series of deep drilling for CNC Fanuc Next entry G02, G03 - circular interpolation

1 comment

  1. Widget says:

    Sep 28, 2012

    Regarding the decimal comma which voice to a topic, it is to your advantage to change the parameters that the machine read without a decimal number as mm, and not as micrometers. Unfortunately, I can not remember at the moment who is responsible for that parameter. But much more convenient to write programs without these unnecessary commas.

Leave a comment

You must be logged in to power komentowaæ ..