Programming of numerical control
The programming of numerical control (CN) makes it possible to control Machine-outil S with Numerical control.
It is the numerical unit control (DCN) which interprets the instructions, receives information of the Capteur S and acts (via an electronic variator) on the Moteur S.
There exist several manufacturers of DCN: Fanuc, NUM, Heidenhain, Siemens, Philips, Makino, Fagor, Selca, Fidia, MAZAK.
Language
In the beginning, the Computer programming language was the G-code , developed by EIA with beginning of the year 60, and finally standardized by the ISO in February 1980 under the reference RS274D/(ISO 6983) .
Taking into account the absence of later developments, large variety of the configurations of machine tools, and little of request for a real interworking, little of controllers with numerical control respect this standard. Extensions and alternatives were added independently by various manufacturers, with the result that the operators must know the various dialects and characteristics of the machines which they use, and the systems of CFAO must be limited to lowest common denominator of the machines than they order.
Many manufacturers tried to circumvent this difficulty of remaining compatible while following the road traced by Fanuc. Unfortunately, Fanuc is not in conformity with standard RS-274 or its preceding standards, and was slow to add new functionalities and to use the increasing power of the computers. For example, they transformed the order g70/g71 into g20/21; they used brackets for the comments, which because of the problems during the introduction of mathematical calculations; they started to use the nanometers only recently (what requires 64 bits); they introduced the nurbs to compensate for the low flow of the blocks since the memory (instead of installing a mask).
Since the establishment of the standard ISO 6983, and technologies evolving/moving quickly, of many extensions were added to take account of the innovations and the new capacities of the machine tools. These extensions, although often useful in manufacturers different of Numerical Control Unit, do not enter the standard and complicate the task of the software of Fabrication computer-assisted, which must create the lines of this language for a particular DCN. Beside the ISO, new codes appeared, different according to the Numerical Control Unit. They integrate more and more, in addition to the ISO, the languages specific to the manufacturers of DCN (symbolic system, C, etc) as well as application program interfaces conversational intended to simplify the programming (see CN Mazak, Heidenhain or Selca).
Codes
-
preparatory Functions (G), functions of call of mode of interpolation (G 0), cycles machine
- Coordinated points (X, Y, Z, I, J, K)
- Speeds, advances… (S, F)
- auxiliary Functions (M) which makes it possible to engage lubrication, to change tool, or to start accessories.
-
X absolute position
- Y absolute position
- Z absolute position
- has position (rotation around axis X)
- B position (rotation around the axis Y)
- C position (rotation around axis Z)
- U position Relative
- V position Relative
- W position Relative
- M codes Fonction " Machine" or " Modale" (another type of action or computer code (*))(sometimes referred like “various” function (" Miscellaneous" in English)
- Y absolute position
- D assiociation of a corrector of gauge tool
- F rate of travel
- S number of revolutions
- C if it is just in a block of outlined cycle fixed or completion, C indicates a chamfer
- NR number of line
- F rate of travel
- V makes it possible to control a number of revolutions in a machine with various configurations
- R Ray of arc or option passed to under program
- P temp of pause or option passed to under program or call of under program (Preceded by M98 by ex)
- T Selection of tool
- I Centers X of the data of an arc
- J Centers Y of the data of an arc
- K Center Z of the data of an arc
- D diameter of cut/shift for the thickness of tool
- H shift for the height of the tool
- R Ray of arc or option passed to under program
(*) The codes M control the whole of the machine, allowing its starting, its stop, the startup of watering, etc Whereas the other codes relate to the advance of the tool.
Different machines can use the same code to carry out different functions: even the machines which use same controller CNC. Some declared that the G-code " Fanuc " is standard, which is false. It is simply one of simplest and most widespread.
A standardized version of the G-code known under the denomination BCL is used, but on very few machines.
The G-code is interpreted by the tracers photographic Gerber, the controllers of machine tool and some their operators.
The files G-code are produced by program of CFAO such as GOelan, SmartCAM, Gibbscam, Featurecam, Artcam, Edgecam, Surfcam, Mastercam, OneCNC, Router-CIM, Alphacam, TopSolid' Cam, ENCLOSE etc These applications in general use converters called post-processor S to optimize the code for its use on a particular machine. The post-processors are generally modifiable by the user in order to optimize their use. The G-code is also produced by certain programs of CAD specialized in the design of Printed circuit. Such programs must be adapted for each type of machine tool.
Some machines CNC use programs " Interactifs" , which makes it possible to program with Agents while hiding partially or completely the G-code. Some popular examples are Mazak Mazatrol, Hurco Ultimax and the interactive language Mori Seiki' S CAPES.
Codes CNC basic ISO
-
|
- M03, M04, M05 Stitches time direction, anti-clockwise direction, stop
- |
- M07, M08, M09 Started watering stop watering
- M02 Program stop
- Fine M30 of the program, rebootstrapping, rewinding
- Fine M99 of the subroutine
- M00, M01 Program stop, optional stop or with condition
- |
- G96, G97 Speed of constant surface, speed of constant pin
- G50 Speed of pin maximum
- G95, G94 Displacement mm per turn, displacement mm/min
- G00, fast G01 Movement, linear interpolation (cut according to a straight line)
- |
- F Rate of travel
- S Speed of pin
- |
- Coordonnées axes X Z HAS B C
- M03, M04, M05 Stitches time direction, anti-clockwise direction, stop
Preparatory functions G
The function of linear interpolation fast G 0 (or G0) (linear interpolation in fast mode).
The linear function of interpolation (at the programmed speed) G 01 (or G1) (linear interpolation in work method).
The circular function of interpolation G 02 (or G2) (circular interpolation direction antitrigonometric) and G 03 (or G3) (circular interpolation trigonometrical direction).
The function of temporization (programmable with F, X or P) G 04 (or G4).
The function of precise stop at the end of the block G 09 (or G9).
It is also possible on certain desks of programming to use these two codes (G2 G3) to create a circular interpolation, functions of interpolation containing curve NURBS G 06.2 .
On the milling machines equipped with birotative head the codes G17, G18, G19 define the axis of the cycles of drilling, tapping… and the plan in which will be carried out the interpolations circular and activated the corrector of ray of tool.
-
G17 : Center tool Z, G2 interpolations, G3 and correction ray in plan X Y.
- G18 : Center tool Y, G2 interpolations, G3 and correction ray in plan Z X.
- G19 : Center tool X, G2 interpolations, G3 and correction ray in the plan Y Z.
Codes of the family G52, G53, G54, G55… is used for:
- To program a shift of origin ;
- Définir that displacements are relative to the origin machine ;
- To choose the number of the origin part .
Certain codes G of the family G60 G70 can be used by the DNC manufacturers for:
- the choice of the Cartesian programming or polar ;
- the activation of a scale factor ;
- the setting in motion of a function mirror ;
- the programming measures of it metric or in inch .
The codes G90 G91 define the absolute programming or incremental of the dimensions.
Canned cycles are also accessible on the majority from the machines: G 81,82,83… for the cycles of drilling, tapping, etc with cancellation by G 80 . Other cycles can be present according to the type of machine (turn " cycle of outline G71, G72, G73… " , milling machine, reamer, wire,…).
Auxiliary functions M
Put in rotation time m3 stitches, M4 anti-clockwise . Stop by M5 .
Automatic change tool or handbook M6 .
Startup of watering N°1 M8 . Stop by M9 .
Startup of watering N°2 M7 Stop by M9
Function of end of program m2 or M30 .
Function of stop programs M0 .
Function of optional stop programs M1
Function of angular activation of axis to replace pin turning " M88-89" (according to order Except mazak which manages automatically)
Origins
-
Origine programs (COp): it is the point origin of the program from which the movements of the machine are programmed.
- Origin Machine (OM): Butted physical positioned against each axis of the reference frame machine. From where the catch of POM (taken origin machine) to each mobile starting machine.le is moved along each axis, in thrust. The Machine origin is often confused with the origin measures.
- Origine measures (Om): it is the point origin in the space from which the machine measures its displacements. The origin measurement is often confused with the origin machine. When they are not it, they are distant of a constant value.
- Origine carries part (Opp): it is used to locate the part in the machine. It is the point of the part which does not move of position according to the variations of dimension. It is the point of intersection of the isostatism.
- Distance origin programs (COp) - origin machine (OM): it is the distance which the machine must add to pass from its origin (OM) at the origin of program (COp).
- " DECALAGE" (DEC): vectorial distance from the origin part in the beginning programs.
- " PREF" (pref): vectorial distance from the origin machine in the beginning part (or part carries).
Corrections
Correction of the machine allowing to take account of the various lengths and diameters of tool.-
in Milling: correct length of strawberry : Activated automatically during the change tool (M6). On DNC FANUC G43 , cancellation by G49 ; For the correct of ray of strawberry : G41 and G42 , cancellation by G40 . On certain DCN, the small ray of end of tool by a corrector prefixed @ is compensable.
- G41 positions the tool on the left programmed trajectory of a value equal to the ray.
- G42 positions the tool on the right programmed trajectory of a value equal to the ray.
- in turning: correct length of correct tool , in diameter and compensation of ray of nozzle : G41 and G42 , cancellation by G40 .
Moreover, correction of tools in the course of machining called " correction dynamique" allows to compensate for the wear of the tool.
Axes
-
axis Z of a machine with numerical control is always the axis of the spindle.
- axes X and Y are laid out according to a direct reference mark orthonormé compared to Z.
- axis X is that which allows the longest distance from displacement. The last axis being the axis Y; on certain machines, one finds axes additional called Axe has, B, C. the axes has, B, C are rotary axes, has turning around X, B around Y, C around Z. One meets moreover designations U, V, W for other additional axes, gantries, turrets secondary or additional.
- the direction + allows an increase in dimensions of the part.
Example
This is a typical program which show the use of the G-Code to turn a part of 1 inch diameter and 1 inch length. One leaves the assumption that the matter bar is already in the machine and that it exceeds slightly in length and diameter. (Attention: This is a typical program, it could not function on a real machine! Be particularly attentive with item 5 below.)
Some note:
-
One can develop a style of programming, even on such a short program. The grouping of the codes of the N05 line could have been distributed on several lines. This would facilitate the follow-up step by step execution of the program.
- Beaucoup of codes is " Modaux" what wants to say that they remain active as long as the order was not cancelled or was replaced by a contradictory order. For example, after having chosen the cutting speed variable (G97), it remains active until the end of the program. In service, the speed of pin will increase as the tool approaches the center so as to maintain a Cutting speed constant. Same manner, after having selected the rate of travel fast (G00) all the movements will be fast until a rate of travel (G01, G02, G03) is selected.
- It is of everyday usage to have a controller of load/speed on a machine with numerical control. This controller will stop the machine if the pin or the rates of travel exceeds values preset S during the parameter setting of the machine. The role of the controller of load is to avoid breakage machine in the event of breaking of tool or programming error. Moreover, to a certain extent it can give information on a tool which becomes too worn and requires a replacement or a regrinding.
- It is of everyday usage to quickly bring the tool to a point " sûr" near to the part - in this case with 0,1 inch - and then to start the slow displacement of the tool. The necessary security distance depends on the knowledge to make and the ease of the programmer.
- If the program is false, the probability of a crash landing machine is high! This can be very expensive. It is possible to envisage with regular intervals of the optional stops (M01 code) which make it possible the program to be carried out by sequences. The optional stops remain in the program but are neglected during a normal execution. Fortunately, the majority of the programs of CFAO are delivered with simulators of displacements posting the movements during the execution of the program. Many modern machines CNC also make it possible to the programmer to carry out a simulation and to check the operational parameters of the machine in any point of the execution. This makes it possible to the programmer to discover semantic errors (in opposition to the errors of syntax) before losing materials or tools with an erroneous program.
Example of a simple program of turning CNC
O1234 G50 S2000 G96 S300 M03 M6 T06D06 (TOOL Of OUTLINE OF TURNING) G18 X37. Z0. G01 X-1. F0.2 Z1. G00 X30. G01 Z-20. X33. X35. Z-21. Z-25. X37. G00 X150. Z300. M01 M6 T0101 (DRILLING 18MM) G97 S1000 G19 M03 X0. Z5. G01 Z-25. F100 G00 Z5. X150. Z300. M05 M30
Example of a simple program of milling CNC
A simple example can be a rectangle of 4 inch X 2 inch. The basic code could be read as follows:
N1X0Y0T01 N2X0Y2000 N3X4000Y2000 N4X4000Y0 N5X0Y0 N6M00
-
Line 1 (N1) known as with the machine of going at point X0Y0 and seizing the tool #1
- Line 2 known as with the machine of going at point X0Y2.000
- Line 3 known as with the machine of going at point X4.000Y2.000
- Line 4 known as with the machine of going at point X4.000Y0
- Ligne 5 turns over towards the origin machine
- Ligne 6 stops the machine
- Line 2 known as with the machine of going at point X0Y2.000
-
Notez that the program does not envisage anything for the advance tool. If the machine is a router and uses a strawberry of ray 6mm, the part will be in practice 12 mm smaller than definite (6 mm by with dimensions). To correct, an order G-code command (in this case) must be used to correct the advance of the tool.
N1G44M0125 N2X0Y0T01 N3X0Y2000 N4X4000Y2000 N5X4000Y0 N6X0Y0 N7M00
-
In this case, the controller sees the first line and adjusts the position of the cutting tool to 0,125 (or 1/8 inch) outside the layout of cutting. Maintaining the machine will create a suitable part with that drawn. According to the cutting tool used, the correction can be definite if necessary. For example, a laser with a very fine beam can require a correction of .005 inch, whereas a water jet machine with a tube of internal diameter 0,060 inch will require a correction of 0,030 inch.
Helps with the programming of complex profiles
The Geometrical Programmation of Profile (P.G.P.) of the DNC manufacturer NUM makes it possible to use directly the dimensions of the Dessin of definition to write the program.
Principle:
- programming in absolute ( G90 )
- valid traditional programming
- programming per blocks: a geometric standard per block
- geometric standard entirely or incompletely definite (in one or two following blocks)
Geometric standards:
- Element of angle EA
- Element leave EB+
- Element chamfer EB-
- tangent Element AND
- secant Element ES
- Discriminant E+ / E
The language PROGET 2 ' of the manufacturer SELCA uses 5 codes G, being able to be comparable with 5 instruments of the draftsman.
-
G20 for the compass in the case of circles of known center and.
- G21 for the gauge multi rays for the blending radii.
- G13 for the bevel protactor in the case of right tilted.
- G10 and G11 for the rule.
See too
-
Numerical control
- Computer-aided design
- CFAO
- Manufacture computer-assisted
- Post-processor S
- Acronyms of the CFAO
Bonds
-
The NIST RS274NGC To interpret
- EMC
- the Industrial Crenel manufacturer of machine tool 3 and 5 Axes
| Random links: | Agent | Oculto | Taddeo di Bartolo | César Alierta | Ellana | Arbor unit | José_Maria_Chacón |