Trajectory Tracking Control System Design For Autonomous Two-Wheeled Robot

A trajectory tracking control system design of an autonomous two-wheeled robot (TWR) is presented. A TWR has two movements: translation (moving forward/backward) and rotation (turning to the right/left) which are commonly represented by a non-linear kinematic equations. The objective of the trajectory tracking control system is to steer the TWR move on a desired trajectory in planar space. In order to simplify the trajectory tracking control system design, the non-linear kinematic equations were approximated by linear kinematic equations through a linearization. Linear quadratics regulator (LQR) method was applied to design the control system. Computer simulations were done to evaluation performance of the designed control system. The simulation results show that the designed control system was able to make the TWR track a desired trajectory that located 1.4 meter away from the TWR initial position within 3 seconds.


INTRODUCTION
Autonomous vehicles are one of the most interesting research topics in the last three decades.Applications of the autonomous vehicles are broadly increasing in military and industrial sectors.Autonomous vehicles are vehicles that have capability to move autonomously on a desired route.Navigation and control systems play the key rule of an autonomous vehicle.The navigation system provides information about position and attitude of the vehicle.The vehicle position and attitude at an instant time is known as the vehicle posture.Different between the vehicle posture and a desired posture is defined as a posture error.The control system uses the posture error as a feedback to drive the vehicle approaching the desired posture.Such kind of control system is known as a trajectory tracking control system [1].
A first study on trajectory-tracking control system of an autonomous vehicle has been presented in [2].The study presented a stable tracking control method of an autonomous four-wheeled mobile robot which consists of two active wheels and another two passive wheels.Both active wheels were driven by two independence motors.The both active wheels were also used to steer the robot, where the robot maneuver was done by manipulating rotation of the active wheels.Such kind of robot is known as a differential-drive robot.Objective of the tracking control system was to determine linear and angular velocities of the robot that make the robot moves on a desired track.The tracking control system was designed based on the robot kinematics and applying Lyapunov based control method.Since then, several types of autonomous vehicles have been developed and include autonomous ground vehicles, autonomous aerial vehicles, autono-mous water surface vehicles, and autonomous under-water vehicles.Several kinds of control method have been applied, for examples: backstepping [3,4], Lyapunov direct's method [5,6], sliding mode control [7], and adaptive control [8].
A two-wheeled robot (TWR) is potentially developed as a high-maneuver autonomous ground vehicle.A TWR is a mobile robot where the robot body is supported by two wheels only.Each wheels are independently driven by an electric motor.This kind of robot is classified as the differential-drive mobile robot.The two independent-wheels support makes the robot to have higher maneuverability than other conventional mobile robots, e.g., three or four wheels mobile robots.The TWR is therefore poten-tially applied as a high-maneuver autonomous ground vehicle.However, the two-wheels support makes the TWR is not able to stand by self and the TWR is therefore known as a statically-unstable system.Because the TWR is a moving platform, a passive stabilization system is not applicable to stabilize the TWR but an active stabilization system.The active stabilization system is a state feedback control system that is used to stabilize the TWR.Apart of gaining advantage of high maneuverability, developing a TWR as an autonomous vehicle is challenged by two problems: 1) stabilization problem and 2) tracking problem.
Several works on developing autonomous TWR have been presented.An autonomous TWR that was able to move on a desired straight line path has been presented in [9].Control system of the autonomous TWR consisted of three parts: balance and velocity control, steering control, and straight line tracking control.The balance and velocity control was used to stabilize the TWR and drive the robot at a desired linear velocity.The steering control was to determine rotational speed at each wheel to make a desired turning.The straight line tracking control was to calculate linear and angular velocities that make the TWR move on the desired straight line path.The resulted linear velocity was used as the reference velocity for the balance and velocity control, while the resulted angular velocity was used as the reference velocity for the steering control.Optimal control was applied in designing the controllers.The experiment results show that the autonomous TWR was able to maintain its posture at the desired posture while moves on a straight line path at a constant speed up to 20 cm/s from indoor to outdoor.Developing an autonomous TWR using partial feedback linearization control method was presented in [10].Two controllers were developed, the first controller was a two-level velocity controller for tracking control system and the second controller was a two-level position controller for stabilizing the TWR.Considering TWR model parameter uncertainties, adaptive backstepping control method was applied in designing a control system of autonomous TWR including balancing and tracking [11], while applying adaptive sliding mode control was presented in [12].Design and experimental results of balancing and tracking system of TWR using backstepping sliding mode control was presented in [13,14].Applying neural networks for balancing and tracking control of two-wheeled robot has also been presented [15].Most of the presented works showed that two decoupled control loops were applied in the autonomous TWRs, where one loop was for balancing (stabilization) while another was for trajectory tracking.Both control loops were realized in a single integrated controller or two separated controllers.The simulation and experimental results shows that the TWRs were balanced and able to track a desired linear and angular velocity or certain trajectory but not an arbitrary trajectory given by earth-fixed frame [16].Tracking a trajectory in earth-fixed frame is very important in real application as the TWR can be integrated with a GPS navigation system.Development of TWR control system using model predictive control (MPC) that was able to balance the TWR and track a given trajectory in earth-fixed frame was presented in [16].
This study presents a design of earth-fixed frame trajectory tracking control system for an autonomous TWR using optimal control method.While two decoupled control loops i.e.: balancing and steering were presented in the previous studies, this study concerns in the TWR steering control only.It is assumed that the TWR is already balanced and coupling between the TWR balancing and TWR steering is neglected.It was investigated through experiments that coupling between TWR balancing and steering can be neglected for small angular velocity of the yaw motion [9].This presented study can be implemented together with one of the TWR active stabilization systems, for examples in [17][18][19].Presentation of this paper is organized as follows.The Section I describes the introduction.Research method is presented in the Section II which consists of two parts: a) kinematics of a TWR and b) trajectory tracking control system design.The kinematics discuss the robot coordinate systems and transformation between the coordinate systems.The discussion is end up with linearization and a state space representation of the robot kinematics.The trajectory tracking control system design present how the optimal control method is applied.Performance of the trajectory control is demonstrated through simulation and the results are shown in the Section III. Discussion of the designed control system and the performance are presented in the Section IV.Finally, conclusion of this work is presented in the Section V.

