Saturday, January 17, 2009

More on Cnc and G-codes


CNC CONTROL-OPEN AND CLOSED LOOP CONTROL


Motor drive controls the position and velocity of the machine axes in a CNC system, with each axis being driven separately, and follows the command signal generated by the NC control. The open-loop and closed-loop systems is how the servo drives are activated


The continuous –path control system is also known as the contour method. It can synchronize the axes of motion to generate a predetermined path such as a line or arc and everything in between.

CNC Control-: Open and Closed Loop Control

Motor drives are required in CNC systems to control position and velocity of the machine axes. NC generated signals drive separately each axis this is accomplished by the open-loop or closed-loop system activating the servos.

Open Loop – The input device feeds programmed instructions into the controller; the signals then are converted into electrical pulses by the controller. These signals then are sent to the servo amplifier which in turn energizes the servo motors. The number of electrical pulses will determine how far each servo will travel, while the pulse frequency determines the velocity.

There is a draw back to the open-loop system primarily being there is no feedback system to determine if the program position and velocity have been achieved. Load, temperature, lubrication, or humidity could affect the actual output of the machine causing it to be different from the desired output.


Because of this point to point systems generally use the open loop system where accuracy is not that critical.

Closed Loop-A feedback system that monitors the actual output and corrects any discrepancies from the programmed input is what is different with the closed loop system. The feedback system can be analog or digital, with the analog system measures the variations of the physical variables such as position and the velocity in terms of voltage levels.

FIXED CYCLES ON THE MILL

Fixed cycles on a CNC mill are used for the drilling of holes or hole machining. This includes center drilling, countersinking, drilling, reaming, counter boring, boring, right hand tapping, and left hand tapping. Holes can be a ¼ inch diameter hole drilled though the part, more complicated as a blind hole, low tolerance, or a stepped hole.

FFixed or canned cycles, as they can be called, allow programs to be shorter, faster to program, easy to


understand, easy to read, easy to troubleshoot, and less chances of error. Here is an example of the usefulness of canned cycles when drilling four holes drilled in a plate. ORIGIN 2 4 3



Here is an example of drilling four holes in the plate above without fixed cycles in the program.


Z-1 drills though

  • G90 Z.05
  • G00 X2Y2
  • GO1 Z-1F20.
  • G00 Z.05
  • X2Y8
  • G01 Z-1
  • X8Y8
  • G01 Z-1
  • G00 Z.05
  • X8Y2
  • G01Z-1
  • G00 Z.05

Here is the same program with a G81 canned cycle

  • G90
  • G81 X2 Y2 Z-1. R.05 F20. G99
  • X2Y2
  • X8 Y8
  • G80

Notice how simpler the program is.

G CODES

Using a canned cycle starts a mini-program already in the controller memory, and different canned cycles work beat for different hole machining operations. Here are the “G” codes used in these machining operations.

o G73 PECK DRILLING BREAK

o G74 LEFT HAND TAPPING

o G76 FINE BORING

o G81 DRILLING

o G82 COUNTER BORING

o G83 PECK DRILLING DEEP HOLE

o G84 RIGHT HAND TAPPING

o G85 REAMING

o G86 BORING

o G89 COUNTER BORING FOR BAR

RULES

A programmer needs to use the proper code words for a canned cycle to operate correctly.

This is an example of G81 correctly written.

G81 X1. Y1.Z-.50R. 1F6. G99

Here is how the five words used in this block of code are used

1. G defines the type of cycle

2. X and Y indicate the hole location

3. Z is the depth of the hole

4. R is to set the rapid plane

5. F is the feed rate

Rapid Plane-Can also be called the retract plane, it is the plane above the work piece where the cutting tool has cleared the top surface. From this position the tool can move the a new position without touching the work piece; however, this is not what is called the initial plane

Initial Plane-In machining the initial plane is the Z height of a tool when a canned cycle is initiated. This also may or may not be at a tool change position. G98 is often used in the canned cycle block insuring the tool returns to Z where it began without movement in X or Y axis. This to ensure the tool does not strike fixtures or jig before moving to a new location.

Feed Rate-A unit distance divided by a time scale that a tool travels while machining, with the unit distance in inches and the time scale in minutes. This is expressed in “inches per minute” (I/m IPM) or “feet per minute” (f/m or FPM).

The use of “words” is derived from the EIAS word address programming protocol, the original NC programming language. To retract the tool to the initial plane G98 is used.

The initial plane is the Z level when the canned cycle was called, and not the rapid plane. Using G98 is a good way to avoid clamps as long as the initial Z is higher than all tooling and clamps. To retract the tool to the rapid plane when the cycle is finish G99 is used. G98 and G99 can be used interchangeably in the program code.

