# Research on Data Transmission of Laser Sensors for Reading Ruler
## 4 Sensor Technology and Code Reading Error Analysis
### Detection of Yardstick Swing  
The reader slides on the ruler track with the goal of accurate positioning. In this process, the transmission of location data is very important and is comparable to an invisible link, which closely connects the reader with the encoder. As shown in Figure 4, The \(Y\)-axis is the horizontal axis parallel to the guide rail, and the \(Z\)-axis is the vertical axis perpendicular to the guide rail. The angle \(\alpha\) is the swing angle of the encoder deviating from the guide rail. when the caliper track encounters strong vibration or a large swing, the laser spot that is stably hit on the target receiving area may be offset. Once the laser spot deviates from the predetermined receiving area, the reflected light that the receiver can capture is weakened or even completely blocked in extreme cases. This seemingly small change may have a profound impact on the measurement signal, and any small interference may cause fluctuations in the measurement data. Figure 3: Schematic diagram of pulse laser ranging principle. When the measurement signal changes due to the offset of the light spot, the measurement accuracy of the code reader is affected, which may be reflected in the instability of the reading, the increase in the error, or even the obvious error of the positioning. This error can be fatal on the production line because it can trigger a series of chain reactions that eventually lead to a reduction in product quality or production efficiency [19; 20]. The accuracy and stability of ranging technology in the industrial production process is very important to ensuring quality and efficiency. If the yardstick swings excessively, the ranging result is inaccurate. A phase laser ranging sensor is required to accurately detect and judge the shaking of the yardstick. In the process of yardstick swinging, the sensor is used to monitor the shaking of the yardstick in real time. When the yardstick swinging amplitude exceeds a certain threshold, the sensor sends a signal denoting necessary adjustment or intervention. Detection principle  
Under normal working conditions, the reader is firmly fixed on the yardstick rail to ensure its stable operation and accurate reading. The common U-shaped code reader is designed so that two detection surfaces are parallel to the encoder. This parallel state is essential to ensure the accuracy of the reading. The distance from each point on the encoder scale to both sides of the reading wharf shall be equal according to the definition of plane parallelism. This means that the reader can obtain information with the same accuracy regardless of which point on the encoder scale is read. However, in practice, the encoder may swing due to various factors. When the encoder scale swings, the two detection surfaces of the U-shaped reader are no longer parallel to the encoder scale. This non-parallel state causes a disparity in the distance from some points to both sides of the reading wharf, thus affecting the accurate reading of the information on the encoder. In order to detect whether the encoder is in a state with large error, such as shaking, we only need to detect whether the distance difference between two points on the laser emitting surface of the reader and the encoder exceeds a certain range. An excessive distance between these two points and the encoder indicates that the encoder is shaking, and the reading result of the reader may be seriously affected. Sensor Layout  
The U-shaped code reader, as shown in Figure 5, is accurately configured on an encoder scale to perform its code reading function. The reader can automatically detect and record a new position value every 0.8 mm. The operation process of the reader does not require a set reference point, and its response is fast. It only requires 1 ms to complete the calculation of the position value. The code reading speed can reach 12.5 m/s, and position values can be determined accurately in real time. The reader is also stable and  
Figure 4: Oscillation of yardstick.