## 3 Contact Angle Measurement and Emergency Control Based on Laser Scanning Sensor
### Contact Angle between Wheel-Ground Using 2D Laser Sensors  
The advantage of wheeled robots is their adaption to different terrains. However, when one of their wheels loses contact with the ground, they can lose their stability and fall. This section describes the method to measure the contact angle between the wheel-ground, which is a parameter of great importance to determine the terrain geometry. Thus, the robot can know if the wheels are touching a flat, vertical, sloped, or irregular surface. This way, we can implement an appropriate controller according to the terrain. In previous research, the Jacobian and its inverse are calculated with the contact angle between the wheel-ground and the desired robot's velocity [13]. There are some methods to measure or estimate the contact angle using internal and external sensors. The proposed method uses 2D laser sensors, that are easy to install, and precise measurement of terrain information. The LiDAR is installed on each side of the robot to scan the contact point between the wheel-ground and determine if the wheel loses contact with the ground, creating an emergency controller to avoid falls. The position from the LiDAR to the chassis is \(l_{6}\); concerning the ground, it must be greater than 12 mm to guarantee the accuracy of the measurement \(\pm\)15 mm. The sensor has a 1 degree range resolution and 360 degrees in total. The scanning range of each wheel is two times the diameter of each wheel to guarantee the measurement of the contact angle throughout the robot's motion; otherwise, during climbing or descent, the information is lost. Figure 9 shows the robot climbing a ladder, and the front wheel loses contact with the tread. The cyan color denotes the measurement of the front wheel, the pink color denotes the middle wheel, and blue denotes the rear wheel. \(d_{imin}\), where \(i=1,2,3\) in red color denotes the distance between the wheel center and contact point with the ground in Equation (5). \(d_{n}\) denotes the distances of each degree \(n\) from the center of the wheel to the ground, and the minimum distance is \(d_{imin}\). \(l_{r}\) is the distance from the LiDAR to the wheel center, \(l_{n}\) denotes the distances from the LiDAR to the ground, and \(\delta_{n}\) is the angle between \(l_{n}\) and \(l_{r}\). Equation (6) calculates \(\phi_{i}\), the angle between \(l_{r}\) and \(d_{imin}\) inverse for each wheel. \[min(d_{n})=\sqrt{{l_{r}^{2}+{l_{n}}^{2}-2l_{r}l_{n}cos(\delta_{l_{n}})}}=d_{imin} \tag{5}\]  
\[\phi_{i}=\sin^{-1}\left(\frac{d_{imin}\sin(\delta_{i})}{\sqrt{{l_{r}}^{2}+{d_ {imin}}^{2}-2l_{r}d_{imin}\cos(\delta_{i})}}\right) \tag{6}\]  
The contact angle measurement for the rear wheel \(\gamma_{3}\) is given by Equation (7), where \(\theta_{3}\) is a constant parameter defined by the angle between \(l_{r}\) and \(l_{rz}\), the vertical distance from  
Figure 9: Schematic 2D of the contact angle measurement and the loss of contact between wheel-ground using laser scanner sensors. the center of the rear wheel to the LiDAR. \(\alpha_{i}\) is the angle formed by the inclination of the chassis, and \(\phi_{3}\) from Equation (6). The front and middle wheels depend on bogie rotation. The following variables are defined: \(l_{1}\) and \(l_{2}\) denote the distance between the bogie center and the front or middle wheel, respectively, \(l_{b}\) is the distance between the LiDAR and the bogie. \(w\) denotes the angle between \(l_{b}\) and the LiDAR z-axis, \(\lambda_{i}\), where \(i=1,2\) front and middle wheel is the angle between \(l_{b}\) and \(l_{r}\), \(\mu_{i}\) denotes the angle between \(l_{b}\) and \(l_{1}\) or \(l_{2}\) that varies by bogie rotation, \(\rho_{2}\) is the angle between \(l_{r}\) and the LiDAR \(z\)-axis by subtracting \(\omega\) and \(\lambda_{i}\). Finally, \(\phi_{i}\) is obtained from Equation (6). The contact angle measurement for the middle and the front wheel is given by \(\gamma_{2}\) and \(\gamma_{1}\) in Equations (8) and (9), respectively.