There are also specific wire-bending machines equipped with a transfer system (TEC, for example) shown in Figure 6, in which the wire placed in the buffer is supplied to the transfer clamps. On average, each rig has twenty clamps. The transfer, in its work cycle, places the wire at the bending stations and, on average, each machine has twenty of these stations. The bending stations have the particularity of being actuated by pneumatic cylinders, the adjustment of the bends being carried out by mechanical end-of-course stops. There are also specific wire-bending machines equipped with a transfer system (TEC, for example) shown in Figure 6, in which the wire placed in the buffer is supplied to the transfer clamps. On average, each rig has twenty clamps. The transfer, in its work cycle, places the wire at the bending stations and, on average, each machine has twenty of these stations. The bending stations have the particularity of being actuated by pneumatic cylinders, the adjustment of the bends being carried out by mechanical end-of-course stops.

In the DH4012 VGP (BLM Group, Cantù, Italy) type bending equipment shown in Figure 7, the wire is used in a coil. The equipment consists of a roller straightener, a drag system, a CNC cutting system, two CNC bending heads and a rotating central gripper.

**Figure 6.** Specific wire-bending machine with transfer.

There are also specific wire-bending machines equipped with a transfer system (TEC, for example) shown in Figure 6, in which the wire placed in the buffer is supplied to the transfer clamps. On average, each rig has twenty clamps. The transfer, in its work cycle, places the wire at the bending stations and, on average, each machine has twenty of these stations. The bending stations have the particularity of being actuated by pneumatic cylinders, the adjustment of the bends being carried out by mechanical end-of-course stops.

moves the wire to the CNC bending stations, where the wire is formed. There are normally four CNC wire-bending stations, with the first station responsible for making the hooks

and pre-bends and the last station responsible for making the two central bends.

**Figure 6.** Specific wire-bending machine with transfer. **Figure 6.** Specific wire-bending machine with transfer.

**Figure 5.** Specific wire-bending machine (U-shaped wires).

In the DH4012 VGP (BLM Group, Cantù, Italy) type bending equipment shown in Figure 7, the wire is used in a coil. The equipment consists of a roller straightener, a drag system, a CNC cutting system, two CNC bending heads and a rotating central gripper. In the DH4012 VGP (BLM Group, Cantù, Italy) type bending equipment shown in Figure 7, the wire is used in a coil. The equipment consists of a roller straightener, a drag system, a CNC cutting system, two CNC bending heads and a rotating central gripper.

**Figure 7.** Wire-bending equipment DH4012 VGP (BLM Group).

The rotary gripper makes it possible to perform the different wire planes that need to be produced. Figure 8 details the configuration of the gripper with the bending heads. As the gripper is quite wide, it limits the central dimensions of the wire. This one has upward and downward vertical movement. When the gripper descends, it allows the bending heads to move closer together and shortens the central dimensions. However, in order to keep the wire fixed, these have clamps that are activated when the gripper is lowered.

**Figure 8.** Central part of the equipment DH4012 VGP (BLM Group).

In the TWF-C07AD bending equipment shown in Figure 9, the concept is similar to the previous one, but wire fixation is promoted by a clamp provided with rotation movement. The system has two rotation axes, both with support at both ends of the machine. One has the center of the bending tools as a reference, while the other supports the gripper at the end in order to be able to supply and extract the wire. *Machines* **2023**, *11*, x FOR PEER REVIEW 8 of 24

**Figure 9.** Wire-bending equipment TWF-C07 A D. **Figure 9.** Wire-bending equipment TWF-C07 A D.

bottom to move between bending, feeding and extraction stations.

**Figure 10.** Wire-bending equipment BT5.2.

tion between stations.

The BT5.2 bending equipment shown in Figure 10 presents a different approach. In this equipment, the bending heads are fixed, which is done in two different bending axes. The manipulators can move in X to change the folding position. In addition to this move-The BT5.2 bending equipment shown in Figure 10 presents a different approach. In this equipment, the bending heads are fixed, which is done in two different bending axes. The manipulators can move in X to change the folding position. In addition to this movement,

ment, they have two more rotation axes, one on the bending tool axis and another on the

The BT5.2 equipment has a rotary straightener, whose approach is also different in relation to the previous ones, as can be seen in Figure 11. As it has two bending stations on different axes, the wire is forced to be fixed alternately by each one of the handlers. The manipulators have clamping systems, as well as folding stations, to ensure better transi-

they have two more rotation axes, one on the bending tool axis and another on the bottom to move between bending, feeding and extraction stations.

**Figure 10.** Wire-bending equipment BT5.2.

The BT5.2 equipment has a rotary straightener, whose approach is also different in relation to the previous ones, as can be seen in Figure 11. As it has two bending stations on different axes, the wire is forced to be fixed alternately by each one of the handlers. The manipulators have clamping systems, as well as folding stations, to ensure better transition between stations.

**Figure 11.** Details of the BT5.2 equipment.

The Gemini 7 equipment shown in Figure 12 has a central clamping system, and the bending heads rotate around the bending axis and move along the X axis, making the equipment more versatile.

**Figure 12.** Wire-bending equipment Gemini 7.

The positioning and extraction of the wire are performed through two upper transfers, as can be seen in Figure 13. It has independent movement, thus not limiting the movement of the bending heads.

**Figure 13.** Upper transfers of Gemini 7.

The 3D-CN-8-M bending equipment shown in Figure 14 presents a different concept, in which the bending head is fixed and the manipulator is responsible for the displacement in X. However, it presents the particularity of having only a rotation axis in the manipulator and a very compact clamping system.

**Figure 14.** Wire-bending equipment 3D-CN-8-M [36].

Table 1 intends to summarize the main characteristics of the different concepts previously described in the perspective of the top management of any company. Thus, the main characteristics evaluated are flexibility, productivity and cost. This table does not intend to serve as a reference to further purchase decisions; thus, it is qualitative. Moreover, only some specific technical aspects are important to take them into consideration during the development of a new concept, taking the best ideas and trying to find solutions to overcome other ideas that do not work as well as expected regarding the requirements initially proposed.

**Table 1.** Some of the main features of the analyzed equipment.

Through a summary description of the main characteristics of the equipment already on the market, it can be inferred that they have very particular advantages. However, they also have some limitations that are restrictive to combining a very high productive capacity and sufficient flexibility, in the same equipment, for any company to be able to easily change the type of wire produced without significantly interfering with its productivity, which would have obvious implications for the competitiveness of the manufactured products. This justifies the need to create a new equipment concept capable of combining flexibility with high productivity.

### **3. Methodology: Drawing the Formability Concept**

The suspension system of a vehicle seat (Figure 15) has foam and flexible structures in wire following a spring shape, which have the capacity to filter vibrations. The level of vibration isolation varies depending on the type of vehicle. In sports cars, drivers seek to have a more direct connection with the car, with the aim of feeling the sensations that the car transmits better. As a result, more rigid seats are designed, that is, with a lower damping rate. Luxury cars have exactly the opposite requirements in that, in addition to elementary suspension systems, they have additional systems that allow adaptation to different occupants [52].

**Figure 15.** Car seat suspension system: cushion (own image).

Taking into account the components of the suspension system of a vehicle seat, in Figure 2, the marked component is the one that corresponds to the scope of this work. This is the cushion (also pointed out in Figure 1), which is conceived from the over-injection of plastic in previously formed wires. The plastic used is usually polypropylene and the wire is made from spring steel.

In the process of folding the cushions, as well as the suspension mats whose structure is very similar, equipment existing until now had a significant gap as the most flexible ones have low productivity, not being indicated for projects with a large production volume. On the other hand, there is also equipment that shows high productivity but is not flexible. Being more suitable for large-volume projects, that is, they follow the principle of fixed automation. For this reason, the modification of high-productivity equipment for new projects entails high costs, which customers are increasingly unwilling to pay, affecting the competitiveness of companies in the field.

In order to make the equipment more flexible, and after the wire class has been established, it is necessary to identify and characterize the wires produced. To this end, a survey about the following features of the wires needs to be performed:

A typical wire used in cushions is shown in Figure 16, which can be used as an example for the development of the concept. In this cushion, four wire references are used, in which the wire diameter is 3.4 mm, the wire class is SH (high tensile strength, following the EN 10270-1 standard), it has fourteen bends, two different radii, three planes of folding, two hooks and is 583 mm in length. The references are two symmetrical pairs.

ing, two hooks and is 583 mm in length. The references are two symmetrical pairs.

ones have low productivity, not being indicated for projects with a large production volume. On the other hand, there is also equipment that shows high productivity but is not flexible. Being more suitable for large-volume projects, that is, they follow the principle of fixed automation. For this reason, the modification of high-productivity equipment for new projects entails high costs, which customers are increasingly unwilling to pay, affect-

In order to make the equipment more flexible, and after the wire class has been established, it is necessary to identify and characterize the wires produced. To this end, a

A typical wire used in cushions is shown in Figure 16, which can be used as an example for the development of the concept. In this cushion, four wire references are used, in which the wire diameter is 3.4 mm, the wire class is SH (high tensile strength, following the EN 10270-1 standard), it has fourteen bends, two different radii, three planes of fold-

survey about the following features of the wires needs to be performed:

• Minimum radius able to avoid crack induction on the wires.

ing the competitiveness of companies in the field.

• Number of different radii per wire; • Number of bending planes per wire;

• Wire diameter; • Number of folds;

• Wire length; • Number of hooks;

**Figure 16.** Typical cushion wire.

**Figure 16.** Typical cushion wire. In Figure 16, folds 1 and 14 are commonly referred to as hooks, and at a minimum, each pad has a hook. Based on a company producing this type of components for seats of motor vehicles, a typification study of its main characteristics was carried out to guide the design of the new equipment. Table 2 shows a summary from which it can be concluded that the wire diameter varies between 3 and 4 mm, the number of bending planes varies between two and five, the number of hooks varies between one and two, the number of radii used in each wire cushion range varies between two and four, the length of the wire In Figure 16, folds 1 and 14 are commonly referred to as hooks, and at a minimum, each pad has a hook. Based on a company producing this type of components for seats of motor vehicles, a typification study of its main characteristics was carried out to guide the design of the new equipment. Table 2 shows a summary from which it can be concluded that the wire diameter varies between 3 and 4 mm, the number of bending planes varies between two and five, the number of hooks varies between one and two, the number of radii used in each wire cushion range varies between two and four, the length of the wire fluctuates between 400 mm and 1120 mm, the number of bends varies from thirteen to twenty-five and the wire grade is SH or SM.

2 4 SH 12 2 3 563.2 1 3 3.5 SM 12 2 5 465.4 1 SH: high tensile strength (following the EN 10270-1 standard). SM: medium tensile strength (following the EN 10270-1 standard).

### **4. The New Concept**

Thus, a new equipment concept was conceived and designed using Catia V6 software (Dassault Systèmes), which is schematically represented in Figure 17. In this new concept, it was understood that the wire was pulled by the drag system, being subsequently taken to the straight position through a two-plane roller straightener. After dragging, the wire is cut by the cutting device, which has movement capacity to perform various cut lengths, thus meeting the intended flexibility requirement. The wire piece is fixed in a system of clamps, ready to be picked up by the manipulator. The manipulator, in addition to transporting the wire between stations, has a rotation system, which yields several planes in the wirebending process. The manipulator will take the wire to the cutting system, moving it to the CNC bending stations and to the final bending stations. For increased cadence, the center post has a hook fold and pre-fold station, similar to what Latour equipment uses. After the CNC folding stations, it has a folding station that makes the last two central folds. It is similar to the last station usually used by Latour and Inovmaq (Figure 17).

**Figure 17.** New concept of high-productivity/high-flexibility wires bending machine.

What makes this concept more innovative are the stations used to make the hooks and the final folds, as shown in Figure 18. The station used to make the hook, in addition to allowing the overlapping of operations as allowed by the Latour concept, also increases flexibility as its position is given by a servomotor, together with the cutting device.

**Figure 18.** Wire-bending station added to the concept.

Like most of the concepts already presented, this equipment has an unwinder, roll straightener and drag, as can be seen in Figure 19. In this concept, the equipment can be divided into three large groups of subsets, as it is possible to observe in Figure 20. These groups are the following:

**Figure 19.** An overview of the entire concept developed as it can be installed on the shopfloor.

At the central station, which can be seen in Figure 21, the raw material is fed into coils, thus avoiding the use of cutting equipment and the existence of intermediate stocks, as in the TEC concept (Figure 8). At the central station, the coil is placed in the unwinder where it is unwound, maintaining constant tension. The wire is pulled by the drag system, forcing it to unwind and straighten. Wire alignment is carried out when passing through the two-plane roller straightener. After dragging, the wire passes through the cutting system and reaches the hook tool, where hook bending and pre-bending takes place. With these operations carried out, more wire is fed until it reaches its cutting position. Once in At the central station, which can be seen in Figure 21, the raw material is fed into coils, thus avoiding the use of cutting equipment and the existence of intermediate stocks, as in the TEC concept (Figure 8). At the central station, the coil is placed in the unwinder where it is unwound, maintaining constant tension. The wire is pulled by the drag system, forcing it to unwind and straighten. Wire alignment is carried out when passing through the two-plane roller straightener. After dragging, the wire passes through the cutting system and reaches the hook tool, where hook bending and pre-bending takes place. With these operations carried out, more wire is fed until it reaches its cutting position. Once in the cutting position, the support claws are activated, and then the cut is performed. Finally, the