A. Kinematics of Two-Wheeled Robot
Two units of two-wheeled robot (TWR) named the TWR A and the TWR B in a planar space are shown in Fig. 1.The TWR A is a real TWR while the robot B is a virtual TWR.The TWR B is used as a reference robot and its movement trajectory is called the reference trajectory.The TWR A is expected to track the reference trajectory.The planar space is a two dimensional space that represents a TWR position in a coordinate system.Position of an object in the planar space can be expressed by (, ) coordinate in an earth fixed-frame coordinate system     .However, two objects at the same position may have different orientation, for example, one is heading to north while another is heading to west.Orientation is important to determine the next position when the object is moving.A new variable that is called heading angle is introduced to represent the object orientation.The heading angle is theangle of the forward moving velocity with respect to the earth fixed-frame coordinate system.Therefore,an object in a planar space is represented by three variables, i.Generally, an object in planar space has three motions: forward motion with linear velocity , side motion with linear velocity , and rotational motion withangular velocity.The rotational motion is known as the yaw motion.The three motions work on the object along three orthogonal axes.A coordinate system that sticks at the object center of mass can be defined based on the three orthogonal velocity axes.This coordinate system is called the object body coordinate system that has an x-axis along the  velocity, a y-axis along the  velocity, and a -axis along the  angular velocity axis.Fig. 1 shows that the TWR A body coordinate system is represented by     and the TWR B body coordinate system is represented by     .The z-axis of the both TWR body coordinate systems and the z-axis of the earth fixed-frame coordinate system are in line, and those are pointing out of this paper.
Posture of a moving object can be calculated based on the initial posture and the posture rate using the following equation 0 0 ( ) ( ) where  ̇ is the posture rate,  0 is the initial time, and Equations ( 3) shows a transformation from the TWR A body coordinate system into the earth fixed frame coordinate system.This transformation can be expressed by: where IA R is the transformation matrix from the TWR A body coordinate system into the earth fixed frame coordinate system and A V is velocity vector of the TWR A that is Equation ( 6) can be expressed by: where IB R is the transformation matrix from the TWR B body coordinate system into the earth fixed frame coordinate system and B V is velocity vector of the TWR B that is As the TWR A is expected to track the TWR B trajectory, it implicates that the TWR A posture should track the TWR B posture.For this purpose, posture error is defined as the different between the both postures and given as follows: ISSN : 2085-3688; e-ISSN : 2460-0997 where e  is the posture error.The posture error will be used as feedback for a controller in TWR A to determine the TWR A velocities such that the TWR A posture approaches the TWR B posture.Because the posture error is in the earth fixed frame coordinate system while the controller is working in the TWR A body coordinate system, transforming the posture error into the TWR A body coordinate system is required.The transformation is given as follows: where | eA  is the transformed posture error in the TWR A body coordinate system and AI R is the transformation matrix from the earth fixed-frame coordinated system into the TWR A body coordinate system.The transformation matrix AI R is defined by: 1 cos sin 0 and the transformed posture error from the earth fixed-frame coordinate system into the TWR A body coordinate system is given by: cos sin 0 sin cos 0 .
Differentiating the posture error (12) Equation ( 14) is the posture error dynamics in the TWR A body coordinate system.The values b u and b r are known from the reference data of the TWR B and the posture error [  ,   ,   ]  can be obtained through measurements.The unknown values are of a u and a r .A control theory can be applied to obtain a u and a r such that the posture error convergences to zero.Unfortunately, the ( 14) is a non-linear system, where non-linear control theories cannot be applied in a straight forward manner such that applying a nonlinear control theory for in problem is not a simple job.Linear control theories provide a straight forward method a linear system.In order to apply the linear control theories in the non-linear system, the non-linear system is approximated by a linear system.This approximation is known as a linearization.Assuming e  is small such that cos 1 e   and sin 0 e   .Applying this assumption in (14) results in: which is a linear system.Equation ( 15) can be factorized into: and then it can also be expressed by: where 1 ba uu   and 2 ba rr  .The ( 17) is a state space representation of the linearized posture error dynamics which is generally expressed by:

