5-Axis Machining Demystified - Part Four PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

5-Axis Machining Demystified - Part Four

MTB Tech Blog


5-Axis Machining Demystified - Part Four
Tim Markoski: Posted on Monday, September 08, 2014 2:12 PM

In our last segment we dealt more specifically with the machine


kinematics and calculating the X,Y,Z coordinates for 5-Axis Profiling Head
CNC Machining Center. We also learned how to calculate the Inverse
Time Feedrates for continuous 5-Axis motion.  We are now ready to learn
about calculating the X,Y,Z coordinates for an entirely different Recent Posts
kinematic configuration - A Table/Table or Dual-Rotary Table CNC ObjectDialogue™ - A
Machining Center. File Open/Save
Dialogue
With a  Dual-Rotary Table Machine, the rotary axes move to position the Replacement for
workpiece so as to align a defined tool vector to the spindle axis. This Developers
type of machine has a fixed spindle that is always parallel to the Z-Axis SIEMENS 840D -
and perpendicular to (normal to) the XY Plane. Creating Custom
Cycles
The most common type of Dual-Rotary Table Machine is one that uses a SIEMENS 840D -
Dual-Rotary Trunnion configuration. Depending upon the size of the Creating Custom M-
trunnion, it may be possible to align the Primary Mechanical  Rotary Axis Codes
with either the X-Axis or Y-Axis of the Machine Tool. For our examples FANUC G43.5 RTCP
we will be using a Dual-Rotary Trunnion that has the Primary Mechanical Type II - Vector
Rotary Axis aligned with the X-Axis of the Machine Tool. Programming for 5-
Axis
CAM Software
Vendors and Post-
Processors
Categories
CNC Techniques
CNC Technology
Editorial
FANUC Settings
Management
The Primary Mechanical Axis of Rotation for a Dual-Rotary Table SIEMENS Settings
Configuration is SECONDARY Mathematically. This means that the Utility Software
SECONDARY MECHANICAL Angle is actually calculated FIRST. The Search
Secondary Mechanical Axis of Rotation for a Dual-Rotary Table powered by
Configuration is PRIMARY Mathematically. This means that the PRIMARY
MECHANICAL Angle is calculated AFTER the SECONDARY MECHANICAL
Angle. This inverse mathematical relationship differs from a Profiling
Head calculation because a Dual-Rotary Table Configuration rotates the
WORKPIECE and not the Tool Spindle Axis.

Dual-Rotary Configurations

A Dual-Rotary Trunnion has an advantage not available to Profiling Head


configurations. A Dual-Rotary Trunnion can be setup to use two different
Home Reference Positions. In our case, the Primary Mechanical Rotary
Axis is aligned with the X-Axis of the Machine. That is, the center-line of
its rotation is parallel to the X-Axis. The Primary Mechanical Rotary Axis
will use the letter address 'A' for the rotary angle of this axis. The letter
address for the Secondary Mechanical Rotary Axis will depend on the
Home Reference Position we use. For our examples we will illustrate the
calculations for both.

In an A/B Dual-Rotary Trunnion, the Secondary Mechanical Rotary Axis is


aligned with the Y-Axis. That is, the center-line of its rotation is parallel
to the Y-Axis. This configuration will use the letter address 'B' for the
rotary angle of this axis.

http://www.mtbtech.net/blog/2014/09/08/5-Axis-Machining-Demystified-Part-Four.aspx[3/22/2017 6:23:41 AM]


5-Axis Machining Demystified - Part Four

In an A/C Dual-Rotary Trunnion, the Secondary Mechanical Rotary Axis is


aligned with the Z-Axis. That is, the center-line of its rotation is parallel
to the Z-Axis. This configuration will use the letter address 'C' for the
rotary angle of this axis.

The A/C configuration is the more natural configuration for a Dual-Rotary


Trunnion as the limits for the A-Axis are generally symmetrical. The A/B
configuration is most often used to accommodate part sizes within a
limited machine envelope. We will start with the A/B Configuration.

ISO Standard Rotation Directions


A-axis rotates in the plus direction CCW about the X-axis.
B-axis rotates in the plus direction CCW about the Y-axis.
C-axis rotates in the plus direction CCW about the Z-axis.

