# Conception and Implementation of a Dual Data Acquisition System on an Eight-Axis High-Speed Tube Cutting CNC Machine

Authors: Zengshi Chen; Wenzhong Gao
Journal: Journal of Mechatronics and Applications
 (2010)

---

## Abstract

Precise and fast position measurement has been a challenging problem in computerized
numerical controller (CNC) machines where parts need to be processed at a high speed.
This paper inspects data acquisition and processing on a high-speed tube cutting Siemens
840D CNC machine with Windows NT.40 operating system and analyzes the constraints
of the old procedure on the production speed. The more efficient technical tactics are
proposed and implemented. The laser is added to the system to perform the same data
acquisition while the function of the capacitive sensor is kept. A dual data acquisition
system is thus created and the old one functions as a backup. In the retrofit, the affordable
and practical data communication method is used, the sensor physical movement is
avoided, the algorithm is optimized with requirement of less data, and computation of the
algorithm is moved from numerical controller unit (NCU) to personal computer unit
(PCU). For every tube part, the laser approach reduces the data acquisition and
processing time to 4 seconds, compared to 12 seconds with a capacitive sensor.


---

## Body

## 1. Introduction

Capacitive sensors are nonconductor devices used for precision measurement of a conductive target’s position or a nonconductive material’s thickness or density [1]. A capacitive sensor treats all conductors in the same way regardless of their materials. Capacitive sensors are insensitive to thickness of the material since the surface of the conductive target is sensed. There is a wide application for capacitive sensors in the semiconductor, disk drive, and precision manufacturing industries where accuracies and high response speed are preferred.Capacitive sensors are used in CNC machines for error compensation [2], accuracy enhancement [3], and structural manufacturing intelligence [4]. Siemens Corporation developed a clearance control technology to maintain a clearance distance for a tool from the work-piece surface to be machined in its Sinumerik 840D and 840Di CNC control systems [5]. An analog module transmits the output voltage of the clearance sensor to the control where, in the event of deviations from the setpoint clearance, it generates an additional velocity setpoint for the machining head motion axes. Such technology has been broadly used for laser cutting since precision is critical in this type of application.Capacitive sensors have a few drawbacks [6]. Because the dielectric influence of objects nearby drops off sharply with distance, they typically have a very short range. A short range requires the sensor itself to move back and forth to yield a clearance if an object with an uneven surface is moving. A capacitive sensor can malfunction if it gets too dirty because it will detect the dirt. It is difficult for a capacitive sensor to detect any material with a dielectric constant similar to air due to invisibility of these substances to it. Although they can be adapted to be more sensitive, their excessive sensitivity can lead to nuisance trips and false signals. Very sensitive capacitive sensors can often be activated by a large increase in relative humidity. In contrast, laser can overcome these drawbacks.For some applications, laser offers significant advantages over capacitive sensors. For example, when measuring disk flatness, these advantages are superior signal-to-noise ratios, smaller measurement area, improved acceleration repeatability, and the ability to show short wavelength disk distortions that affect the flying and terrain following ability of smaller footprint heads [7]. In addition there are practical considerations such as much greater stand-off distances (dozens of centimeters for laser compared with several millimeters for capacitive sensors) and the ability to measure a wide variety of material types without correction factors, that make the use of laser attractive for accurate measurements without the risk of accidental target/probe contact and resulting probe damage [7]. In the retrofit to be studied, a 2 mm (millimeter) distance from the capacitive sensor to the spinning square or rectangular steel tube is maintained to achieve the measuring accuracy in the previous design. Consequently, the capacitive sensor has to constantly follow some specific path contours to yield to a tube’s rotation. Extra power is consumed. Time waste is huge when a massive amount of tubes is processed every day. In case of a clearance head fault, a target/probe collision will damage the probe. Therefore, a stationary laser with a larger clearance distance (300 millimeters) is preferred to raise efficiency and secure the null probability of collision. For an application of precision magnitude of millimeters, the factors such as temperature, pressure, and humidity in a normal office or plant environment have negligible effects on precision.Laser has two typical applications in CNC machines. Low- or high-power lasers can work as CNC cutting tools [8–10]. Acting as sensors, low-power lasers are applied to geometric positioning measurement in CNC machine centers [11]. Based on laser measurement, the volumetric compensation was discussed and CNC laser marking on freeform surfaces without prior geometrical information was proposed and tested [12]. A laser-guided measurement robot system was designed and its kinematics was analyzed [13]. In the retrofit to be studied, a low-power laser is used to detect the position of the tubes.Laser measurement data can be passed to CNC part programs through numerical controller (NC) fast input modules, programmable logic controller (PLC) local/remote input modules, or  PCU [5]. A pertinent option is often based on cost, compatibility, available system resources, and speed requirement. In our scenario, real-time data acquisition and control are not required; the original system PCU had a free RS232 port; computation based on the measurement was carried on in the NC controller. To reduce the retrofit cost and render a dual data acquisition system, the RS232 communication is used to pass the data from the laser controller to the PCU. The dynamic data exchange (DDE) technique between NC and PCU is implemented in a client-to-the-server manner via Visual Basic 6.0. To spare the NC’s expensive computational resources, data processing is moved to PCU. In this way, the capacitive sensor is preserved as a backup tool and a high-speed laser is integrated to the system as an extra feature to raise production speed.