Canned cycle are modal meaning once they are turned on they stay on until the cycle is cancelled. Once started every block of code is interpreted as being a part of that canned cycle process. G80 is the command to cancel a canned cycle, if not used every movement after the intended hole/s is more unwanted holes may be drilled or the machine may crash.

This is what a canned cycle will do:

1. Rapid to specific X and Y location;

2. Rapid to the Z rapid plane specified;

3. Machine the hole to the G code specified.

4. Exit the hole.

This is an example of a properly written G81 canned cycle to drill four holes.

o N008 G81 X1. Y1. Z-.2 R. 1 F6 G99

o N009 X1.25 Y1.25

o N010 X1.5

o N012 G80

G73-Peck Drilling Cycle

What the peck drilling cycle does is rapid to the XY coordinates and then to the R plane where it begins to feed down in increments of Q at a feed rate of F to a depth of Z. At the end of every Q increment the drill will back off .005 to break any possible stinger chips and continues to the next increment of Q. The controller calculates the number of pecks till the programmed Z depth is reached, when complete G99 return the drill to the initial plane.

G74-Left Hand Tapping Cycle

The left hand tapping cycle rapids to the XY coordinates and to the R plane where it begins to feed the spindle down and counterclockwise at a feed rate of F to the depth of Z. The spindle then reverses and feeds upward at the same federate to the R plane, G99 will rapid to the initial plane.

G76-Fine Boring Cycle

With this cycle no witness marks are left behind, this is done by moving the tool away from the bored surface before retracting. The tool feeds down to the bottom of the bore; the spindle then stops and orients itself to the M19 position. Next the tool retracts from the wall of the bore and rapids out of the hole. I and J are introduced here, I and J are simply clones of X and Y. Depending on the tool orients itself, they determine how to move the tool away from the bored surface. I-.002 tells the controller to move the tool .002 in the X direction, J.002 tells the controller to move the tool in the +Y direction. Here is an example of G76 code: G76 X1. Y1. Z-1.R. 1 I-.002 F5 G98.

G81-Standard Drilling Cycle

This cycle has many uses such as center drilling, drilling, reaming, and rough boring. It travels down at a set feed rate and then rapids out of the hole. When drilling deeper holes, another cycle is recommended, either G73 or G83, as chips can clog in the flutes and break or overheat a drill.

An example of G81 code: G81 X1. Y1 Z-.2 R. 1 F3 G99

G82- Counter Boring cycle

The counter boring cycle causes the tool to feed to the bottom, pause if needed, and then rapid out of the hole. This pause is programmed in milliseconds, and allows the tool time to cut the bottom of the hole. Tool pressure is relieved, this is important when counter bore holes have a tight tolerance.

An example of G82 code: G82 X1. Y1. Z-1.R.1 P500 F7 G98

G83-Deep Hole Drilling Cycle

When drilling deeper holes G83 can be used, this cycle clears away chips and curls from the hole, as an excess of chips in a deep hole can cause a tool to break. The cycle drills a Q peck distance at the F (feed rate) then retracts at rapid speed back to the R (rapid plane) to clear out the chips, and then starts the cycle over again. Then the specified Z depth is reached it retracts at rapid. Here is G83 code: G83 X1. Y1. R.1 Q.1 F6 G99

A parameter in the controller controls the distance between the end of the rapid plunge and the new material to be drilled after the completed peck.

G84-Right Hand Tapping Cycle

This cycle goes to the XY coordinates, then to the R plane and begins to feed the spindle down and clockwise at a feed rate of F to a depth of Z. The spindle then reverses and feed upward at the same federate to the R plane. G99 will rapid to the initial plane.

Here is G84 code: G84 X1.Y1.Z-.8 R.400 F30 G99

G85-Reaming Cycle

This cycle is used for reaming and it feeds in and out of the hole at the set feed rate. Here is G85 code: G85 X1. Y1. Z1. R. 1 F5 G99

G86-Boring Cycle

This cycle feeds the tool in and at the bottom it stops the spindle, and then the spindle orients and rapids out.

G86 code: G86 X1. Y1. Z-1. R. 1 F7 G98

G89-Counter Boring Cycle

This cycle is half G82 and half G86 canned cycle, the tool feeds into the hole and pauses at the bottom; at that point the spindle stops and the tool will rapid out. The pause is necessary to relieve tool pressure for very accurate depths, and this cycle will leave a witness mark.

G89 code: G89 X1. Y1. Z-1. R. 1 P800 F10

No comments: