Siemens 840D CNC Training
BleierCNCTraining@gmail.com / (847) 917-8145
Monday, January 9, 2012
Siemens CNC Training from Bleier CNC Training
I offer to combine seminars with machine side training with your programmer and operator to put the machine through its paces. Ideally we will do a commercial part.
The following are some of my recent events:
1. Assisted a small shop to get acquainted with the Siemens 810D on a a recent purchase of a used Hardinge 3-axis VMC. The user, who was familiar with Fanuc and Fadal, needed a few tips to get started with Siemens. Helped another user of a previously owned Fadal VMC wrangle its 840D with 802 front end to success.
2. Performed the NAS acceptance testing (cone frustum, circle/diamond/square, hole operations and power test) on an 840D retrofit of a G&L horizontal boring machine. Configured the machine to conform to the shop’s process. Trained the operators. As the first person to put the machine through its paces I discovered and worked with the retrofitter to fix incorrect direction of rotation of orientation axes, problems with block search, faulty tool pocket positions of the box-type magazine and the need to fine tweak the vector settings for the 5-axis transformation.
3. Trained the smart operator (programmer-operator) of a large, second hand 840C (note “C”) mill-turn machine. Worked through dozens of problems to discover how to use the machine to machine a highly contoured drive shaft with a bolt pattern on one end and a spline on the other.
4. Trained the programmer and operator of a large 5-axis router. Loaded standard cycles and measuring cycles and wrote measuring routines. Went through the process from start to finish by actually machining a typical job. Simultaneously the programmer modified his post to accommodate our discoveries. Our goal was to turn operations over to general purpose factory workers whose modest need for training could be accomplished by the operator I trained.
5. The user purchased an R&D laser machine in Europe for a highly discounted price and brought the machine to the U.S. The builder’s U.S. affiliate was not able to provide training on this one-off, odd ball machine.
6. The user’s 5-axis in-house retrofit was doing a contour in herky-jerky motion. Worked with the programmer to experiment with different ways to post the program. Discovered if we used the old ways of 5D/G93 we got much improved performance.
7. The machine tool builder’s installation personnel did wham-bam thank-you-ma’am training on a complicated 5-sided machine with a nutating head and left for the airport to return to the old country. I showed the user how to set work zero and use Cycle800 to machine on a swivel plane in the process of doing an actual part that we could send out for inspection.
8. Worked with the programmer to configure his post to output code that we determined worked well on the machine. The key was spending time at the machine doing a typical commercial job to understand the best way to use the machine. Should we use CompCad? If so, what compressor tolerance to optimize cycle time and surface finish while achieving dimensional tolerance?
9. The user of a multi-spindle machine wanted an analysis of the master program that orchestrated the machine as a whole in order to determine if the machine could be programmed for shorter cycle time. While there, did seminar for the operators and programmers of user’s other 840D machines.
Email me BleierCNCTraining@gmail.com or call me (847) 917-8145 if I can be of service to you
Wednesday, September 1, 2010
Turn Mill with 840D / Multi-Spindle Turning with 840D
A right angle attachment fits into a turret pocket just like any tool and redirects the tool axis parallel with the turning centerline. The geometry of the attachment is set in the base registers of the D-code so that the preset lengths of the tools are still valid. The TRANSMIT function (Transformation Milling into Turning) of the 840D makes milling on the face of the workpiece programmable in an XY plane. In this case the Y-axis is a virtual axis that does not map to the Y-servo axis. The Y-servo axis has to be kept in its neutral position for TRANSMIT machining.
From time to time I get my hands on a multi-spindle turning machine (photo below).
Multi-Spindle CNC machines are made easy by Channel CNC. Channel CNC is a concept that Siemens pioneered in the mid-1980’s. A Channel CNC is many independent CNCs in a common hardware/software configuration and serviced by a common operator interface and PLC, the latter for machine control generally. Each channel has its own spindle and axes and its own part program. Each channel does its own independent path interpolation. The machine of the photo has 10 channels. Channel 1 is the master channel that orchestrates the selection of programs in the other channels, when they start, when they wait, when they resume and the like. This is called "program coordination" and the program coordination commands are part of the G-code language (described in the so-called Job Planning manual).
Monday, June 21, 2010
Cycle800, Nutating Heads & Swivel Plane Machining