• Device that performs the Hook + Pre-fold + Cut;

as follows:

• Support claws.

the cutting position, the support claws are activated, and then the cut is performed. Fi-

device that performs the Hook + Pre-bend + Cut set withdraws, and the wire is available for the subsequent operations. The devices that make up the central station are as follows:

**Figure 21.** Central station. moves to the middle fixation device. The wire is fixed in this device and the central bends of the wire are performed. Finally, the extraction system removes the shaped wire and

• Handler;

The wire available at the central station is picked up by the left or right handler (Figure 22). Afterwards, it moves to the CNC bending devices. Here, several bends are performed, always with the wire fixed to the manipulator. With the bends completed, it moves to the middle fixation device. The wire is fixed in this device and the central bends of the wire are performed. Finally, the extraction system removes the shaped wire and drop-off it onto the equipment's exit ramps. drop-off it onto the equipment's exit ramps. The devices that make up the left and right stations are as follows: • CNC bending device; • Middle fixing device; • Extraction.

**Figure 22.** Left and right station.

The equipment is capable of bending wire from 3 to 4 mm, with a maximum length of 1100 mm. The wire is dispensed on both sides of the equipment, as shown in Figure 23. **Figure 22.** Left and right station. The devices that make up the left and right stations are as follows:

The equipment is capable of bending wire from 3 to 4 mm, with a maximum length of 1100 mm. The wire is dispensed on both sides of the equipment, as shown in Figure 23.

**Figure 23.** Wire-bending output machine.

In terms of productivity, and considering only five of several references produced by the company used as target for the implementation of this concept and considering the concept now developed face to face with the TEC and the Robomac concepts previously described, a comparative study is presented in Table 3, yielding an understanding of the differences.

In addition to productivity gains, this concept yields the implementation of new wire references, changing only the tool kit, as can be seen from the different references already implemented. Therefore, this concept is proven to be much more flexible and productive than any of the concepts already existing on the market. The flexibility of this concept is also verified in the ability to produce two symmetrical references simultaneously, or even different references on each side of the equipment, a situation that is also innovative, as there is currently no equipment that uses this concept and is capable of allowing different programming for each side of the machine. This point is extremely important for the manufacture of bent wires for car seats, as it is extremely common for each component on one side to have a corresponding one on the other side (symmetrical). However, in certain situations, there are differences in detail (no symmetry), which can be easily managed by this new equipment, producing equivalent parts, although with specific formats. This possibility significantly facilitates the management of stocks and setups, as production is flexible, allowing the perfect adjustment of the quantity to be produced to the quantity ordered by the customer and, when it comes to symmetrical components, the quantity obtained from one side of the equipment is exactly equal to that obtained from the other (imposed by the cadence of the equipment), which makes it possible to complete the amount of shaped wires necessary so that the cushions or suspension mats can be produced immediately (the next product where the bent wires are applied), with a shorter lead time. Thus, the advantages presented by this innovative concept are clear, both in terms of productivity and flexibility, as well as the advantages in terms of internal logistics that it provides.

**Table 3.** Productivity analysis regarding the different considered concepts.

The cost of this new concept is 3% lower than that of the TEC concept because the last one uses a high number of mechanical parts. Taking into account the Robomac concept, it is 19% higher. However, the productivity gain is around 230%, largely offsetting any disadvantage in the initial investment. With regard to the necessary investment in tools, there are significant differences in terms of their cost. The cost of the tools for the new equipment is about the double that of the Robomac tools cost, which is compensated by increased productivity. On the other hand, the tools of the new concept are 87% lower than the cost of new tools for the TEC concept. It is easy to understand that, although some differences exist, the increased productivity provided by the new concept overlaps the small costs of the tools and allows a flexibility level completely incomparably higher.

## **5. Discussion**

This work was developed with the aim of solving the need for concrete of companies that produce components for car seats, whose products have a relatively low added value, and where any increase in productivity without deteriorating the quality is extremely welcome. Analyzing existing equipment on the market (benchmarking), it was possible to detect an opportunity to develop a new concept that would significantly increase productivity, without jeopardizing flexibility. The concept aims to take advantage of the dead time that the wire feeding system has in relation to bending systems, which are necessarily slower. A concept was then conceived that aimed to achieve double production, doubling the bending systems around a common wire feeding system.

Given that vehicle customization led to an increase in the model variants available to customers, setup time has become a problem that needs to be resolved quickly as tool changes and process fine-tuning heavily penalizes productivity [13]. It also became necessary to create an agile system for changing tools, which were not excessively expensive, but which fully complied with what was intended, i.e., to switch production from one model to another in an extremely expeditious manner [14–16].

In addition to this, it was possible to establish two ways in the same equipment, programmable in a different way, which allow two different references or mirrored references, to be carried out simultaneously. In terms of bending-wire operations with this complexity, this is a novel concept.

In addition to extremely significant gains in terms of productivity and flexibility, it was also found that, in terms of internal logistics, there are significant advantages. In fact, two symmetrical models can be produced simultaneously, producing exactly the same amount of both products at the same time, which allows these wires to move simultaneously to the next production step (manufacturing cushions or suspension mats) simultaneously, which allows a much more organized production management. In case there is a need to produce different products, lead time is also greatly reduced, as it is not necessary to finish the production of a model to start the production of another. Thus, industrial management is much more agile, allowing different combinations of products as necessary to respond to demand.

Thus, it can be said that this work is in line with some work that has already been carried out in this area [7,33,34,52], where an attempt was made to increase productivity, also significantly improving the logistics around these processes that normally have low added value. Management techniques, in many cases, solve serious problems in terms of lack of competitiveness in products of this nature [16,36,37], but sometimes it is even necessary to promote necessary changes in terms of the equipment involved. Automation plays an extremely relevant role in this regard, mainly flexible automation, but it is necessary to select the best set of devices so that the desired results can be obtained [4]. In addition, a high critical state of mind is necessary, so that truly innovative solutions can be obtained, disruptive with what has been conducted so far, in order to achieve new standards of productivity and flexibility [4,19].

Figure 24 intends to illustrate the implementation of the previously described concept, which only became viable through a full demonstration of the advantages that it would entail for an increase in flexibility and productivity. The equipment is based on 1400 different parts and devices, comprising electrical actuators, pneumatic actuators, sensors, electrical components, standard parts and several mechanical parts specifically designed to this equipment, especially conceived to be easily replaced through planned maintenance operations.

**Figure 24.** Image of the real equipment after assembling.

#### **6. Conclusions**

Given the characteristics of the wires and the volumes of the projects, budgetary restrictions and production objectives are usually imposed. An innovative solution for wire-bending equipment is developed, requiring a low budget and complying with the requirements and constraints initially pointed out. The concept consists of equipment provided with three stations, a central one where the wire is unwound from the coil, straightened, shaped (double bends are made) and cut. In the lateral stations, left and right, the wire, after being picked up by the manipulator at the central station, is shaped in CNC bending devices with the wire always fixed in the manipulator. At the end, it is placed by the manipulator at the final bending station to finish shaping the wire. After forming, the wire is extracted onto material exit guides.

The implementation of this new concept yielded an output in productivity of around 230% in relation to flexible equipment previously existing, and a gain of 12.5% in relation to high-cadence equipment on the market. In addition to productivity gains, this concept yields the implementation of new wire references by changing only the tool kit. The flexibility of this concept is also verified in the ability to produce two symmetrical references simultaneously, or even different references (albeit similar). This point is extremely important in the management of stocks and setups.

The cost of this new concept is 3% lower than the TEC concept and 19% higher, relative to the Robomac concept, but with the previously described productivity gain.

The cost of new tools is double that of the Robomac concept, which is 87% cheaper than the cost of new tools for the TEC concept. It is thus verified that this concept is much more competitive in the implementation of new projects. The new concept was also thought to be easier to repair. Knowing the main drawbacks of the other equipment, some solutions were developed, taking into account forecasted problems. Moreover, because all development is made "in house" mode, the domain of all devices and mechanical parts are easier to deal with. A maintenance guide is provided to the maintenance department with all care needed in the different zones of the equipment, identifying and solving the most common problems.

Table 4 intends to summarize the main advantages and limitations of the developed concept.

**Table 4.** Advantages and limitations of the new concept concepts.

A video of the equipment working in its initial phase can be observed in Supplementary Materials S1 attached to this work.

This work followed the design search research methodology, taking solutions already implemented in the market as a starting point and promoting an evolution of knowledge from these initial ideas, reaching a level of knowledge that can be shared and expanded to other business areas, equally successfully. In fact, the knowledge produced can be used in other industries linked to the same sector, or even to different sectors, yielding the development of new concepts with greater efficiency. Indeed, the DSR methodology structured the thought and achieved the desired results, thus verifying that it is extremely useful in the study of upgrading production systems.

**Supplementary Materials:** The following supporting information can be downloaded at: https:// www.mdpi.com/article/10.3390/machines11030410/s1, Video S1: Equipment working.

**Author Contributions:** M.G.: Conceptualization, main research and data collection; F.J.G.S.: Work orientation, Investigation, Methodology, Supervision, Writing—Reviewing; Investigation, Formal analysis; A.G.P.: Co-Supervision, Formal analysis, Visualization; R.D.S.G.C.: Formal analysis, Visualization, Writing—Reviewing. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** The authors would like to thank Mário Cardoso from FicoCables, Lda. due to its permanent strong support. F.J.G. Silva, A.G. Pinto and R.D.S.G. Campilho also thank INEGI—Institute of Science and Innovation in Mechanical and Industrial Engineering, Porto, Portugal, due to their continuous support on applied research.

**Conflicts of Interest:** The authors declare no conflict of interest.

## **References**

**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

## *Article* **A Method for Measurement of Workpiece form Deviations Based on Machine Vision**

**Wei Zhang 1,\* , Zongwang Han 1,2, Yang Li <sup>1</sup> , Hongyu Zheng <sup>1</sup> and Xiang Cheng <sup>1</sup>**

**Abstract:** Machine vision has been studied for measurements of workpiece form deviations due to its ease of automation. However, the measurement accuracy limits its wide implementation in industrial applications. In this study, a method based on machine vision for measurement of straightness, roundness, and cylindricity of a workpiece is presented. A subsumed line search algorithm and an improved particle swarm optimization algorithm are proposed to evaluate the straightness and roundness deviations of the workpiece. Moreover, an image evaluation method of cylindricity deviation by the least-square fitting of the circle's center coordinates is investigated. An image acquisition system incorporating image correction and sub-pixel edge positioning technology is developed. The performance of the developed system is evaluated against the measurement results of the standard cylindricity measuring instrument. The differences in the measurement of straightness, roundness, and cylindricity are −4.69 µm, 3.87 µm, and 8.51 µm, respectively. The proposed method would provide a viable industrial solution for the measurement of workpiece form deviations.

**Citation:** Zhang, W.; Han, Z.; Li, Y.; Zheng, H.; Cheng, X. A Method for Measurement of Workpiece form Deviations Based on Machine Vision. *Machines* **2022**, *10*, 718. https:// doi.org/10.3390/machines10080718

Academic Editors: Raul D. S. G. Campilho and Francisco J. G. Silva

Received: 17 July 2022 Accepted: 5 August 2022 Published: 22 August 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

**Keywords:** machine vision; form deviation; evaluation algorithm; image-based process; edge detection

## **1. Introduction**

Shafts are one of the most important machinery parts for a wide range of industrial applications. Geometric deviations of a shaft will affect its functional performance. Conventionally, manual inspection and measurement are usually conducted for the measurement of straightness and roundness, which has the disadvantage of larger errors and lower efficiency [1]. Machine vision technology has been employed to measure industrial parts of different sizes with high efficiency and accuracy, which is widely used in automatic measuring [2–4]. Many researchers have conducted research on measurements based on machine vision technology. Lu et al. [5] developed a straightness measurement system based on the combination of a laser and machine vision, where multiple groups of vision sensors were adopted to realize on-line detection of seamless steel pipe straightness. Cho et al. [6] explored a new method of support vector regression to detect roundness to improve the accuracy and speed of the fitting algorithm, and it was proved to be more robust to noises, including measurement deviations for the tested problems. Liu et al. [7] proposed a binocular-vision-based deviation detection system and an identification algorithm to achieve deviation detection with three-dimensional measurement capability and to simplify the complex error identification formulations of position-independent geometric deviations in the rotary axis. Xiao et al. [1] proposed an on-line dimensional accuracy measurement method by machine vision, where three surface sources were placed in the positions of left, middle, and right to ensure uniform illumination, which realized the real-time measurement of the straightness and roundness on the conical spun workpiece. Tan et al. [8] studied the measurement of shaft diameter with the structured light system composed of a laser linear light source and a camera. The test results show that when the shaft diameter was 36.162 mm, the speed was 1250 r/min, and the maximum average

