Dynamic Modeling of a Nonlinear Two-Wheeled Robot Using Data-Driven Approach

: A system identiﬁcation of a two-wheeled robot (TWR) using a data-driven approach from its fundamental nonlinear kinematics is investigated. The fundamental model of the TWR is implemented in a Simulink environment and tested at various input/output operating conditions. The testing outcome of TWR’s fundamental dynamics generated 12 datasets. These datasets are used for system identiﬁcation using simple autoregressive exogenous (ARX) and non-linear auto-regressive exogenous (NLARX) models. Initially the ARX structure is heuristically selected and estimated through a single operating condition. We conclude that the single ARX model does not satisfy TWR dynamics for all datasets in term of ﬁtness. However, NLARX ﬁtted the 12 estimated datasets and 2 validation datasets using sigmoid nonlinearity. The obtained results are compared with TWR’s fundamental dynamics and predicted outputs of the NLARX showed more than 98% accuracy at various operating conditions.


Introduction
System identification using open loop experimental datasets is a well-known trick for determining the unknown dynamics of a real-time system [1].The mathematical models obtained through an open loop experimental data driven approach serve as a bridge between control theory and real-world problems.The development of a modern feedback control system for a real-world problem requires an accurate estimate of unknown dynamics.Thus, good system identification will lead a control designer to develop a control system in a systematic manner and diagnose an appropriate solution to a real-world problem [2,3].The unknown dynamics of a system can be represented in terms of both frequency and time domain, depending upon the control methodology, which determines the type of mathematical representation being adopted.Classical control theory uses the frequency domain and modern control systems uses state space representation (time domain).System identification using open loop datasets at various operating conditions [4] can represent system dynamics in the time domain as well as the frequency domain.Parametric system identification can be performed by using fundamental laws of physics but are based on a set of assumptions which may lead to the inaccurate estimation of unknown dynamics due to unknown parameters.On the other hand, time series data are used for the determination of an infinite number of model parameters, and for their estimation without having sufficient knowledge of the dynamical systems [5].
Over the past several decades, robots have received a great deal of attention due to their usage in almost every part of life.Almost every type of robot is an engineering problem in itself [6].A TWR can be thought of as a ground-based mobile robot with two wheels for supporting its body.Two high-torque DC electric motors are used to drive the wheels independently.For this reason, the robot has the advantage of a high maneuverability, but also has the disadvantage of stability problems due to unstable pitch motion.Several control techniques have been applied to address this, including the state feedback [7][8][9][10].For the development of an autonomous vehicle based on a TWR, presented in [11].The TWR was facilitated with provision of the three controllers for balancing, controlling and steering.Experimental results showed that the robot is able to move in a desired straight line.Subsequently, another autonomous two-wheeled vehicle is reported in [12] based on a trajectory tracking control system, designed using partial state feedback linearization.Different control techniques, namely, optimal control [13], adaptive control [14][15][16] and predictive control [17], have been used in designing the trajectory tracking control system.Much work has been done on the system modelling of TWR dynamics on a planar surface [13][14][15][16][17].
A review of the literature revealed that due to the complexity of the mathematical modeling of nonlinear dynamics and its assumptions, various parameters have been left undetermined.Thus, there is a need for an approach that can estimate the dynamics of a system based on experimental observation.The results of several linear and nonlinear models for two-wheeled robots are compared in [18].The identification of TWR dynamics using neural networks is presented in [19].The problem with this technique is that it does not provide transient and training datasets considering only a single operating condition.System identification for optimal control design (linear quadratic regulator) using the SI toolbox in Matlab is presented in [20].The experimental modeling of human heart rate response during walking, cycling and rowing at various intensity levels is presented in [21].System identification using a data-driven approach for human heart rate during treadmill exercise at different treadmill speeds is performed in [22].A data-driven robust adaptive Hinfinity controller during various rhythmic exercises is described in [23].Previous studies using data-driven approaches had been unable to identify TWR dynamics at different operating conditions.Thus, the system identification of TWR dynamics using a nonlinear ARX model at twelve different operating conditions with optimal efficacy is presented in this paper.This technique will be useful in the future for designing and simulating feedback control systems.
The rest of this paper is organized as follows.Section 2 gives a brief overview of the system dynamics and ARX model structure, Section 3 describes the methodology, Section 4 contains simulations and results, Section 5 contains discussion and analysis and Section 6 concludes the overall work.