## 2. The System with the Capacitive Sensor

### 2.1. The System

The equipment is a laser tube cutting machine with Siemens 840D CNC. The overall mechanical picture is shown in Figure1. The head for high-power cutting laser and the capacitive sensor is 3. Loader is 1. Tube support/handling group is 2. Support/unloader is 4. CNC is 5. Laser source is 6. Electrical panel is 7. Cooler is 8. Aspirator is 9. Hydraulic center is 10.Figure 1
The laser tube cutting machine LT712D.The equipment mainly uses high-power laser beam to process long square and rectangular steel tubes and cuts them into segments. Each tube could be twisted due to its mechanical structure when it is held in the fixture. It is necessary to correct its torsion and calculate its centering offset before laser beam is applied. The equipment has eight translational or rotational axes as shown in Figure2. The names, movements, functions, and travel distances of these working axes are briefly introduced in Table 1. The cutting head shown in Figure 3 moves along Y and Z axes. The tube moves along X and X1axes.Table 1
Working Axes.
AxisAxis movementDescriptionTravelXBrushless DC motor. Travel is actuated by an encoder-monitored pinion and rack.Spindle carriage advance. Axis dimension corresponds to the distance between the spindle front and the laser beam. The axis moves in a positive direction away from the control panel.6,500 mm to 8,500 mmYBrushless DC motor. Transmission is with an encoder-monitored ball recirculation pinion and rack.Laser head axis transversal advance.400 mmZBrushless DC motor. Transmission is with an encoder-monitored ball recirculation pinion and rack.Laser head vertical movement. Zero position is on the tube axis and moves upwards in the positive direction.95 mmABrushless DC motor. Transmission is with an encoder-monitored ball recirculation pinion and rack.Spindle rotation.Not applicableA1Brushless DC motor. Transmission is with an encoder-monitored toothed belt.Rest Rotation.Not applicableVBrushless DC motor. Transmission is with an Archimedean screw.Bar support on the machining line. Zero position is on the tube axis and moves downward in the positive direction.90 mmWBrushless DC motor. Transmission is with an encoder-monitored reduction gear pinion and rack.Unload piece support. Zero position is on the tube axis and moves downward in the positive direction.85 mmX1Brushless DC motor. Transmission is via angular reducer and rack.Steady rest shift.610 mmFigure 2
The machine axes. LT712D has six translational axes X, Y, Z, V, W, and X1 and two rotational axes A and A1.Figure 3
The cutting head. 1 refers to focusing lens seat which houses optical path pressurization air and service gas. 2 refers to the “autofocus” mobile head.A tube is placed and clamped in the four jaws as shown in Figure4. The control flowchart is shown in Figure 5. The process of “waiting for load, bar alignment, and measurement” is to be improved. The control system consists of PCU, NCU, and PLC, the machine control panel, SIMO drive 611U, remote PLC I/O modules, and fast NC I/O modules [5]. The laser is interfaced to the RS232 port on PCU. The capacitive sensor measures the vertical distance from the sensor tip to the point on the tube surface right below the sensor on the left side of the tube. Then it moves to the right side of the tube and the other similar measurement is obtained. CNC uses these two measurements to obtain the torsion angle and a compensatory rotation along A axis eliminates the torsion. After that, with head movement and tube rotation, two similar measurements on each side are obtained and there are a total number of eight measurements. Laser cutting will not be applied to a tube if its computed centering offset is greater than 1.5 mm.Figure 4
The four tube guide jaws.Figure 5
The main program flowchart. The process of “Waiting for load, bar alignment, and measurement” is modified.