measurement deviation was 0.019 mm. Li. [9] developed a geometric measurement system for shaft parts by machine vision, and an improved single-pixel edge detection method was proposed by the Canny detection algorithm. The experimental results show that the repeatability deviation of the system was less than 0.01 mm. Luo et al. [10] proposed an improved differential evolution algorithm (IoCoDE) for the accurate evaluation of minimum zone axis straightness deviation. The results indicate that the evaluation accuracy of IoCoDE was better than linking ends, the least-square method (LSM), and other common evaluation algorithms, and it was basically around 1 s. Hao et al. [11] suggested a coded references and geometric-constraints-based method to solve the inconsistency problem of measurement range and accuracy for slender shafts. The systematic deviation of the experimental system was 0.01754 mm. Min et al. [12] measured the high-precision geometric deviation of thread with machine vision and optical enlargement. The geometric deviations of thread were calculated by using the thread cross-sectional image. The linear precision of this system was less than 10µm. Chai et al. [13] proposed a non-contact optical measurement scheme to measure the co-axiality of a composite gear shaft; the least-square circle (LSC) and the particle swarm optimization (PSO) were used, and the measurement deviation range was less than 0.065 mm. was less than 0.01 mm. Luo et al. [10] proposed an improved differential evolution algorithm (IoCoDE) for the accurate evaluation of minimum zone axis straightness deviation. The results indicate that the evaluation accuracy of IoCoDE was better than linking ends, the least-square method (LSM), and other common evaluation algorithms, and it was basically around 1 s. Hao et al. [11] suggested a coded references and geometric-constraints-based method to solve the inconsistency problem of measurement range and accuracy for slender shafts. The systematic deviation of the experimental system was 0.01754 mm. Min et al. [12] measured the high-precision geometric deviation of thread with machine vision and optical enlargement. The geometric deviations of thread were calculated by using the thread cross-sectional image. The linear precision of this system was less than 10μm. Chai et al. [13] proposed a non-contact optical measurement scheme to measure the co-axiality of a composite gear shaft; the least-square circle (LSC) and the particle swarm optimization (PSO) were used, and the measurement deviation range was less than 0.065 mm. In the literature mentioned above, the machine vision measurement is more precise and efficient as compared with the traditional measurements. However, there is a lack of standard vision detection instrument for form deviations measurement in industry.

surface sources were placed in the positions of left, middle, and right to ensure uniform illumination, which realized the real-time measurement of the straightness and roundness on the conical spun workpiece. Tan et al. [8] studied the measurement of shaft diameter with the structured light system composed of a laser linear light source and a camera. The test results show that when the shaft diameter was 36.162 mm, the speed was 1250 r/min, and the maximum average measurement deviation was 0.019 mm. Li. [9] developed a geometric measurement system for shaft parts by machine vision, and an improved single-pixel edge detection method was proposed by the Canny detection algorithm. The experimental results show that the repeatability deviation of the system

In the literature mentioned above, the machine vision measurement is more precise and efficient as compared with the traditional measurements. However, there is a lack of standard vision detection instrument for form deviations measurement in industry. Therefore, the structure of vision measurement and related algorithms need to be further studied. Therefore, the structure of vision measurement and related algorithms need to be further studied. In this study, a new method is presented for measuring the form accuracy of a shaft workpiece. In order to obtain images of the shaft, an image acquisition system is de-

In this study, a new method is presented for measuring the form accuracy of a shaft workpiece. In order to obtain images of the shaft, an image acquisition system is designed. The image pre-processing method and form deviations evaluation algorithm are studied. By integrating the computer control and calculation algorithm, form deviations, such as straightness, roundness, and cylindricity deviation of the shaft part, are calculated automatically and efficiently. signed. The image pre-processing method and form deviations evaluation algorithm are studied. By integrating the computer control and calculation algorithm, form deviations, such as straightness, roundness, and cylindricity deviation of the shaft part, are calculated automatically and efficiently. **2. Image Acquisition System and Camera Calibration**

#### **2. Image Acquisition System and Camera Calibration** *2.1. Composition of the Image Acquisition System*

*Machines* **2022**, *10*, x FOR PEER REVIEW 2 of 17

#### *2.1. Composition of the Image Acquisition System* The composition of the form deviation measurement system is depicted in Figures 1

The composition of the form deviation measurement system is depicted in Figures 1 and 2. It is mainly composed of the X, Y, Z linear electrokinetic displacement platform, rotating electric platform, CMOS camera, optical lens, LED light source, three-jaw chuck, tailstock, motion control card, and computer. Information on the main hardware models of the system is provided in Table 1. The parameters of the motion stages are listed in Table 2. and 2. It is mainly composed of the X, Y, Z linear electrokinetic displacement platform, rotating electric platform, CMOS camera, optical lens, LED light source, three-jaw chuck, tailstock, motion control card, and computer. Information on the main hardware models of the system is provided in Table 1. The parameters of the motion stages are listed in Table 2.

**Figure 1.** Schematic diagram of an image acquisition system. **Figure 1.** Schematic diagram of an image acquisition system.

**Table 1.** Main hardware of the system.

**Figure 2.** Form deviation detection system by machine vision. **Figure 2.** Form deviation detection system by machine vision.

**Table 1.** Main hardware of the system. **Table 2.** Specification of motion stages.

#### **Motorized Stage**  *2.2. Camera Calibration*

**Travel Range (mm) Resolution (µm) Repeatability Positioning (µm)**  X KXL06200-C2-F 200 0.2 ±1 Y, Z KXG06030-C 30 0.1 ±1 Rotating KS401-40 360° 0.003° ±0.05° *2.2. Camera Calibration*  In the process of two-dimensional images, there is nonlinear deformation in different degrees, which is usually called geometric distortion. In addition, there are other factors, such as the instability of the camera imaging process and the quantization deviation caused by the low image resolution. Thus, there is a complex nonlinear relationship between the object points in the image and the corresponding points in the World Coordinate System. Because of the existence of these distortions, the calibration coefficients of different image zones even in one direction are different [14,15].

In the process of two-dimensional images, there is nonlinear deformation in different degrees, which is usually called geometric distortion. In addition, there are other factors, such as the instability of the camera imaging process and the quantization deviation caused by the low image resolution. Thus, there is a complex nonlinear relationship between the object points in the image and the corresponding points in the World Coordinate System. Because of the existence of these distortions, the calibration coefficients of Figure 3 shows the relationship between the camera coordinate system and the World Coordinate System. Let *p* be a point in the field of camera view. The homogeneous coordinates of point *p* in the camera coordinate system and the World Coordinate System are (*X*C, *Y*C, *Z*C, 1) and (*X*W, *Y*W, *Z*W, 1), respectively. The homogeneous transformation relationship between the World Coordinate System and pixel image coordinate system is as follows:

$$Z\_{\varepsilon} \begin{bmatrix} u \\ v \\ 1 \end{bmatrix} = \begin{bmatrix} f\_u & 0 & u\_0 & 0 \\ 0 & f\_v & v\_0 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} \begin{pmatrix} \mathbf{R} & \mathbf{t} \\ \mathbf{0}^\mathrm{T} & 1 \end{pmatrix} \begin{bmatrix} \mathbf{X}\_W \\ \mathbf{Y}\_W \\ Z\_W \\ 1 \end{bmatrix} = \mathbf{M}\_1 \mathbf{M}\_2 \begin{bmatrix} \mathbf{X}\_W \\ \mathbf{Y}\_W \\ Z\_W \\ 1 \end{bmatrix} \tag{1}$$

**Parameters**

relationship between the World Coordinate System and pixel image coordinate system is as follows: = = 0 1 0 0 0 0 0 0 *W W W W W W v u <sup>c</sup> Z Y X Z Y X f v f u v u Z* **M1M2 R t** <sup>T</sup> (1) where **R** is a 3 × 3 rotation matrix, **t** is a 3 × 1 translation matrix, **M<sup>1</sup>** is the inner camera parameter matrix, **M**<sup>2</sup> is the outer camera parameter matrix, *f<sup>u</sup>* and *f<sup>v</sup>* are the equivalent focal lengths in *x* and *y* directions, (*u*0, *v*0) represents the coordinate of the main point on the camera. The space point *p* in the camera coordinate system is set as *p*(*X*C, *Y*C, *Z*C). Suppose that the projected coordinates of point *p* normalized are *p*(*xn*, *yn*), and the projected coordinates of point *p* after adding distortion are *p*(*x<sup>d</sup>* , *y<sup>d</sup>* ) [16]; then, the relationship is as follows:

the camera. The space point *p* in the camera coordinate system is set as *p*(*X*C, *Y*C, *Z*C). Suppose that the projected coordinates of point *p* normalized are *p*(*xn*, *yn*), and the pro-

$$\mathbf{x}\_d = \mathbf{x}\_n(1 + k\_1(\mathbf{x}\_n^2 + y\_n^2) + k\_2(\mathbf{x}\_n^2 + y\_n^2)^2) \tag{2}$$

$$y\_d = y\_n(1 + k\_1(\mathbf{x}\_n^2 + y\_n^2) + k\_2(\mathbf{x}\_n^2 + y\_n^2)^2) \tag{3}$$

focal lengths in *x* and *y* directions, (*u*0, *v*0) represents the coordinate of the main point on where *k*1, *k*<sup>2</sup> are radial distortion coefficients.

1

where *k*1, *k*2 are radial distortion coefficients.

ship is as follows:

**Figure 3.** Relationship between the camera coordinate system and the World Coordinate System. **Figure 3.** Relationship between the camera coordinate system and the World Coordinate System.

jected coordinates of point *p* after adding distortion are *p*(*xd*, *yd*) [16]; then, the relation-

2 2

2 2

(1 ( ) ( ) ) <sup>2</sup> <sup>2</sup> <sup>2</sup> 2

(1 ( ) ( ) ) <sup>2</sup> <sup>2</sup> <sup>2</sup> 2

*<sup>d</sup> <sup>n</sup>* <sup>1</sup> *<sup>n</sup> <sup>n</sup> <sup>n</sup> <sup>n</sup> x* = *x* + *k x* + *y* + *k x* + *y* (2)

*<sup>d</sup> <sup>n</sup>* <sup>1</sup> *<sup>n</sup> <sup>n</sup> <sup>n</sup> <sup>n</sup> y* = *y* + *k x* + *y* + *k x* + *y* (3)

In order to make vision measurement more accurate, the ceramic calibration board with 1 μm possession precision is selected in this experiment. The sum of the calibration grid is 20 × 16, and the side lengths are 4 mm. The process for camera calibration includes, firstly, the collection of a calibration board image under the same condition on the form deviation measurement, such as focal length, object distance, lighting strength, and then, the collection of nine different orientation board images. The flow chart for camera calibration is shown in Figure 4. In order to make vision measurement more accurate, the ceramic calibration board with 1 µm possession precision is selected in this experiment. The sum of the calibration grid is 20 × 16, and the side lengths are 4 mm. The process for camera calibration includes, firstly, the collection of a calibration board image under the same condition on the form deviation measurement, such as focal length, object distance, lighting strength, and then, the collection of nine different orientation board images. The flow chart for camera calibration is shown in Figure 4. *Machines* **2022**, *10*, x FOR PEER REVIEW 5 of 17

**Figure 4.** Flow chart of camera calibration. **Figure 4.** Flow chart of camera calibration.

#### **3. Main Algorithms 3. Main Algorithms**

#### *3.1. Image Correction 3.1. Image Correction*

Due to deviations of camera installation and equipment assembly, the acquired part image may have a small tilt angle. When evaluating form deviations, it is necessary to obtain the element line coordinates in 360 measuring images, whose coordinate results Due to deviations of camera installation and equipment assembly, the acquired part image may have a small tilt angle. When evaluating form deviations, it is necessary to obtain the element line coordinates in 360 measuring images, whose coordinate results

are affected by the small tilt angle. This increases the detection deviation and detection complexity. In order to improve the detection accuracy and efficiency, it is necessary to

and then, the coordinates of the top and bottom edges on the workpiece image are obtained by the Canny algorithm [17]. The average data are computed as a centerline by the corresponding addition algorithm. The slope of the centerline is obtained by the least-square fitting, by which the rotation angle *θ* is obtained. Finally, the measured part image is revised by *θ*. Suppose that the point *P*0(*x*0, *y*0) rotated anticlockwise by *θ* is *P*0(*x*,

>

(4)

0 0 *y x*

0 0 1 1

θ

θ

sin cos 0 cos sin 0

The conventional sub-pixel edge detection methods include: sub-pixel edge detection by moment, sub-pixel edge detection by fitting, sub-pixel edge detection by interpolation, etc. [18,19]. The measured workpiece in this experiment is an axis, so it is assumed there will be no burrs, roughness, etc., in the edge area of the image. The top and

*y*), the coordinate point matrix expression after rotation is as follows:

=

1

*y x*

*3.2. Sub-Pixel Edge Detection Algorithm*

−

θ

θ

are affected by the small tilt angle. This increases the detection deviation and detection complexity. In order to improve the detection accuracy and efficiency, it is necessary to rectify the measured part images. We propose an image correction algorithm based on the centerline slope. Firstly, the distorted image is eliminated by camera calibration data, and then, the coordinates of the top and bottom edges on the workpiece image are obtained by the Canny algorithm [17]. The average data are computed as a centerline by the corresponding addition algorithm. The slope of the centerline is obtained by the least-square fitting, by which the rotation angle *θ* is obtained. Finally, the measured part image is revised by *θ*. Suppose that the point *P*0(*x*0, *y*0) rotated anticlockwise by *θ* is *P*0(*x*, *y*), the coordinate point matrix expression after rotation is as follows:

$$
\begin{bmatrix} x \\ y \\ 1 \end{bmatrix} = \begin{bmatrix} \cos \theta & -\sin \theta & 0 \\ \sin \theta & \cos \theta & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x\_0 \\ y\_0 \\ 1 \end{bmatrix} \tag{4}
$$

## *3.2. Sub-Pixel Edge Detection Algorithm*