A/B Dual-Rotary Trunnion Configuration Calculations

For the sake of simplicity, we will be performing the calculations


necessary to perform a canned drilling cycle at the proper X,Y,Z location
and rotary axis positions.

Calculate Rotary Angles from Vector Components


(A-Mechanical Primary/B-Mechanical Secondary)
The A-Axis rotates about (parallel to) the X-axis.
The B-Axis rotates about (parallel to) the Y-axis.

Vector Component I  =  0.48038447


Vector Component J  =  -0.83205029
Vector Component K  =  0.27735010

IF Vector K > 0.0 Then


'Vector K is above horizon of XY Plane

Angle B = ATN(Vector I/Vector K)*(-1)


Angle B = ATN(0.48038447/0.27735010)*(-1)
Angle B = ATN(1.73205082)*(-1)
Angle B = 60.000*(-1)
Angle B = -60.000 (Rounded to 3 places)

Angle A = ATN((Vector J/Vector K) * COS(Angle B))


Angle A = ATN((-0.83205029/0.27735010) * COS(-60.000))
Angle A = ATN(-2.99999996 * 0.5)
Angle A = ATN((-2.99999996) * COS(-60.000))

http://www.mtbtech.net/blog/2014/09/08/5-Axis-Machining-Demystified-Part-Four.aspx[3/22/2017 6:23:41 AM]


5-Axis Machining Demystified - Part Four

Angle A = ATN(-1.49999998)
Angle A = -56.310 (Rounded to 3 places)

ELSE IF Vector K = 0.0 Then


' Vector K is at horizon of XY Plane

'Prevent Division by Zero Error by


'Assigning the smallest non-zero double-precision value
Vector K = 0.0000000000000001
Angle B = ATN(Vector I/Vector K)*(-1)
Angle A = ATN((Vector J/Vector K) * COS(Angle B))

ELSE
'Vector K is below horizon of XY Plane

' +180.0 adjustment indicates Vector K below horizon of XY


Plane
Angle B = ATN(Vector I/Vector K)+180.0)*(-1)
Angle A = ATN((Vector J/Vector K) * COS(Angle B))

END IF

Calculate Intermediate Location Point

We now have the Rotary Axis Angles needed for performing our Drilling
Cycle. Our next set of calculations will be calculating the X,Y,Z location
of the hole to be drilled. We start with the initial X,Y,Z location in our
Cutter Location Data generated by our CAM System. This data is PRIOR to
any rotation. Keep in mind that all our X,Y,Z locations are referencing
the Center of Rotation - The intersection point of the rotary axis center-
lines.

Hole Location in CL Data


X=1.93730251
Y=-6.23427374
Z=1.67372321

Since our A/B Rotary Axis Configuration requires that we first calculate
our B-Axis Angle, we need to first calculate the X,Y,Z location of the
intermediate point that results from the B-Axis rotation. Because we are
rotating only the B-Axis at this point, only the X,Z Coordinates will
change. Therefore, we can limit our calculations to the XZ Plane (G18).

Our first calculation required is to establish the distance from the center
of rotation to our initial CL point. This distance is the hypotenuse of the
triangle in the XZ Plane.  We calculate this distance via the Pythagorean
Theorem. That is we can solve our triangle by the following formula.

Hypotenuse = SQRT(X²+Z²)
Hypotenuse = 2.5601739

Our next calculation is the included angle of our triangle.

Included Angle = ATN(Z/X)


Included Angle = ATN(1.67372321/1.93730251)
Included Angle = ATN(0.86394520)
Included Angle = 40.825 (Rounded to 3-Places)

We can now calculate the X,Y,Z location of the intermediate point that
results from the B-Axis rotation.

NOTE: Calculations from Front View of XZ Plane

Intermediate X = Hypotenuse * COS(Included Angle+ABS(Angle B))


Intermediate X = 2.5601739 * COS(40.825 + 60.0)
Intermediate X = 2.5601739 * COS(100.825)
Intermediate X = 2.5601739 * -0.18781363
Intermediate X = -0.48083556