### 2.2. Data Acquisition with the Capacitive Sensor

In the capacitive sensor solution, the tube motion sequence is divided into seven states as shown in Figure6. S1, S2, S3, S4, S5, S6, and S7 refer to the tube positional states. The tube rotates counterclockwise. The position of the surface “a” follows the axis A angular position. State transition takes S1→S2→S3→S4→S5→S6→S7. The rotating angle in each transition is labeled between two states. The total time spent on transition from S1 to S7 is more than 12 seconds. It involves measuring, axis A start and pause, head movement, and position correction. Torsion correction in S1→S2→S3, centering offset computation in S3→S4→S5→S6, and preparatory rotation for laser cutting in S6-S7 are implemented in the three different part programs. The axis A frequently starts and pauses. The cutting head has to move from position to position in order to make every measurement. It also has to move to make clearance for the spinning tube. The capacitive sensor has to maintain a distance of two millimeters from the tube top surface during measuring. The tube rotation is synchronized with the cutting head motion while the cutting head moves back to the left side of the tube after it completes its task on the right side. However, the cutting head has to move from the left side of the tube to the right side to measure the next distance after the first distance is measured while the tube is idle. Additional time is used for axis traversing. Hence, a static laser is desired to speed up the data acquisition and avoid the damage of the sensor due to faults.Figure 6
The tube motion sequence with the capacitive sensor.-1, -2, 0, 1, 2, 3, 4, 5, 6, and 7 are markers for each measurement position. a, b, c, and d designate the four sides of the tube.


## 2.1. The System