We can put the G17 XYZ system on the inclined plane of the figure above, orient the G17 system so that its Z-axis is normal to the plane and translate again to put the G17 XYZ origin at the point where the centerline of the pocket intersects the plane. If we have a nutating head (or a forked head or any number of orientation schemes for that matter) we can normalize the tool axis to the plane (put them at right angles)and program the face and pocket as if they are in the XY plane of a simple vertical mill.
Knowing the orientation angles to normalize the tool axis can be a challenge with some orientation schemes such as the nutating head. For example, the rotary positions of a 22 ½ degree nutating head are C71.468 A39.886 to normalize to the 15 degree plane of the figure.
Cycle800 does the transformation that calculates the orientation angles and actually commands the orientation axes to these angular positions. It also translates, rotates and translates again (if required) the G17 system so that when it is done the machine and control are ready to read-in and process G-code blocks that are identical to blocks for simple vertical bed mills.
Another way to imagine swivel plane machining is to imagine that the workpiece is frozen in space and you have miraculous strength. With two hands you grasp the machine, carry it to the workpiece and orient the machine so that a drill in the spindle points normal to any plane. In other words, you use your physical power to swivel the machine around the workpiece. You call out to the programmer, "Now you can program drilling operations in the plane normal to the tool axis like any ordinary 2 1/2 axis operation." The realistic equivalent of this fantasy is done by designing into the machine the means to orient just the tool (or work or some combination of work and tool), translating and orienting the G17 XYZ system and provisioning the CNC with transformation functions. This having been done, Cycle800 is the means to turn over to the user the use of this capability
To be clear, the capability is the ability to do 2 1/2 axis machining on a swivel plane in a way that allows the operator to make changes (say to Cycle81) the same way he would do changes when the plane is not a swivel plane. (All standard cycles and measuring cycles are in the G17 XYZ system or the G18 ZXY system or the G19 YZX system).
Definition of Swivel Plane:
Drilling into an inclined (same as compound plane) is ultimately a vectored move of the XYZ machine [servo] axes. It can be programmed as a 2 ½ axis machining operation when the G17 XYZ system is translated and rotated so its XY plane is in the drilling plane. The drilling plane is what this article calls a swivel plane because rotary axes are required to normalize the tool axis to the G17 XY plane.
Not all rotary axes are machine [servo] axes and when the operator loosens bolts and nudges the head that carries the quill to a desired angle, the rotary axis he positions is called a manual axis. Cycle800 knows to prompt the operator for a manual axis. However, we will assume our machine has servo rotary axes.
The transformation for static orientation is called Tcarr (Tool Carrier [transformation]). Tcarr is the poor man's Traori (Transformation [for] Orientation) for aerospace 5-axis contouring where the tool orientation changes along the path. Tcarr is a standard option. It is there, in the 840D when it leaves the Siemens factory and it was put there without the machine tool builder paying extra for it. However, it is not strictly free to the end user since the machine tool builder has to invest engineering time to configure it to his machine's orientation scheme.
The machine tool builder (MTB) can use Cycle800 to do the configuration, but this is not the subject of this posting. Rather, this posting seeks to explain the parameters of Cycle800 for the user of the machine to do swivel plane machining.
The Cycle800 Parameters:
_FR “1” is retract on Z to a clearance position. “2” is retract on Z first and then X & Y. “4” is retract on the tool axis to the software limit. “5” is retract an incremental displacement on the tool axis. “0” is do not retract.
The machine tool builder (MTB) sets retraction positions in the tcarr data block in variables 38, 39 and 40 discussed in the section “The Swivel Head Data Block”.
Cycle800 calls up a subroutine named ToolCarr where the retraction code exists.
_TC The given name of the tcarr data block. Also called the swivel plane data block. These data blocks are numbered 1, 2, 3, etc., but they also have a name given to them by the machine tool builder. He could name them for the Presidents of the United States if he wishes but typically he will name them Head_1, Head_2, etc.
The Machining Cycles manual says the names are limited to 20 characters but the PROC line in Cycle800 defines _TC as a 32 character string variable.
Only one data block is needed if your machine has permanently attached rotary axes for swivel plane machining. Programming blank quotes for _TC or programming “0” with the quotes is sufficient for Cycle800 to pick this data block although if the data block has a name, the name can be used.
_ST “0”/new and “1”/additive are whether the coordinate system translations and rotations specified in the Cycle800 call block begin at the origin of the G54 system (or the one your use) or whether they start at the origin of a coordinate system that has already been translated and rotated from the G54 system.
A “new” Cycle800 call does the equivalent of Trans+aRot+aTrans in this order written to a system frame created by Siemens to support swivel plane machining. This system frame is distinct from the Programmable frame.
An “additive” call does the equivalent of aTrans+aRot+aTrans, also not stored in the Programmable frame variable.
The Programmable frame is not unaffected by a Cycle800 call. The Programmable frame is zeroed by a “new” call. It is not zeroed by an “additive” call.
_MODE There are many schemes to specify the coordinate rotations to place the XYZ geometry system in the swivel plane. Most commonly, axis by axis rotation is the scheme. The first rotation is around any one of X, Y or Z. The second rotation is around one of the other two axes in the new system created by the first rotation. Two rotations are sufficient to fully define a swivel plane
As an example: The first rotation could be around the X axis of the G54 system. The second rotation could be around the Y-axis of the system created by the first rotation around X. The
_MODE code for this is the decimal number 57 (for the machine of this explanation)
If you are parameterizing the Cycle with cycle support screens, cycle support determines the decimal code from the information you entered in the screen. If you want to understand more about the decimal code, read on.
In the XYZ system there are 6 permutations of X, Y and Z. A decimal number is used to encode a binary number code that specifies the order of axes.
“00” is the code for axis by axis. “01” is the code for X. “10” is the code for Y and “11” is the code for Z. “27” is “00 01 10 00” in decimal.
XYZ 00 01 10 11 B = 27 D. 1st around Z, 2nd around the new Y.
XZY 00 01 11 10 B = 30 D. 1st around Y, 2nd around the new Z.
YXZ 00 10 01 11 B = 39 D. 1st around Z, 2nd around the new X.
YZX 00 10 11 01 B = 45 D. 1st around X, 2nd around the new Z.
ZXY 00 11 01 11 B = 54 D. 1st around Y, 2nd around the new X
ZYX. 00 11 10 11 B = 57 D. 1st around X, 2nd around the new Y
When _MODE is 39, this means that the G54 system is rotated around Z first, and if a second rotation is required, this rotation is around X of the system created by the first rotation.
In the Cycle800 support screen, you are asked to specify the 1st and 2nd axes and the rotation in degrees. The support screen converts your input into the appropriate decimal number.
_X0, _Y0, _Z0 Since a “new” Cycle800 call cancels the Programmable frame, _X0, _Y0 and _Z0 are a translation from the active member of the G54 group.
If the call is additive, these parameters would most often be set to zero (because why would you not have folded them into the previous “new” call?).
A “new” Cycle800 call with non-zero values assigned to some or all of _X0, _Y0 and _Z0 is called the first translation.
_A, _B, _C These parameters are for an additive coordinate system rotation. _A around the X-axis, _B around the Y-axis and _C around the Z-axis.
Here is a pop test: Why would you not always include a rotation in a “new” Cycle800 call? After all, it takes a rotation to define a swivel plane.
Here is the answer: Cycle800 activates the compensation functions to account for the geometry of the attachment head and this compensation is required even when the swivel axes are in their neutral positions.
_X1, _Y1, _Z1 An additive translation after the rotation.
_DIR You parameterize Cycle800 to translate and rotate the coordinate system. The Cycle has to figure out the swivel position to normalize the tool and surface. There are usually two solutions. You tell the cycle what solution to use by setting a 1 or -1 to _Dir.
It is not likely that you will know ahead of time the _Dir = 1 solution. Still, program a “1” and if this doesn’t seem right in actual practice, change it to a -1.
_FR_I In the early software editions of Cycle800 Siemens did not provide a means to specify an incremental retraction on the tool axis to a safe place to command a new orientation. This was added to Cycle800 from SW 6.5 on up. (At the time of this writing, SW 7.x is the latest.) So, if the MTB commissions Cycle800 to retract along the tool axis, the user can specify with _FR_I the incremental retraction distance.
_LOG_ON Lets not worry about this parameter. It is not even mentioned in the Cycles manual.
Example:

