Torque-based Terrain Classification for Mobile Robot

An experiment was conducted to develop algorithms for online terrains classification by robots used in agricultural environments. An instrumented agricultural tractor robotic platform was used to collect data from four different terrains; concrete, dense grass, sparse grass, and firm soil. The data collected were hand-labeled, segmented, and transformed from a time domain to frequency domain using fast furrier transform (FFT). The feature dimension of the transformed data was reduced using principal component analysis (PCA), and the principal components that account for 95% of the total variation in the feature data were selected. The selected features were used to train decision tree and linear discriminant analysis classifiers. From the result, the linear discriminant analysis performed better than the decision tree, and PCA improved the speed and accuracy of the online classification and offline training.


Introduction
In recent years, electric vehicle technologies have become one of the most important fields of research and investment for automotive companies and this leading to the development of various types of electric and hybrid electric vehicles [1]. Intelligent agricultural tractors that are powered by electric energy are the typical example of such development in electric vehicles. Because the working environment of agricultural tractors is rough and complex, making them terrain adaptive significantly improve their performances. Modifying vehicle control algorithms to take into account the terrain types is greatly improving the performance of traction control, stability control, collision warning, cruise control, and adaptive anti-skid steering [2]. For instance, when driving on wet asphalt, the maximum turning speed should be lower than the one used when driving on dry asphalt; also to reduce excessive wheel slip, acceleration has to be reduced in soft terrain. By incorporating terrain adaptive driving rules on the vehicle's control system, the general performance will improve, power consumptions will reduce, and the vehicle can be prevented from immobilization in poor terrains [2,3]. The development of technologies that enable vehicles to travel longer distances with limited human supervision in a highly challenging environment is among the main thrust of researches in robot mobility. This study aims to develop machine learning-based algorithms for online classification of terrains during robotic vehicle operations and to evaluate the performance of the algorithms in selected terrains.
In the past, terrain identification mainly focused on path planning and obstacle detection using vision and range data [4][5][6]. However, obstacle detection does not identify terrain types or address the issue of terrain being a potential risk factor, while vision-based terrain classification method does not identify the underlying terrain types, and the underlying terrains have more effect on vehicle mobility. To address the problems of terrain classification, vibration method was suggested by Iagnemma and Dubowsky in [7]. The suggested method was demonstrated on a slow-moving robot by Sadhukhan et al. [8]. The vibration signal from slow-moving robot was transformed to the frequency domain using FFT and the feature dimension of the transformed signal was reduced using PCA. Finally, linear discriminant analysis (LDA) was applied to classify the terrains into various types. Vibration signal was also applied to classified terrain in [9][10][11][12], however, the major problems of vibration-based method are that; it does not detect grass-covered terrain, and at low speed, its performance is poor. Acoustic features were also applied in terrain classification. Sound from vehicle-terrain interactions was used to classify grass, pavement, gravel, carpet, and sand using deep convolutional neural network [13,14]; the system is robust to Gaussian white noise. However, acoustic methods suffered from the problem of noise interference from the machine parts and other sources. Features calculated from wheel slip, wheel torque, and wheel vertical force were employed to characterize asphalt, dirt road, plowed terrain, and beach sand [15]. Conventional sensors that include wheel encoders, electrical current ammeter, and yaw rate gyroscope were used in the study; the system was able to characterize terrain online during normal vehicle operations.
In this study, rolling resistance which is a measure of total resistance offered by terrain to a traversing vehicle was used to classify terrains, this is due to the consideration that different terrain gives different levels and types of resistance to vehicle movement, and the rolling resistance can be easily computed from the measurement of wheel torque and vertical load. The structure of the remaining part of the paper is as follows: In the second section, the experimental procedure that includes data collection, feature transformation and reduction, and offline training was discussed. The third section describes and discusses the experimental result, while the fourth section gives the conclusion.

Data Collection
Experiments were conducted to collect instantaneous torque data using an autonomous agricultural tractor experimental platform shown in figure 1. The platform is a 4-in-wheel motor drive electric tractor; it is equipped with programmable logic controllers (PLC) for control, sensors for measuring wheel torque, wheel vertical force, wheel rotational speed, and a GPS device for measuring the vehicle velocity. The location of the experiment was the machinery testing strip of Nanjing agricultural university workshop; the robotic platform was manually piloted around the field using a remote. The machine was droved through concrete, firm soil, soft soil, and sparse grass surfaces at a speed of around 0.8 to 1.0 m/s. Instantaneous wheel torque data at a sampling frequency of 120 Hz were collected and stored in a laptop computer mounted on the system.

Wheel rolling resistance
The driving torque, Tr that needs to be applied to overcome the wheel rolling resistance moment is defined as: = * * (1) , coefficient of rolling resistance of the wheels in the longitudinal direction; , the vertical load acting on the wheel; and r, the wheel radius.
The torque developed by the wheel is estimated by measuring the electrical current drawn by the wheel drive motor [16,17]. It is known that in DC brushed motors, the electrical current, I, is roughly proportional to the delivered mechanical torque Tr [18].
= * * (2) , the motor torque constant and τ, the gearhead ratio. By measuring wheel vertical load and the motor current during straight driving at a constant speed, it will be possible to get an indirect estimate of the motion resistance, given the wheel geometry and the motor torque constant.