The equipment is a laser tube cutting machine with Siemens 840D CNC. The overall mechanical picture is shown in Figure1. The head for high-power cutting laser and the capacitive sensor is 3. Loader is 1. Tube support/handling group is 2. Support/unloader is 4. CNC is 5. Laser source is 6. Electrical panel is 7. Cooler is 8. Aspirator is 9. Hydraulic center is 10.Figure 1
The laser tube cutting machine LT712D.The equipment mainly uses high-power laser beam to process long square and rectangular steel tubes and cuts them into segments. Each tube could be twisted due to its mechanical structure when it is held in the fixture. It is necessary to correct its torsion and calculate its centering offset before laser beam is applied. The equipment has eight translational or rotational axes as shown in Figure2. The names, movements, functions, and travel distances of these working axes are briefly introduced in Table 1. The cutting head shown in Figure 3 moves along Y and Z axes. The tube moves along X and X1axes.Table 1
Working Axes.
AxisAxis movementDescriptionTravelXBrushless DC motor. Travel is actuated by an encoder-monitored pinion and rack.Spindle carriage advance. Axis dimension corresponds to the distance between the spindle front and the laser beam. The axis moves in a positive direction away from the control panel.6,500 mm to 8,500 mmYBrushless DC motor. Transmission is with an encoder-monitored ball recirculation pinion and rack.Laser head axis transversal advance.400 mmZBrushless DC motor. Transmission is with an encoder-monitored ball recirculation pinion and rack.Laser head vertical movement. Zero position is on the tube axis and moves upwards in the positive direction.95 mmABrushless DC motor. Transmission is with an encoder-monitored ball recirculation pinion and rack.Spindle rotation.Not applicableA1Brushless DC motor. Transmission is with an encoder-monitored toothed belt.Rest Rotation.Not applicableVBrushless DC motor. Transmission is with an Archimedean screw.Bar support on the machining line. Zero position is on the tube axis and moves downward in the positive direction.90 mmWBrushless DC motor. Transmission is with an encoder-monitored reduction gear pinion and rack.Unload piece support. Zero position is on the tube axis and moves downward in the positive direction.85 mmX1Brushless DC motor. Transmission is via angular reducer and rack.Steady rest shift.610 mmFigure 2
The machine axes. LT712D has six translational axes X, Y, Z, V, W, and X1 and two rotational axes A and A1.Figure 3
The cutting head. 1 refers to focusing lens seat which houses optical path pressurization air and service gas. 2 refers to the “autofocus” mobile head.A tube is placed and clamped in the four jaws as shown in Figure4. The control flowchart is shown in Figure 5. The process of “waiting for load, bar alignment, and measurement” is to be improved. The control system consists of PCU, NCU, and PLC, the machine control panel, SIMO drive 611U, remote PLC I/O modules, and fast NC I/O modules [5]. The laser is interfaced to the RS232 port on PCU. The capacitive sensor measures the vertical distance from the sensor tip to the point on the tube surface right below the sensor on the left side of the tube. Then it moves to the right side of the tube and the other similar measurement is obtained. CNC uses these two measurements to obtain the torsion angle and a compensatory rotation along A axis eliminates the torsion. After that, with head movement and tube rotation, two similar measurements on each side are obtained and there are a total number of eight measurements. Laser cutting will not be applied to a tube if its computed centering offset is greater than 1.5 mm.Figure 4
The four tube guide jaws.Figure 5
The main program flowchart. The process of “Waiting for load, bar alignment, and measurement” is modified.


## 2.2. Data Acquisition with the Capacitive Sensor

In the capacitive sensor solution, the tube motion sequence is divided into seven states as shown in Figure6. S1, S2, S3, S4, S5, S6, and S7 refer to the tube positional states. The tube rotates counterclockwise. The position of the surface “a” follows the axis A angular position. State transition takes S1→S2→S3→S4→S5→S6→S7. The rotating angle in each transition is labeled between two states. The total time spent on transition from S1 to S7 is more than 12 seconds. It involves measuring, axis A start and pause, head movement, and position correction. Torsion correction in S1→S2→S3, centering offset computation in S3→S4→S5→S6, and preparatory rotation for laser cutting in S6-S7 are implemented in the three different part programs. The axis A frequently starts and pauses. The cutting head has to move from position to position in order to make every measurement. It also has to move to make clearance for the spinning tube. The capacitive sensor has to maintain a distance of two millimeters from the tube top surface during measuring. The tube rotation is synchronized with the cutting head motion while the cutting head moves back to the left side of the tube after it completes its task on the right side. However, the cutting head has to move from the left side of the tube to the right side to measure the next distance after the first distance is measured while the tube is idle. Additional time is used for axis traversing. Hence, a static laser is desired to speed up the data acquisition and avoid the damage of the sensor due to faults.Figure 6
The tube motion sequence with the capacitive sensor.-1, -2, 0, 1, 2, 3, 4, 5, 6, and 7 are markers for each measurement position. a, b, c, and d designate the four sides of the tube.


## 3. The Dual Data Acquisition System

### 3.1. Data Acquisition with the Laser