TWR Dynamics Moving on a Planar Surface and ARX Model Structure
A block diagram of the TWR is shown in Figure 1.The time-varying robot posture (position coordinates x and y, along with orientation angle Ψ in a specific coordinate system) caused by the motion of the robot is represented by Equation ( 1): The high-torque DC electric motors drive the wheels in such a way that the TWR moves with linear velocity 'u' and angular velocity 'r' because of the difference in the rotational speed of the two DC motors.The state equations for the system are represented by Equations ( 2)-(4): . .

ARX Model Structure
For parameter estimation, one of the most reliable types of regression model is the ARX model.In the ARX model, the assumption made is that the current output of the system is a function of the last 'n' system outputs and the last 'm' system inputs.This technique proves to be the most efficient technique for solving linear regression equations when provided in analytical form.Furthermore, when the order of the system is high, this technique can perform at its best.The generalized form of this technique is given in Equation ( 5): where

NLARX Model Structure
In the time-series modelling, NLARX is a non-linear autoregressive model which has exogenous inputs.The current value of a time series is related to both the past values of the same series and the current and past values of the exogenous series, that is, an externally determined series that has an impact on the model's series of interest.An error term is also included which indicates that knowledge of the other terms will not permit the current value of the time series to be anticipated exactly.The algebraic expression of this model is given below in Equation (6) as: where 'y' is the variable of our interest, 'u' is the externally determined variable that helps in the prediction of 'y', E is the error term and function 'F' is some nonlinear function (i.e., polynomial).
The estimated regressor and details of the output nonlinear functions are tabulated in Table 1.Input Regressor Output Nonlinearity Function Sigmoidnet Sigmoidnet Linear The cost function is defined as the mean square error between the simulated response of the nonlinear kinematics and the estimated output of the model, as given by Equation (7). where

Methodology
At first step, the given system of differential equations is simulated in Matlab-Simulink.Twelve different datasets are generated through different possible scenarios by varying the parameter vales of linear velocity and angular velocity respectively.For twelve datasets, a total of 729 samples are acquired and then exported to the workspace.
The order of the model should be selected prior to the estimation of parameters and reconstruction of the dataset.According to the number of inputs, outputs and desired delay, the order of the system is determined in [na, nb, nk] format.'na' is a ny-by-ny matrix, while 'nb' and 'nk' are ny-by-nu matrices.The order of the system is adjusted intelligently so that the system performed better and achieved more than 98% accuracy even in the presence of noisy conditions.ARX and NLARX models are applied on each individual dataset and on the merged dataset with the orders already defined.In the case of the NLARX model, appropriate nonlinearities are incorporated and the results analyzed afterwards.

Dataset Generation
The details of different operating conditions are shown in Table 2.All the input and output datasets are acquired at different operating points, listed in Table 1.These datasets are obtained through the nonlinear kinematics of the TWR given in Equations ( 2) and (3).TWR kinematics is implemented in a Simulink environment using the S function.The radius of the wheel is considered as a physical parameter that converts the rotation of the DC motor to a linear velocity along x and y directions, as shown in Equation ( 8).
V = rω (8) where 'r' represents the radius of a wheel, 'V' represents the linear velocity and 'ω' represents the angular velocity of the DC motor.The two DC motors are operated in the two wheels of the TWR, and the rotation of these motors covered the linear displacement of the x and y axes.Moreover, the angular velocity is 90 • apart from x, y coordinates, and thus angular rotation is considered at the z axis with z displacement equal to zero.These are the three manipulated inputs of the TWR used for generating the datasets.The obtained datasets from 12 different operating conditions provided the testbed for estimation of the nonlinear dynamics of the TWR.The sampling time period is 0.25 s for the nonlinear kinematics of the TWR.All the datasets are obtained using the Matlab command 'iddata' and combined using the 'merge' command.The merged dataset is used for estimating the dynamics of the TWR.The NLARX structure is heuristically selected to provide maximum fit for the estimation of 12 operating conditions, as shown in Table 1.The NLARX model is estimated using the Matlab 'nlarx' command.This model is validated at two different operating conditions.In the first dataset, the two DC motor velocities are equal to 2 m/s and angular velocity is equal to 0.05 rad/s.In the second dataset, the two DC motor velocities are equal to 4 m/s and angular velocity is equal to 0.8 rad/s.The obtained datasets are considered as validation datasets.

