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

G02, G03 - interpolacja kołowa

G02, G03 - Circular interpolation

Making bows using circular interpolation G02/G03, is one of the basic steps for programming CNC machine tools. The key to proper programming of such treatment is the knowledge of several components: the plane on which we work - XY (G17), XZ (G18), YZ (G19) plotting the direction of the arc, in accordance with the G02 clockwise, counterclockwise to ...
Tabela otworów pod gwint

Table-hole

Holes for screw threads - selection table drill into the threads version in pdf format download Metric (M) Metric fine (MF) Thread-inch Whitworth (BSW) Whitworth Pipe Thread (BSP) Thread Size Drill diameter [mm] Thread Size Drill diameter [mm] Thread Size ['] Drill diameter [mm] Thread Size ["] ...
Alfabet CNC

Alphabet CNC

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

As we already know, the operation consisting in the repetition of the same action / processing, we can easily use a simple subroutine. Macro offers us the opportunity to use the parameters, the function arithmetic and logic, and conditional loops, and the macro itself can call in the same simple way as a subroutine.


At the beginning of the fitting to mention how to define variables Fanuc controllers in our macro. For Sinumerik achieved this by assigning specific values ​​of R parameters, eg R10=25 . For Fanucach do the same, except that instead of the letter R, we use # ', eg: #10=25 . More as a curiosity must be given to the fact that the number of our variable can be represented also in the form of an arithmetic expression, contained in square brackets, eg:
 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 this range will trigger the alarm No. 111
In the program, to specify the variables referenced in the following way:

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

When defining the values ​​of the variables do not have to use commas as decimal values, so important when programming for Fanuc controllers, namely:

 N10 # 1 = 5 / / define a variable without a point / comma 
                     decimal
 N15 G90 G1 X5.  / / Here no dots for the X5.  result in an error 
 N20 G90 G2 X # 1 / / even though no parameter has been 
                     dot, it will not cause the program error

Arithmetic and logical variables make very straight

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

The values ​​define the angle in degrees, for example to an angle
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]
  • absolute value ABS[#1]
  • rounding the ROUND[#1]
  • rounding down FIX[#!]
  • rounding up FUP[#1]
  • Boolean value OR #1 OR #2
  • Boolean value XOR #1 XOR #2
  • Boolean value AND #1 AND #2

We can make nesting operations and the order of execution is defined by using square brackets. We can nest up to 5 arithmetic functions, such as:

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



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

1 comment

  1. Widget says:

    September 28, 2012

    Regarding decimal commas, which you moved on, it is to your advantage to change the parameters to the machine read a number without a decimal point as mm, and not as micrometers. Unfortunately I can not remember at the moment which parameter is responsible for this. But much more convenient to write programs without those unnecessary commas.

Comment

You must be logged in to power komentowaæ ..