In the laser solution, the tube rotates in both directions. As shown in Figure7, the surface “a” follows the axis A rotation. State transition takes P1→P2→P3→P4→P5→P6→P7. At P1, measurement 0 is taken. At P2, measurement 1 is taken. Based on these two measurements, torsion is obtained. P3 is the state after torsion is compensated. The next four measurements, 2, 3, 4, and 5 obtained at the states of P3, P4, P5, and P6 are used to compute centering offsets. The transition from P6 to P7 in the previous design was a 180-degree counterclockwise rotation. The rotation from P6 to P7 is a -90 degree clockwise rotation. The transitions from P1 to P2 and from P2 to P3, the transitions from P3 to P4, P4 to P5, and P5 to P6, and the rotation from P6 to P7 are implemented in the three different part programs. The 90-degree rotation from S1 to S2 in the previous design is discarded. The pair of measurements on the left and right sides are used to estimate the centering offset along the horizontal line. The other pair of measurements on the top and bottom sides is used to estimate the centering offset along the vertical line. A laser is placed on the left side of the tube. Its incident beam coincides with Y axis. The laser continuously measures its distance from the contact point of the beam on the tube. Handshaking between NCU and PCU is done through R variables as shown hereinafter.(1)
A tube is placed inside the chuck of the machine. The axis A is at its initial position. Based on this position, a signal from NCU is sent to the VB application on PCU, telling that VB will send a command to the laser to retrieve the data.(2)
When the data is successfully retrieved, the VB application sends a command to NCU, telling that the axis A will rotate for counterclockwise 5 degrees. The revolution is completed within 500 ms.(3)
After 5-degree rotation, NCU sends a signal to the VB application, telling that VB will send a command to the laser to retrieve the data.(4)
Once this second data is successfully retrieved, the VB application does computation and passes the result to NCU. Based on this result, the axis A will rotate for a compensatory angle and stops. The time is less than 500 ms.(5)
Once the axis A stops, NCU sends a signal to the VB application on PCU, telling that VB will send a command to the laser to retrieve the data.(6)
Once the data is successfully retrieved, the VB application sends a signal to NCU. The axis A will generate a counterclockwise 90-degree rotation and stops (the revolution is completed within 500 ms). Then, NCU sends a signal to the VB application, telling that VB will retrieve the data from the laser.(7)
Once the data is successfully retrieved, VB stores the data and sends a signal to NCU. The axis A will rotate 90 degrees counterclockwise and stops (the revolution is completed within 500 ms). NCU sends a signal to the VB application, telling that VB will retrieve the data.(8)
Once the data is successfully retrieved, VB stores the data and sends a signal to NCU. The axis A will rotate 90 degrees counterclockwise and stops (the revolution is completed within 500 ms). Then, NCU sends a signal to the VB application, telling that VB will retrieve the data.(9)
Once the data is successfully retrieved, VB stores the data, does computation, and rejects or approves the tube.  Meanwhile, VB sends a signal to NCU. The axis A will rotate 90 degrees clockwise and stops (the revolution is completed within 500 ms).Figure 7
The tube motion sequence with the laser. 0, 1, 2, 3, 4, and 5 are markers for each measurement position. a, b, c, and d designate the four sides of the tube.The total amount of time spent on the axis A servo motor motion is 3000 ms (500+500+500+500+500+500=3000 ms). The serial communication baud rate is 38400 baud. The PCU sends 3 ASCII command characters to the laser controller and receives 12 data ASCII characters from the laser controller. The total serial communication time is about 3.125 ms (=1/38400·15·8·1000 ms). The laser sampling time is 200 us (micron seconds). The NCU program scanning cycle is about 20 ms. Each handshaking between PCU and NCU takes about 40 ms (=2·20 ms). Six data measurements and acquisitions thus take about 258.75 ms (=6·(40+3.125)ms). The testing shows that with the tube load, servo motors can be started, can rotate, and can be stopped within 500 ms. PCU clock frequency is about 1.7 Giga Hz. NCU clock frequency is about 1.32 Mega Hz. The computation time of PCU for a part program with a few instructions is negligible. The total time for such a laser data acquisition procedure is thus less than 4 seconds.


### 3.2. Component Update