Intermediate Y = Y CL Point
Intermediate Y = -6.23427374

Intermediate Z = Hypotenuse * SIN(Included Angle +ABS(Angle B))


Intermediate Z = 2.5601739 * SIN(40.825 + 60.0)
Intermediate Z = 2.5601739 * SIN(100.825)
Intermediate Z = 2.5601739 * 0.98220539
Intermediate Z = 2.51461662

Intermediate Point
X-0.48083556, Y-6.23427374, Z2.51461662

http://www.mtbtech.net/blog/2014/09/08/5-Axis-Machining-Demystified-Part-Four.aspx[3/22/2017 6:23:41 AM]


5-Axis Machining Demystified - Part Four

Calculate Final Location Point

We are now ready to calculate the final X,Y,Z locationof the hole to be
drilled. Since we have already accounted for the B-Axis rotation, we will
now apply the A-Axis rotation. Because we are rotating only the A-Axis
this time, only the Y,Z Coordinates will change. Therefore, we can limit
our calculations to the YZ Plane (G19).

Our first calculation required is to establish the distance from the center
of rotation to our intermediate point. This distance is the hypotenuse of
the triangle in the YZ Plane.  We calculate this distance via the
Pythagorean Theorem. That is we can solve our triangle by the following
formula.

Hypotenuse = SQRT(Y²+Z²)
Hypotenuse = 6.72231104

Our next calculation is the included angle of our triangle.

Included Angle = ATN(Z/Y)


Included Angle = ATN(2.51461662/-6.23427374)
Included Angle = ATN(-0.40335357)
Included Angle = -21.967 (Rounded to 3-Places)

We can now calculate the Final X,Y,Z location of the hole to be drilled.

NOTE: Calculations from Right View of YZ Plane

Final X = Intermediate X Point


Final X = -0.48083556

Final Y = Hypotenuse * COS(Included Angle + Angle A)


Final Y = 6.72231104* (COS(-21.967 - 56.310)*-1)
Final Y = 6.72231104* (COS(-78.277)*-1)
Final Y = 6.72231104* -0.20318036
Final Y = -1.36584157

Final Z = Hypotenuse * SIN(Included Angle + Angle A)


Final Z = 6.72231104* (SIN(-21.967 - 56.310)*-1)
Final Z = 6.72231104* (SIN(-78.277)*-1)
Final Z = 6.72231104* 0.97914132
Final Z = 6.58209250

Final Hole Location Point


X-0.48083556, Y-1.36584157, Z6.58209250

NC Code for Drill Cycle

(X,Y,A,B RAPID POSITIONING)


G00 G90 X-0.4808 Y-1.3658 A-56.310 B-60.0
(RAPID TO 2.0 ABOVE HOLE LOCATION)
Z8.5821
(DRILL 2.0 DEEP HOLE / R-PLANE = 0.1 ABOVE TOP OF HOLE)
G81 G98 X-0.4808 Y-1.3658 Z4.5821 R6.6821 F10.0

http://www.mtbtech.net/blog/2014/09/08/5-Axis-Machining-Demystified-Part-Four.aspx[3/22/2017 6:23:41 AM]


5-Axis Machining Demystified - Part Four

We are now ready to perform the calculations for the second


configuration. The A/C configuration is the more natural configuration for
a Dual-Rotary Trunnion as the limits for the A-Axis are generally
symmetrical. The A/B configuration is most often used to accommodate
part sizes within a limited machine envelope.

A/C Dual-Rotary Trunnion Configuration Calculations

Calculate Rotary Angles from Vector Components


(A-Mechanical Primary/C-Mechanical Secondary)
The A-Axis rotates about (parallel to) the X-axis.
The C-Axis rotates about (parallel to) the Z-axis.

Vector Component I  =  0.48038447


Vector Component J  =  0.27735010
Vector Component K  =  0.83205029

IF Vector K > 0.0 Then


'Vector K is above horizon of XY Plane

'Prevent Division by Zero Error by


'Assigning the smallest non-zero double-precision value
IF Vector J = 0.0 Then
Vector J = 0.0000000000000001
END IF

Angle C = ATN(Vector I/Vector J)


