The switch rail detection system based on laser sensor

As a carrier, turnout is an extremely important part of transport, when railways is operating. So the detection of turnout should meet the requirement. However, the detection effort is mainly completed manually at the present stage, which is low accuracy. Thus the study of the switch rail detection system based on laser sensor is necessary. In this paper, we discuss the scheme of the switch rail detection by using Gocator 2030 laser sensor and SIMENS 840D numerical control system. We study the algorithm and data collection of the switch rail detection based on laser sensor. This detection system provides accurate data collection and information display for the enterprise of producing turnout. After the test, the system has a faster detection speed and higher


Introduction
In order to meet the rapid development of railway, the safety of railway transport has gradually aroused public's attention.The accuracy of turnout matching improves steps by steps.The existing turnout detection methods in our country are basically artificial measurement, and the test results will be affected by many artificial factors.The error of measurement is about 1mm, so the artificial measurement can't match the accuracy requirements of high-precision processing equipment.The switch rail detection system based on laser sensor has advantages of small workload, fast measurement and high accuracy.It also can give clear and concise result.So the study of the switch rail detection system based on laser sensor is very important.
In this paper, we take the Gocator2030 laser sensor and the 840D SIEMENS numerical control system as an example, study the specified data measurement of the switch section by laser sensor.The system achieves a high precision measurement and it has important practical significance.
1 The design of detection system

The principle of detection system
This system measures the switch rail profile by laser sensor.Each detection system has two laser sensors.The data collected by sensor transmits to SIEMENS 840D CNC system through Ethernet.The CNC system achieves these functions, including data processing, information display and interface printing.We put two laser sensors on both sides to realize the detection of the switch rail contour.As shown in Figure 1.
Figure 1 The switch rail profile measurement The red area is the area of laser irradiation, blue line segment represents the sensor view.

The profile of Siemens 840D
The switch rail detection system is installed on the Siemens 840D system.
Siemens 840D system (referred to as 840D) is a CNC system based on Personal Computer.Its MMC system uses NT Windows or XP operating system, has all kinds of interface.840D has better human-computer interaction and integration of the upper application system which facilitates the user to customize the system function and parameter adjustment.
According to customer's request for data reading of machine tool, SIEMENS developed the software for data acquisition, such as SinCOM software and MCIS software.840D has an open man-machine interface and a communication interface, which uses Ethernet TCP/IP protocol for communication and has flexible reading and writing functions.840D is suitable for the development of CNC machine.

Gocator 2030 Laser Sensor
Gocator 2030, which combines laser source with camera together perfectly, has many advantages such as easy to use, strong independence, good development and portable design.The sensor is shown in Figure 2.

3.Data processing and algorithm analysis
The contour of the image is converted into N data points by Gocator 2030.Then these data points are stored as CSV file format in the SIEMENS 840D CNC system.
The image data points of the rail have three problems, that are different camera visual angles, some data points lost and burr contour.
In this chapter, we need to design an algorithm, which can deal with the three problems and get the detection data which we need from the processed data.

Correcting the contour data
In  The rotation of the contour data is shown as figure 7.
The process of converting original point (Xsp,Ysp) to new point (Xtp,Ytp) needs three steps: (1) The original coordinate system origin point (Xtp,Ytp) shifts to new coordinate system origin point (0,0).
(2) The original X axis rotates θx and the original Y axis rotates θy.
(3) The original X axis expand ratio of Kx and Y axis stretches ratio of Ky.

Contour data deburring
The burr of contour data, which is zigzag, is generated by light interference.The burr of contour data is shown as figure 9(a).The burr of contour data can be suppressed or eliminated by using Kalman filtering and sliding filter based on Hamming function.
Kalman filter, which is using the linear state equation, is an optimal estimation algorithm by observing the system data of input and output.The contour data can be processed by using formula(7).The contour data which has been processed by kalman filter is shown in figure9(b).The red line is original contour data, and the blue line is processed contour data by using kalman filter.This method has small/subtle inhibitory effect on the burr of the contour data.
Sliding filter based on Hamming is a weighted smoothing filter.It is a spatial domain filtering technique with low frequency enhancement.The neighborhood size of the sliding filter is directly related to the smoothing effect.The larger the neighborhood is, the better the effect is.However, if the neighborhood is too large, the edge information loss is very serious.So it is very important to choose the value of neighborhood reasonably.
Choosing the value of neighborhood reasonably is a weighted method.Reasonable weighting factor g(r) can be computed by Hamming function W(r).

Extracting the required values from 8 sets of rail contour data
In the paper, the switch rail line 4305 is selected as sample.The height and the width of 8 sets of the rail contour data needs to be calculated.In order to improve the accuracy of calculation, the following measures can be taken: 1.The height of the rail is the maximum value in the contour data.In order to prevent the interference from the jumping point, we take the maximum 7 values in the average.
2. The width of rail is the width of the rail height decreased by 16mm.In order to make the data more accurate, we select 5 adjacent points on both sides which are decreased by 16mm of the rail height.

( 1 )
Easy to use: The inside Web server of Gocator 2030 can configure parameters and measurement methods by any computer.So gocator 2030 can be very easy to update and configuration without installing additional software.

( 2 )
Independence and Development: The Gocator 2030 system can easily make extensive use of LMI multi sensor hubs, master the power distribution and has a safety interlock device of laser.Gocator 2030 has a Microsecond synchronizer, an encoder and an input array processor.(3) Portable Design: Gocator 2030 has small volume and its mass is less than 1.5kg.So it is very suitable to set up the Gocator 2030 around the robotic arms and in a tight space.

Figure 3 ( 1 )
Figure 3 the 4305 switch rail standardized process The mechanical structure of the system is divided into three parts, which are fixed plate, aluminum profile and sensor connecting plate.The overall configuration is shown as figure 4.(1)The fixed plate is used to adjust the height and angle of

Figure 4
Figure 4 the overall configuration

6 .
figure 6.The angle of line segment B and line segment C reflect the tilt angle of rail.In fact, line segment B and line segment C are overlap.The expression of line segment B and line segment C is y=ax+b.It is shown in formula (1) and Formula (2) that computing the value of parameters a and b.The slope of line segment B and line segment C can be obtained as ab and ac based on Least squares.Then the contour data can be rotated in the coordinate system that

Figure 5
Figure 5 the standard block figure 6(a).θ cd is the rotation angle of red contour data in figure 6(a).ab is the slope of line segment B in figure 6(a).ac is the slope of line segment C in figure 6(a).The following part introduces how to translate the contour data.Line segment A and Line segment D are parallel.Line segment B and line segment C are an overlapping line.The standard block is 100mm height and 150mm width.The two values Xso,Yso of the two contour data can be computed based on formula (3) and formula (4).The contour data which has been rotated and translated is shown as figure 6(b).Rotation angle value, x axis translation value and z axis translation value of green contour data and Rotation angle value, x axis translation value and z axis translation value of red contour data has been computed.These 6 contour correcting values can correct the original contour data.The corrected contour is shown as figure 8.

Figure 8
Figure 8 the correction of contour data

Figure 9
Figure 9 Kalman filter and Hamming filter

Figure 10
Figure 10 the result of standard block The detection result of the switch rail line 4305 is shown in figure 11.The Numerical errors of the rail line 4305 is less than 0.15mm.Comparing with artificial measurement, the detection accuracy of the switch rail detection system has a great improvement.

Figure 11
Figure 11 the result of the rail line 4305