In the old NC part programs for torsion correction and center offset detection, PLC is used for cutting head clearance motion control. Apparently, clearance motion control is not needed in the laser approach so that PLC is not accessed in this retrofit. The precise angular position of the axis A for each laser sample data must be known due to fluctuation of the axis A. Thus, the laser is fired to sample the tube according to known axis A positions. The Keyence LK-G402 laser used can handle a 60-degree tilting object relative to its incident beam. In this application, the maximal tilting angle for most tube surface areas relative to the horizontal laser incident beam is 45 degrees. The following hardware and software are used in this retrofit: (1) a Keyence laser head, (2) a Keyence laser controller, (3) a laser bracket, (4) Visual Basic 6.0, and (5) a cable for laser and PCU. The modification is as follows.(1)
A Keyence laser measures the distance between its head and the contact point of the beam on a tube.(2)
Sampled distance data is passed to PCU from the laser controller via serial communication.(3)
A Visual Basic program is to handle serial communication and data retrieval from the laser controller. Torsion and centering offsets are computed by VB on PCU.(4)
NCU retrieves the torsion and centering offset results from PCU.(5)
Modify NCU part programs for laser integration.
(a)
Create three additional part programs in which cutting head motion is disabled during data acquisition, the 90-degree tube turning before torsion measurement is disabled, and the axis A is rotated by-90 degrees before laser cutting.(b)
Add new tags to the human machine interface for operators to select the laser or the capacitive senor. If the capacitive senor is selected, the old part programs are executed. Otherwise, the part programs for the laser are activated.


### 3.3. Algorithm

The laser and the tube cross-section are shown in Figure8. A measurement is taken while the tube is on a stationary position. A total number of six measurements are taken. “O”, the origin of the coordinate system “YZ”, is the projection of the axis A center line around which the tube rotates. “C” is the projection of the tube center line.  Markers 0, 1, 2, 3, 4, and 5 are the contact points of the laser beam when the lines O0, O1, O2, O3, O4, and O5 are coincident with the Y after a rotation. Let the distance from the laser head to the point 0 when the point 0 is on the Y axis be L0. Let the distance from the laser head to the point 1 when the point 1 is on the Y axis be L1. Then, |O0|=L-L0 and |O1|=L-L1. Let the angle between O0 and Y- axis (Y- refers to negative Y) be 0. Let the angle between O1 and Y- axis be θ, which is selected to be a small constant (e.g., in this retrofit, it is 5 degrees as stated in Section 3.1).  The coordinates of O0 or O1 are
(1)(y0,z0)=(-|O0|,0),(y1,z1)=(|O1|cos(180-θ),|O1|sin(180-θ))
where || refers to the absolute value of an argument. The original torsion angle is (2)α=90-atan2(y1-y0,z1-z0)
where α is the angle between the line Z+ and the line which is formed by connecting the points 3 and 5. Siemens 840D needs α to correct torsion. The new torsion angle after θ is compensated is (3)β=α-θ.
Centering offset computation is carried on as follows. Let the measured distances from the laser head to the 2, 3, 4, and 5 be L2, L3, L4, and L5, respectively. The centering offsets for the horizontal and vertical directions are (4)yoffset=|L2-L4|2,zoffset=|L3-L5|2.
If |yoffset|>1.5 mm or |zoffset|>1.5 mm, the tube is rejected.Figure 8
The cutting head. 1 refers to focusing lens seat which houses optical path pressurization air and service gas. 2 refers to the “autofocus” mobile head.


## 3.1. Data Acquisition with the Laser