The conventional sub-pixel edge detection methods include: sub-pixel edge detection by moment, sub-pixel edge detection by fitting, sub-pixel edge detection by interpolation, etc. [18,19]. The measured workpiece in this experiment is an axis, so it is assumed there will be no burrs, roughness, etc., in the edge area of the image. The top and bottom edges of the sampling image are in accordance with the image characteristics of a polynomial function. In order to realize the sub-pixel edge position, the parameters describing the edge features in the image can be obtained by establishing equations of polynomial parameters and using the principle of the least-square method [20,21].

The method used is to filter and denoise gray images and use the Otsu method to complete threshold segmentation [22]. The Canny algorithm is used to obtain the rough edges of the part image, selecting rough edges in order to turn them into a single row. An appropriate zoom is chosen, and then, the fine edges are accurately obtained by using the polynomial fitting algorithm. The edge point formula fitted by polynomial *y*(*x*) can be expressed as Equation (5):

$$y(\mathbf{x}) = a\_0 + a\_1 \mathbf{x} + a\_2 \mathbf{x}^2 + \dots + a\_m \mathbf{x}^m = \sum\_{j=0}^m a\_j \mathbf{x}^j \tag{5}$$

By calculating the quadratic sum of the least squares and making partial derivatives of *a<sup>m</sup>* equal to 0, the result is obtained.

$$F(a\_0, a\_1, \dots, a\_m) = \sum\_{i=1}^n \left[ y(x\_i) - y\_i \right]^2 \tag{6}$$

$$\frac{\partial F}{\partial a\_j} = 2 \sum\_{i=1}^{n} \left[ y(\mathbf{x}\_i) - y\_i \right] \mathbf{x}\_i^j = 0 \ (j = 0, 1, \dots, m) \tag{7}$$

By solving the above equations, the fitting polynomial coefficients can be determined.

#### *3.3. Calculation of Straightness Deviation*

#### 3.3.1. Axis of workpiece fitting

By extracting the middle line on the top pixel edges and the corresponding bottom pixel edges of a workpiece image as the central axis, the calculation is rendered simple and easy. However, if the workpiece in the image has a tilted angle or straightness deviation, the upper and the corresponding lower edge pixel edges are asymmetric, which leads to a large straightness deviation of the central axis. In order to reduce this deviation, the radial local zone search method is used to determine the position of the shaft axis.

In order to determine the coordinates of the top and bottom edges, the top edge point (*xj* , *y<sup>j</sup>* ) closest to the bottom edge point (*x<sup>i</sup>* , *y<sup>i</sup>* ) is shown in Figure 5.

$$\sqrt{(y\_i - y\_j)^2 + (\mathbf{x}\_i - \mathbf{x}\_j)^2} = \min\{H\} \tag{8}$$

**Figure 5.** Graphical demonstration of calculating pixel coordinates of the central axis. **Figure 5.** Graphical demonstration of calculating pixel coordinates of the central axis.

3.3.2. Straightness deviation algorithm The geometric center coordinates of the workpiece axis are as follows.

$$\begin{cases} \mathbf{x} = \frac{\mathbf{x}\_{i} + \mathbf{x}\_{j}}{2} \\ \mathbf{y} = \frac{\mathbf{y}\_{i} + \mathbf{y}\_{j}}{2} \end{cases} \tag{9}$$

minimum zone method [25] is needed to search for the minimum value of the distance between two parallel lines containing the measured contours according to the minimum condition principle. So, an enveloped line searching algorithm is proposed to obtain the straightness deviation. The algorithm is discussed below. To decrease computing time, extract each *n* point on the left and right of the bottom edges corresponding relatively to the abscission of the top edge point, which is a total of 2*n* points. According to Equations (8) and (9), the geometric coordinates of a workpiece axis are obtained. Then, the axis of the part is estimated. **Figure 5.** Graphical demonstration of calculating pixel coordinates of the central axis.

The least-square method is used to obtain the baseline *L*1, as shown in Figure 6, and

#### the linear equation is set as 3.3.2. Straightness deviation algorithm 3.3.2. Straightness deviation algorithm

*y* = *k*1*x* + *m* (10) The straightness deviation according to ISO 1101 is the difference between the largest and smallest distances between the workpiece line and the reference line. According to ISO 1101, the form tolerance zone has the direction of the minimum [23,24]. The minimum zone method [25] is needed to search for the minimum value of the distance between two parallel lines containing the measured contours according to the minimum condition principle. So, an enveloped line searching algorithm is proposed to obtain the straightness deviation. The algorithm is discussed below. The straightness deviation according to ISO 1101 is the difference between the largest and smallest distances between the workpiece line and the reference line. According to ISO 1101, the form tolerance zone has the direction of the minimum [23,24]. The minimum zone method [25] is needed to search for the minimum value of the distance between two parallel lines containing the measured contours according to the minimum condition principle. So, an enveloped line searching algorithm is proposed to obtain the straightness deviation. The algorithm is discussed below.

The least-square method is used to obtain the baseline *L*1, as shown in Figure 6, and the linear equation is set as The least-square method is used to obtain the baseline *L*1, as shown in Figure 6, and the linear equation is set as

$$y = k\_1 \mathbf{x} + m \tag{10}$$

point *P*2 is determined.

the expression below.

In order to calculate *P*2, let

where *a* is the minimum value. Calculate the corresponding intercept based on *ki* using **Figure 6.** Graphical demonstration of enveloped line search algorithm. **Figure 6.** Graphical demonstration of enveloped line search algorithm.

the expression below. *<sup>P</sup>*<sup>1</sup> *<sup>P</sup>*<sup>1</sup> *<sup>i</sup> <sup>i</sup> m* = −*k x* + *y* (12) In order to calculate *P*2, let Regarding baseline *L*2 as the boundary, all sampling points are divided into two category points, i.e., high points and low points, from which the farthest point *P*1 is found. Serving *P*1 as the base point, a line *L*2 is generated with the slope *k*1. By changing the slope of line *L*2, the sampling points are located below or on the line, and the critical Regarding baseline *L*<sup>2</sup> as the boundary, all sampling points are divided into two category points, i.e., high points and low points, from which the farthest point *P*<sup>1</sup> is found. Serving *P*<sup>1</sup> as the base point, a line *L*<sup>2</sup> is generated with the slope *k*1. By changing the slope of line *L*2, the sampling points are located below or on the line, and the critical point *P*<sup>2</sup> is determined.

All coordinates of the measured points, except *P*1, are substituted into Equation (13),

All coordinates of the measured points, except *P*1, are substituted into Equation (13), and the sampling points are calculated when *ki* varies. In theory, when *W* is zero, *P*2 is obtained. However, in an actual situation, by setting small step size *a*, *P*2 appears between

$$k\_i = k\_1 + a \tag{11}$$

*<sup>P</sup>*<sup>1</sup> *<sup>P</sup>*<sup>1</sup> *<sup>i</sup> <sup>i</sup> m* = −*k x* + *y* (12)

*W k x m y* = *<sup>i</sup>* + *<sup>i</sup>* − (13)

two scanning lines. In this case, the following requirement should be met:

two scanning lines. In this case, the following requirement should be met:

where *a* is the minimum value. Calculate the corresponding intercept based on *k<sup>i</sup>* using the expression below. min{ } *k x* + *m* − *y* < 0 *<sup>i</sup> <sup>i</sup>* (14) The enveloped line *y* = *ki x* + *m*1 is confirmed by two points, *P*1 and *P*2, and then, the

*Machines* **2022**, *10*, x FOR PEER REVIEW 8 of 17

$$m\_l = -k\_l \mathbf{x} P\_1 + \mathbf{y} P\_1 \tag{12}$$

In order to calculate *P*2, let At this point, the three points, *P*1, *P*2, and *P*3, are satisfied with the 'high-low-high' rule criterion of the minimum zone. The straightness deviation is calculated by the distance between the two enveloped lines.

$$\mathcal{W} = k\_i \mathfrak{x} + m\_i - y$$

All coordinates of the measured points, except *P*1, are substituted into Equation (13), and the sampling points are calculated when *k<sup>i</sup>* varies. In theory, when *W* is zero, *P*<sup>2</sup> is obtained. However, in an actual situation, by setting small step size *a*, *P*<sup>2</sup> appears between two scanning lines. In this case, the following requirement should be met: 1 <sup>2</sup> *d*<sup>3</sup> = *m*<sup>1</sup> − *m*<sup>2</sup> *k* + (15) In the same way, search for the bottom line and three points of the 'low-high-low' criterion to satisfy the minimum zone. The distance of a pair of enveloped lines is also obtained after calculation, according to the similar steps above. The minimum distance

$$\min\{k\_i \mathbf{x} + m\_i - y\} < 0\tag{14}$$

The enveloped line *y* = *k<sup>i</sup> x* + *m*<sup>1</sup> is confirmed by two points, *P*<sup>1</sup> and *P*2, and then, the minimum enveloped line *y* = *k<sup>i</sup> x* + *m*<sup>2</sup> is parallel to the line through the farthest point *P*3. At this point, the three points, *P*1, *P*2, and *P*3, are satisfied with the 'high-low-high' rule criterion of the minimum zone. The straightness deviation is calculated by the distance between the two enveloped lines. *3.4. Calculation of Roundness Deviation*  3.4.1. Three-dimensional reconstruction by monocular camera The workpiece three-dimensional coordinate system *xoyz* is seen in Figure 7. Let the initial position angle be 0°; the point coordinates on the workpiece contour surface collected by the camera are (*x*1, *y*1, *z*1), and the rotating *β* point *A* on the workpiece is moved

$$d\_3 = |m\_1 - m\_2| / \sqrt{k^2 + 1} \tag{15}$$

In the same way, search for the bottom line and three points of the 'low-high-low' criterion to satisfy the minimum zone. The distance of a pair of enveloped lines is also obtained after calculation, according to the similar steps above. The minimum distance value of the two results obtained will be used as the straightness deviation. *y*<sup>1</sup> = *AO*⋅ cos0 (16) *z*<sup>1</sup> = *AO* ⋅sin 0 (17)

## *3.4. Calculation of Roundness Deviation*

#### 3.4.1. Three-Dimensional Reconstruction by Monocular Camera *y*<sup>2</sup> = *BO*⋅ cosβ(18)

The workpiece three-dimensional coordinate system *xoyz* is seen in Figure 7. Let the initial position angle be 0◦ ; the point coordinates on the workpiece contour surface collected by the camera are (*x*1, *y*1, *z*1), and the rotating *β* point *A* on the workpiece is moved to point *B*, whose coordinate is (*x*2, *y*2, *z*2). According to the geometric relationship, as shown in Figures 7 and 8, the relationship is as follows: *z*<sup>2</sup> = *BO*⋅sin β (19) <sup>1</sup> <sup>2</sup> *x* = *x* (20) Among them, *AO* is distance between point *A* and the workpiece axis. The work-

$$y\_1 = AO \cdot \cos 0^\circ \tag{16}$$

$$z\_1 = AO \cdot \sin 0^\circ \tag{17}$$

$$\mathbf{z}\_2 = \mathbf{BO} \cdot \sin \beta \tag{19}$$

$$\mathbf{y}\_1 = \mathbf{y}\_2 \tag{100}$$

$$\mathfrak{x}\_1 = \mathfrak{x}\_2 \tag{20}$$

**Figure 7. Figure 7.**  Position relation of camera and workpiece in the measuring coordinate. Position relation of camera and workpiece in the measuring coordinate.

**Figure 8.** Graphical demonstration of the axis section acquisition point. **Figure 8.** Graphical demonstration of the axis section acquisition point.

3.4.2. Roundness deviation algorithm The roundness deviation according to ISO 1101 is the difference between the largest and smallest radial distance of the workpiece circumference from the reference circle Among them, *AO* is distance between point *A* and the workpiece axis. The workpiece contour information is collected by the camera through the workpiece rotation, and the 3D contour model of the workpiece surface is established by the camera.

[23,24]. There are four commonly used methods for evaluating roundness deviation, which are the minimum zone circle method, the minimum circumscribed circle method, the maximum inner circumscribed circle method, and the least-square circle method [26,27]. The minimum zone method is an evaluation method in accordance with the definition, but it is difficult to solve directly because it is a nonlinear problem, and it is complicated to calculate the collected data [28]. Due to the installation eccentricity of the workpiece, the circle center of a certain section workpiece is changed. In order to eliminate the eccentricity deviation, the half distance between the top and bottom edge is used as a radius value, that is, *AO* = |*y*<sup>1</sup> <sup>0</sup>−*y*1|/2, so the radius of the corresponding positions under other rotation angles can be obtained. The radius under every *x* position can be determined on the corresponding circle, so as to realize the three-dimensional reconstruction of the workpiece contour. **Figure 8.** Graphical demonstration of the axis section acquisition point. 3.4.2. Roundness deviation algorithm The roundness deviation according to ISO 1101 is the difference between the largest and smallest radial distance of the workpiece circumference from the reference circle [23,24]. There are four commonly used methods for evaluating roundness deviation,

#### As shown in Figure 9, assuming that (*xi*, *yi*) are the measured coordinates on the 3.4.2. Roundness Deviation Algorithm which are the minimum zone circle method, the minimum circumscribed circle method, the maximum inner circumscribed circle method, and the least-square circle method