Feature Extraction and Reduction
The original signals were split into a set of segments of length 1 second, for uniformity, 235 segments from each class of data were selected. 128 point FFT of the signals segments were computed, and the absolute value of the FFT coefficients selected [19]. To speed up the training and classification process, the redundant features were eliminated using PCA and the principal components that account for 95% of the variation in the feature vector were selected for further processing.

1) Linear discriminant analysis
Linear discriminant analysis (LDA) is a supervised machine learning algorithm for feature classification [20,21]. LDA provides class boundaries by drawing decision areas between different classes and it is appropriate for multi-class classification. LDA tries to maximize the ratio of the variance between and within classes. Given a set of training data represented by their feature vectors, for each class of , the centroid and the covariance matrix are calculated by assuming that all the class labels are represented equally in the training data. When each of the training instances is tried to be classified into each of the specified class, a within-class scatter matrix will be obtained.
The center of the whole dataset μ is first calculated to obtain the between-class scatter matrix. Let D be a matrix keeping the distance between centers of classes and the center of the whole data set, So the between-class scatter matrix is The aim is to maximize the ratio of between and within classes' variance max ( ) = 2) Decision Tree Decision tree (DT) is a capable machine learning tool used to solve both classification and regression problems. Unlike other classification methods that use a set of features to jointly perform classification in a single decision step, decision tree is based on multi-level or hierarchical decision schemes of a tree-like structure as illustrated in figure 4 [22]. The tree consists of a root node, a set of internal nodes (split), and a set of terminal nodes (leaves). Each node of the decision tree structure makes a binary decision of separating one class or some of the classes from the rest. Processing is usually performed by moving the tree down until it reaches the leaf node, this is known as the top-down approach; other approaches are bottom-up and the hybrid [23]. In comparison to other methods, DT has the advantages of the ability to process the data measured on different scales, and it is not based on any assumed frequency distribution. In the decision tree, the features with the highest information are automatically selected for classification, and the remaining features are rejected, thereby improving the efficiency of computation. To overcome the problems of overfitting in DT, a pruning process is usually employed using the validation data sets and a user-specified cost complexity factor.

Figure 2: Diagram illustrating a decision tree
In this study, decision tree and linear discriminant analysis were trained to classify the data, the performance of each classifier was tested, and its prediction accuracy determined and compared. Before training and testing, the data was divide into training and testing set, 70% of the data was assigned for training, and 30% was set for testing. The following data processing and training were conducted.
• Feature transformation by FFT and training by DT. The method is named DTM.
• Feature transformation by FFT, Feature reduction by PCA, and training by DT. The method is named DTM-Plus. • Feature transformation by FFT and training by LDA. The method is named LDM. • Feature transformation by FFT, Feature reduction by PCA, and training by LDA. The method is named LDM-Plus. Using Matlab 2019a programming environment, algorithms for linear discriminant analysis and decision trees were developed and trained, wheel rolling resistances was used as input data, the terrain type as the class variables. The algorithms were developed to optimize the training process for optimum classifiers automatically.
The trained DTM, DTM-Plus, LDM, and LDM-Plus were used to classify a single instance of data. As shown in Table 1, the online classification is relatively faster than the offline training. The specifications of the PC used during the experiment are windows 10 operating system, 2.1 GHz processor, 8 GB ram, and 256 GB SSD.

Experimental result and discussion
The performances of the trained classifiers were validated using the testing data set. The result is presented in figure 3; for DTM, the precision and recall value range from 85.7 -100% and 84.4 -98.6% respectively, while for DTM-Plus, the value range from 93.0 -100% and 89.2 -100% respectively. Looking at the values, we can say that the precision and recall values are a little bit high with low variations (0.2365 and 0.2134 standards deviation). For the LDM, the precision and recall values range from 93 -100 and 92.3 -100% respectively, while for LDM-Plus it ranges from 94.7 -100% and 94.4 -100% respectively. Just like the case of DTM and DTM-Plus classifiers, the standard deviation in this case is also low, 0.213 and 0.1165 for LDM and LDM-Plus respectively. Therefore, we can confirm that the precision and recall values of the two trained classifiers are relatively good as all the values are close to or equal to 100%, and the variation is low. We can also observe from the two charts in figure 3 that all the classifiers were able to predict and recall firm soil with 100% accuracy, this can be attributed to the distinct nature of its signal. Comparing DTM and DTM-Plus, it can be seen that the total accuracy of the classifier increased from 92.55 -95.74% when PCA was applied to the data; while for LDM and LDM-Plus, the total accuracy increased only a little value from 97.74 -98.22%.
As shown in figure 4, the total accuracy of LDM was 5.32% higher than DTM, and that of LDM-Plus was 2.48% higher than DTM-Plus, this shows that discrimination analysis performed better than the decision tree. The differences in the classification accuracy of the four methods were statistically compared using student t-test at 5% confidence level (table 2). Except for DTM versus LDM combination, the rest of the comparison returns a zero null hypothesis, indicating that there is no significant difference in the accuracy of the classification process.

Conclusion
Algorithms that can classify terrains which are commonly found in agricultural environments has been developed, and the performance of the algorithms was evaluated. To collect the experimental data, an instrumented autonomous agricultural tractor platform was used and a speed range of 0.8 -1.0 m/s was maintained during the experiment. Classification accuracy of up to 98% was obtained with LDM and DTM respectively. Transforming the data using FFT improves accuracy as well as the speed of the algorithms. Finally, it was found that PCA doesn't statistically improve the classification accuracy significantly.