In the laser solution, the tube rotates in both directions. As shown in Figure7, the surface “a” follows the axis A rotation. State transition takes P1→P2→P3→P4→P5→P6→P7. At P1, measurement 0 is taken. At P2, measurement 1 is taken. Based on these two measurements, torsion is obtained. P3 is the state after torsion is compensated. The next four measurements, 2, 3, 4, and 5 obtained at the states of P3, P4, P5, and P6 are used to compute centering offsets. The transition from P6 to P7 in the previous design was a 180-degree counterclockwise rotation. The rotation from P6 to P7 is a -90 degree clockwise rotation. The transitions from P1 to P2 and from P2 to P3, the transitions from P3 to P4, P4 to P5, and P5 to P6, and the rotation from P6 to P7 are implemented in the three different part programs. The 90-degree rotation from S1 to S2 in the previous design is discarded. The pair of measurements on the left and right sides are used to estimate the centering offset along the horizontal line. The other pair of measurements on the top and bottom sides is used to estimate the centering offset along the vertical line. A laser is placed on the left side of the tube. Its incident beam coincides with Y axis. The laser continuously measures its distance from the contact point of the beam on the tube. Handshaking between NCU and PCU is done through R variables as shown hereinafter.(1)
A tube is placed inside the chuck of the machine. The axis A is at its initial position. Based on this position, a signal from NCU is sent to the VB application on PCU, telling that VB will send a command to the laser to retrieve the data.(2)
When the data is successfully retrieved, the VB application sends a command to NCU, telling that the axis A will rotate for counterclockwise 5 degrees. The revolution is completed within 500 ms.(3)
After 5-degree rotation, NCU sends a signal to the VB application, telling that VB will send a command to the laser to retrieve the data.(4)
Once this second data is successfully retrieved, the VB application does computation and passes the result to NCU. Based on this result, the axis A will rotate for a compensatory angle and stops. The time is less than 500 ms.(5)
Once the axis A stops, NCU sends a signal to the VB application on PCU, telling that VB will send a command to the laser to retrieve the data.(6)
Once the data is successfully retrieved, the VB application sends a signal to NCU. The axis A will generate a counterclockwise 90-degree rotation and stops (the revolution is completed within 500 ms). Then, NCU sends a signal to the VB application, telling that VB will retrieve the data from the laser.(7)
Once the data is successfully retrieved, VB stores the data and sends a signal to NCU. The axis A will rotate 90 degrees counterclockwise and stops (the revolution is completed within 500 ms). NCU sends a signal to the VB application, telling that VB will retrieve the data.(8)
Once the data is successfully retrieved, VB stores the data and sends a signal to NCU. The axis A will rotate 90 degrees counterclockwise and stops (the revolution is completed within 500 ms). Then, NCU sends a signal to the VB application, telling that VB will retrieve the data.(9)
Once the data is successfully retrieved, VB stores the data, does computation, and rejects or approves the tube.  Meanwhile, VB sends a signal to NCU. The axis A will rotate 90 degrees clockwise and stops (the revolution is completed within 500 ms).Figure 7
The tube motion sequence with the laser. 0, 1, 2, 3, 4, and 5 are markers for each measurement position. a, b, c, and d designate the four sides of the tube.The total amount of time spent on the axis A servo motor motion is 3000 ms (500+500+500+500+500+500=3000 ms). The serial communication baud rate is 38400 baud. The PCU sends 3 ASCII command characters to the laser controller and receives 12 data ASCII characters from the laser controller. The total serial communication time is about 3.125 ms (=1/38400·15·8·1000 ms). The laser sampling time is 200 us (micron seconds). The NCU program scanning cycle is about 20 ms. Each handshaking between PCU and NCU takes about 40 ms (=2·20 ms). Six data measurements and acquisitions thus take about 258.75 ms (=6·(40+3.125)ms). The testing shows that with the tube load, servo motors can be started, can rotate, and can be stopped within 500 ms. PCU clock frequency is about 1.7 Giga Hz. NCU clock frequency is about 1.32 Mega Hz. The computation time of PCU for a part program with a few instructions is negligible. The total time for such a laser data acquisition procedure is thus less than 4 seconds.


## 3.2. Component Update