actual contour of the workpiece, and (*xk*, *yk*) are the center coordinates of the minimum zone method to be solved, then the distance *Hik* from the measured point to the center is <sup>2</sup> <sup>2</sup> ( ) ( ) *ik <sup>i</sup> <sup>k</sup> <sup>i</sup> <sup>k</sup> H* = *x* − *x* + *y* − *y* (21) The objective function *F* to be optimized is max( ) min( ) *F* = *Hik* − *Hik* (22) The roundness deviation according to ISO 1101 is the difference between the largest and smallest radial distance of the workpiece circumference from the reference circle [23,24]. There are four commonly used methods for evaluating roundness deviation, which are the minimum zone circle method, the minimum circumscribed circle method, the maximum inner circumscribed circle method, and the least-square circle method [26,27]. The minimum zone method is an evaluation method in accordance with the definition, but it is difficult to solve directly because it is a nonlinear problem, and it is complicated to calculate the collected data [28]. [26,27]. The minimum zone method is an evaluation method in accordance with the definition, but it is difficult to solve directly because it is a nonlinear problem, and it is complicated to calculate the collected data [28]. As shown in Figure 9, assuming that (*xi*, *yi*) are the measured coordinates on the actual contour of the workpiece, and (*xk*, *yk*) are the center coordinates of the minimum zone method to be solved, then the distance *Hik* from the measured point to the center is <sup>2</sup> <sup>2</sup> ( ) ( ) *ik <sup>i</sup> <sup>k</sup> <sup>i</sup> <sup>k</sup> H* = *x* − *x* + *y* − *y* (21)

What needs to be solved is how to determine the value of (*xk*, *yk*), so that *F* is the minimum. When *F* = *f*, *f* is the roundness deviation. As shown in Figure 9, assuming that (*x<sup>i</sup>* , *y<sup>i</sup>* ) are the measured coordinates on the actual contour of the workpiece, and (*x<sup>k</sup>* , *y<sup>k</sup>* ) are the center coordinates of the minimum zone method to be solved, then the distance *Hik* from the measured point to the center is The objective function *F* to be optimized is max( ) min( ) *F* = *Hik* − *Hik* (22)

$$H\_{ik} = \sqrt{\left(\mathbf{x}\_i - \mathbf{x}\_k\right)^2 + \left(y\_i - y\_k\right)^2} \tag{21}$$

lows:

this paper, the PSO algorithm of synchronously changing learning factors is used to solve roundness. This algorithm has clear advantages in optimization accuracy and conver-**Figure 9.** Schematic of roundness deviation evaluation. **Figure 9.** Schematic of roundness deviation evaluation.

gence speed. The synchronous learning factor refers to setting the range of learning factors *c*1 and Particle swarm optimization (PSO) is an intelligent optimization algorithm pro-The objective function *F* to be optimized is

minimum. When *F* = *f*, *f* is the roundness deviation.

$$F = \max(H\_{i\bar{k}}) - \min(H\_{i\bar{k}}) \tag{22}$$

*t*

1 2 max (23)

*t c c*

max max min

*t c c <sup>c</sup> <sup>c</sup> <sup>c</sup>* <sup>⋅</sup> <sup>−</sup> <sup>=</sup> <sup>=</sup> <sup>−</sup> max min 1 2 max (23) roundness. This algorithm has clear advantages in optimization accuracy and convergence speed. What needs to be solved is how to determine the value of (*x<sup>k</sup>* , *y<sup>k</sup>* ), so that *F* is the minimum. When *F* = *f*, *f* is the roundness deviation.

*t* max The synchronous learning factor refers to setting the range of learning factors *c*1 and *c*2 as [*c*min, *c*max], and the value formula of the learning factor in the *t*-th iteration is as follows: Particle swarm optimization (PSO) is an intelligent optimization algorithm proposed by Kennedy and Eberhart in 1995, inspired by the movement of flock birds [29]. In this paper,

*<sup>c</sup> <sup>c</sup> <sup>c</sup>* <sup>⋅</sup> <sup>−</sup> <sup>=</sup> <sup>=</sup> <sup>−</sup>

the PSO algorithm of synchronously changing learning factors is used to solve roundness. This algorithm has clear advantages in optimization accuracy and convergence speed.

The synchronous learning factor refers to setting the range of learning factors *c*<sup>1</sup> and *c*<sup>2</sup> as [*c*min, *c*max], and the value formula of the learning factor in the *t*-th iteration is as follows:

$$c\_1 = c\_2 = c\_{\text{max}} - \frac{c\_{\text{max}} - c\_{\text{max}}}{t\_{\text{max}}} \cdot t \tag{23}$$

The algorithm flow chart is shown in Figure 10 as follows. The algorithm flow chart is shown in Figure 10 as follows.

*Machines* **2022**, *10*, x FOR PEER REVIEW 10 of 17

**Figure 10.** Improved PSO flow chart. **Figure 10.** Improved PSO flow chart.

3.4.3. Cylindricity deviation algorithm 3.4.3. Cylindricity Deviation Algorithm

The cylindricity deviation according to ISO 1101 is the difference between the largest and smallest radial distances of the workpiece surface from the reference [23,24]. According to the form deviation evaluation principle, when the actual cylindrical surface is compared with the ideal surface, the minimum enveloped zone should be determined according to the actual cylindrical surface. When the actual surface is tightly contained by two identical co-axial cylindrical surfaces, between which the radius difference is the The cylindricity deviation according to ISO 1101 is the difference between the largest and smallest radial distances of the workpiece surface from the reference [23,24]. According to the form deviation evaluation principle, when the actual cylindrical surface is compared with the ideal surface, the minimum enveloped zone should be determined according to the actual cylindrical surface. When the actual surface is tightly contained by two identical co-axial cylindrical surfaces, between which the radius difference is the minimum, it is the minimum enveloped zone.

minimum, it is the minimum enveloped zone. In this paper, a method of spatial cylindricity deviation detection is proposed based on the PSO and the least-square algorithm. Suppose that the circle center coordinate of each cross-section in Figure 11 is obtained by the improved particle swarm algorithm. According to the circle center coordinates, the space axis is fitted by the least-square algorithm. Assume that *E*1 and *E*2 are the points with the largest and smallest distances, respectively, from the measured contour points on the fitted straight line. The cylindricity deviation *d*2 can be expressed as the difference between the maximum distance In this paper, a method of spatial cylindricity deviation detection is proposed based on the PSO and the least-square algorithm. Suppose that the circle center coordinate of each cross-section in Figure 11 is obtained by the improved particle swarm algorithm. According to the circle center coordinates, the space axis is fitted by the least-square algorithm. Assume that *E*<sup>1</sup> and *E*<sup>2</sup> are the points with the largest and smallest distances, respectively, from the measured contour points on the fitted straight line. The cylindricity deviation *d*<sup>2</sup> can be expressed as the difference between the maximum distance and the minimum distance from the measured contour points to the spatial axis.

and the minimum distance from the measured contour points to the spatial axis.

$$d\_2 = d\_{\text{max}} - d\_{\text{min}} \tag{24}$$

calibration plate is as shown in Figure 13.

The algorithm flow chart is shown in Figure 10 as follows.

**Figure 11. Figure 11.** Schematic of the space axis fitting. Schematic of the space axis fitting.

#### **4. Experiment and Results Analysis 4. Experiment and Results Analysis**

**Figure 10.** Improved PSO flow chart.

3.4.3. Cylindricity deviation algorithm

minimum, it is the minimum enveloped zone.

#### *4.1. Calibration Results 4.1. Calibration Results*  **4. Experiment and Results Analysis**

Camera calibration is performed before image collection. A total of nine images are collected, as shown in Figure 12, for calibration. The corner detection result of the calibration plate is as shown in Figure 13. Camera calibration is performed before image collection. A total of nine images are collected, as shown in Figure 12, for calibration. The corner detection result of the calibration plate is as shown in Figure 13. *4.1. Calibration Results*  Camera calibration is performed before image collection. A total of nine images are collected, as shown in Figure 12, for calibration. The corner detection result of the

The cylindricity deviation according to ISO 1101 is the difference between the largest and smallest radial distances of the workpiece surface from the reference [23,24]. According to the form deviation evaluation principle, when the actual cylindrical surface is compared with the ideal surface, the minimum enveloped zone should be determined according to the actual cylindrical surface. When the actual surface is tightly contained by two identical co-axial cylindrical surfaces, between which the radius difference is the

In this paper, a method of spatial cylindricity deviation detection is proposed based on the PSO and the least-square algorithm. Suppose that the circle center coordinate of each cross-section in Figure 11 is obtained by the improved particle swarm algorithm. According to the circle center coordinates, the space axis is fitted by the least-square algorithm. Assume that *E*1 and *E*2 are the points with the largest and smallest distances, respectively, from the measured contour points on the fitted straight line. The cylindricity deviation *d*2 can be expressed as the difference between the maximum distance

<sup>2</sup> max min *d* = *d* − *d* (24)

and the minimum distance from the measured contour points to the spatial axis.

**Figure 12.** Calibration plate image. **Figure 12.** Calibration plate image. **Figure 12.** Calibration plate image.

respectively.

respectively.

**Figure 13.** Corner detection of the calibration plate. **Figure 13.** Corner detection of the calibration plate.

rameters and distortion matrix are obtained as follows: [ ] [ 0.0868 0.0127] *k*<sup>1</sup> *k*<sup>2</sup> = − The camera is calibrated according to the flow chart in Figure 4, and the inner parameters and distortion matrix are obtained as follows: The camera is calibrated according to the flow chart in Figure 4, and the inner parameters and distortion matrix are obtained as follows:

The camera is calibrated according to the flow chart in Figure 4, and the inner pa-

$$\begin{bmatrix} k\_1 \ k\_2 \end{bmatrix} = \begin{bmatrix} -0.0868 & 0.0127 \end{bmatrix}$$

$$M\_1 = \begin{vmatrix} 5395.86 & 0 & 2749.23 \\ 0 & 5394.83 & 1809.22 \\ 0 & 0 & 1 \end{vmatrix}$$

0 0 1

0 0 1

Extract subpixel image corrected angular coordinates,. The pixel distance between the adjacent corner point is obtained as *h*. Internal and external calibration parameters are used to calculate the sub-pixel corner coordinates in the image. Assume the distance between the adjacent corner points is *M*, according to the pixel distance, the ratio of the 0 0 1 Extract subpixel image corrected angular coordinates,. The pixel distance between the adjacent corner point is obtained as *h*. Internal and external calibration parameters are used to calculate the sub-pixel corner coordinates in the image. Assume the distance Extract subpixel image corrected angular coordinates,. The pixel distance between the adjacent corner point is obtained as *h*. Internal and external calibration parameters are used to calculate the sub-pixel corner coordinates in the image. Assume the distance between the adjacent corner points is *M*, according to the pixel distance, the ratio of the proportion

proportion relation coefficient *k* is calculated out, which is shown in Equation (25). The values *k* in the horizontal direction and vertical direction are 30.32 μm and 30.44 μm,

between the adjacent corner points is *M*, according to the pixel distance, the ratio of the proportion relation coefficient *k* is calculated out, which is shown in Equation (25). The values *k* in the horizontal direction and vertical direction are 30.32 μm and 30.44 μm,

*h*

*h*

After calibration, the measured workpiece is clamped by the three-jaw chuck, and the other end of the part is held by the tail. The *X*, *Y*-direction linear electrokinetic displacement stages are moved to the initial position of the camera, and the measured workpiece is moved to the focal plane of the camera lens by controlling the *Z*-direction linear electrokinetic displacement stage. When the workpiece is rotated by 1°, an image of the workpiece is acquired by the camera. A total of 360 images are obtained and stored

After calibration, the measured workpiece is clamped by the three-jaw chuck, and the other end of the part is held by the tail. The *X*, *Y*-direction linear electrokinetic displacement stages are moved to the initial position of the camera, and the measured workpiece is moved to the focal plane of the camera lens by controlling the *Z*-direction linear electrokinetic displacement stage. When the workpiece is rotated by 1°, an image of the workpiece is acquired by the camera. A total of 360 images are obtained and stored

*<sup>M</sup> <sup>k</sup>* <sup>=</sup> (25)

*<sup>M</sup> <sup>k</sup>* <sup>=</sup> (25)

relation coefficient *k* is calculated out, which is shown in Equation (25). The values *k* in the horizontal direction and vertical direction are 30.32 µm and 30.44 µm, respectively.

$$k = \frac{M}{h} \tag{25}$$

After calibration, the measured workpiece is clamped by the three-jaw chuck, and the other end of the part is held by the tail. The *X*, *Y*-direction linear electrokinetic displacement stages are moved to the initial position of the camera, and the measured workpiece is moved to the focal plane of the camera lens by controlling the *Z*-direction linear electrokinetic displacement stage. When the workpiece is rotated by 1◦ , an image of the workpiece is acquired by the camera. A total of 360 images are obtained and stored in the computer. Before image pre-processing, the image is corrected by the methods described in Section 3.1. Figure 14 is the collected original workpiece image, and Figure 15 is the corrected workpiece image. *Machines* **2022**, *10*, x FOR PEER REVIEW 12 of 17 in the computer. Before image pre-processing, the image is corrected by the methods described in Section 3.1. Figure 14 is the collected original workpiece image, and Figure 15 is the corrected workpiece image. *Machines* **2022**, *10*, x FOR PEER REVIEW 12 of 17 in the computer. Before image pre-processing, the image is corrected by the methods 15 is the corrected workpiece image.