Angle C = ATN(0.48038447/0.27735010)
Angle C = ATN(1.73205082)
Angle C = 60.000
Angle C = 60.000 (Rounded to 3 places)

Angle A = ATN((Vector J/Vector K) / COS(Angle C))


Angle A = ATN((
0.27735010/
0.83205029) / COS(60.000))
Angle A = ATN((0.33333333) / COS(60.000))
Angle A = ATN(0.33333333 / 0.5)
Angle A = ATN(0.66666666)
Angle A = 33.690 (Rounded to 3 places)

ELSE IF Vector K = 0.0 Then


' Vector K is at horizon of XY Plane

'Prevent Division by Zero Error by


'Assigning the smallest non-zero double-precision value
Vector K = 0.0000000000000001

IF Vector J = 0.0 Then


Vector J = 0.0000000000000001
END IF

Angle C = ATN(Vector I/Vector J)


Angle A = ATN((Vector J/Vector K) / COS(Angle C))

ELSE
'Vector K is below horizon of XY Plane

IF Vector J = 0.0 Then


Vector J = 0.0000000000000001
END IF
' +180.0 adjustment indicates Vector K below horizon of XY
Plane
Angle C = ATN(Vector I/Vector J)
Angle A = ATN((Vector J/Vector K) / COS(Angle C+180))

END IF

Calculate Intermediate Location Point

http://www.mtbtech.net/blog/2014/09/08/5-Axis-Machining-Demystified-Part-Four.aspx[3/22/2017 6:23:41 AM]


5-Axis Machining Demystified - Part Four

We now have the Rotary Axis Angles needed for performing our Drilling
Cycle. Our next set of calculations will be calculating the X,Y,Z location
of the hole to be drilled. We start with the initial X,Y,Z location in our
Cutter Location Data generated by our CAM System. This data is PRIOR to
any rotation. Keep in mind that all our X,Y,Z locations are referencing
the Center of Rotation - The intersection point of the rotary axis center-
lines.

Hole Location in CL Data


X=1.93730251
Y=1.67372321
Z=6.23427374

Since our A/C Rotary Axis Configuration requires that we first calculate
our C-Axis Angle, we need to first calculate the X,Y,Z location of the
intermediate point that results from the C-Axis rotation. Because we are
rotating only the C-Axis at this point, only the X,Y Coordinates will
change. Therefore, we can limit our calculations to the XY Plane (G17).

Our first calculation required is to establish the distance from the center
of rotation to our initial CL point. This distance is the hypotenuse of the
triangle in the XY Plane.  We calculate this distance via the Pythagorean
Theorem. That is we can solve our triangle by the following formula.

Hypotenuse = SQRT(X²+Y²)
Hypotenuse = 2.5601739

Our next calculation is the included angle of our triangle.

Included Angle = ATN(Y/X)


Included Angle = ATN(1.67372321/1.93730251)
Included Angle = ATN(0.86394520)
Included Angle = 40.825 (Rounded to 3-Places)

We can now calculate the X,Y,Z location of the intermediate point that
results from the C-Axis rotation.

NOTE: Calculations from Top View of XY Plane

Intermediate X = Hypotenuse * COS(Included Angle + Angle C)


Intermediate X = 2.5601739 * COS(40.825 + 60.0)
Intermediate X = 2.5601739 * COS(100.825)
Intermediate X = 2.5601739 * -0.18781363
Intermediate X = -0.48083556

Intermediate Y = Hypotenuse * SIN(Included Angle + Angle C)


Intermediate Y = 2.5601739 * SIN(40.825 + 60.0)
Intermediate Y = 2.5601739 * SIN(100.825)
Intermediate Y = 2.5601739 * 0.98220539
Intermediate Y = 2.51461662

Intermediate Z = Z CL Point
Intermediate Z = 6.23427374

Intermediate Point
X-0.48083556, Y2.51461662, Z6.23427374

Calculate Final Location Point

We are now ready to calculate the final X,Y,Z location of the hole to be
drilled. Since we have already accounted for the C-Axis rotation, we will
now apply the A-Axis rotation. Because we are rotating only the A-Axis
this time, only the Y,Z Coordinates will change. Therefore, we can limit
our calculations to the YZ Plane (G19).