Estimated Results of the NLARX Model
The obtained NLARX models are used to estimate the 12 operating conditions listed in Table 1 and compared with the nonlinear kinematics acquired in the 12 estimated datasets.All the other datasets gave 100% accuracy and are not provided here.For the sake of convenience, only the results of the sixth operating condition are shown in Figure 2. To validate the NLARX model, the validation datasets used the estimated response as shown in Figures 3 and 4.

Discussion and Analysis
A system identification of a two-wheeled robot (TWR) from its fundamental nonlinear kinematics using the data-driven approach at different operating conditions is presented in this paper.The fundamental model of TWR is implemented in a Simulink environment and tested at various input/output operating conditions, as shown in Table 1.The simulated outcome of the TWR fundamental dynamics generated 12 estimated datasets for TWR model identification.These datasets are developed based on the analysis of the nonlinear kinematics of the TWR.The analysis showed that linear displacement is covered by TWR when angular rotation is equal to zero, otherwise the TWR followed a circular path indicated by sinusoid variation in x and y displacement axes, as shown in Figures 2-4.Based on the observations, twelve operating conditions are identified.The TWR kinematics are estimated by using NLARX.Initially the ARX structure is heuristically selected and estimated at a single operating condition.We conclude that the single ARX model did not satisfy the TWR dynamics for all datasets in terms of fitness.However, the NLARX model fitted the 12 estimated datasets and 2 validation datasets using sigmoid nonlinearity.The simulated responses from the NLARX estimated models are compared with the fundamental dynamics of the TWR at validation operating conditions, as shown in Figures 3 and 4. The results indicate that the NLARX model performed optimally for the validation dataset.Thus, system identification for the TWR using an NLARX structure performed well and would be suitable for simulating a feedback control system.The results in the form of fit to estimation data and mean square error are presented in Table 3.The fitness value of the third output is 100% for all datasets as it is a ramp function.

Conclusions
The estimated response from the NLARX estimated model is compared with the fundamental dynamics of the TWR.Results indicated that the NLARX model performed optimally for the validation dataset.Thus, system identification for the TWR using the NLARX structure performed well and would be suitable for simulating a feedback control system.Furthermore, the results presented in this paper exceed in terms of accuracy the work already presented [19] using a neural network approach for a similar but lesscomplex system without noise.The cited neural network required extensive training and is less accurate than the work presented in this paper.Therefore, this paper presents the estimation and validation of a complex model of the fundamental dynamics of a TWR using an NLARX model with maximum accuracy, even in the presence of noise.

Figure 2 .
Figure 2.Estimated model response '+' of NLARX from estimation dataset 6 and '−' indicates the nonlinear kinematics of the TWR.

Figure 3 .
Figure 3.Estimated model response 'o' of the TWR from validation dataset 1 and '-' indicates the nonlinear kinematics of the TWR.

Figure 4 .
Figure 4.Estimated model response 'o' of the TWR from validation dataset 2 and '-' indicates the nonlinear kinematics of the TWR.

Table 1 .
Regressor and its nonlinearity function for the NLARX model.

Table 2 .
Operating conditions for testing TWR dynamics.

Table 3 .
Statistical Results Fitness and Mean Square Error.