**Figure 14.** Original workpiece image. **. Figure 14.** Original workpiece image. **Figure 14.** Original workpiece image. **.**

**Figure 15.** Workpiece image after correction. **Figure 15.** Workpiece image after correction. **Figure 15.** Workpiece image after correction.

#### *4.2. Image Pre-Processing 4.2. Image Pre-Processing 4.2. Image Pre-Processing*

mial fitting algorithm, as shown in Figure 16e.

Since the measurement of the form deviation is only related to the edges, the complex background and noise are present in the collected images. It is necessary to carry out pre-processing, such as region of interest (ROI) extraction, filtering, and image enhancement, to eliminate additional interference in order to precisely measure the workpiece form. When collecting the image, the workpiece, three-jaw chuck, and tailstock part are photographed, so a rectangular area is used for ROI extraction. According to the requirements of form deviation and characteristics of the workpiece image, various filters are used to deal with the same image. After comparison, Gaussian filtering is more suitable for image pre-processing for our study. The processed images are shown in Figure 16. The original workpiece image is obtained by machine vision, as shown in Figure 16a. ROI extraction is performed by a rectangular area, as shown in Figure 16b. Threshold segmentation is completed by the Otsu method, as shown in Figure 16c. Rough edges of the part image are extracted by the Canny algorithm, as shown in Figure 16d. Parts of the upper-edge sub-pixel-position fine edges are accurately obtained by using the polynomial fitting algorithm, as shown in Figure 16e. Since the measurement of the form deviation is only related to the edges, the complex background and noise are present in the collected images. It is necessary to carry out hancement, to eliminate additional interference in order to precisely measure the workpiece form. When collecting the image, the workpiece, three-jaw chuck, and tailstock part are photographed, so a rectangular area is used for ROI extraction. According to the requirements of form deviation and characteristics of the workpiece image, various filters are used to deal with the same image. After comparison, Gaussian filtering is more suitable for image pre-processing for our study. The processed images are shown in Figure 16. The original workpiece image is obtained by machine vision, as shown in Figure 16a. ROI extraction is performed by a rectangular area, as shown in Figure 16b. Threshold segmentation is completed by the Otsu method, as shown in Figure 16c. Rough edges of the part image are extracted by the Canny algorithm, as shown in Figure 16d. Parts of the Since the measurement of the form deviation is only related to the edges, the complex background and noise are present in the collected images. It is necessary to carry out preprocessing, such as region of interest (ROI) extraction, filtering, and image enhancement, to eliminate additional interference in order to precisely measure the workpiece form. When collecting the image, the workpiece, three-jaw chuck, and tailstock part are photographed, so a rectangular area is used for ROI extraction. According to the requirements of form deviation and characteristics of the workpiece image, various filters are used to deal with the same image. After comparison, Gaussian filtering is more suitable for image preprocessing for our study. The processed images are shown in Figure 16. The original workpiece image is obtained by machine vision, as shown in Figure 16a. ROI extraction is performed by a rectangular area, as shown in Figure 16b. Threshold segmentation is completed by the Otsu method, as shown in Figure 16c. Rough edges of the part image are extracted by the Canny algorithm, as shown in Figure 16d. Parts of the upper-edge subpixel-position fine edges are accurately obtained by using the polynomial fitting algorithm, as shown in Figure 16e.

*Machines* **2022**, *10*, x FOR PEER REVIEW 13 of 17

(**d**) Edge contour extracted by Canny (**e**) Part of the upper edge sub-pixel position According to the vision measurement algorithm of straightness deviation, several

**Figure 16.** Images after image processing. **Figure 16.** Images after image processing. measuring experiments are completed on the φ 20 mm × 100 mm shaft workpiece. Results of the containment line search algorithm at the rotation angle of 0° are shown in

#### *4.3. Straightness Deviation Results 4.3. Straightness Deviation Results* Figure 17. All fitting axis points are successfully contained by the two containment lines.

According to the vision measurement algorithm of straightness deviation, several measuring experiments are completed on the φ 20 mm × 100 mm shaft workpiece. Results of the containment line search algorithm at the rotation angle of 0° are shown in Figure 17. All fitting axis points are successfully contained by the two containment lines. The straightness deviation is the distance between the two lines multiplied by the calibration coefficient *k*. The results of 360 straightness measurement are shown in Figure 18, where the maximum straightness deviation is 30.18 μm, the minimum value is 4.71 μm, and the average value is 11.12 μm, respectively. According to the vision measurement algorithm of straightness deviation, several measuring experiments are completed on the ϕ 20 mm × 100 mm shaft workpiece. Results of the containment line search algorithm at the rotation angle of 0◦ are shown in Figure 17. All fitting axis points are successfully contained by the two containment lines. The straightness deviation is the distance between the two lines multiplied by the calibration coefficient *k*. The results of 360 straightness measurement are shown in Figure 18, where the maximum straightness deviation is 30.18 µm, the minimum value is 4.71 µm, and the average value is 11.12 µm, respectively. The straightness deviation is the distance between the two lines multiplied by the calibration coefficient *k*. The results of 360 straightness measurement are shown in Figure 18, where the maximum straightness deviation is 30.18 μm, the minimum value is 4.71 μm, and the average value is 11.12 μm, respectively. In Figure 18, the variation in straightness deviation is somewhat large. There are two possible reasons. Firstly, it takes about 3 min to collect 360 images from different angles, during which the image quality may be affected by an unstable illumination. Secondly, the workpiece axis is not the center of rotation. These factors affect the measured results.

Radial coordinates

**Figure 17.** Graph of straightness deviation evaluation results. **Figure 17.** Graph of straightness deviation evaluation results.

**Figure 17.** Graph of straightness deviation evaluation results. In Figure 18, the variation in straightness deviation is somewhat large. There are two possible reasons. Firstly, it takes about 3 min to collect 360 images from different angles, during which the image quality may be affected by an unstable illumination. Secondly, the workpiece axis is not the center of rotation. These factors affect the measured results.

**Figure 18.** Graph of 360 straightness deviation results. **Figure 18.** Graph of 360 straightness deviation results. *4.4. Roundness Deviation Results*

*Machines* **2022**, *10*, x FOR PEER REVIEW 14 of 17

#### *4.4. Roundness Deviation Results 4.4. Roundness Deviation Results* Since the images of the entire axis are not detected in the roundness measurement,

Since the images of the entire axis are not detected in the roundness measurement, several cross-sections in the same distance are used to calculate roundness deviation, so that the ROI region required for roundness deviation measurement is smaller than that of straightness deviation. Seven equidistance cross-section positions are selected in group A with 2000 pixels and group B with 1100 pixels in the diameter direction, and the comparison results are shown in Table 3 by using methods described in Section 3.3. Figure 19 shows the graph of the improved particle optimization algorithm (PSO) calculation results for position 1 in group A (the first position). Since the images of the entire axis are not detected in the roundness measurement, several cross-sections in the same distance are used to calculate roundness deviation, so that the ROI region required for roundness deviation measurement is smaller than that of straightness deviation. Seven equidistance cross-section positions are selected in group A with 2000 pixels and group B with 1100 pixels in the diameter direction, and the comparison results are shown in Table 3 by using methods described in Section 3.3. Figure 19 shows the graph of the improved particle optimization algorithm (PSO) calculation results for position 1 in group A (the first position). several cross-sections in the same distance are used to calculate roundness deviation, so that the ROI region required for roundness deviation measurement is smaller than that of straightness deviation. Seven equidistance cross-section positions are selected in group A with 2000 pixels and group B with 1100 pixels in the diameter direction, and the comparison results are shown in Table 3 by using methods described in Section 3.3. Figure 19 shows the graph of the improved particle optimization algorithm (PSO) calculation results for position 1 in group A (the first position).

7 12.36 13.71

Average value 13.73 13.82

**Figure 19.** Graph of the improved PSO calculation results for position 1 in group A. **Figure 19.** Graph of the improved PSO calculation results for position 1 in group A.

#### **Figure 19.** Graph of the improved PSO calculation results for position 1 in group A. *4.5. Cylindricity Deviation Results 4.5. Cylindricity Deviation Results*

*4.5. Cylindricity Deviation Results*  The number of cross-sections usually used in the measuring cylinder should be no less than 5. In this study, by the rotation angle interval of 1°, 10 cylindricity sections and 20 cylindricity sections of the parts are acquired to calculate cylindricity deviation. This calculation process is the same as the roundness deviation calculation. Data fitting results The number of cross-sections usually used in the measuring cylinder should be no less than 5. In this study, by the rotation angle interval of 1°, 10 cylindricity sections and 20 cylindricity sections of the parts are acquired to calculate cylindricity deviation. This calculation process is the same as the roundness deviation calculation. Data fitting results The number of cross-sections usually used in the measuring cylinder should be no less than 5. In this study, by the rotation angle interval of 1◦ , 10 cylindricity sections and 20 cylindricity sections of the parts are acquired to calculate cylindricity deviation. This calculation process is the same as the roundness deviation calculation. Data fitting results are shown in Figure 20; the cylindricity deviations are 26.91 µm and 29.81 µm, respectively.

The cylindricity deviation of the workpiece changes slightly with the different number of sections under the same experimental conditions. are shown in Figure 20; the cylindricity deviations are 26.91 μm and 29.81 μm, respectively. The cylindricity deviation of the workpiece changes slightly with the different number of sections under the same experimental conditions. respectively. The cylindricity deviation of the workpiece changes slightly with the different number of sections under the same experimental conditions.

are shown in Figure 20; the cylindricity deviations are 26.91 μm and 29.81 μm,

**Figure 20.** Graph fitting of workpiece axis and measured points. **Figure 20.** Graph fitting of workpiece axis and measured points. **Figure 20.** Graph fitting of workpiece axis and measured points.

*Machines* **2022**, *10*, x FOR PEER REVIEW 15 of 17

#### *4.6. Verification of Measurement Results 4.6. Verification of Measurement Results*

*4.6. Verification of Measurement Results*  In order to judge whether the measurement proposed is correct, a commercial instrument, RD602 cylindricity measuring instrument, is used to measure the same workpiece, as shown in Figure 21. RD602 cylindricity measuring instrument has a high precision, with the deviation of less than 0.5 μm at full working motion, which is used to verify the accuracy of the on-line measurement system. The repeatability of this instrument In order to judge whether the measurement proposed is correct, a commercial instrument, RD602 cylindricity measuring instrument, is used to measure the same workpiece, as shown in Figure 21. RD602 cylindricity measuring instrument has a high precision, with the deviation of less than 0.5 µm at full working motion, which is used to verify the accuracy of the on-line measurement system. The repeatability of this instrument is 0.2 µm. The comparison results of form deviation are shown in Table 4. In order to judge whether the measurement proposed is correct, a commercial instrument, RD602 cylindricity measuring instrument, is used to measure the same workpiece, as shown in Figure 21. RD602 cylindricity measuring instrument has a high precision, with the deviation of less than 0.5 μm at full working motion, which is used to verify the accuracy of the on-line measurement system. The repeatability of this instrument is 0.2 μm. The comparison results of form deviation are shown in Table 4.

**Figure 21.** Workpiece form deviation measurement by cylindricity measuring instrument RD602. **Figure 21.** Workpiece form deviation measurement by cylindricity measuring instrument RD602. **Figure 21.** Workpiece form deviation measurement by cylindricity measuring instrument RD602.

**Table 4.** Comparison of deviation results. **Table 4.** Comparison of deviation results. **Table 4.** Comparison of deviation results.

Through some experiments, the standard deviations of straightness, roundness, and cylindricity measured by this instrument are 0.52, 0.31, and 1.56, respectively. From the comparison results shown in Table 4, it can be concluded that the straightness, roundness, and cylindricity deviations of the form deviation measurement system are −4.69 μm,3.87 μm, and 8.51 μm, respectively. The various form deviation values were measured accurately, which can reach the measurement accuracy of commonly used Through some experiments, the standard deviations of straightness, roundness, and cylindricity measured by this instrument are 0.52, 0.31, and 1.56, respectively. From the comparison results shown in Table 4, it can be concluded that the straightness, roundness, and cylindricity deviations of the form deviation measurement system are −4.69 μm,3.87 μm, and 8.51 μm, respectively. The various form deviation values were measured accurately, which can reach the measurement accuracy of commonly used Through some experiments, the standard deviations of straightness, roundness, and cylindricity measured by this instrument are 0.52, 0.31, and 1.56, respectively. From the comparison results shown in Table 4, it can be concluded that the straightness, roundness, and cylindricity deviations of the form deviation measurement system are −4.69 µm, 3.87 µm, and 8.51 µm, respectively. The various form deviation values were measured accurately, which can reach the measurement accuracy of commonly used three-coordinate measuring machine and provides a reference for testing form deviation in production. When calculating the straightness deviation, in order to use less time, it is not necessary to

Cylindricity 21.30 29.81 8.51

calculate the 360 data values. Instead, the rotation angle can be appropriately increased to reduce the calculation. When calculating cylindricity, about 20 sections can be selected, which can be time saving and efficient, satisfying the accuracy requirements.

## **5. Conclusions**