B. Trajectory Tracking Control System Design
A trajectory tracking control system is designed to find a control input  in (18) such that the posture error e  converges to zero.Linear quadratic regulator (LQR) is applied as the control method in designing the trajectory tracking control system based on the TheThe trajectory tracking control system is designed through the following steps [20,21].Define a cost function for (18) : where is a cost function,  is a positive semi definite matrix, and  is a positive definite matrix.Optimal control solution to minimize the cost function in ( 19) of a linear system in ( 18) is given by: , where  is the control gaindefined by: The matrix  is a solution of algebraic Riccati equation: III. RESULT Performance of the designed tracking controller is demonstrated through a computer simulation.Two TWRs named TWR A and TWR B are used in these simulations.The TWR A is a real TWR, while the TWR B is a virtual TWR is used as reference.The trajectory where the TWR B is moving on is the reference trajectory and therefore the TWR A is desired to track it.The tracking trajectory is done by TWR A through tracking the TWR B posture using the designed control system.Because the TWR B is moving, the TWR B posture is time varying.Tracking performance will be shown by the posture error where the goal is to make the posture error convergence to zero.
In these simulation, the TWR A is desired to move in a circle path, where the circle center is (0, 1) and the circle radius is 1 meter.The circle path is represented by the TWR B that is initially located at (0, 0) with heading angle 0° and move with linear velocity 1 m/s and yaw rate 1 rad/s.Therefore, the initial posture of TWR B is denoted by[0, 0, 0  ]  .The designed trajectory tracking control system is applied in the TWR A to track the TWR B trajectory.Control law of the control system is given in (20) and designed using the following parameters: Three cases are simulated to evaluate the designed trajectory tracking control system performance that is applied in the TWR A.

 Case 1:
The TWR A is initially located at the circle center with heading angle 0° such that initial posture of TWR A in case 1 is[0, 1, 0  ]  . Case 2: The TWR A is initially located at the same location as in the case 1 but the heading angle is 180°.Therefore, initial posture of TWR A for the case 2 is [0, 1, 180  ]  . Case 3: The TWR A is initially located at (-1, 2) which is outside the circle with heading angle -90°.Therefore, initial posture of TWR A for the third case is [-1, 2, -90°] T .
Simulation results are shown in Fig. 2 to Fig. 4.
Trajectories of both TWRs for the three simulation cases are shown in Fig. 2. The figure shows how the TWR A that initially located in different position and heading angle approaches the TWR B trajectory.
Figure 3 shows that the TWR B posture is time varying for all posture elements.This is because the TWR B is moving on a circle path.The simulation results show that the designed tracking control system make the TWR A posture track the TWR B posture for the three different initial conditions.Figure 4 shows posture errors of the TWR A with respect to the TWR B for the three simulation cases.Posture errors for the three simulation cases converge to zero within 3 seconds.

IV. DISCUSSION
The simulation results show that the designed trajectory tracking control system has a good performance.Although the control system was designed through linearization, but the resulted control system was able to track a trajectory from different initial postures.It was shown through the simulations that the designed tracking control system was able to make the TRW A track the TWR B while the TWR A is initially located at one meter away in yaxis with heading angle 180° different to the TWR B. The designed tracking control system was also able to make TWR A track the TWR B trajectory while the TWR A is initially located at one meter in x-axis and two meter in y-axis away from the TWR B with the heading angle different -90°.

V. CONCLUSION
A design of trajectory tracking control system of an autonomous two-wheeled robot (TWR) has been presented.The control system was designed using linear quadratic regulator (LQR) method based on the linearized TWR kinematics.Performance of the designed control system was demonstrated through computer simulation to simulate tracking a trajectory for three different initial postures in an earth fixed-frame coordinate.The simulation results showed that the designed control system is able to make a TWR track a desired trajectory which is initially located in radius 1.4 meter within 3 seconds.

VI. FUTURE WORK
This research is continued by implementing the designed trajectory tracking control system in a real TWR. .
Fig. 1.Two Units of TWR in A Planar Space procedure, projection of the TWR B velocities into the earth fixed frame coordinate system results in:

Fig. 2 .
Fig. 2. Trajectories of the TWR A and the TWR B for the three simulation cases.

Fig. 4 .
Fig. 4. Posture Error of TWR A With Respect to The TWR B.
̇=   , it can be expressed as follows: is the final time.The posture rate is defined by  ̇= Trajectory Tracking Control System Design For Autonomous Two-Wheeled Robot 94 Jurnal Infotel Vol.10 No.3 August 2018 https://doi.org/10.20895/infotel.v10i3.393linearized posture error dynamics.LQR is a control design method where a states feedback control gain is determined through minimizing a cost function.