The example faces the top of the rectangular block of the figure. It then faces the swivel plane and finally, it does the circular pocket.
In the example, Head_Call() is a head change macro subroutine. Tool_Call(
%_N_CYCLE800_EXAMPLE_MPF
;$PATH=/_N_WKS_DIR/_N_TEST_PROGRAMS_WPD
N05 Cycle800( ) ;to start with a clean slate
N10 Head_Call(3) ;command head change to head 3
N15 Tool_Call(1492) ;T1492 is the face mill
N20 G94 G54 G90 G70 G64 S1500 M3 M8
N25 Cycle800(1, “Head_3”, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)
N30 Cycle71(
N35 M5 M9
N40 Cycle800(1, “Head_3”, 0, 57, 25, 0, 0, -15, 0, 0, 0, 0, 0, 1) ; new translation followed by rotation
N45 S1500 M3 M8
N50 Cycle71(
N55 Tool_Call(1156) ;T1156 is end mill
N60 Cycle800(1, “Head_3”, 1, 57, 0, 0, 0, 0, 0, 0, 40, 30, 0, 1) ;additive translation in the plane
N65 S5000 M3 M8
N70 Pocket4(
N80 Cycle800( )
N85 M5 M9 M30
In the real world the top surface might be faced with the vertical head. While the vertical head is the standard against which the other heads are compared, some machine tool builders assign a tcarr data block to it to account for its own imperfections as a standard. The equivalent in tool setting would be, suppose there is a constant discrepancy between set tools and their actual cutting length.
Explanation of Individual Blocks:
N05 A safety block to make sure the Cycle800 frame variables are nulled.
N10 Only your MTB can tell you how to program a head change. However, a macro subroutine is typical of 5-sided machines. In the old days before the 840D, Siemens CNC used “L” for subroutines. If your machine uses L
N15 Tool changes are machine specific. Only your MTB can tell you how to program a tool change.
N20 Most of these G-codes are default except G54. G500 is probably the default for the G54 group.
N25 This Cycle800 call will position the swivel axes to their neutral position and activate head compensation. This block may not be necessary since very likely compensation was activated in the head change macro subroutine. The “27” means the order of rotation is first around Z and second around Y. However, since all the rotational angles are zero, no coordinate system rotation happens. Also, work zero stays at G54 since the first translation and second translation parameters are zero.
N30 Calls the facing cycle to face the top surface of the block.
N35 Turns off spindle and coolant
N40 A new Cycle800 call to translate and rotate the coordinate system and swivel the rotary axes.
N45 Turns on spindle and coolant
N50 Face down to the swivel plane.
N55 Tool_Call for an end mill. We assume that Tool_Call turns off the spindle and coolant, retracts the head to the tool change position and swivels to position the spindle for the tool change.
N60 This is a not-new Cycle800 call. This means the 40 and 30 are additive translations in the swivel plane to the center of the pocket.
N65 Spindle speed, etc., for pocketing
N70 Calls the pocketing cycle for roughing out the pocket
N75 Finishes the pocket
N80 Cycle800( ) is the D0 for head compensation. It may not be wise to cancel compensation at this time.
N85 Spindle off. Coolant off
N90 End of Program and Reset of program execution

The not-so-good graphic above shows a shows a translation (top left) followed by a rotation (middle right) followed by an additive translation (bottom left). If we were to program this directly the blocks would be as follows:
N1776 Trans Y-19.2929 ;(20 - 1*cos(45))
N1778 aRot X45
N1780 aTrans Z-0.5
Following this we would have to program an orientation of the tool axis and activate a transformation (Tcarr or Traori). This is all done by Cycle800.

The not-so-good photo above shows me and my coolant brothers making chips on a HBM with a nutating head. If it weren't for Cycle800 we would not be happy campers.
If you are a machine tool builder you know that there is so much more to Cycle800 than its user dimension. Contact me if you want my notes on it all. In the meantime, I will show you the vector diagram of the geometric description of a particular nutating head required for the Tcarr data structure $TC_CARRn[1] to $TC_CARRn[65]. The diagram is for a horizontal boring machine and the orientation shown is the neutral position.

V1 and V2 are the directions of the 1st and 2nd orientation axes. S is the direction of the spindle.
I3 is on the line of the spindle axis to the point where the direction line of the 2nd rotary axis intersects it.
I2 is the vector from the tip of I3 to the point where the directions of V1 and V2 intersect.
I1 closes the vector diagram because in the exampe of the diagram, the tool reference point and the head reference point coincide have been picked to coincide. If you had a second or more attachment heads, it is not likely that you would be able to pick this was and the vector diagram becomes more involved.
Wednesday, August 26, 2009
Continuous Path Modes G64 and G642
The photo is a shadow graph of two parts side by side. The corner on the right was cut with G64. The one on the left with G642.
This comparison was made after one of Siemens experienced specialists in servo optimization had done his best to get rid of the instability in the servos (they were hydraulic servos). We increased the overload factor from 1.20 to 1.80 (to give the CNC 80% of the linear acceleration to use for lateral acceleration) and this made a difference (photo not shown). However, the dramatic difference was when we asked the CNC to insert a b-spline at the corner. This is what G642 does. It inserts a b-spline block at the corner and the CNC interpolates the spline path. We tightened up the tolerance that the spline can depart from the corner (photo not shown) and we got a very tight, smooth corner.
G64 slows down the axes as they enter a corner so that it can be taken at the prescribed lateral acceleration set as a percentage of the linear acceleration of the axes. Strangely, increasing this to 80% made improvements which is counter-intuitive, but still, the instability of the axes dominated the corner transition. The instability was still there with G642 but it was not provoked into acting up when the CNC had a nice, smooth curve to interpolate at the corner.
G64/G642 can be compared to a car's changing direction by 90 degrees at the corner of an intersection versus driving a banked 90 degree curve. Clearly, the banked curve does not challenge the suspension system as agressively as the sharp turn and thus, any tendency to instability is reduced.
Exact Stop Mode G60 / Exact Stop Check G601 & G602
G60 G602 is exact stop with coarse in-position check
G60 G603 is exact stop without in-position check
G60 tells the CNC to decelerate the axes to a stop at block boundaries. G601, G602 and G603 define conditions that must be met before the CNC moves on and begins to execute the next motion block.
You would program G60 when you want sharp corners. You would program G60 (or G09) in drilling because you want the tool to get to final depth before the drill pulls out.
Following error - the difference between the actual position of the axes and the commanded position - is a property of CNC's proportional position control. When the CNC gets to the block end point in its processing of the geometric data, the axes are shy of this position by following error.
-------------------------------------------------------------
G60 is the modal exact stop mode and G09 is the non-modal exact stop mode.
G60 is the default member of group 10 that includes G60, G64 and G642 to G644.
G09 is in group 11.
You can change the G60 default to G64 by putting a "2" in MD 20150 $MC_Gcode_Reset_Value[9]. (The index is one less than the group number.) Put in a "3" and you have changed the default to G642.
It is important to know that exact stop is one thing and exact stop check is another, subordinate thing. We will see that not all exact stops require an exact stop check.
G60 is like driving a car and having to stop at ever intersection and at every point where the road blends from a straight away into a curve and vice versa.
In the exact stop mode the axes are decelerated by the CNC as they approach the block end point so at least in the mind of the CNC they are stopped (at stand still) when they get to this point. If asked, the numerical control does an in-position check and if the axes are within a prescribed tolerance of the end point the CNC moves on and begins execution of the next block.
Following error is the primary reason the axes could be out of the in-position tolerance when the CNC has consumed the interpolation function of the current block. However, before discussing following error, lets clarify how we ask the CNC to do an in-position check and the in-position tolerance.
There are two in-position tolerances called coarse and fine. These tolerances are set in the following machine data:
MD36000 $MA_Stop_Limit_Coarse
MD36010 $MA_Stop_Limit_Fine
The coarse default is 0.0016" (0.04 mm).
The fine default is 0.0004"
There is also MD36012 $MA_Stop_Limit_Factor (default is "1") that one expects is a scale factor on the coarse and fine in-position tolerances although the Siemens manual does not say this explicitly.
(The problem with the manuals not saying what they mean explicity in the technical language of science and technology - mathematics - is that the same text explanation could apply to any number of situations when words are not chosen carefully and when the writer does not know the cultural and technical sensibilities of his readers.)
If in fact, Stop_Limit_Factor is a scale, if this MD is set to "2", the in-position tolerances is double. This could be useful when machining workpieces that are at the upper end in mass for the specifications of the machine provided inspection can accept the consequences of a larger in-position tolerance.
G60 G601 commands the CNC to do an exact stop fine in-position check.
G60 G602 commands the CNC to do an exact stop coarse in-position check.
There is also G60 G603. G603 is a cancelation of exact stop check. G603 does not do an in-position check following deceleration of the axes to commanded stand still. Rather, after the CNC has consumed the interpolation function of the current block, it begins consuming the interpolation function of the next block.
G603 could result in a rolling stop which would be similar to G602 with very large in-position tolerances because residual following error keeps the axes moving.
Following error is a servo concept. The CNC samples the interpolation function on a time grid to issue incremental setpoints to the position servos. The servo algorithm used by CNC is proportional position control.
If you read a massively heavy volume on control theory you will find near-nothing on proportional control because is it so basic that authors feel it is spontaneously understood. With proportional control, in order to get go, there must be a difference between where the controller has commanded the position servo to be and where the position servo actually is at. This difference is called following error. Internally, within the position control loop, the velocity command to the servo drives is . . .
velocity_command = position_control_gain * following_error
(Clearly the position control gain has to have dimensions of per time since velocity is length over time. Per time is called inverse time and it is usually inverse seconds. A gain of "1" is 16.67 inverse seconds. A gain of "1" produces 0.0010 inch of following error at 1 inch/minute feedrate. There is 0.100" following error at 100 in/min. High gains result in less following error but high gains require more rigid axes which is one reason high speed machines are more expensive.)
When the rate at which the position control loop receives position feedback is equal to the rate at which the CNC issues new position commands, the following error remains constant. Once the CNC has consumed the interpolation function of the current block it no longer issues incremental position setpoints, not until it can move on and begine to consume the interpolation function of the next block. However, there is still following error in the system and this following error results in a velocity command. It is like pulling a wagon with a bunji cord. The stretch in the cord is the following error of this system. When you stop walking, there is still stretch. However, wait a bit, and the stretch will cause the wagon to come along until there is no stretch (maybe a little because of friction but lets assume there is none).
When the position control gain is low and the feedrate is high the following error is considerable. This is why, if you cannot tolerate large corner contours due to following error, first you want the CNC to command the axes to a stop at the block end point and even then, you want to make sure that the residual following error has been worked out so that it is not just in the mind of the CNC that the axes are at their end point but they actually are at their end point. The latter is what the end position check is all about.
Some CNC workers have problems with an exact stop check that is not exactly exact. Get over it. We do not machine to exactness. We machine to tolerance.
Tuesday, August 25, 2009
Continuous Path Control & Look Ahead
Continuous path control is a broadly defined concept that includes Look Ahead and a number of functions that are subordinate to it. However, Continuous Path Control and Look Ahead are the same thing from the point of view of the programmer and operator.
Look Ahead seeks to achieve a smooth, continuous velocity along the interpolated path, trying as much as possible to hold the velocity constant at the programmed feedrate without exceeding the dynamic limits of the axes. When the dynamic limits would exceed the programmed feedrate the axes have to slow down much like a car slows down to take a turn at an unprotected intersection.
To continue with the car analogy, Look Ahead can be compared to driving a winding road in hill country with radar vision. Since you can see ahead you do not have to stop to see if the road is washed out over the next hill.
Look Ahead is turned off with G60. G60 is called the exact stop mode. It is like stopping for stop signs at every intersection.
Continuous path control needs Look Ahead to do its thing. Its thing is to smooth corners while keeping the path velocity as close to the programmed feedrate as possible. In the main, it accomplishes this by inserting rounding blocks at corners and by limiting velocity and acceleration so the axes do not flutter at block transitions.
The rounding blocks that span the corner to "connect" two contour elements smoothly are akin to the wedges used by picture framers to hold the corners together. These wedges are called splines. Thus, spline is my prefered term for the inserted rounding block that connects two contour elements. Coincidently, the contour of the rounding block is a polynomial produced by the 840D's b-spline algorithm. Thus it is more correct to talk about inserting a spline block at corners as opposed to a rounding block since the inserted path is not the arc of a circle. However, Siemens documentaion calls them rounding blocks and so will I.
Back to G64 & G641 - G645 and Overload Factor versus Compressor Tolerance . . .
The Overload Factor is a machine data setting. It is used by the 840D to limit the step change in velocity at a corner. I will discuss the vector diagram later that illustrated how there can be a step change in velocity at a point while the velocity remains constant. For the time being . . .
If the step change at the programmed feedrate exceeds the maximum allowable step change of the Overload Factor equation (discussed later), the 840D decelerates into the corner so that when the tool enters the corner the servos can accomplish the step change and thus, the change in direction, in one period of the interpolation cycle.
The formal Siemens documentation does not say that the corner is actually commanded to be taken in one cycle. To compound the matter, the one cycle change in direction cannot be conclusively inferred from the definition of the Overload Factor because at other places in the documentation Siemens implies that a rounding block is inserted in the corner. My attempts to get clarification on this have not addressed the contradictory nature of the documentation. Thus, when I write that with G64, corner smoothing is a consequence of residual following error I am not 100% confident that this tells the whole story.
Uncertainty with regards to G64's precise behavior is not a burning issue for most programmers. However, for people who seek to be problem solvers, an in-depth understanding of any detail of CNC is often a lever to understand other details that don't have a legacy of practice to give us confidence that it works even if we do not fully understand why.
There is no uncertainty in the documentation with regards to the 3-digit G64x and especially G642, the one must used. Corner smoothing is achieved by inserting a rounding block between two blocks whose intersection is a corner. The block must pass within the Compressor Tolerance of the corner point. Like the Overload Factor, the Compressor Tolerance is a machine data setting that I discuss in my post on Cycle832. I also discuss the Compressor Tolerance in my Directory of Terms. If you have the wherewithal to read my posts you should definitely email me BleierCNCTrainin@gmail.com for an e-copy.
You would typically use G64 for 2 ½ machining and G642 for high speed kellering and 5-axis aerospace contouring. Your machine tool builder may advise you differently since there are slight differences between individuals of the 3-digit group.
Siemens recommends you use G642 with CompCurv and CompCad. This recommendation needs elaboration since CompCurv/CompCad are themselves smoothing functions. So, here we go . . .
CompCurv/CompCad are b-spline algorithms that act on short G01 blocks to produce one polynomial block out of a sequence of G01 blocks (typically 5 to 10 G01 blocks in the sequence). This one block blends tangentially with the the polynomial block produces by the next sequence of G01 blocks and on and on. As a consequence of this tangential blending there are no corners. However, there can be corners when the algorithm temporarily suspends doing its thing at an intersection point where the next block is very long or the next block is not a G01 block. In this case the intersection between the most recently produced polynomial block and the the next block could be a corner and G64/G642 (whichever you use) would do its thing at this corner and any subsequent corners until CompCurv/CompCad resume producing polynomial blocks.
By default, a long G01 block is longer than 20 mm (0.7874 inches).
The best recommendation regarding G64 or G642 (or another member of the 3-digit G-codes) should come from your machine tool builder because he is the one who knows how the servos were optimized.
If your machine tool builder is no longer in the picture, or heavens forbid, he doesn't know, you may be left with trial and error to discover what works best. In this case, you may find my additional discussion below useful.
---------------------
Newtonian mechanics is part of a deeper discussion of continuous path control since CNC moves masses. It moves masses with servos. Servo is about negative feedback to control the position, velocity and acceleration of masses. With regards to servos it is probably sufficient to say that servo optimization consumes some choices. For example, if your axes have been optimized with Feed Forward turned on, whether you machine with FFWON or FFWOF is a choice that has already been made; you must always machine in FFWON.
About G64 . . .
The people who developed the 840D decided that the Overload Factor would be used to limit velocity steps at corners when G64 is active.
To understand velocity steps we need to recall that velocity is a vector with magnitude and direction. With G64, only the direction changes at corners. However, even a directional change results in a change in velocity as illustrated in the vector diagram below where the length of arrows Vin and Vout is the same. The velocity change is the ΔV arrow.
If the feedrate into and out of an intersectional point at the corner of two linear blocks is 100 in/min, the magnitude of the change in velocity at a 90 degree corner is 141.4 in/min (the square root of the sum of the squares). This is a step change in velocity since it occurs at the point. Keep in mind that the 141.14 is not the velocity at the point but rather, the change in the velocity vector at the point.
ΔV is also called the velocity jump and velocity step.
ΔV is limited according to the following equation:
ΔV <= axis_acceleration * (overload_factor-1) * IPO where
axis_acceleration is the linear acceleration of the least dynamic axis of the axes involved in the path interpolation. The axial linear acceleration is in MD32300 $MN_MAX_AX_ACCEL.
overload_factor is a value set in machine data 32310 $MN_Max_Accel_Ovl_Factor
IPO is the period of the interpolation cycle
The interpolation cycle is called the IPO (pronounced with long ee-PO) and just as often IPO means the period of the cycle. Ball park periods are 2 milliseconds for high speed machines and 4 milliseconds for machines with serious ambitions for high speed. Lets suppose it is 4 milliseconds. Every 4 milliseconds the CNC samples the interpolation function to output an incremental set point to the position control servos.
We get acceleration when we divide both sides of the equation by IPO, and since IPO is a scalar, this acceleration is in the direction of the ΔV vector.
ΔV/IPO <= axis_acceleration * (overload_factor-1)
This acceleration - the consequence of a step increase in thrust impressed on the load through the drive linkages and originating from a rapid increase in torque from the motor - acts for one IPO.
The default setting for the Overload Factor is 1.2. In this case, the acceleration ΔV/IPO is 20% of the linear acceleration of the least dynamic axis.
To be sure, an infinite acceleration would be required for the direction to change at a point. However, the change can occur on a dime because a dime has a radius. The radius of the dime is the travel that can occur in the time of one IPO at the feedrate of the tool when it enters the dime.
[To my international readers, a dime is smaller in size than the U.S. penny. Its value is 1/10 of a dollar. In the U.S. we say that a car cannot stop on a dime.]
To return to the 100 in/min example, if the interpolation period is 4 milliseconds, the ΔV/IPO acceleration is 589.25 in/sec2. This is 1.53G since 1G is 386.0892 inches/sec2. If the corner is actually taken at a feedrate of 100 in/minute, the X and Y servos must be able to accelerate the X and Y axes at 1.08G and the CNC must be told that it can do its calculation on the assumption that the axes can accelerate/decelerate at 1.08G without going unstable.
If the axes cannot accelerate/decelerate simultaneously this quickly, the CNC must decelerate into the corner so that its velocity at the start of the interpolation cycle wherein the change in direction will occur is small enough so that ΔV of the equation is not exceeded.
The Siemens manual says that G64 takes corners at a constant velocity. This means the magnitude of the velocity out of the dime is equal to the magnitude into the dime. Having come out of the dime the axes accelerate back to the programmed feedrate.
To return to the acceleration of the vector diagram – ΔV/IPO – this acceleration is a consequence of the thrust generated by the servos. If linear motors are used, the thrust is generated directly by the interaction of magnetic fields. If rotary motors are used, mechanical linkages convert motor torque into thrust. Typical linkages are ball screw & ball nut and rack & pinion.
[The servo drives must be able to generate changes in linear motor thrust or rotary torque in much shorter time periods than the IPO. The torsion wave must be able to travel smoothly through the drive linkages.]
The acceleration – ΔV/IPO – is lateral acceleration. Lateral acceleration is sideways to the motion.
When you drive a car quickly along a tight radius, your inertia keeps you moving in a straight line. The door collides with you and pushes on you. This push is the force that produces the lateral acceleration that keeps you with the car. Of course, in a real world situation, some of the lateral force is from the contoured seat back, the seat belt and the static friction between your bottom and the seat. Still, if you go fast enough and the car stays on the curve these contributions may not be enough to prevent the door from smashing into you.
Physicists use the term centripetal acceleration for lateral acceleration. Your science teacher may have called it centrifugal acceleration. Your teacher was wrong. The force that keeps a mass on a curve is inward acting and centripetal is the term that names the acceleration that is a consequence of this.
Back to CNC axes . . . , the lateral acceleration is a fraction of the linear acceleration and this fraction is determined by the Overload Factor that has already been mentioned. An Overload Factor of 1.2 means that the limit on lateral acceleration is 20% of the linear acceleration of the least dynamic axis of the axes involved in the path interpolation. Thus, if the least dynamic axis is limited to 0.5G of linear acceleration, the lateral acceleration is limited to 0.1G.
However, ΔV is limited, not ΔV/IPO. The CNC uses the 0.1G to calculate an upper bound for feedrate and if this upper bound exceeds the programmed feedrate the CNC decelerates the axes into the corner so that when the last IPO of the interpolation function is due, the feedrate into the dime is <= the upper bound.
The Overload Factor is a machine data setting that is established when the servos are optimized. The factor is a compromise between cycle time and surface finish. If the factor is too high for the rigidity of the mechanical elements the axes will flutter at corners (same as saying "oscillate at corners") and this will be recorded in the surface finish. The Overload Factor can be higher for roughing if the flutter is not so severe that it degrades the mechanical rigidity of the linkages.
Ideally, the machine tool builder employs Cycle832 to set the Overload Factor for the mode of machining (roughing, semi-finishing, finishing).
The servos may be able to drive the tool into a change of direction that is greater than our example 0.1G. However, the mechanical linkages may not be able to withstand the inertial forces that this produces. In other words, the axes are not rigid enough. They will tend to flutter and degrade the surface finish. Engineers who do servo optimization have software tools that reside in the CNC to observe the behavior of the axes and determine an optimum value for the Overload Factor.
To repeat what has already been said, if the velocity step to take the the next corner exceeds the maximum velocity step derived from the Overload Factor, the CNC must decelerate the tool along the interpolated path as the tool approaches the corner so that when the interpolation cycle comes due to make the change in direction, the magnitude of the feedrate is reduced so that the velocity step stays within bounds.
If the Overload Factor is set to "1" the allowable step change in velocity is "0". In this case, the CNC must bring the path axes to a stop at corners and G64 appears the same as G60.
With regards to G64 at tangential intersections, the intersection between two blocks is not a corner when the geometric elements blend together tangentially such as a line meeting the arc of a circle tangentially. There is no step change in velocity at a tangential intersection so the Overload Factor is not at play here. However, there is a step in lateral acceleration since lateral acceleration is always required to achieve curved motion. Unless there is another scheme to limit this acceleration the servos get on with doing what they do without constraints. The shock of this step can cause flutter that gets recorded in the surface finish.
For the record, G643 employs the Overload Factor to limit lateral steps in acceleration at tangential intersections.
By the way, a linear acceleration of 0.5G is very dynamic. The upper limit on mechanical drive systems for small machine tools is roughly 2G but normally, accelerations of this magnitude require linear motors.
By the way again: A "G" is the acceleration of gravity at the Earth surface. It is 9.8067 meters/second per second. It is 32.1741 feet/second per second.
About G642 . . .
G642 does smoothing by inserting a rounding block (b-spline) at the corner. The path must pass within the so-called Compressor Tolerance of the corner. The easiest way to set the Compressor Tolerance is with Cycle832 discussed in another post.
Thursday, July 30, 2009
Cycle997 to Measure Tooling Balls
The example of this post is from an aerospace shop where the workpiece came to our machine with 4 tooling balls with documentation regarding their ideal locations from a previous operation on a different machine. We indicated one of the balls with a mechanical probe and scratched a zero offset into G54.
The first Cycle997 in the program below measures this ball for more precise G54 determination.
The second Cycle997 measures 3 of the 4 balls to align G54 to the workpiece as it sits out of square and cocked in the work envelop of the machine.
In our first run of the program the probe missed a ball by a hair. We picked a different set of 3 and did fine. Alternatively, we could have fudged the diameter of the balls by making _setval slightly less than 0.5”.
%_N_Job1942_MPF
N05 T9999 M06 ;touch probe
N10 Jog_spin ;sub to jog spindle to turn on probe
N15 TRAORI
N20 G00 G70 G54 Z30 D1 ;establish an initial level
N25 _mvar=119 ;measure a single ball for G54 determination
N30 _setval=.5 ;diameter of tooling ball
N35 _setv[0]=-70.7904 _setv[1]=36.9768 _setv[2]=18.8512 ;ideal XYZ center of tooling ball
N40 _knum=1 ;correct G54
N45 _fa=10 ; cycle997 will position the probe 10 mm off of the touch point. The distance-to-go of the measurement infeed is 2*_fa. _fa always has mm units. Don’t ask why!
N50 _tsa=.3 ;_tsa is a tolerance. See explanation in text after the program
N55 _vms=10 ;the feedrate for the G01 measure move
N60 _nmsp=1 ;one hit at each location
N65 _prnum=1 ;the number assigned to the probe for calibration
N70 Cycle997 ;measure 1 ball for G54 determination
N75 _mvar=10119 ;code for 3-ball measurement for G54 correction
N80 _setv[0]=23.7217 _setv[1]=36.4123 _setv[2]=18.878;XYZ 1st ball
N85 _setv[3]=69.6605 _setv[4]=-35.4953 _setv[5]=27.6538 ;2nd ball
N90 _setv[6]=-70.7904 _setv[7]=36.9768 _setv[8]=18.8512 ;3rd ball
N95 _tnvl=.1 ;tolerance for sum of sides difference[1]
N100 _chbit[2]=0 ;collision monitor off. rapid between balls
N105 Cycle997 ;measure 3 balls for G54 alignment to workpiece
N110 Jog_spin ;turns off probe
N115 M30
The distance-to-go of the measurement infeed is 2*_fa. The cycle will alarm if the probe does not touch before over traveling the target by the _tsa distance.
[1] Each ball is at the vertex of a triangle. The sum of the sides of the ideal triangle and the actual triangle must not differ by more than the _tnvl amount or the cycle alarms.