Full Text
Full Text
SOFTWARE
INTEGRATION OF MACHINING INSPECTION
By
A Thesis
Submitted to the School of Graduate Studies
in Partial Fulfilment of the Requirements
for the Degree
Master of Applied Science
McMaster University
McMaster University
(Mechanical Engineering)
Hamilton, Ontario
Software.
SUPERVISOR: A. D. Spence
ii
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Abstract
Ideally, the nominal design of a part or assembly, created with 3D
Machine tool support for high data rate sensors such as laser scanners is also
lacking.
machine tool mounted inspection sensors with GD&T analysis software, and
clamped in the CNC machine, datum spheres are measured, and after
iii
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
produced. To facilitate multiple tests, a tool path is split into four and
machined in four poses with measurement and tool path adjustment for each
iv
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Acknowledgements
generosity, and support over our years working together. I have had the
opportunity to meet and work with many interesting and intelligent people,
and I thank Dr. Spence for giving me that opportunity. When faced with
setbacks, Dr. Spence made sure we found a solution, and that both textbook
None of this work would be possible without the following people. Terry
Wagg, for CNC training, Joe Verhaeghe for electronics assistance, and Jim
McLaren, Mark MacKenzie and Ron Lodewyks for help in the machine shop.
Thank you to Yu Pin Lin and Hazem Mazhar for their assistance with
grateful.
To Lisa, your patience and encouragement, are more than I could ever
ask for.
v
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Table of Contents
vi
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
vii
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
References 109
viii
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 2.2 - Touch Probes [23] : (a) TPS1(S) Touch Trigger Probe; (b)
Probe ............................................................................................................... 12
Figure 2.3 – Touch Trigger Probe Kinematics - Low Force Direction [24] . 14
Figure 2.4 – Touch Trigger Probe Kinematics - High Force Direction [24] 14
Figure 2.6 - Triangulation using Two Cameras [26], (b) Structured Light
[27] .................................................................................................................. 17
Figure 2.7 - Specular and Diffuse Reflection in laser scanning systems .... 18
trajectories. ..................................................................................................... 37
ix
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 4.2 - Fixture Base with Tooling Spheres and Workpiece ................. 44
Figure 5.2 - Case 0, Roland Scan Data – Colour Map adjusted to show
detail. .............................................................................................................. 51
Data................................................................................................................. 52
Figure 5.4 – Cases 1-4, Roland Scan Data – Colour Map adjusted to
Figure 6.3 - 3D Scanner Mount with bolt hole pattern for locking pin ...... 65
x
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 6.8 - LMI Scan Data: Case 0 Surface Deviation Analysis ................ 73
Figure 6.9 - Case 0, LMI Scan Data – Colour Map adjusted to show
detail. .............................................................................................................. 74
Figure 6.10 - LMI Scan Data: Cases 1-4 Surface Deviation Analysis ......... 75
Figure 6.11 – Cases 1-4, LMI Scan Data – Colour Map adjusted to show
detail. .............................................................................................................. 76
Components .................................................................................................... 48
xi
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
xii
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Chapter 1
Introduction
cutting tool paths. The part is then clamped into place, the tool paths
as:
• In Process Variability
1
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
• Geometric/Setup Variability
and weld bead shape differs in each case. Measurement and nominal
perform part measurement. CNC and CMM design, calibration and error
software, and the measurement devices used on these machines [4]. Resistive
2
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
technology based touch trigger probes, while popular in use, have been
applications.
surface deviation report, is used for approval of parts, and also as feedback for
performed after machining, and thus after any machining errors have
approach with the ability to inspect a part prior to machining and make
After use of this software, typically employed with a dedicated CMM or laser
Common machine tool sensors include tool setters and touch trigger
probes. Tool setters are used to determine the tool length, and touch trigger
probes are used to locate the workpiece within the machine workspace.
3
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Virtually all turning centres and machining centres come equipped with some
form of touch trigger probe option [7]. Although the CNC control computer is
numerical control (NC) code, it cannot run least squares or other data fitting
techniques with the same efficiency as a modern computer used for processing
The lack of integrated and automated methods for using these tools
data [4], discouraging adoption of the tools. Because of this, scrap production
may result from a failure to adjust nominal tool paths to actual part
4
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
were used to update nominal tool paths to match the measured workpiece
Chapter 7.
5
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Chapter 2
Literature Review
production quantity, tolerance level, part complexity, and part variety. When
dealing with high production quantities and low part variety, dedicated
automatic gauges can be faster and more cost effective than CMM machines.
CMM can be justified [8]. This thesis focuses on inspecting and machining
their existence in the manufacturing timeline [9]. The four categories are
four categories.
6
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
fall in this category [4]. The ISO 10360 standard [10] describes “Acceptance
and reverification tests for coordinate measuring machines”, likewise the ISO
tool, and the ISO 230-10 standard [12] evaluates the measuring performance
machine tools can approach the accuracy of a measuring machine [13], [14],
impending hazards on the factory floor such as chips, coolant and the tool
calibrate the machine and monitor on-line variables, correcting the process
7
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
vibrations, however this technique has yet to reach the factory floor [18].
momentary break from machining where measurements are taken and used
device. Higher end CMM systems employ analog scanning probes capable of
tracing surface contours, but point measurement based touch trigger probes
are much more common among machining centres. The use of a touch probe
on a machining centre has many sources for error that complicate measuring.
The steady state temperature conditions that are imposed on CMM machines
the spindle position from machining to probing can be very large [19].
equipment that machined it. If a systematic error exists with the machine at
the time of machining, the same error will exist during inspection [20]. If
these sources of error are understood and diligently considered, and machine
tool measurement evaluation standards are followed, is has been shown that
8
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
parameters.
the:
while 2 σ and 3 σ are achieved 95.45% and 99.73% of the time. By the same
9
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
low degree of repeatability will have inherently lower accuracy even after
10
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
The touch trigger probe (Figure 2.2(a)) was invented to measure fuel
methods caused the fuel lines to deflect during measurement [22]. The touch
trigger probe relies on three equally spaced contact points, serving as series
wired normally closed switches (Figure 2.2(b)). The probe is positioned in the
X, Y, and Z directions using CMM or CNC machine tool motorized axes, and
upon making contact with the part being measured, one of three switch
contacts will open. The open switch signals the control computer to stop
motion, and save the current axes positions in memory. The positions can
measured, the probe must be moved away from the point of contact to allow
the probe switch to close, and to avoid damage to the probe due to excess
approximately one point per second. Newer analog touch probes (Figure
2.2(c)), available for CMMs, measure the amount of stylus deflection and can
11
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 2.2 - Touch Probes [23] : (a) TPS1(S) Touch Trigger Probe; (b)
Probe
Touch trigger probes are also available for CNC machine tools. The
probe can be loaded into the spindle using an automatic tool changer, and
(infrared or radio frequency) is used to transmit the probe switch open signal.
As with CMM touch trigger probes, the data collection rate is slow. The
machine tool control has limited mathematical calculation ability, and lack of
direct integration prohibits use of analog probes with standard CNC controls.
12
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
travel and probe lobing concepts. Pre-travel refers to the amount the stylus
deflects as it generates the torque required to unseat the probe. The stylus
P3 F
d= (2.1)
3EI
Since the stylus length P dominates the deflection, one should use the
shortest stylus possible while maintaining the ability to visit all the required
variation shown in Figure 2.3 and Figure 2.4. To unseat the probe, the stylus
torque 𝑻𝒔 created by the force 𝑭𝒔 at the stylus tip must overcome the torque
𝑻𝒌 created by the spring force 𝑭𝒌 and distance 𝑹. The torque will be lowest
when the pivot point is the line drawn between two of the stylus supports, as
the perpendicular distance to the stylus axis is minimal. This effect will
contribute an error as if the tip were not spherical, as shown by the dotted
line in Figure 2.5. Since the effects of pre-travel are repeatable, calibration
13
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
[24]
[24]
14
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
control used in this thesis used the RS274D G-code standard. The essential
G-code commands and syntax are given in sections 2.1.2.3 and 2.1.2.4 .
15
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
mm/min. The G01 code is used to position the probe before measurement,
control so that a special skip signal is generated when the probe switch opens
upon contacting the workpiece. To interface with the skip signal, the
to G01, in that linear motion begins at the current position and proceeds to
halts and the CNC control records the machine coordinate system (MCS)
position to local variables. The Fanuc 15i-MA control used in this work
assigns the X,Y and Z MCS positions to local variables #5061, #5062 and
#5063 [25]. Once MCS positions are stored, the next line in the NC code will
be executed. Since the skip signal remains high while the probe is in contact,
must be backed away from the surface using a command other than G31.
16
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
(a) (b)
Figure 2.6 - Triangulation using Two Cameras [26], (b) Structured
Light [27]
very difficult computer vision problem [28]. One strategy to assist in pixel
projector or laser diode, a line can be projected from viewpoint 𝑹! . The point
Figure 2.9 shows a laser scanner employing these techniques, and the
laser line as seen by the camera. Synchronization and calibration with the
17
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
systems
systems, where no light is reflected from the surface toward the camera [29].
18
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 2.8 illustrates two limitations of laser scanners. On the left, the
shadow caused by another part feature (corner 1) obstructs the path of the
laser. To overcome this, multiple view angles are required, which can be
additional reflections are visible to the camera. Since some light is absorbed
Additionally, if the light sensor stores the intensity value of the collected
19
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
point, intensity values that are significantly lower compared to points taken
20
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
on the machine, and then map them to the corresponding CAD points.
Denoting the machine coordinate system with subscript MCS, and the CAD
Pi ,MCS ( xi ,MCS , yi ,MCS , zi ,MCS ) , and P1,CAD ( x1,CAD , y1,CAD , z1,CAD ) = ( 0,0,0) ,
P2,CAD ( x2,CAD , y2,CAD , z2,CAD ) = (1,0,0) , P3,CAD ( x3,CAD , y3,CAD , z3,CAD ) = ( 0,1,0)
.
21
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
P3,MCS
P2,MCS
P1,MCS
P3,CAD
x
P1,CAD P2,CAD
Note that the misalignments have been greatly exaggerated for clarity.
With these assumptions, the HTM to convert from CAD to MCS can be
written as
𝑿 𝒀 𝒁 𝑷
𝑯𝑻𝑴𝑴𝑪𝑺←𝑪𝑨𝑫 = 𝟏,𝑪𝑨𝑫 (2.5)
𝟎 𝟎 𝟎 𝟏
22
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
After collecting the data points, such as from the surface of a sphere, a
(OLS) methods were used. The fit parameters for an OLS circle fit are shown
in Figure 2.11.
+
𝑺𝟏(𝑺𝟏,𝒙 ,𝑺𝟏,𝒚)
𝒅!
𝒓
𝑺(𝒙,𝒚) 𝒅! +
𝑺𝟐(𝑺𝟐,𝒙,𝑺𝟐,𝒚 )
𝒅!
+
𝑺𝟑(𝑺𝟑,𝒙,𝑺𝟑,𝒚 )
For a sphere with sample points S j , centre point S , and radius r , the
23
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
2 2 2
dj = (s j,x ) ( ) (
− sx + s j, y − s y + s j,z − sz ) −r (2.6)
M
and the OLS sum to minimize is Σ2 = ∑ d 2j where M is the number of sphere
j=1
sample points. Assuming that the sphere is very nearly perfectly round
(small form errors), a clever initial approximation is obtained using the linear
approximation [31].
θj = ⎡( s − s )2 + ( s − s )2 + ( s − s )2 ⎤ − r 2
⎣⎢ j , x x j, y y j,z z
⎦⎥
⎧ 2 2 2 1/2 ⎫ ⎧ 2 2 2 1/2 ⎫
= ⎨ ⎡⎢( s j , x − sx ) + ( s j , y − s y ) + ( s j , z − sz ) ⎤⎥ − r ⎬ ⋅ ⎨ ⎡⎢( s j , x − sx ) + ( s j , y − s y ) + ( s j , z − sz ) ⎤⎥ + r ⎬
⎩ ⎣ ⎦ ⎭ ⎩ ⎣ ⎦ ⎭
≈ d j ⋅ 2r
M M 2
{
Θ2 = ∑θ j2 = ∑ g j − h − 2 ⋅ ⎡⎣ s j , x sx + s j , x sx + s j , x sx ⎤⎦
j =1 j =1
}
where g j = s 2j , x + s 2j , y + s 2j , z and h = r 2 − ( sx2 + sy2 + sz2 ) . Simultaneously solving the
24
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
⎡ M M M M
⎤ ⎡ M ⎤
⎢ ∑1 ∑s j,x ∑s j, y ∑s j,z ⎥ ⎢ ∑ g j ⎥
⎢ j =1 j =1 j =1 j =1
⎥ ⎢ j =1 ⎥
⎢ M M
2
M M ⎥ ⎡ h ⎤ ⎢ M ⎥
⎢ ∑ s j , x ∑s j,x ∑s s
j,x j, y ∑ s j , x s j , z ⎥ ⎢ ⎥ ⎢ ∑ s j , x g j ⎥
⎢ j =1 j =1 j =1 j =1 ⎥ ⋅ ⎢ 2sx ⎥ = ⎢ j =1 ⎥
⎢ M M M
2
M ⎥ ⎢ 2s y ⎥ ⎢ M ⎥
⎢ ∑ s j , y ∑ s j,x s j, y ∑s j, y ∑ s s
j, y j,z ⎥ ⎢ ⎥ ∑ j , y j ⎥
⎢ s g
⎢ j =1 j =1 j =1 j =1 ⎥ ⎣ 2sz ⎦ ⎢ j =1 ⎥
⎢ M M M M ⎥ ⎢ M ⎥
2
⎢ ∑ s j , z ∑s s
j,x j,z ∑s s
j, y j,z ∑ s j,z
⎥ ⎢ s g
∑ j , z j ⎥⎥
⎣⎢ j =1 j =1 j =1 j =1 ⎦⎥ ⎣⎢ j =1 ⎦
⎡ ∂Σ 2 ⎤ ⎡ ∂ 2 Σ 2 ∂ 2Σ2 ∂ 2 Σ 2 ⎤
⎢ ⎥ ⎢ 2 ⎥
⎢ ∂sx ⎥ ⎢ ∂sx ∂sx s y ∂sx sz ⎥
⎢ ∂Σ 2 ⎥ ⎢ ∂ 2 Σ 2 ⎡δ sx ⎤
∂ 2Σ2 ∂ 2 Σ 2 ⎥⎥ ⎢ ⎥
⎢ ⎥ = ⎢ ⋅ δ sy
⎢ ∂s y ⎥ ⎢ ∂sx s y ∂s y2 ∂s y sz ⎥ ⎢ ⎥
⎢ 2 ⎥ ⎢ 2 2 ⎥ ⎢⎣δ sz ⎥⎦
⎢ ∂Σ ⎥ ⎢ ∂ Σ ∂ 2Σ2 ∂ 2 Σ 2 ⎥
⎢⎣ ∂sz ⎥⎦ ⎢ ∂sx sz ∂s y sz ∂sz2 ⎥⎦
⎣
M
1 2 2 2
r= ∑ (s j ,x
− sx ) + (s j,y
− sy ) + (s j ,z
− sz ) . Iterations continue until the
M j=1
25
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Using the linearized initial approximation, with small form errors, reduces
locations, or there are more than four points, Orthogonal Least Squares
(OLS) methods that distribute the error over the set are used [32]. For
ˆ
The OLS goal is to find R ˆ
and T that minimize the sum
MCS←PCS MCS←PCS
N 2
Σ 2 = ∑ Pi ,MCS − ( R MCS←PCS Pi ,CAD + TMCS←PCS ) (2.8)
i =1
N N
1 1
approach as follows. First calculate PCAD = ∑ Pi,CAD and PMCS = ∑P i ,MCS
.
N i =1 N i =1
Next define Qi ,CAD = Pi ,CAD − PCAD and Qi ,MCS = Pi ,MCS − PMCS . Calculate
N
A = ∑ Qi ,CADQiT,MCS , the SVD A = UΛVT , and X = VUT . Usually the
i=1
ˆ = X , and Tˆ = P − R
determinant det ( X ) = +1, and in this case R ˆ .
MCS MCS←CAD PCAD
26
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
If the det ( X ) = −1, and an eigenvalue of Λ is zero, the reflection solution has
27
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
facet surface creation, and CAD file import. To align the MCS point cloud to
registration methods are derived from the Iterative Closest Point (ICP) work
of McKay and Besl [33]. For manufacturing operations, the use of Geometric
fitting of lines, planes, etc. and the ability to lock any combination of the six
(three translational and three rotational) rigid body degrees of freedom. The
above cited software has ability to accomplish this, but, being intended for
is lacking. For automation of the work reported herein, use of the Origin
functions that implement the feature fitting and registration functions for
GD&T analysis.
software project for 2D and 3D point cloud processing. The PCL framework
28
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
segmentation [37]. Creation of PCL was driven by the availability of low cost,
high data rate sensors such as Microsoft Kinect, which have significant
potential for robotics navigation and object recognition. While it does not
currently have functions relating to GD&T analysis of point clouds, given the
2.3 Summary
Touch trigger probes have evolved to now include higher data rate
analog probes, and implementation on CNC machine tools. Very high data
rate laser digitizers are now available for CMMs, but are not integrated with
software deals only with standard cases, and does not interface with CNC
29
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Chapter 3
Hardware Description
including CNC turning centres, 3 axis milling centres, 5 axis milling centres
computer.
The FX-5 was equipped with a Renishaw MP12 touch trigger probe
with a repeatability of 1.0 µμm (2𝜎) when used with the 50mm stylus.
cycle programs provided by the probe manufacturer. While these cycles are
allows use of data fitting techniques such as the OLS methods described in
section 2.2 The NC DPRNT command is used to print the probe hit
30
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
connection. The UMI will then pass the data over Ethernet to a computer for
undesirable for security reasons, the UMI can be programmed to process the
31
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
32
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
the processing computer via the UMI. Once all data points have been
received, the an updated tool path is computed and sent back to the machine
towards bringing the capabilities of GD&T software to the CNC machine tool.
factory floor. It features 0-30VDC volt digital inputs and 30VDC digital
and Ethernet connectivity for data reporting and transfer of part programs.
other comparable hardware were all factors in the decision to use the Ax9150
UMI.
33
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
3.4.1 Installation
The Ax9150 UMI was installed inside the Matsuura FX-5 Machine
Tool cabinet and connected to Serial port 1 of the Fanuc Series 15i-MA
control. To support the UMI Ethernet connection, a local area network router
was also installed in the cabinet. The machine control system parameters
#20 and #21 were changed from “1” to “14” on the CNC Controller to set the
Controller, the ‘Macro B’ feature set of the Fanuc control was utilized. The
34
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Macro B feature set enables a set of codes outside the RS274D G-code
as data storage, logical operations, looping and more [39]. The ‘DPRNT’
command was used to send plain text output to a RS-232C device, in this case
the Ax9150 UMI, which then relays the data over Ethernet to the processing
computer.
The following code is used to measure a point, and then print the probe
G31X-137.Y-137.Z72.F25.
POPEN
DPRNT[POINT: #5061 [44] #5062 [44] #5063 [44]]
PCLOS
using the probe in the CNC. From the resulting data, the directionally
35
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
was calculated and used for compensation in this work. The probing method
radially from the centre of the ring to the inside surface of the ring as shown
in Figure 3.3.
36
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
trajectories.
To reduce the error associated with the probing speed and the
unpredictable 0-4ms delay between the rising edge of the skip signal and the
reaction of the machine [40], a double hit method illustrated in Figure 3.4
was used. Upon making initial contact with the ring gauge surface (1), the
probe backs away from the contact point a small amount (2). The probe
37
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
delay effects (3). The probe then moves to another inspection site (4).
From the measured ring gauge radius data, the average pre-travel was
direction, however, all probe hits in later experiments were in line with the
major axes (0,90,180,270) where pre-travel error is very close to 0.062 mm.
Pretravel in the axial direction of the probe stylus (Z- direction) is governed
by the deflection due to compressive forces, the which is much less than the
38
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
260 120
250 130
240 140
230 150
220 160
210 170
200 180
190
A probing routine was created to obtain sphere centre data for the
fixture plate illustrated in Figure 4.2. The operator positions the probe above
the first sphere so that contact will be made with the top hemisphere as the
39
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
equally spaced locations on the circular cross section located one radius
distance down from the point of first contact, as shown in Figure 3.6.
Once the centre is found, the process is repeated using this centre as a
starting point. This method ensures all the final probe hits are made normal
Because the sphere locations on the plate are known, the probing
41
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Chapter 4
Registration Experiment
cylindrical arc surface has been roughly cut by a band saw or other non-CNC
means, and CNC machining is used to create the desired surface finish.
42
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
fixtures are created with a single workpiece in mind, and are not suited for
using automated sensor measurement methods, and tool path trajectories are
reducing set-up times, scrap avoidance can be achieved by using early part
material distribution with GD&T software gives the ability to adjust the tool
path to best fit the available material, so that all features can be machined to
43
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
provide simple geometry for touch trigger probe inspection. The ceramic
tooling spheres are also suitable for laser scanning technology due to the
probing routine will obtain point data to solve for the centre of each of the
tooling spheres. Once the point locations are known in the MCS, the HTM to
44
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
and the correction transformation can be applied to the nominal tool path.
45
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
toolpath shown in Figure 4.1 is split into 5 sections shown in Figure 4.3. Each
section will be machined after moving and re-probing the fixture, fitting probe
workpiece axes aligned with the machine axes. In this position the spheres
the plate is rotated by 1 degree about Z, and moved -48 mm in X. And finally
in Case 4, the plate is rotated -2 degrees about Z and moved -35 mm in X. All
The rotation in Case 4 is the maximum rotation that the plate’s oversized bolt
holes would permit. Machining of Case 0 on the Matsuura F-X5 3 axis CNC
46
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Case 0 – Sphere 3
Point X (mm) Y (mm) Z (mm)
1 -136.7110 136.4120 148.8330
2 -124.0060 136.4140 136.1330
3 -149.4150 136.4140 136.1330
4 -136.7120 149.1310 136.1330
5 -136.7120 123.6930 136.1330
47
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Components
Table 4.2 shows the 3 point registration sphere centre errors, for Cases
48
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Chapter 5
After machining, the part was removed from the fixture plate and
scanned using a Roland PICZA LPX-600 laser scanner with accuracy ±0.050
The scan data of Case 0 was fit with the nominal cylinder arc geometry
and a deviation report was generated, comparing scan data from Cases 1
through 4 with the nominal cylinder arc geometry. Deviation from nominal is
49
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Data
50
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 5.2 - Case 0, Roland Scan Data – Colour Map adjusted to show
detail.
51
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Data
52
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 5.4 – Cases 1-4, Roland Scan Data – Colour Map adjusted to
show detail.
53
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Standard
0.021 mm
Deviation
performance tests [43]. From the standard deviation of 0.021 mm, the system
has a 98.26% ability to achieve the DIN ISO 2768 f (fine) class tolerance of
±0.05 mm for the standard’s smallest nominal linear dimension category, 0.5-
3 mm.
54
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Standard
Fitted Uncertainty
Deviation of
Sphere Radius of Centre
Residuals
(mm) (mm)
(mm)
Case 0 Sphere 1 12.7130 0.0150 0.0075
Sphere 2 12.7130 0.0150 0.0075
Sphere 3 12.7118 0.0145 0.0073
Case 1 Sphere 1 12.7153 0.0065 0.0033
Sphere 2 12.7140 0.0130 0.0065
Sphere 3 12.7133 0.0145 0.0073
Case 2 Sphere 1 12.7125 0.0130 0.0065
Sphere 2 12.7145 0.0150 0.0075
Sphere 3 12.7128 0.0155 0.0078
Case 3 Sphere 1 12.7160 0.0100 0.0050
Sphere 2 12.7143 0.0155 0.0078
Sphere 3 12.7113 0.0155 0.0078
Case 4 Sphere 1 12.7133 0.0125 0.0063
Sphere 2 12.7160 0.0130 0.0065
Sphere 3 12.7130 0.0130 0.0065
Average 12.7136 0.0134 0.0067
trace the errors introduced by each step. First, the OLS sphere fit statistics
55
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
between the sphere centres. Table 5.3 gives the centre-to-centre distances
calculated between each sphere for each case. To compare the distances for
each case, the difference from Case 0 was also computed. The data does not
suggest that any significant amount of was present, but Table 5.4 gives a
better analysis using an OLS plane fit of probe data obtained from the plate
surface.
56
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
centroid Z height is 3.2 µμm. For each case, direction cosines describe the plane
to be effectively normal to the Z axis. The standard deviation of the data fit
residuals indicates the plate surface flatness was consistent between trials. A
57
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
58
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
critical areas of the part. If a fixture is not available, special care must be
detailed in this thesis, 2x4x6 blocks were used to support the entire bottom of
the fixture plate. Additionally, the mating surfaces of the machine and the
workpiece were cleaned to ensure the surfaces were free of chips or other
had a digital read out with resolution of 1.0 µμm. Occasional malfunction
issues were experienced when homing the Z axis. In one instance the machine
homed to a location 0.180mm away from the previous day’s home location,
59
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
The probe accuracy is 1.0 µμm when used with the 50 mm stylus.
vector directions used in the experiment, was done using a ring gauge and
pre-travel was found to be 67 µμm for the +/- X and Y probing directions.
The results of the OLS sphere centre calculation are used in an OLS
data set fit to compute the HTM used for Toolpath adjustment. The HTM is
negligible.
Table 5.5.
60
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Chapter 6
digitizers can be enough distort or destroy the object. Also, the speed of touch-
processing technology have enabled the design of digitizers that can measure
The Gocator 2300 scan head used in this chapter was purchased from
LMI Technologies Inc. The scanner uses the triangulation principle shown in
Figure 2.9 implemented using a laser stripe and 2D image sensor. The
61
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
62
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Since measurements are only made at the intersection of the laser line
and the part surface, the sensor must be attached to a movable platform in
order to obtain measurements of the entire part. The platform must be able to
report the exact location of the scan head so that the data obtained by the
following subchapters describe how the sensor was integrated with the IOTA-
the CMM were used to provide location resolution to 1.0µm. The linear
63
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
with a mounting system for previous equipment (Appendix B). The mount
allows the sensor attach to the z-axis and to rotate about the y-axis. A bolt-
hole pattern and locking pin allows the sensor to be angled at 15 degree
tool holder is required to attach the sensor to the spindle, and the spindle
orientation would be locked using the M19 code, as is customary when using a
64
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 6.3 - 3D Scanner Mount with bolt hole pattern for locking pin
65
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
control computer over Ethernet. This allows homing, and linear move
66
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
position information.
commanding of the laser scan head functions. The scanner settings were
67
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Send “receive_data”
command to 3D Scanner
Scan data
Wait
available?
Receive Data
68
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
error in diameter.
After homing the CMM and the initialization of the scan head, the scan
begins by reading the current location from the counter memory registers,
sending the trigger command to the scan head, and then the “receive_data”
command. Data is received into allocated memory where the scanner location
69
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
exposure time.
Interface
70
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
following factors:
The positional error of the CMM due to thermal distortion was not
considered in these experiments. The small scanning distance and short time
Time delay between the capture of the position and the scan data
creates a distance error equal to the scanning head velocity multiplied by the
scanning period of 0.005s limits the maximum distance error to 12.5 µμm in
the Y direction. This error can be accounted for and corrected if the time
0.044-0.075mm in X. Since the scan line X direction is along the part cylinder
axis, only the Z scanner error will be a factor in the surface deviation report.
71
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
was scanned using the assembled laser scanner and CMM system. The 30
second scan captured 200 frames per second, each generating 1280 points for
a total point count of 7.68 million points. The point spacing in the X direction
of the scan head was approximately 62.5 µm, and the point spacing in the Y
72
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
73
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 6.9 - Case 0, LMI Scan Data – Colour Map adjusted to show
detail.
74
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 6.10 - LMI Scan Data: Cases 1-4 Surface Deviation Analysis
75
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Figure 6.11 – Cases 1-4, LMI Scan Data – Colour Map adjusted to show
detail.
76
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Standard
0.019 mm
Deviation
0.014 mm) shows a much higher level of detail than the Roland scanner
which claims an accuracy of 0.05mm. The higher Z resolution allows the final
surface waviness characteristic of the ball nose end mill to be seen from the
capture a point cloud much faster than is possible with a touch trigger probe
77
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Chapter 7
CNC machining has evolved from manually entered and tape punched
with CMM inspection data. A method has been developed and demonstrated
trigger probe, analyzed using GD&T software, and machined using a tool
misaligned part. This process was tested using a fixturing plate with three
78
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
was investigated using a CMM with optical linear encoders and a laser
to link the captured 3D point data to the CMM location data, and a
calibration sphere, and the workpiece from Chapter 4 were scanned with
The registration method in this work uses spherical datums, but there
may be situations where this is not possible. Future work will include trials
using part features as datums, and implementing the system on a 5-axis CNC
machining centre.
79
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
restricted line of sight while air pressure keeps air-borne contaminants out.
80
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
Appendix
81
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
82
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
%
O1040
(A.SAWULA)
(RING GAUGE CALIBRATION)
G21 G40 G90 G54
M19
#31 = 100.0
POPEN
DPRNT[Index,X,Y]
PCLOS
G1 X0.0 Y0.0
(PROBE HIT1)
G31 X21.7889 Y249.0487
#1 = #5061
#2 = #5062
G1 X0.0 Y0.0
POPEN
DPRNT[1,#1 [44], #2 [44]
PCLOS
(PROBE HIT2)
G31 X43.4120 Y246.2019
#1 = #5061
#2 = #5062
G1 X0.0 Y0.0
POPEN
DPRNT[2,#1 [44], #2 [44]
PCLOS
(PROBE HIT3)
G31 X64.7048 Y241.4815
#1 = #5061
#2 = #5062
G1 X0.0 Y0.0
POPEN
DPRNT[3,#1 [44], #2 [44]
PCLOS
(PROBE HIT4)
G31 X85.5050 Y234.9232
#1 = #5061
#2 = #5062
G1 X0.0 Y0.0
POPEN
DPRNT[4,#1 [44], #2 [44]
PCLOS
(PROBE HIT5)
G31 X105.6546 Y226.5769
#1 = #5061
#2 = #5062
G1 X0.0 Y0.0
POPEN
DPRNT[5,#1 [44], #2 [44]
PCLOS
83
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
%
O1050
(PROBES 1)
(MEASURE 1INCH DIA SPHERE)
(START AT XY NEAR CENTRE, Z ABOVE CENTRE)
(PROGRAM SETS X AND Y PROBE TRAJECTORIES BASED ON FIRST HIT IN Z-)
(CENTRE CALCULATED FROM THE AVERAGE OF PAIRS OF X AND Y HITS)
#20 = 5. (PROBE TIP DIA.)
#21 = 0.062 (PROBE FLEX COMPENS.0.062)
#22 = [#20/2]-#21
#23 = 273. (SPHERE SPACING)
#25 = 15.0 (SPHERE CLEARANCE)
#30 = 25.400 (SPHERE DIA.)
#31 = 100 (FAST PROBE SPEED)
#32 = 20 (SLOW PROBE SPEED)
#33 = 4000 (SAFE RAPID MOVE SPEED)
G21 G40 G90 G54
M19
G31 Z0.0 F#31 (PROBE Z)
#1 = #5061
#2 = #5062
#3 = [#5063-#20/2]
G1 Z[#3+#25] F#33 (UP)
G31 X[#1+[#30]+#20] F#33 (OVER+)
G31 Z[#3-[#30/2]] F#33 (DOWN)
G31 X[#1] F#31 (PROBE X1 FAST-)
G1 X[#5061+#22]F#33(RETRACT+)
G31 X[#1] F#32 (PROBE X1 SLOW-)
#4 = #5061-#22
#5 = #5062
#6 = #5063
G1 X[#4+#20] F#33 (RETRACT+)
G31 Z[#3+#25] F#33 (UP)
G31 X[#1-[#30]-#20] F#33 (OVER-)
G31 Z[#3-[#30/2]] F#33 (DOWN)
G31 X[#1] F#31 (PROBE X2 FAST+)
G1 X[#5061-#22](RETRACT+)
G31 X[#1] F#32 (PROBE X2 SLOW+)
#7 = #5061+#22
#8 = #5062
#9 = #5063
G1 X[#1-[#30]-#20] F#33 (RETRACT)
G31 Z[#3+#25] F#33 (UP)
G31 X[#1] Y[#2+[#30]+#20] F#33 (OVER+)
G31 Z[#3-[#30/2]] F#33 (DOWN)
G31 Y[#2] F#31 (PROBE Y1 FAST-)
G1 Y[#5062+#22](RETRACT+)
G31 Y[#2] F#32 (PROBE Y1 SLOW-)
#10 = #5061
#11 = #5062-#22
#12 = #5063
G1 Y[#2+[#30]+#20] F#33 (RETRACT+)
84
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
85
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
86
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
%
:0001
(BladeBaseMtl2012ZUp)
N10 G21 G90 G40
N20 G10 P1 Z85.0 R4.0 T00
N30 G10 L2 P1 X0.0 Y0.0 Z0.0 (Top)
N40 (DEFINE OPERATION : PARALLEL LACE OPERATION)
N50 G0 X0.0 Y0.0 Z100.0
N60 M5
N70 G28 G91 Z0 H0
N80 G28 X0 Y0
O90 G21 G90 G40 G94
N100 T00 M06 (8.0 MM DIA BALL NOSE MILL)
N110 G54P1
N120 T00 M1
N130 S5000 M3 M42
N140 G0 X0.0 Y0.0
N150 G43 Z50.0 H00 M7
N160 G0 X-25.399 Y35.004 Z50.0
N170 G0 X-25.399 Y35.004 Z23.486
N180 G1 X-25.399 Y35.004 Z18.486 F1000.0
N190 G1 X25.391 Y35.004 Z18.486
N200 G0 X25.391 Y35.004 Z50.0
N210 G0 X-25.399 Y34.48 Z50.0
N220 G0 X-25.399 Y34.48 Z23.698
N230 G1 X-25.399 Y34.48 Z18.698
N240 G1 X25.391 Y34.48 Z18.698
N250 G0 X25.391 Y34.48 Z50.0
N260 G0 X-25.399 Y33.955 Z50.0
N270 G0 X-25.399 Y33.955 Z23.909
N280 G1 X-25.399 Y33.955 Z18.909
N290 G1 X25.391 Y33.955 Z18.909
N300 G0 X25.391 Y33.955 Z50.0
N310 G0 X-25.399 Y33.431 Z50.0
N320 G0 X-25.399 Y33.431 Z24.12
N330 G1 X-25.399 Y33.431 Z19.12
N340 G1 X25.391 Y33.431 Z19.12
N350 G0 X25.391 Y33.431 Z50.0
N360 G0 X-25.399 Y32.901 Z50.0
N370 G0 X-25.399 Y32.901 Z24.316
N380 G1 X-25.399 Y32.901 Z19.316
N390 G1 X25.391 Y32.901 Z19.316
N400 G0 X25.391 Y32.901 Z50.0
N410 G0 X-25.399 Y32.37 Z50.0
N420 G0 X-25.399 Y32.37 Z24.511
N430 G1 X-25.399 Y32.37 Z19.511
N440 G1 X25.391 Y32.37 Z19.511
N450 G0 X25.391 Y32.37 Z50.0
N460 G0 X-25.399 Y31.84 Z50.0
N470 G0 X-25.399 Y31.84 Z24.707
87
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
%
O1064
(ALAN-S-HUB4)
G21 G90 G40
(DEFINE OPERATION : PARALLEL LACE OPERATION)
G0 X24.886 Y0.215 Z35.016
G21 G90 G40 G94 (8.0 MM DIA BALL NOSE MILL)
G54
S5000 M3
G0 X24.886 Y0.215 Z35.016
G0 X10.972 Y25.275 Z-14.973
G0 X10.966 Y25.281 Z-35.588
G1 X10.964 Y25.283 Z-40.588 F250.0
G1 X12.282 Y-25.493 Z-40.603
G0 X12.290 Y-25.500 Z-14.988
G0 X10.412 Y25.261 Z-14.973
G0 X10.406 Y25.267 Z-35.671
G1 X10.404 Y25.268 Z-40.671
G1 X11.722 Y-25.508 Z-40.685
G0 X11.730 Y-25.515 Z-14.987
G0 X9.853 Y25.246 Z-14.972
G0 X9.847 Y25.252 Z-35.753
G1 X9.846 Y25.254 Z-40.753
G1 X11.163 Y-25.522 Z-40.768
G0 X11.171 Y-25.529 Z-14.987
G0 X9.294 Y25.232 Z-14.972
G0 X9.288 Y25.238 Z-35.836
G1 X9.287 Y25.239 Z-40.836
G1 X10.605 Y-25.537 Z-40.851
G0 X10.612 Y-25.544 Z-14.987
G0 X8.738 Y25.217 Z-14.972
G0 X8.731 Y25.223 Z-35.933
G1 X8.730 Y25.225 Z-40.933
G1 X10.048 Y-25.551 Z-40.948
G0 X10.056 Y-25.558 Z-14.987
G0 X8.181 Y25.203 Z-14.972
G0 X8.175 Y25.209 Z-36.033
G1 X8.173 Y25.210 Z-41.033
G1 X9.491 Y-25.565 Z-41.048
G0 X9.499 Y-25.573 Z-14.987
G0 X7.625 Y25.189 Z-14.972
G0 X7.619 Y25.195 Z-36.132
G1 X7.617 Y25.196 Z-41.132
G1 X8.935 Y-25.580 Z-41.147
G0 X8.943 Y-25.587 Z-14.987
G0 X7.068 Y25.174 Z-14.972
G0 X7.062 Y25.180 Z-36.231
G1 X7.060 Y25.182 Z-41.231
G1 X8.378 Y-25.594 Z-41.246
G0 X8.386 Y-25.602 Z-14.987
G0 X6.512 Y25.160 Z-14.97
88
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
1 #pragma once
2
3
4 #include "stdafx.h"
5 #include "Form1.h"
6 #include <iostream>
7 #include <fstream>
8 using namespace std;
9
10 //cmm motion communication
11 #include <winsock2.h>
12 #include <ws2tcpip.h>
13 #include <stdio.h>
14
15 //encoder quadrature capture card
16 #include <conio.h>
17 #include "..\cbw.h"
18
19 //scanner
20 #include <Go2.h>
21 #include <stdlib.h>
22 #include <memory.h>
23 #include <windows.h>
24 #include <time.h>
25
26 #pragma comment(lib, "Ws2_32.lib")
27 #pragma comment(lib, "comdlg32.lib")
28 #pragma comment(lib, "Go2.lib")
29 #pragma comment(lib, "user32.lib")
30
31 #define RECEIVE_TIMEOUT 20000
32 #define INVALID_RANGE_16BIT (0x8000) // gocator transmits
range data as 16-bit signed integers. 0x8000 signifies invalid range
data.
33 #define DOUBLE_MAX (1.79769e+308) // 64-bit double - largest
positive value.
34 #define INVALID_RANGE_DOUBLE (-DOUBLE_MAX) // floating point
value to represent invalid range data.
35
36 SOCKET ConnectSocket = INVALID_SOCKET;
37 int iResult;
38 int testCount = 0;
39 /* Encoder Variable Declarations */
40 //int Row, Col;
41 int ULStat = 0;
42 int BoardNum = 0;
43 int CounterNum, Quadrature, CountingMode, DataEncoding, IndexMode;
44 int InvertIndex, FlagPins, GateEnable;
45 long LoadValue;
46 unsigned long Count, lastCount, StatusBits;
47 unsigned long xCount, xlastCount, xStatusBits;
89
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
90
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
97
98 /// <summary>
99 /// Summary for Form1
100 /// </summary>
101 public ref class Form1 : public System::Windows::Forms::Form
102 {
103 public:
104 Form1(void)
105 {
106 InitializeComponent();
107
108 }
109
110 protected:
111 ~Form1()
112 {
113 // shutdown the connection for sending since no more data will be
sent
114 // the client can still use the ConnectSocket for receiving data
115 iResult = shutdown(ConnectSocket, SD_SEND);
116 if (iResult == SOCKET_ERROR) {
117 printf("shutdown failed: %d\n", WSAGetLastError());
118 closesocket(ConnectSocket);
119 WSACleanup();
120 // return 1;
121 }
122
123 //Scanner Cleanup
124 // stop Gocator system
125 if ((status = Go2System_Stop(scannerSystem)) != GO2_OK)
126 {
127 printf ("Error: Go2System_Stop:%d\n", status);
128 return;
129 }
130
131 // destroy system handle
132 if ((status = Go2System_Destroy(scannerSystem)) != GO2_OK)
133 {
134 printf ("Error: Go2System_Destroy:%d\n", status);
135 return;
136 }
137
138 // terminate Go2 API
139 if ((status = Go2Api_Terminate()) != GO2_OK)
140 {
141 printf ("Error: Go2Api_Terminate:%d\n", status);
142 return;
143 }
144 printf("Press any key to Free Memory...\n", status);
145 getchar();
146 //free memory array
147 for(i = 0; i < scanCount; i++)
148 free(memory[i]);
149 free(memory);
150 //End Scanner Cleanup
91
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
151
152 if (components)
153 {
154 delete components;
155 }
156 }
157 private: System::Windows::Forms::Button^ button1;
158 protected:
159
160
161
162 public: System::Windows::Forms::TextBox^ textBox1;
163 public: System::Windows::Forms::Label^ label2;
164 public: System::Windows::Forms::RichTextBox^ richTextBox1;
165 public: System::Windows::Forms::Label^ staticStatusLabel;
166 public: System::Windows::Forms::Label^ statusLabel;
167 public: System::Windows::Forms::Button^ button2;
168
169 public: System::Windows::Forms::Label^ label3;
170 public: System::Windows::Forms::Label^ label4;
171 public: System::Windows::Forms::Label^ label5;
172
173 public: System::Windows::Forms::Label^ xlabel;
174 public: System::Windows::Forms::Label^ ylabel;
175 public: System::Windows::Forms::Label^ zlabel;
176 private: System::Windows::Forms::GroupBox^ groupBox1;
177 public: System::Windows::Forms::Timer^ timer1;
178 public: System::Windows::Forms::CheckBox^ checkBox1;
179 public: System::Windows::Forms::RichTextBox^ richTextBox2;
180 public: System::Windows::Forms::Button^ buttonStartScan;
181 public: System::Windows::Forms::Button^ buttonStopScan;
182 private: System::Windows::Forms::Button^ buttonSaveData;
183 private: System::Windows::Forms::Timer^ timerScan;
184 public: System::Windows::Forms::Label^ labelScanSize;
185 private: System::Windows::Forms::Label^ label1;
186 public: System::Windows::Forms::ProgressBar^ progressBar1;
187 private: System::Windows::Forms::TrackBar^ trackBar1;
188 public: System::Windows::Forms::Label^ labelScanRateHz;
189 private: System::Windows::Forms::Button^ buttonRestartScan;
190 protected:
191 private: System::ComponentModel::IContainer^ components;
192
193
194 #pragma region Windows Form Designer generated code
195 /// <summary>
196 /// Required method for Designer support - do not modify
197 /// the contents of this method with the code editor.
198 /// </summary>
199 void InitializeComponent(void)
200 {
201 this->components = (gcnew System::ComponentModel::Container());
202 this->button1 = (gcnew System::Windows::Forms::Button());
203 this->textBox1 = (gcnew System::Windows::Forms::TextBox());
204 this->label2 = (gcnew System::Windows::Forms::Label());
92
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
93
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
94
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
95
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
96
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
97
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
449 //
450 this->label1->AutoSize = true;
451 this->label1->Location = System::Drawing::Point(223, 375);
452 this->label1->Name = L"label1";
453 this->label1->Size = System::Drawing::Size(98, 13);
454 this->label1->TabIndex = 22;
455 this->label1->Text = L"Scan Profile Count:";
456 //
457 // progressBar1
458 //
459 this->progressBar1->Location = System::Drawing::Point(226, 408);
460 this->progressBar1->MarqueeAnimationSpeed = 1000;
461 this->progressBar1->Name = L"progressBar1";
462 this->progressBar1->Size = System::Drawing::Size(123, 23);
463 this->progressBar1->Step = 1;
464 this->progressBar1->Style =
System::Windows::Forms::ProgressBarStyle::Continuous;
465 this->progressBar1->TabIndex = 23;
466 //
467 // trackBar1
468 //
469 this->trackBar1->Location = System::Drawing::Point(202, 327);
470 this->trackBar1->Maximum = 200;
471 this->trackBar1->Name = L"trackBar1";
472 this->trackBar1->Size = System::Drawing::Size(205, 45);
473 this->trackBar1->TabIndex = 24;
474 this->trackBar1->Value = 200;
475 this->trackBar1->Scroll += gcnew System::EventHandler(this,
&Form1::trackBar1_Scroll);
476 //
477 // labelScanRateHz
478 //
479 this->labelScanRateHz->AutoSize = true;
480 this->labelScanRateHz->Location = System::Drawing::Point(210,
311);
481 this->labelScanRateHz->Name = L"labelScanRateHz";
482 this->labelScanRateHz->Size = System::Drawing::Size(35, 13);
483 this->labelScanRateHz->TabIndex = 25;
484 this->labelScanRateHz->Text = L"label6";
485 //
486 // buttonRestartScan
487 //
488 this->buttonRestartScan->Location = System::Drawing::Point(42,
442);
489 this->buttonRestartScan->Name = L"buttonRestartScan";
490 this->buttonRestartScan->Size = System::Drawing::Size(123, 23);
491 this->buttonRestartScan->TabIndex = 26;
492 this->buttonRestartScan->Text = L"Restart Scan";
493 this->buttonRestartScan->UseVisualStyleBackColor = true;
494 this->buttonRestartScan->Click += gcnew System::EventHandler(this,
&Form1::
buttonRestartScan_Click);
495 //
496 // Form1
497 //
98
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
99
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
550 hints;
551
552 ZeroMemory( &hints, sizeof(hints) );
553 hints.ai_family = AF_INET;
554 hints.ai_socktype = SOCK_STREAM;
555 hints.ai_protocol = IPPROTO_TCP;
556
557
558
559 // Resolve the server address and port
560 iResult = getaddrinfo("192.168.0.35", "5010", &hints, &result);
561 if (iResult != 0) {
562 printf("getaddrinfo failed: %d\n", iResult);
563 statusLabel->Text = "getaddrinfo failed:" + iResult;
564 WSACleanup();
565 // return 1;
566 }
567
568 // Attempt to connect to the first address returned by
569 // the call to getaddrinfo
570 ptr=result;
571
572 // Create a SOCKET for connecting to server
573 ConnectSocket = socket(ptr->ai_family, ptr->ai_socktype,
574 ptr->ai_protocol);
575
576 //check socket is valid
577 if (ConnectSocket == INVALID_SOCKET) {
578 printf("Error at socket(): %ld\n", WSAGetLastError());
579 freeaddrinfo(result);
580 WSACleanup();
581
582 }
583
584 // Connect to server.
585 iResult = connect( ConnectSocket, ptr->ai_addr, (int)ptr-
>ai_addrlen);
586 if (iResult == SOCKET_ERROR) {
587 closesocket(ConnectSocket);
588 ConnectSocket = INVALID_SOCKET;
589 }
590
591
592 freeaddrinfo(result);
593
594 if (ConnectSocket == INVALID_SOCKET) {
595 printf("Unable to connect to server!\n");
596 WSACleanup();
597
598 }else{
599 statusLabel->Text = "Connected to CMM Motion Control";
600 }
601
602
603 //begin counter capture card setup
100
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
101
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
102
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
103
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
104
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
(dataItem);
799 unsigned int profilePointCount =
Go2RawProfileData_Width(dataItem);
800 double XResolution = Go2RawProfileData_XResolution(dataItem);
801 double ZResolution = Go2RawProfileData_ZResolution(dataItem);
802 double XOffset = Go2RawProfileData_XOffset(dataItem);
803 double ZOffset = Go2RawProfileData_ZOffset(dataItem);
804
805 //translate 16-bit range data to engineering units and copy
profiles to memory array
806 for (arrayIndex = 0; arrayIndex < profilePointCount; ++arrayIndex)
807 {
808 if (profileData[arrayIndex].z != -INVALID_RANGE_16BIT)
809 {
810 //This section should be implemented using HTM of scanner
orientation
811 memory[scanIndex][arrayIndex].x = XScannerOffset;
812 memory[scanIndex][arrayIndex].y = YScannerOffset - (XOffset
+ XResolution * profileData[arrayIndex].x); //based on the scan stripe
aligned with the Y axis
813 memory[scanIndex][arrayIndex].z = ZScannerOffset + ZOffset +
ZResolution * profileData[arrayIndex].z;
814 }
815 else
816 {
817 memory[scanIndex][arrayIndex].x = INVALID_RANGE_DOUBLE;
818 memory[scanIndex][arrayIndex].y = INVALID_RANGE_DOUBLE;
819 memory[scanIndex][arrayIndex].z = INVALID_RANGE_DOUBLE;
820 }
821 }
822 }
823 }
824
825
826 if ((status = Go2Data_Destroy(data)) != GO2_OK)
827 {
828 printf("Error: Go2Data_Destroy:%d\n", status);
829 return;
830 }
831 } else {
832 printf("Error: Go2System_ReceiveData failed\n");
833 }
834
835
836 scanIndex++;
837
838 //endofSampleScan
839
840 }
841
842 private: System::Void GrabCount(){
843
844 //START COUNTER CAPTURE
845
846 ULStat = cbCIn32 (BoardNum, CounterNum, &xCount);
105
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
106
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
898 }
899 }
900 private: System::Void button2_Click(System::Object^ sender,
System::EventArgs^ e) {
901 // timer1->Enabled = true;
902 LoadValue = 100000;
903 //load value in micrometers
904 int xLoadValue = 700000;
905 //y and z load values declared globally
906 int yLoadValue = 0;
907 int zLoadValue = 0;
908 RegName = COUNT1 + CounterNum - 1;
909 printf ("Loading counter #%u with an initial count of %u
using cbCLoad()\n", CounterNum, LoadValue);
910 ULStat = cbCLoad32 (BoardNum, RegName, xLoadValue);
911 ULStat = cbCLoad32 (BoardNum, RegName+1, yLoadValue);
912 ULStat = cbCLoad32 (BoardNum, RegName+2, zLoadValue);
913 // testCount = 0;
914 // button2->Text = System::Convert::ToString(testCount);
915 }
916
917 private: System::Void textBox1_TextChanged(System::Object^ sender,
System::EventArgs^ e) {
918
919 }
920
921 public: System::Void buttonStartScan_Click(System::Object^ sender,
System::EventArgs^ e) {
922 buttonStartScan->Enabled = false;
923 buttonStopScan->Enabled = true;
924 timerScan->Enabled = true;
925
926 }
927 public: System::Void buttonStopScan_Click(System::Object^ sender,
System::EventArgs^ e) {
928 buttonStopScan->Enabled = false;
929 buttonStartScan->Enabled = true;
930 timerScan->Enabled = false;
931 }
932
933 private: System::Void timerScan_Tick(System::Object^ sender,
System::EventArgs^ e) {
934
935 if (scanIndex < scanCount ){
936
937 progressBar1->Value = scanIndex;
938 GrabCount();
939 //update offset
940 XScannerOffset = (double)xCount / 1000;
941 YScannerOffset = YMax - ((double)(yCount) / 1000) ;
942 ZScannerOffset = ZMax - ((double)(zCount) / 1000) ;
943 //
944 Go2System_Trigger(scannerSystem);
945 //
946 GrabScanProfile();
107
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
947 } else{
948 //memory buffer full
949
950 }
951 labelScanSize->Text = System::Convert::ToString((unsigned
int)scanIndex);
952 if (trackBar1->Value == 0){
953 buttonStopScan->Enabled = false;
954 buttonStartScan->Enabled = true;
955 timerScan->Enabled = false;
956
957 };
958
959 }
960 private: System::Void buttonSaveData_Click(System::Object^ sender,
System::EventArgs^ e) {
961
962 //save data to file datafile.txt
963 ofstream myfile;
964
965 myfile.open ("ScanData.txt", ios::out | ios::app);
966
967 for (i=0;i < scanIndex ;i++){
968 for (j = 0; j < 1280;j++){
969 if (memory[i][j].x != INVALID_RANGE_DOUBLE)
970 myfile << memory[i][j].x << "," << memory[i][j].y << "," <<
memory[i][j].z << "\n";
971 }
972 }
973 myfile.close();
974
975 }
976
977 private: System::Void trackBar1_Scroll(System::Object^ sender,
System::EventArgs^ e) {
978 labelScanRateHz->Text = System::Convert::ToString( trackBar1-
>Value) + " Hz";
979 if (trackBar1->Value != 0){
980 timerScan->Interval = int(1000/trackBar1->Value);
981 }else{
982 timerScan->Interval = int(5);
983 }
984
985 }
986 private: System::Void buttonRestartScan_Click(System::Object^
sender, System::EventArgs^ e) {
987 scanIndex = 0;
988 }
989 };
990 }
991
992
108
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
References
in Milling Operations," Trans. ASME, J. Eng. Ind., vol. 110, no. 3, pp.
and Systems, 2nd ed. Boca Raton, FL, USA: Taylor & Francis, 2012.
[5] Origin International Inc. (2012) CheckMate, SoftFit Solver: The What,
http://info.originintl.com/Portals/37807/docs/SoftFitSolver_d2.pdf
[6] Yu Pin Lin, "Geometrically Adaptive Milling of Fan Blade Assembly Weld
109
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
1987.
UCRL-52960-S, 1980.
[11] ISO, "Test code for machine tools -- Part 2: Determination of accuracy and
2:2006, 2006.
[12] ISO, "Test code for machine tools -- Part 10: Determination of the
turning machine," Precision Engineering, vol. 1, no. 13, pp. 13-17, 1979.
110
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
pp. 147-59.
[17] M. A. Donmez, "A real-time control system for CNC machine tool based on
[19] G et al. Belforte, "Coordinate measuring machines and machine tools self-
calibration and error correction," Annals of CIRP, vol. 36, no. 1, pp.
359-364, 1987.
111
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
[22] J.A. Bosch, Coordinate Measuring Machines and Systems, G., Dieter, G.
[23] Renishaw Plc. (2002, December) SP600 Scanning Probe System. [Online].
http://www.renishaw.com/en/sp600--6687
http://www.renishaw.com/en/touch-trigger-probes--6652
Manual 1998.
http://en.wikipedia.org/wiki/Structured-light_3D_scanner
1, p. 99.
[Online]. http://blog.shapegrabber.com/2012/05/optical-3d-inspection-of-
transparent-or-reflective-parts.html
112
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
http://www.lmi3d.com/education/line-triangulation
[32] K.S. Arun, T.S. Huang, and S.D. Blostein, ""Least-Squares Fitting of Two
3-D Point Sets," IEEE Trans. PAMI, vol. 9, no. 5, pp. 698-700, 1987.
[33] P.J. Besl and H.D. McKay, "A Method for Registration of 3-D Shapes,"
http://www.geomagic.com/en/products/studio/overview/
http://www.innovmetric.com/polyworks/3D-
scanners/so_pointcloud3.aspx?lang=en
[36] Origin International Inc. (2012, Nov.) Origin International, Inc. [Online].
http://info.originintl.com/Portals/37807/docs/ISO.pdf
[37] Radu Bogdan Rusu and Steve Cousins, "3D is here: Point Cloud Library
113
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
[38] Memex Automation Inc. a unit of Astrix Networks Inc. (2012, August)
http://memex.ca/index.php?option=com_content&view=article&id=46&I
temid=200145
[39] P. Smid, Fanuc CNC custom macros: Programming resources for Fanuc
strategies. [Online].
http://resources.renishaw.com/download.aspx?data=32423〈=&showFor
m=true
http://www.rolanddga.com/products/scanners/lpx600/#specifications
[43] C. Y. Wu, "Arbitrary Surface Flank Milling and Flank SAM in the Design
www.lmi3D.com
114
M. A. Sc. Thesis – D. A. Sawula; McMaster University - Mechanical Engineering.
[45] Renishaw Plc. (2012, August ) Inspection Plus - software for machining
software-for-machining-centres--6094
[46] Rolls-Royce. (2003, April) Rolls-Royce Ships First Blisk for Joint Strike
16_forum_viewtopic-t-9880-start-30.html
[48] Allan D. Spence, D. Alan Sawula, James R. Stone, and Yu Pin Lin, "In-
Italy, 2013.
115