In this paper, a new workpiece form deviation measurement method based on machine vision is presented for the measurement of straightness, roundness, and cylindricity of a workpiece. An image acquisition system for obtaining images of shaft workpiece is developed. Edge detection technology and sub-pixel edge positioning technology are used to extract the edge information. A subsumed line search algorithm and an improved particle swarm optimization algorithm are proposed to evaluate the straightness and roundness deviations of the workpiece. Moreover, a method of spatial cylindricity deviation solution based on an improved synchronous PSO algorithm is proposed. The results of straightness, roundness, and cylindricity deviations of the workpiece are obtained by the above algorithms. Their standard deviations are 0.52, 0.31, and 1.56, respectively, implying consistency in the measurement. From the contrast experiments, the differences of straightness, roundness, and cylindricity deviations of the form deviation measurement system are −4.69 µm, 3.87 µm, and 8.51 µm, respectively, which are comparable to the traditional measurement methods. Therefore, the proposed method meets the precision requirements and is applicable for non-contact measurement, which has the advantages in measuring vulnerably scratched workpieces and in quickly obtaining form outlines of the workpieces. The proposed method would provide a viable industrial solution for the measurement of form deviations.

**Author Contributions:** Conceptualization, W.Z. and Z.H.; Data curation, Z.H. and Y.L.; Formal analysis, H.Z. and X.C.; Funding acquisition, H.Z.; Investigation, Y.L.; Methodology, W.Z.; Project administration, H.Z.; Resources, Z.H.; Validation, W.Z. and X.C.; Writing—original draft, W.Z. and Z.H. All authors have read and agreed to the published version of the manuscript.

**Funding:** The paper is financially supported by the National Key Research and Development Program of China (2022YFE0199100) and the Natural Science Foundation of Shandong Province (ZR2020ME164, ZR2016FL15).

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

## *Article* **An Improved Automation System for Destructive and Visual Measurements of Cross-Sectional Geometric Parameters of Microdrills**

**Wen-Tung Chang \* and Yu-Yun Lu**

Department of Mechanical and Mechatronic Engineering, National Taiwan Ocean University, Keelung 20224, Taiwan

**\*** Correspondence<EMAIL_ADDRESS>
**Abstract:** Microdrills are specific cutting tools widely used to drill microholes and microvias. For certain microdrill manufacturers, a conventional sampling inspection procedure is still manually operated for carrying out the destructive and visual measurements of two essential cross-sectional geometric parameters (CSGPs), called the cross-sectional web thickness (CSWT) and the crosssectional outer diameter (CSOD), of their straight (ST) and undercut (UC) type microdrill products. In order to comprehensively automate the conventional sampling inspection procedure, a destructive and visual measuring system improved from an existing vision-aided automation system, for both the hardware and the automated measuring process (AMP), is presented in this paper. The major improvement of the hardware is characterized by a machine vision module consisting of several conventional machine vision components in combination with an innovative and lower cost optical subset formed by a set of plano-concave achromatic (PCA) lenses and a reflection mirror, so that the essential functions of visually positioning the drilltip and visually measuring the CSGPs can both be achieved via the use of merely one machine vision module. The major improvement of the AMP is characterized by the establishment of specific image processing operations for an autofocusing (AF) sub-process based on two-dimensional discrete Fourier transform (2D-DFT), for a web thickness measuring (WTM) sub-process based on an iterative least-square (LS) circle-fitting approach, and for an outer diameter measuring (ODM) sub-process based on integrated applications of an iterative LS circle-fitting approach and an LS line-fitting-based group-dividing approach, respectively. Experiments for measuring the CSGPs of microdrill samples were conducted to evaluate the actual effectiveness of the developed system. It showed that the developed system could achieve good repeatability and accuracy for the measurements of the CSWTs and CSODs of both ST and UC type microdrills. Therefore, the developed system could effectively and comprehensively automate the conventional sampling inspection procedure.

**Keywords:** microdrill; cross-sectional geometric parameter (CSGP); cross-sectional web thickness (CSWT); cross-sectional outer diameter (CSOD); automation system; image processing operations; destructive and visual measurement

### **1. Introduction**

Microdrilling processes, based on mechanical and laser microdrilling techniques, have been widely adopted by printed circuit board (PCB) industries for the mass production of microholes and microvias in single- and multi-layer PCBs [1–3]. Mechanical microdrilling is based on the fundamentals of conventional cutting processes [4–16] and the use of specific cutting tools called microdrills to drill microholes and microvias. As compared with laser microdrilling, higher hole quality and lower equipment cost are the advantages of mechanical microdrilling, although such a conventional cutting process may also lead to slightly lower positioning accuracy and drilling efficiency. Therefore, microdrills are necessary and high-demand consumables for PCB industries, and superior design, rapid

**Citation:** Chang, W.-T.; Lu, Y.-Y. An Improved Automation System for Destructive and Visual Measurements of Cross-Sectional Geometric Parameters of Microdrills. *Machines* **2023**, *11*, 581. https:// doi.org/10.3390/machines11060581

Academic Editors: Raul D. S. G. Campilho and Francisco J. G. Silva

Received: 12 April 2023 Revised: 13 May 2023 Accepted: 14 May 2023 Published: 23 May 2023

**Copyright:** © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

and precision manufacture, and reliable inspection techniques must be involved for their mass production. sign, rapid and precision manufacture, and reliable inspection techniques must be involved for their mass production. Nowadays, commercially available microdrill products can be classified into the

also lead to slightly lower positioning accuracy and drilling efficiency. Therefore, microdrills are necessary and high-demand consumables for PCB industries, and superior de-

Machines 2023, 11, x FOR PEER REVIEW 2 of 34

Nowadays, commercially available microdrill products can be classified into the straight (ST) and undercut (UC) type microdrills, as shown by the illustrations depicted in Figure 1. Each type of microdrill can be functionally divided into two main portions: the drill body and the shank. (Note that for the purpose of clarity of illustration, the drill body of each microdrill depicted in Figure 1 is exaggerated.) The drill body, usually with a nominal diameter under 0.5 mm, can be further functionally divided into two sub-portions: the drill point and the helical flutes. The drill point, with the geomety of a so-called fourfacet chisel point [2,4,5], is designed to produce cutting action inside the PCB (i.e., the workpiece). The helical flutes are designed to provide screw-shaped passageways for chip removal. The main difference between the ST and UC type microdrills is that the drill body of an ST type one has a diametral continuity along its axial direction, but that of a UC type one has a diametral discontinuity occurring at a certain axial location. The drill body of a UC type microdrill, besides its front portion adjacent to the drill point, is further ground to yield a smaller outer diameter, called an undercut diameter. The design of an undercut diameter is to largely reduce the extent of friction and heat generation caused by the surfaces of the drill body rubbing against the hole walls, which is especially suitable for producing microholes and microvias, with diameters under 0.25 mm, in multi-layer PCBs. straight (ST) and undercut (UC) type microdrills, as shown by the illustrations depicted in Figure 1. Each type of microdrill can be functionally divided into two main portions: the drill body and the shank. (Note that for the purpose of clarity of illustration, the drill body of each microdrill depicted in Figure 1 is exaggerated.) The drill body, usually with a nominal diameter under 0.5 mm, can be further functionally divided into two subportions: the drill point and the helical flutes. The drill point, with the geomety of a socalled four-facet chisel point [2,4,5], is designed to produce cuĴing action inside the PCB (i.e., the workpiece). The helical flutes are designed to provide screw-shaped passageways for chip removal. The main difference between the ST and UC type microdrills is that the drill body of an ST type one has a diametral continuity along its axial direction, but that of a UC type one has a diametral discontinuity occurring at a certain axial location. The drill body of a UC type microdrill, besides its front portion adjacent to the drill point, is further ground to yield a smaller outer diameter, called an undercut diameter. The design of an undercut diameter is to largely reduce the extent of friction and heat generation caused by the surfaces of the drill body rubbing against the hole walls, which is especially suitable for producing microholes and microvias, with diameters under 0.25 mm, in multilayer PCBs.

Figure 1. Illustrations and ground cross-sections of ST and UC type microdrills. **Figure 1.** Illustrations and ground cross-sections of ST and UC type microdrills.

Furthermore, as shown in the real photographs of the ground cross-sections of the drill bodies shown in Figure 1, the exterior contours of the cross-sections of an ST type microdrill are theoretically formed by six piecewise curves (i.e., Sections A-A and B-B). However, those of a UC type microdrill are theoretically formed by six and four piecewise curves at the front portion (i.e., Section C-C) and the undercut portion (i.e., Section D-D) of the drill body, respectively. For the cross-section of the ST type microdrill depicted in Figure 2, two important cross-sectional geometric parameters (CSGPs) called the crosssectional web thickness (CSWT, denoted by w) and the cross-sectional outer diameter (CSOD, denoted by D) are highlighted and must be considered. The centroid of the crosssection is located at point Oa, where the rotational axis of the microdrill passes through. Two concentric circles Ct and Cb centered at point Oa and of diameters Dt and Db, respectively, are indicated in Figure 2. The circle Ct is mathematically a circle common tangent to the pair of cross-sectional flute contours (the concave contours denoted by ФF) Furthermore, as shown in the real photographs of the ground cross-sections of the drill bodies shown in Figure 1, the exterior contours of the cross-sections of an ST type microdrill are theoretically formed by six piecewise curves (i.e., Sections A-A and B-B). However, those of a UC type microdrill are theoretically formed by six and four piecewise curves at the front portion (i.e., Section C-C) and the undercut portion (i.e., Section D-D) of the drill body, respectively. For the cross-section of the ST type microdrill depicted in Figure 2, two important cross-sectional geometric parameters (CSGPs) called the crosssectional web thickness (CSWT, denoted by *w*) and the cross-sectional outer diameter (CSOD, denoted by *D*) are highlighted and must be considered. The centroid of the cross-section is located at point O*a*, where the rotational axis of the microdrill passes through. Two concentric circles *C<sup>t</sup>* and *C<sup>b</sup>* centered at point O*<sup>a</sup>* and of diameters *D<sup>t</sup>* and *Db* , respectively, are indicated in Figure 2. The circle *C<sup>t</sup>* is mathematically a circle common tangent to the pair of cross-sectional flute contours (the concave contours denoted by ΦF) at points P*t*<sup>1</sup> and P*t*2, respectively, and the CSWT *w* is theoretically equal to its diameter *D<sup>t</sup>* and the distance P*t*1P*t*2. The circle *C<sup>b</sup>* is mathematically the minimum bounding circle of the entire cross-section that overlaps the pair of cross-sectional margin contours (denoted by ΦM), and the CSOD *D* is theoretically equal to its diameter *D<sup>b</sup>* . For the cross-section of a

UC type microdrill, whether formed by six or four piecewise curves (and characterized by a pair of nonconcave flute contours), its CSWT and CSOD can both be defined in the same manner. The trade-off of the magnitude of CSWT will influence both the chip removal ability and rigidity of the drill body, while the accuracy and stability of the CSOD will influence the hole quality. For microdrill manufacturers, the cross-sectional geometry measurements (for both the CSWTs and CSODs of the drill body), as well as the drill point defect inspections, are essential quality control tasks that can benefit the mass production of their microdrill products. a UC type microdrill, whether formed by six or four piecewise curves (and characterized by a pair of nonconcave flute contours), its CSWT and CSOD can both be defined in the same manner. The trade-off of the magnitude of CSWT will influence both the chip removal ability and rigidity of the drill body, while the accuracy and stability of the CSOD will influence the hole quality. For microdrill manufacturers, the cross-sectional geometry measurements (for both the CSWTs and CSODs of the drill body), as well as the drill point defect inspections, are essential quality control tasks that can benefit the mass production of their microdrill products.

at points Pt1 and Pt2, respectively, and the CSWT w is theoretically equal to its diameter D<sup>t</sup> and the distance Pt1Pt2. The circle Cb is mathematically the minimum bounding circle of the entire cross-section that overlaps the pair of cross-sectional margin contours (denoted by ФM), and the CSOD D is theoretically equal to its diameter Db. For the cross-section of

Machines 2023, 11, x FOR PEER REVIEW 3 of 34

Figure 2. Cross-section and geometric parameters of the drill body of an ST type microdrill. **Figure 2.** Cross-section and geometric parameters of the drill body of an ST type microdrill.

