Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 5, No. 1, 2023 179 The Design of LabVIEW‐based Measurement & Control System of Automatic Straightening Machine Qigeng Liu1, Kuosheng Jiang2, *, Chuanshuai Wang3 1, 2, 3 School of Mechanical Engineering, Anhui University of Science and Technology, Anhui, 232001, China 2 Anhui Key Laboratory of Mine Intelligent Equipment and Technology, Anhui University of Science and Technology, Huainan, 232001, China 1, 2, 3 State Key Laboratory of Mining Response and Disaster Prevention and Control in Deep Coal Mines, Anhui University of Science and Technology, Huainan, 232001, China 2 Shanqi Automobile Huainan Special Purpose Vehicle Co., Ltd, Huainan, 232001, China *Corresponding author Abstract: With the development of the machinery industry and the popularization of shaft parts, the bending and deformation problems of shaft parts in the machining process have become particularly prominent. In order to reduce the bending deformation and improve the yield of parts, shaft straightening machines have become a necessary choice. According to the development status of straightening machines at home and abroad, and based on the consideration of improving the automation and intelligence level of domestic straightening machines, a fully automatic straightening machine measurement and control system has been proposed and developed in this paper based on the LabVIEW platform. It has been proved that the straightening machine can realize parallel operation of data in the working process, with high straightening accuracy and good operation stability. Keywords: Straightening machine, LabVIEW, FPGA, Measurement and Control system. 1. Introduction With the development of the machinery industry, shaft parts are put to an increasingly wide use in the machinery industry, and the bending and deformation of shaft parts in machining not only affects the subsequent processes of machining and manufacturing, but also brings a heavy burden to enterprises. In order to reduce the bending deformation in an effort to improve the yield of parts, shaft straightening machines have become a necessary choice[1] [2] [3]. There are many companies and scientific research institutions abroad specializing in the research and development of straightening machines, with the more famous companies as follows: MAE in Germany, Galdabini in Italy, TAA TRANDING in the United States, Towa Seiki Co., Ltd. of Japan and International Measuring Co., Ltd. and so on. Their straightening machines have relatively high measurement accuracy, automation and intelligence[3] [4 [5] [6] [7] [8] [9] . In China, the development of straightening machines is still at a low level in terms of intelligence and automation and the measurement accuracy. Based on the consideration of improving the automation and intelligence level of domestic ones, a fully automatic straightening machine measurement and control system based on the LabVIEW platform is proposed and developed in this paper to flexibly detect and straighten shaft workpieces. 2. Overall Design Scheme of Measurement and Control System The circular bounce detection and straightening correction of the workpiece is one of the main problems to be solved by this design. It can be seen from the straightening diagram of the measurement and control system in Figure 1 that the measurement and control system of the automatic straightening machine mainly includes four parts: data acquisition, data processing, positioning and straightening, and FPGA controller. The first part includes the displacement sensor of differential variable voltage, data acquisition card, and photoelectric encoder. The second part is mainly completed by the industrial control computer. The third includes motion control card, stepper motor, servo motor, and servo drive; The FPGA controller uses AX-7035 development board of the black gold. Figure 1. Calibration Schematic of Measurement and Control System 180 The core of the automatic measurement and control system of the straightening machine designed in this paper is the industrial computer processing and FPGA control, which realizes the functions of data acquisition, data processing, workpiece detection, positioning and straightening, monitoring of the operating status of the control system, data statistics and query. Based on the versatility of the straightening measurement and control system of shaft parts, the automatic measurement and control system of the straightening machine designed in this paper mainly has the following five functions: 1) The collected data is transmitted to the industrial computer for analysis and processing through Gigabit Ethernet, with the processing results returned to the FPGA; 2) With the adoption of distributed assembly operation, different shaft parts are straightened to meet different needs; 3) The measurement and control system uses multi-channel displacement sensors to collect data, arrange them in different measurement positions, and detect the workpiece according to what is needed; 4) On the basis of the complexity of detecting shaft parts, adjust the number of displacement sensors and the installation angle of the encoder are adjusted to achieve a good detection effect; 5) with the identification and judge of whether the workpiece is qualified, the straightened and corrected unqualified workpiece and the qualified one is put into the corresponding storage silo or different assembly lines to record and query the detection process and results of the workpiece. Therefore, the overall structure of the measurement and control system of the automatic straightening machine is shown in Figure 2, which mainly includes automatic loading and unloading, data collection, data processing, positioning and straightening, qualification determination, data recording and other parts of the workpiece. Figure 2. The Overall Structure Diagram of Measurement & Control system 3. The Hardware System of Measurement and Control System Through the analysis of the working principle and overall architecture of the measurement and control system of the automatic straightening machine, its hardware system is mainly composed of industrial computer, FPGA, displacement sensor, photoelectric encoder, data acquisition card, motion control card, servo motor and servo drive, solenoid valve components, with the specific relationship between each component shown in Figure 3. Among them, the industrial computer is selected as a domestic IPC610 working equipment and control system with 14 slots, supporting PCI and ISA bus, the industrial computer has high stability and reliability, with a strong anti-interference ability to operate in various complex environments. The FPGA module is selected from the FPGA development board developed by Xilinx XC7A35T-2FGG484I, which is equipped with a DDR3 data cache module with a capacity of 256MB, and the clock frequency of 400MHz can increase the FPGA development bandwidth to 12.8GB/s. The sensor is selected from the high-precision displacement sensor of German VOLFA. The data acquisition card is selected by Advantech's PCI-1716, which has a maximum bandwidth of 250KS, automatic analog input scanning, and provides 8 analog gradient inputs, with a good noise reduction effect; The role of motion control card is mainly used to control servo motor, so the motion control card selected in this paper is of DMC5410A with multiple general I/O, continuous interpolation cache I/O, external CAN bus I/O expansion to meet the needs of various control I/O, and the various pulse signals and switching signals connected to the control card are shown in Figure 4. The servo motor is selected from MINAS A5 family AC servo of Panasonic, with the controller of a feed-forward function to increase the stability of the straightening control system operation and improve the accuracy of detecting workpieces. 181 Figure 3. System hardware system diagram Figure 4. The Interface Schematic of the Motion Control Card 4. The Software System As for the traditional application system development of FPGA, VHDL or Verilog text programming language is used to write code, with a large workload, and high difficulty of development. An icon program instead of a text program is used in the LabVIEW FPGA tool, which is less difficult to develop and easy to learn and use, so LabVIEW FPGA tool is 182 applied in this paper as the development platform of the system. 4.1. The Workflow of Automatic Straightening Machine The workflow of automatic straightening machine is mainly divided into seven steps, as shown in Figure 5, i.e., 1) power supply and system initialization to confirm the status of relevant indicators. Dial the "hand/self-transfer switch" to the "automatic" position, with the "automatic mode" in the straightening manipulator control system selected, and press the "automatic start" and "manipulator start" buttons of the main interface of the host operation at the same time to start automatic operation; 2) The automatic feeding manipulator takes out the workpiece from the process storage position, transports it to the straightening workbench, and starts the automatic straightening process; 3) the pneumatic unit of FPGA control solenoid valve control drives top clamping workpiece; At the same time, control the servo motor to drive the workpiece to rotate; 4) During the rotation of the workpiece, the three-way displacement sensor and photoelectric encoder measure the circular runout of the workpiece and the rotation angle of the motor, and the FPGA control data acquisition card collects the measured data to transmit it to the industrial computer through the serial port after signal processing; 5) The industrial computer analyzes the obtained data, calculates the circular runout of the three channels, and finds the maximum bending amount and direction angle of the workpiece; 6) If straightening is required, the industrial computer presses down the workpiece through the FPGA control servo motor drives the indenter of the workbench, and feedback the amount of pressure to the industrial computer. If it cannot be straightened, the manipulator will take out the workpiece and put it into the unqualified belt; 7) If all measuring points are qualified, the straightening is completed and the next straightening begins. If any measuring points are unqualified, repeat (6) and subsequent steps within the given number of straightening times and time until all measuring points are qualified. Figure 5. The workflow of the automatic straightening machine The inspection system is shown in Figure 6. Displacement sensors collect data once for every 1 degree of shaft rotation, and 360 times per sensor after one rotation of the shaft. The data collected by the acquisition card is processed by the industrial computer to obtain the maximum bending deformation and direction of the workpiece at the position of 183 the displacement sensor. Figure 6. Basic Schematic Diagram of the Detection System 4.2. The Theory & Method of Data Acquisition and Processing Data collection, processing and storage of straightening machine measurement and control system are inseparable, of which data acquisition is the premise of control. In this paper, PCI-1716 data acquisition card is used to collect relevant data of each sensor. Data processing is the basis of the application, and the data of this system mainly has three processing processes: 1) F/V filter conversion of the sensor output signal; 2) Digital filtering, nonlinear compensation and signal scaling are used to process the data once; 3) Through the calculation and analysis of the data, discover the signal law, determine the nature of the object, generate the necessary control signal, and study the control effect after the control and the secondary processing of the control program before control. The random error is mainly processed by remote point detection and digital filter, with the singularity point eliminated by prediction and the collected data smoothed by digital filters such as sequencing filtering, RM filtering, weighted filtering, reference filtering, debugging filtering and single filtering, eliminating or reducing various noises and improving the signal-to-noise ratio. For the systematic error, the methods of lookup table, curve comparison and interpolation are in place to eliminate the nonlinear error of the sensor, and the models of temperature error and the dynamic characteristic curve change is applied to correct the error of the temperature characteristic of the sensor and the error of the dynamic characteristics of the system. 4.3. The Interface of Measurement & Control System of the Straightening Machine The interface of the Automatic straightening machine’s measurement and control system designed by LabVIEW t shown in Figure 7, includes six modules: main interface operation, sensor test, debugging panel, parameter setting, data query and statistics. The first is shown in Figure 8, with a total of 6 functional areas, the top of which is the actual value area of the differential, the middle is the runout quantity display area and the bending direction display area measured by the displacement sensor, the bottom is the manipulator operation area, the left side is the function menu area, and the right side is the working status display area and the correction quantity display area. Figure 7. The interface of the Automatic straightening machine’s measurement and control system 184 Figure 8. The Main Interface of Measurement & Control System Figure 9 is the interface of sensor test, which displays the measurements (in microns) collected by each channel in real time. The abscissa is the measurement channel number (expandable to six channels, and Figure 8 shows the case where three channels are enabled), and the ordinate is the current sensor value of each channel. The interface enables intuitive determination of the appropriate installation position of the sensor and real-time dynamic monitoring of the entire measurement process. Figure 9. Sensor Test Interface Figure 10 shows the debug window interface of the system, which is mainly used to monitor the function setting of the system, and can be accessed through the shortcut key of F4. 185 Figure 10. The Debug Window Interface Figure 11 is the parameter setting interface, including four modules: workpiece setting, correction quantity parameter setting, reverse correction parameter setting and weighted parameter setting. In the manual state, the user can set and modify the straightening parameters of workpiece through this interface. Figure 11. Parameter Setting Interface 186 Figure 12. Communication Program between FPGA and IPC 4.4. Part of the Program of Measurement & Control System of Straightening Machine Figure 12 is the communication program between FPGA and IPC, which is used to realize communication between IPC and FPGA. Figure 13 is the monitoring program of equipment condition, which is used to monitor the operation of displacement sensors and encoders in real time during the straightening process, and if there is an abnormality, it is fed back to the industrial computer through the FPGA to make an alarm signal. Figure 13. Equipment condition monitoring procedure. 5. Summary Based on the consideration of improving the automation and intelligence level of domestic straightening machine, this paper constructs the hardware part of the measurement and control system of straightening machine with the FPGA controller as the core, with LabVIEW platform applied to develop the software part of the measurement and control system. It has proved that the straightening machine designed in this paper can realize parallel operation of data during the working process, with high straightening accuracy and good operation stability. However, there is also the problem of slow speed of the data interaction and the straightening accuracy needs to be further improved. Acknowledgment This work was supported by the National Natural Science Foundation Project in China (51705003 and 51979261), Anhui University Natural Science Research Project (KJ2017A081), Anhui Science and Technology Major Project (1808085QE130), Anhui University of Technology Youth Fund (12867), and Anhui Provincial Education Department Fund (11673), Graduate Innovation Fund (2019CX2030). References [1] WANG Mengfan. Research and Design of Intelligent Detection Module of shaft Parts Straightening Machine[D]. Chongqing University of Technology, 2020. (in Chinese) [2] ZHUANG Shuming, YUAN Dezhi, SUN Xinglei, et al. Automatic Micro Shaft Straightening Machine: CN112547852A [P]. 2021. (in Chinese) [3] JIANG Jiale, JIANG Hao. Design of Rotor Output Shaft Straightening Measurement and Control system[J]. Metrology and Testing Technology, 2017, 44(2):84-87. (in Chinese) 187 [4] KONG Qingan, ZHAO Guo, WU Liang. Multi-head Automatic Straightening Machine:, CN212419189U[P]. 2021. (in Chinese) [5] HAO Jianjun, CHEN Jiadong, WANG Mengfan, et al. Shaft Straightening Machine Stroke Prediction Based on Improved PSO-LSSVM[J]. Journal of Chongqing University of Technology (Natural Science), 2020, v.34; No.426(04):93-100. (in Chinese) [6] ZHOU Xiangqing. Design and Development of Motion Controller of Circular Axis Intelligent Straightening machine [D]. Zhejiang:Zhejiang University of Technology, 2020. (in Chinese) [7] E. A. Maksimov,R. L. Shatalov,E. P. Ustinovsky. Development of a Method for the Evaluation of the Gap in the Course of Straightening of Sheet Products on Roller Leveling Machines [J]. Metallurgist, 2021,65(1-2):P62-72. [8] Juan Zhou, Yu-Hang Huang, Zhong-Hua Yu.. Research on the Design of a Hexagonal Shaft Straightening Machine Based on Quality Function Development and Evidence Theory[J]. Symmetry, 2021, 13:P707 [9] K. A. Kotov, N. L. Bolobanova, D. V. Nushtaev. Modeling the Stress State of a Steel Strip with a Roller Leveling Machine under Cyclic Alternating Deformations[J]. Steel in Translation, 2020, 50(11): P750-755.