In the old NC part programs for torsion correction and center offset detection, PLC is used for cutting head clearance motion control. Apparently, clearance motion control is not needed in the laser approach so that PLC is not accessed in this retrofit. The precise angular position of the axis A for each laser sample data must be known due to fluctuation of the axis A. Thus, the laser is fired to sample the tube according to known axis A positions. The Keyence LK-G402 laser used can handle a 60-degree tilting object relative to its incident beam. In this application, the maximal tilting angle for most tube surface areas relative to the horizontal laser incident beam is 45 degrees. The following hardware and software are used in this retrofit: (1) a Keyence laser head, (2) a Keyence laser controller, (3) a laser bracket, (4) Visual Basic 6.0, and (5) a cable for laser and PCU. The modification is as follows.(1)
A Keyence laser measures the distance between its head and the contact point of the beam on a tube.(2)
Sampled distance data is passed to PCU from the laser controller via serial communication.(3)
A Visual Basic program is to handle serial communication and data retrieval from the laser controller. Torsion and centering offsets are computed by VB on PCU.(4)
NCU retrieves the torsion and centering offset results from PCU.(5)
Modify NCU part programs for laser integration.
(a)
Create three additional part programs in which cutting head motion is disabled during data acquisition, the 90-degree tube turning before torsion measurement is disabled, and the axis A is rotated by-90 degrees before laser cutting.(b)
Add new tags to the human machine interface for operators to select the laser or the capacitive senor. If the capacitive senor is selected, the old part programs are executed. Otherwise, the part programs for the laser are activated.


## 3.3. Algorithm

The laser and the tube cross-section are shown in Figure8. A measurement is taken while the tube is on a stationary position. A total number of six measurements are taken. “O”, the origin of the coordinate system “YZ”, is the projection of the axis A center line around which the tube rotates. “C” is the projection of the tube center line.  Markers 0, 1, 2, 3, 4, and 5 are the contact points of the laser beam when the lines O0, O1, O2, O3, O4, and O5 are coincident with the Y after a rotation. Let the distance from the laser head to the point 0 when the point 0 is on the Y axis be L0. Let the distance from the laser head to the point 1 when the point 1 is on the Y axis be L1. Then, |O0|=L-L0 and |O1|=L-L1. Let the angle between O0 and Y- axis (Y- refers to negative Y) be 0. Let the angle between O1 and Y- axis be θ, which is selected to be a small constant (e.g., in this retrofit, it is 5 degrees as stated in Section 3.1).  The coordinates of O0 or O1 are
(1)(y0,z0)=(-|O0|,0),(y1,z1)=(|O1|cos(180-θ),|O1|sin(180-θ))
where || refers to the absolute value of an argument. The original torsion angle is (2)α=90-atan2(y1-y0,z1-z0)
where α is the angle between the line Z+ and the line which is formed by connecting the points 3 and 5. Siemens 840D needs α to correct torsion. The new torsion angle after θ is compensated is (3)β=α-θ.
Centering offset computation is carried on as follows. Let the measured distances from the laser head to the 2, 3, 4, and 5 be L2, L3, L4, and L5, respectively. The centering offsets for the horizontal and vertical directions are (4)yoffset=|L2-L4|2,zoffset=|L3-L5|2.
If |yoffset|>1.5 mm or |zoffset|>1.5 mm, the tube is rejected.Figure 8
The cutting head. 1 refers to focusing lens seat which houses optical path pressurization air and service gas. 2 refers to the “autofocus” mobile head.


## 4. Conclusion

A detailed industrial CNC retrofit procedure from conception to implementation is demonstrated. The RS232 serial port on the existing PCU is used. The capacitive sensor data acquisition approach is preserved instead of being discarded. A high-speed and high-accuracy laser is added to the tube cutting machine LT712D for torsion angle correction and centering offset computation. The motionless laser reduces the operating time and energy consumption for tube cutting. With consultation from Siemens and experimentation, accelerating, spinning, and decelerating of the axis A servo motor is controlled to be within 500 ms. Therefore, the servo motor motion characteristic has been explored to a larger degree with a knowledge of the tube load. The data acquisition time is reduced to 4 seconds that is much less than the previous 12 seconds. The potential collision of the cutting head with the tube during data acquisition is eliminated. A dual data acquisition system is set up: the capacitive sensor is a backup and the laser operates routinely to improve productivity. The system has been improved by using most of the original components.



---

*Source: 273963-2010-06-13.xml*