In the last two decades, optical-based nondestructive methods and systems for dealing with the defect inspections and geometry measurements of certain types of microdrills have been developed by a variety of researchers [17–26]. In order to inspect some types of drill point defects and flank wear, visual measuring methods based on dedicated image processing procedures in combination with specific machine vision devices have been developed and applied [17–21]. Tien et al. [17,18] have proposed two specific image processing algorithms for detecting some types of drill point defects from captured drill point images. Huang et al. [19] have developed an automated visual inspection system and also an image processing procedure for automatically capturing the drill point images and identifying the drill point defects. Su et al. [20] have proposed a machine vision-based approach for carrying out the flank wear measurement. Duan et al. [21] have proposed a specific image processing procedure for optically measuring the flank wear. As for the geometry measurements, some industrial measuring devices with excellent precision (repeatability) and accuracy, such as laser micro-gauges (LMGs), laser confocal displacement meters (LCDMs), and optical micrometers, have been applied to develop some nondestructive measuring systems [22–25]. Huang et al. [22] have adopted an LMG to measure the CSODs and runout amounts of microdrills. For the measurement of the CSWT, a laserbased inspection system and method have been developed by Chuang et al. [23] via applying an LMG and a conventional LCDM. Chang et al. [24] have applied an optical micrometer and a surface-scanning LCDM for measuring the CSWT with runout compensation. Chang and Wu [25] have applied a rotatable optical micrometer-based design for measuring the CSWT with an innovative optical-based method. The methods developed by Chuang et al. [23] and by Chang et al. [24], respectively, are suitable for measuring the CSWTs of ST type microdrills, while that developed by Chang and Wu [25] can be applicable to both ST and UC type ones. However, some of the above-mentioned nondestructive geometry measuring systems may not be easily universalized because of the higher In the last two decades, optical-based nondestructive methods and systems for dealing with the defect inspections and geometry measurements of certain types of microdrills have been developed by a variety of researchers [17–26]. In order to inspect some types of drill point defects and flank wear, visual measuring methods based on dedicated image processing procedures in combination with specific machine vision devices have been developed and applied [17–21]. Tien et al. [17,18] have proposed two specific image processing algorithms for detecting some types of drill point defects from captured drill point images. Huang et al. [19] have developed an automated visual inspection system and also an image processing procedure for automatically capturing the drill point images and identifying the drill point defects. Su et al. [20] have proposed a machine vision-based approach for carrying out the flank wear measurement. Duan et al. [21] have proposed a specific image processing procedure for optically measuring the flank wear. As for the geometry measurements, some industrial measuring devices with excellent precision (repeatability) and accuracy, such as laser micro-gauges (LMGs), laser confocal displacement meters (LCDMs), and optical micrometers, have been applied to develop some nondestructive measuring systems [22–25]. Huang et al. [22] have adopted an LMG to measure the CSODs and runout amounts of microdrills. For the measurement of the CSWT, a laser-based inspection system and method have been developed by Chuang et al. [23] via applying an LMG and a conventional LCDM. Chang et al. [24] have applied an optical micrometer and a surface-scanning LCDM for measuring the CSWT with runout compensation. Chang and Wu [25] have applied a rotatable optical micrometer-based design for measuring the CSWT with an innovative optical-based method. The methods developed by Chuang et al. [23] and by Chang et al. [24], respectively, are suitable for measuring the CSWTs of ST type microdrills, while that developed by Chang and Wu [25] can be applicable to both ST and UC type ones. However, some of the above-mentioned nondestructive geometry measuring systems may not be easily universalized because of the higher hardware cost and/or lower availability (due to the import/export control on strategic commodities) of some of their key measuring devices. Besides the measurement of CSGPs, Jaini et al. [26] have developed a specific computer vision algorithm for measuring the axial straightness errors and radial runout amounts of microdrills. Without the use of optical-based devices,

Beruvides et al. [27] have studied the runout detection in microdrilling via online measured force signals and a neural network-based model.

In addition, a conventional procedure for carrying out the cross-sectional geometry measurements (for the purpose of sampling inspection) is still employed by certain microdrill manufacturers. In the conventional sampling inspection procedure, the drill body of a microdrill sample is ground off by a microdrill grinder to yield certain ground cross-sections (similar to those shown in Figure 1), while their corresponding CSWTs (and also CSODs) are measured by a measuring microscope. Such a destructive measuring procedure is completely manually operated by experienced inspectors and may not have good efficiency and accuracy. In order to automate and improve the manually operated procedure, Chang et al. [28] have proposed a vision-aided automation system, characterized by the integration of a grinding module and two specific machine vision modules, for carrying out the destructive web thickness measurement via a dedicated automation process. As compared with the nondestructive measuring systems [23–25], such a vision-aided automation system could have benefits of lower hardware cost and higher availability of key devices, although the arrangement of its two machine vision modules could be disadvantageous to achieve a compact design. It should also be noted that the automated measuring process (AMP) developed in Chang et al.'s work [28] is suitable for measuring the CSWTs of ST type microdrills, but not the CSWTs of UC type ones nor the CSODs of ST or UC type ones. In this process, two approaches called the shortest-distance (SD) and the minimum common-tangent-circle (MCTC) approaches are developed to calculate the CSWTs of ST type microdrills. However, both the SD and MCTC approaches cannot be applied to calculate the CSWTs of UC type microdrills, since they theoretically cannot be applied to cross-sections characterized by a pair of nonconcave flute contours. In addition, the approach for measuring the CSODs of ST or UC type microdrills was not developed in their study. Hence, further improvements on hardware design and AMP are still required to develop a more comprehensive system for carrying out the destructive and visual measurements of the CSWTs and CSODs of both ST and UC type microdrills.

According to the literature review, it can be understood that the destructive and visual measuring system and method for the essential CSGPs of microdrills still need to be improved for comprehensively automating the conventional sampling inspection procedure. To this end, an automation system improved from the one proposed by Chang et al. [28], for both the hardware and the AMP, is presented in this study for carrying out the destructive and visual measurements of the CSWTs and CSODs of both ST and UC type microdrills. Experiments for measuring the CSWTs and CSODs of certain microdrill samples were conducted to evaluate the actual effectiveness of the developed system.

### **2. Hardware Design and Construction of the Improved Automation System**

In order to automate the conventional sampling inspection procedure, the hardware of the automation system proposed by Chang et al. [28] primarily consists of a dual-axis motion module, a grinding module, and two machine vision modules. Its dual-axis motion module is applied to move (or feed) and position a microdrill sample to be measured, and its grinding module is applied to grind off the drill body of that sample. One of its machine vision modules is applied to visually position the drilltip of that sample (relative to the grinding wheel of the grinding module) before the grinding off operation, and the other machine vision module is applied to visually measure the CSWTs of ground cross-sections of that sample. The essential functions of such an automation system must be equally realized by the improved one developed in this study.

The hardware of an improved automation system was innovatively developed according to the essential functions and was then constructed. In concept, the improved hardware primarily consists of a dual-axis motion module, a grinding module, and merely one machine vision module that can be innovatively applied to position the drilltip and to measure the CSGPs. As merely one innovative machine vision module is required, a more compact and lower cost hardware design, as compared with that of the previous

system [28], can be achieved. The setup of the constructed hardware of the improved automation system is shown in Figures 3 and 4, and its hardware modules and system integration are described in the following sections. system [28], can be achieved. The setup of the constructed hardware of the improved automation system is shown in Figures 3 and 4, and its hardware modules and system integration are described in the following sections.

hardware primarily consists of a dual-axis motion module, a grinding module, and merely one machine vision module that can be innovatively applied to position the drilltip and to measure the CSGPs. As merely one innovative machine vision module is required, a more compact and lower cost hardware design, as compared with that of the previous

Machines 2023, 11, x FOR PEER REVIEW 5 of 34

Figure 3. Entire views of the constructed hardware of the improved automation system: (a) the first perspective view; (b) the second perspective view. **Figure 3.** Entire views of the constructed hardware of the improved automation system: (**a**) the first perspective view; (**b**) the second perspective view.

#### 2.1. Hardware Modules *2.1. Hardware Modules*

As indicated in Figure 3, the foundation of the constructed hardware was a cabinettype base with high rigidity, and a dual-axis motion module, a grinding module, and a machine vision module were all mounted on the top of the cabinet-type base. The dualaxis motion module primarily consisted of an X-axis linear motion table (LMT) serially combined with a Y-axis LMT, while a microdrill fixture was installed on the moving stage of the Y-axis LMT. The driving mechanism of the X-axis LMT consisted of a Misumi BSX1505 C3 class ballscrew unit (with a nominal lead of 5 mm) coupled to an Oriental As indicated in Figure 3, the foundation of the constructed hardware was a cabinettype base with high rigidity, and a dual-axis motion module, a grinding module, and a machine vision module were all mounted on the top of the cabinet-type base. The dualaxis motion module primarily consisted of an X-axis linear motion table (LMT) serially combined with a Y-axis LMT, while a microdrill fixture was installed on the moving stage of the Y-axis LMT. The driving mechanism of the X-axis LMT consisted of a Misumi BSX1505 C3 class ballscrew unit (with a nominal lead of 5 mm) coupled to an Oriental Motor (OM) VEXTA RK566BAE 5-phase stepping motor, while that of the Y-axis LMT consisted of Misumi BSX1202 C3 class ballscrew unit (with a nominal lead of 2 mm) coupled to an OM VEXTA PK545BW 5-phase stepping motor. In addition, two sets of Renishaw RGH41X/RGS40S optical linear encoders (with a fine resolution of 1 µm) were installed

in the X- and Y-axis LMTs, respectively, as their positioning sensors. According to the orthogonal traveling directions of X- and Y-axis LMTs, the X-, Y-, and Z-directions of the entire machine could thus be defined, as indicated in Figures 3 and 4a. As indicated in Figure 4, the microdrill fixture, designed for holding the shank of a microdrill sample, was characterized by a simple and reliable three-point clamping formed by a V-grooved bracket, a hinged pressing plate, and an extension spring used for a pre-loading purpose. The central axis (i.e., the rotational axis) of a held microdrill sample would be parallel to the Y-direction. As a result, the setup of the dual-axis motion module could enable a held microdrill sample to be precisely moved (or fed) and positioned along the X- and/or Y-directions. the orthogonal traveling directions of X- and Y-axis LMTs, the X-, Y-, and Z-directions of the entire machine could thus be defined, as indicated in Figures 3 and 4a. As indicated in Figure 4, the microdrill fixture, designed for holding the shank of a microdrill sample, was characterized by a simple and reliable three-point clamping formed by a V-grooved bracket, a hinged pressing plate, and an extension spring used for a pre-loading purpose. The central axis (i.e., the rotational axis) of a held microdrill sample would be parallel to the Y-direction. As a result, the setup of the dual-axis motion module could enable a held microdrill sample to be precisely moved (or fed) and positioned along the X- and/or Ydirections.

Motor (OM) VEXTA RK566BAE 5-phase stepping motor, while that of the Y-axis LMT consisted of Misumi BSX1202 C3 class ballscrew unit (with a nominal lead of 2 mm) coupled to an OM VEXTA PK545BW 5-phase stepping motor. In addition, two sets of Renishaw RGH41X/RGS40S optical linear encoders (with a fine resolution of 1 µm) were installed in the X- and Y-axis LMTs, respectively, as their positioning sensors. According to

Machines 2023, 11, x FOR PEER REVIEW 6 of 34

Figure 4. Closeup views of the constructed hardware of the improved automation system: (a) the setup of the machine vision module; (b) the details of the microdrill fixture and the optical subset. **Figure 4.** Closeup views of the constructed hardware of the improved automation system: (**a**) the setup of the machine vision module; (**b**) the details of the microdrill fixture and the optical subset.

As shown in Figure 3a, the grinding module primarily consisted of a customized grinder unit driven by an OM 5IK90A-BW2 induction motor. The grinder unit primarily consisted of a GMN Paul Müller Industrie TSA-50x160-6004 grinding spindle (with its radial and axial runouts within 3 and 1 µm, respectively) with an installed Asahi Diamond Industry SD1000-600P100B3.0 grinding wheel. The end face of the installed grinding As shown in Figure 3a, the grinding module primarily consisted of a customized grinder unit driven by an OM 5IK90A-BW2 induction motor. The grinder unit primarily consisted of a GMN Paul Müller Industrie TSA-50x160-6004 grinding spindle (with its radial and axial runouts within 3 and 1 µm, respectively) with an installed Asahi Diamond Industry SD1000-600P100B3.0 grinding wheel. The end face of the installed grinding wheel is specially formed by an inner annular portion (the ocher-colored portion with a code of SD600P100B3.0) and an outer annular portion (the dark-green-colored portion with a code of SD1000P100B3.0); the inner and outer annular portions were applied for roughly grinding off the drill body and finishing the ground cross-sections, respectively, via the surface grinding process. The rotational axes of the grinding unit and the induction motor were both parallel to the Y-direction. The induction motor was set to rotate at a constant rotary speed of 3200 rpm, and a belt-pulley mechanism with a velocity ratio of 2 was used to connect the induction motor and the grinding spindle. As a result, the setup of the grinding module could enable the grinding wheel to be driven at a constant rotary speed of 6400 rpm for the grinding off operation.

As shown in Figure 4a, the machine vision module primarily consisted of an Imaging Source DMK72AUC02 complementary metal-oxide-semiconductor (CMOS) camera, a Moritex MML8-ST65S telecentric lens (with a nominal magnification of 8) coupled with a Moritex ML-Z2X rear converter lens (with a nominal magnification of 2), a Moritex MDRL-CW16-NS diffuse ring illuminator, a Moritex MCBP-CW3430 collimated backlight illuminator, and a specially designed optical subset. The rear converter lens, the telecentric lens, and the ring illuminator were sequentially and coaxially mounted on the CMOS camera to form a camera-lens subassembly, while the CMOS camera itself was installed on an X-Y-Z manual linear stage for fine positioning and focusing purposes. The camera-lens subassembly could achieve an overall magnification of 16 due to the combined effects of the telecentric and rear converter lenses, and its optical axis was set parallel to the rotational axis of the grinding unit (i.e., along the Y-direction). The backlight illuminator was fixed to one side of the supporting structure (block) of the grinder unit, so that the grinding wheel could be placed between it and the camera-lens subassembly and its collimated (parallel) light beam could be projected along the X-direction (toward the grinding wheel and the camera-lens subassembly). As shown in Figure 4b, the optical subset, consisting of a set of Newport BAC21AR.14 plano-concave achromatic (PCA) lenses (a set of achromatic doublets) and a Newport 05D20ER.2 broadband silver-coated reflection mirror, was fixed to one side of the base of the Y-axis LMT and could be precisely moved and positioned by the X-axis LMT. That is, the optical subset and the microdrill fixture (and the held microdrill sample) could have no relative movement along the X-direction.