Our first calculation required is to establish the distance from the center
of rotation to our intermediate point. This distance is the hypotenuse of
the triangle in the YZ Plane.  We calculate this distance via the
Pythagorean Theorem. That is we can solve our triangle by the following
formula.

Hypotenuse = SQRT(Y²+Z²)
Hypotenuse = 6.72231104

Our next calculation is the included angle of our triangle.

http://www.mtbtech.net/blog/2014/09/08/5-Axis-Machining-Demystified-Part-Four.aspx[3/22/2017 6:23:41 AM]


5-Axis Machining Demystified - Part Four

Included Angle = ATN(Z/Y)


Included Angle = ATN(6.23427374/2.51461662)
Included Angle = ATN(2.47921440)
Included Angle = 68.033 (Rounded to 3-Places)

We can now calculate the Final X,Y,Z location of the hole to be drilled.

NOTE: Calculations from Right View of YZ Plane

Final X = Intermediate X Point


Final X = -0.48083556

Final Y = Hypotenuse * COS(Included Angle + Angle A)


Final Y = 6.72231104* COS(68.033 + 33.690)
Final Y = 6.72231104* COS(101.723)
Final Y = 6.72231104* -0.20318036
Final Y = -1.36584157

Final Z = Hypotenuse * SIN(Included Angle + Angle A)


Final Z = 6.72231104* SIN(68.033 + 33.690)
Final Z = 6.72231104* SIN(101.723)
Final Z = 6.72231104* 0.97914132
Final Z = 6.58209250

Final Hole Location Point


X-0.48083556, Y-1.36584157, Z6.58209250

NC Code for Drill Cycle

(X,Y,A,C RAPID POSITIONING)


G00 G90 X-0.4808 Y-1.3658 A33.69 C60.0
(RAPID TO 2.0 ABOVE HOLE LOCATION)
Z8.5821
(DRILL 2.0 DEEP HOLE / R-PLANE = 0.1 ABOVE TOP OF HOLE)
G81 G98 X-0.4808 Y-1.3658 Z4.5821 R6.6821 F10.0

We now have the final X,Y,Z location for our hole to be drilled.
We have used the same part, mounted to our rotary table the same way
but in two different rotary axis configurations with two different home
reference positions. The one common element is the center of rotation.
The net effect of this is that the hole location is calculated to be at the
exact same X,Y,Z position, regardless of the method used.

If the part to be machine was NOT mounted to our rotary table the same
way for both configurations, then the final X,Y,Z position would NOT be
the same.

The last important point to make note of is that each rotary


configuration will require its own separate CAM Post-Processor. This will
ensure that all rotary angles and coordinates in NC code will be correct
for the given machine and dual-rotary kinematics.

In future segments we will deal with rotary configurations that combine


both a nutating head and a rotary table.

3 Comments to 5-Axis Machining Demystified - Part Comments


Four: RSS

http://www.mtbtech.net/blog/2014/09/08/5-Axis-Machining-Demystified-Part-Four.aspx[3/22/2017 6:23:41 AM]


5-Axis Machining Demystified - Part Four

michael on Monday, December 22, 2014 5:48 PM


are there still links to parts 1-3 or are they expired posts?
Reply to comment

Tim  Markoski on Monday, December 22, 2014 9:59 PM


Michael, All four parts are available by simply following the CNC
Techniques Category.
http://www.mtbtech.net/blog/CNC+Techniques.aspx

Kuba on Friday, February 06, 2015 7:00 AM


Hello it's great explanation of this task.Do Have you maybe some books
about this? I know is geometry from school but is many details from CNC
world which is little bit complicated. - I'm form Poland, sorry for english
writing mistakes.
Reply to comment

Add a Comment

Your Name: Email Address: (Required)

Website:

Comment:

Make your text bigger , bold, italic and more with HTML tags. We'll
show you how.

http://www.mtbtech.net/blog/2014/09/08/5-Axis-Machining-Demystified-Part-Four.aspx[3/22/2017 6:23:41 AM]

You might also like